1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-24 15:40:21 +01:00
upscayl/electron/utils/config-variables.ts

67 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-09-10 11:14:04 +02:00
import { ChildProcessWithoutNullStreams } from "child_process";
2023-09-10 19:42:18 +02:00
export let imagePath: string | undefined = "";
export let folderPath: string | undefined = undefined;
export let customModelsFolderPath: string | undefined = undefined;
export let outputFolderPath: string | undefined = undefined;
export let saveOutputFolder = false;
export let quality = 0;
export let overwrite = false;
export let stopped = false;
export let childProcesses: {
2023-09-10 11:14:04 +02:00
process: ChildProcessWithoutNullStreams;
kill: () => boolean;
}[] = [];
2023-09-10 19:54:08 +02:00
console.log({
imagePath,
folderPath,
customModelsFolderPath,
outputFolderPath,
saveOutputFolder,
quality,
overwrite,
stopped,
childProcesses,
});
2023-09-10 11:14:04 +02:00
export function setImagePath(value: string | undefined): void {
2023-09-10 19:42:18 +02:00
imagePath = value;
2023-09-10 11:14:04 +02:00
}
export function setFolderPath(value: string | undefined): void {
2023-09-10 19:42:18 +02:00
folderPath = value;
2023-09-10 11:14:04 +02:00
}
export function setCustomModelsFolderPath(value: string | undefined): void {
2023-09-10 19:42:18 +02:00
customModelsFolderPath = value;
2023-09-10 11:14:04 +02:00
}
// SETTERS
export function setOutputFolderPath(value: string | undefined): void {
2023-09-10 19:42:18 +02:00
outputFolderPath = value;
2023-09-10 11:14:04 +02:00
}
export function setSaveOutputFolder(value: boolean): void {
2023-09-10 19:42:18 +02:00
saveOutputFolder = value;
2023-09-10 11:14:04 +02:00
}
export function setQuality(value: number): void {
2023-09-10 19:42:18 +02:00
quality = value;
2023-09-10 11:14:04 +02:00
}
export function setOverwrite(value: boolean): void {
2023-09-10 19:42:18 +02:00
overwrite = value;
2023-09-10 11:14:04 +02:00
}
2023-09-10 19:42:18 +02:00
export function setStopped(value: boolean): void {
stopped = value;
2023-09-10 11:14:04 +02:00
}
export function setChildProcesses(value: {
process: ChildProcessWithoutNullStreams;
kill: () => boolean;
}): void {
childProcesses.push(value);
}