Add support to remove old galleries

This commit is contained in:
2023-06-23 15:15:47 +08:00
parent 4e5dbd8390
commit fe7af51988
11 changed files with 169 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
import { Task } from "../task.ts";
import { TaskEventData } from "../task_manager.ts";
import { DownloadConfig } from "../tasks/download.ts";
import { ExportZipConfig } from "../tasks/export_zip.ts";
import { DiscriminatedUnion } from "../utils.ts";
@@ -9,12 +10,9 @@ export type TaskServerSocketData = TaskEventData | { type: "close" } | {
running: number[];
};
type Gid<T extends Record<PropertyKey, unknown>> = ({ gid: number } & T) extends
infer U ? { [Q in keyof U]: U[Q] } : never;
type EventMap = {
new_download_task: { gid: number; token: string };
new_export_zip_task: Gid<ExportZipConfig>;
new_download_task: { gid: number; token: string; cfg?: DownloadConfig };
new_export_zip_task: { gid: number; cfg?: ExportZipConfig };
};
export type TaskClientSocketData = DiscriminatedUnion<"type", EventMap> | {