初始化
This commit is contained in:
31
frontend/wailsjs/go/main/FileHandler.d.ts
vendored
Normal file
31
frontend/wailsjs/go/main/FileHandler.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
import {main} from '../models';
|
||||
|
||||
export function AddRecentUse(arg1:main.RecentUse):Promise<void>;
|
||||
|
||||
export function GetCompareImages(arg1:string,arg2:string):Promise<Record<string, string>>;
|
||||
|
||||
export function GetConfig():Promise<main.AppConfig>;
|
||||
|
||||
export function GetFileInfo(arg1:string):Promise<Record<string, any>>;
|
||||
|
||||
export function GetImageBase64(arg1:string):Promise<string>;
|
||||
|
||||
export function GetRecentUses():Promise<Array<main.RecentUse>>;
|
||||
|
||||
export function GetShortcuts():Promise<Array<main.Shortcut>>;
|
||||
|
||||
export function OpenFileDialog(arg1:string,arg2:Array<string>):Promise<string>;
|
||||
|
||||
export function OpenFolder(arg1:string):Promise<void>;
|
||||
|
||||
export function OpenSaveDialog(arg1:string,arg2:string,arg3:Array<string>,arg4:string):Promise<string>;
|
||||
|
||||
export function ProcessFile(arg1:main.ProcessRequest):Promise<main.FileResult>;
|
||||
|
||||
export function SaveConfig(arg1:main.AppConfig):Promise<void>;
|
||||
|
||||
export function SaveResult(arg1:string,arg2:string):Promise<main.FileResult>;
|
||||
|
||||
export function SaveShortcuts(arg1:Array<main.Shortcut>):Promise<void>;
|
||||
59
frontend/wailsjs/go/main/FileHandler.js
Normal file
59
frontend/wailsjs/go/main/FileHandler.js
Normal file
@@ -0,0 +1,59 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export function AddRecentUse(arg1) {
|
||||
return window['go']['main']['FileHandler']['AddRecentUse'](arg1);
|
||||
}
|
||||
|
||||
export function GetCompareImages(arg1, arg2) {
|
||||
return window['go']['main']['FileHandler']['GetCompareImages'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function GetConfig() {
|
||||
return window['go']['main']['FileHandler']['GetConfig']();
|
||||
}
|
||||
|
||||
export function GetFileInfo(arg1) {
|
||||
return window['go']['main']['FileHandler']['GetFileInfo'](arg1);
|
||||
}
|
||||
|
||||
export function GetImageBase64(arg1) {
|
||||
return window['go']['main']['FileHandler']['GetImageBase64'](arg1);
|
||||
}
|
||||
|
||||
export function GetRecentUses() {
|
||||
return window['go']['main']['FileHandler']['GetRecentUses']();
|
||||
}
|
||||
|
||||
export function GetShortcuts() {
|
||||
return window['go']['main']['FileHandler']['GetShortcuts']();
|
||||
}
|
||||
|
||||
export function OpenFileDialog(arg1, arg2) {
|
||||
return window['go']['main']['FileHandler']['OpenFileDialog'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function OpenFolder(arg1) {
|
||||
return window['go']['main']['FileHandler']['OpenFolder'](arg1);
|
||||
}
|
||||
|
||||
export function OpenSaveDialog(arg1, arg2, arg3, arg4) {
|
||||
return window['go']['main']['FileHandler']['OpenSaveDialog'](arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
export function ProcessFile(arg1) {
|
||||
return window['go']['main']['FileHandler']['ProcessFile'](arg1);
|
||||
}
|
||||
|
||||
export function SaveConfig(arg1) {
|
||||
return window['go']['main']['FileHandler']['SaveConfig'](arg1);
|
||||
}
|
||||
|
||||
export function SaveResult(arg1, arg2) {
|
||||
return window['go']['main']['FileHandler']['SaveResult'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function SaveShortcuts(arg1) {
|
||||
return window['go']['main']['FileHandler']['SaveShortcuts'](arg1);
|
||||
}
|
||||
226
frontend/wailsjs/go/models.ts
Normal file
226
frontend/wailsjs/go/models.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
export namespace main {
|
||||
|
||||
export class AppConfig {
|
||||
defaultOutputDir: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new AppConfig(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.defaultOutputDir = source["defaultOutputDir"];
|
||||
}
|
||||
}
|
||||
export class FileResult {
|
||||
success: boolean;
|
||||
message: string;
|
||||
path?: string;
|
||||
size?: number;
|
||||
originalSize?: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new FileResult(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.success = source["success"];
|
||||
this.message = source["message"];
|
||||
this.path = source["path"];
|
||||
this.size = source["size"];
|
||||
this.originalSize = source["originalSize"];
|
||||
}
|
||||
}
|
||||
export class ProcessRequest {
|
||||
inputPath: string;
|
||||
outputPath?: string;
|
||||
format?: string;
|
||||
quality?: string;
|
||||
qualityInt?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
angle?: number;
|
||||
bgColor?: string;
|
||||
bgRemoveColor?: services.ColorRGB;
|
||||
text?: string;
|
||||
threshold?: number;
|
||||
shape?: services.CropShape;
|
||||
brightness?: number;
|
||||
contrast?: number;
|
||||
saturation?: number;
|
||||
grayscaleIntensity?: number;
|
||||
sharpenAmount?: number;
|
||||
blurRadius?: number;
|
||||
flipH?: boolean;
|
||||
flipV?: boolean;
|
||||
maintainRatio?: boolean;
|
||||
cropX?: number;
|
||||
cropY?: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ProcessRequest(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.inputPath = source["inputPath"];
|
||||
this.outputPath = source["outputPath"];
|
||||
this.format = source["format"];
|
||||
this.quality = source["quality"];
|
||||
this.qualityInt = source["qualityInt"];
|
||||
this.width = source["width"];
|
||||
this.height = source["height"];
|
||||
this.angle = source["angle"];
|
||||
this.bgColor = source["bgColor"];
|
||||
this.bgRemoveColor = this.convertValues(source["bgRemoveColor"], services.ColorRGB);
|
||||
this.text = source["text"];
|
||||
this.threshold = source["threshold"];
|
||||
this.shape = this.convertValues(source["shape"], services.CropShape);
|
||||
this.brightness = source["brightness"];
|
||||
this.contrast = source["contrast"];
|
||||
this.saturation = source["saturation"];
|
||||
this.grayscaleIntensity = source["grayscaleIntensity"];
|
||||
this.sharpenAmount = source["sharpenAmount"];
|
||||
this.blurRadius = source["blurRadius"];
|
||||
this.flipH = source["flipH"];
|
||||
this.flipV = source["flipV"];
|
||||
this.maintainRatio = source["maintainRatio"];
|
||||
this.cropX = source["cropX"];
|
||||
this.cropY = source["cropY"];
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
for (const key of Object.keys(a)) {
|
||||
a[key] = new classs(a[key]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return new classs(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
export class RecentUse {
|
||||
id: string;
|
||||
name: string;
|
||||
category: string;
|
||||
usedAt: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new RecentUse(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.id = source["id"];
|
||||
this.name = source["name"];
|
||||
this.category = source["category"];
|
||||
this.usedAt = source["usedAt"];
|
||||
}
|
||||
}
|
||||
export class Shortcut {
|
||||
id: string;
|
||||
name: string;
|
||||
category: string;
|
||||
icon: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Shortcut(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.id = source["id"];
|
||||
this.name = source["name"];
|
||||
this.category = source["category"];
|
||||
this.icon = source["icon"];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace services {
|
||||
|
||||
export class ColorRGB {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ColorRGB(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.r = source["r"];
|
||||
this.g = source["g"];
|
||||
this.b = source["b"];
|
||||
}
|
||||
}
|
||||
export class Point {
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Point(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.x = source["x"];
|
||||
this.y = source["y"];
|
||||
}
|
||||
}
|
||||
export class CropShape {
|
||||
type: string;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
radius: number;
|
||||
points: Point[];
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new CropShape(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.type = source["type"];
|
||||
this.x = source["x"];
|
||||
this.y = source["y"];
|
||||
this.width = source["width"];
|
||||
this.height = source["height"];
|
||||
this.radius = source["radius"];
|
||||
this.points = this.convertValues(source["points"], Point);
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
for (const key of Object.keys(a)) {
|
||||
a[key] = new classs(a[key]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return new classs(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user