diff --git a/electron/typeGuard.ts b/electron/typeGuard.ts index 0441015..02a0d27 100644 --- a/electron/typeGuard.ts +++ b/electron/typeGuard.ts @@ -18,6 +18,7 @@ import type { ApiRequestGetAvailableProfiles, ApiRequestGetNiconicoMovieMetadata, ApiRequestGetSetting, + ApiRequestInterruptQueue, ApiRequestSelectComment, ApiRequestSelectFile, ApiRequestSelectMovie, @@ -82,6 +83,10 @@ const typeGuard = { (i as ApiRequestFromController).host === "controller" && (i as ApiRequestGetNiconicoMovieMetadata).type === "getNiconicoMovieMetadata", + interruptQueue: (i: unknown): i is ApiRequestInterruptQueue => + typeof i === "object" && + (i as ApiRequestFromController).host === "controller" && + (i as ApiRequestInterruptQueue).type === "interruptQueue", }, renderer: { buffer: (i: unknown): i is ApiRequestBuffer => diff --git a/src/@types/request.controller.d.ts b/src/@types/request.controller.d.ts index 89c2224..e69b263 100644 --- a/src/@types/request.controller.d.ts +++ b/src/@types/request.controller.d.ts @@ -1,5 +1,6 @@ import type { SaveDialogOptions } from "electron"; +import type { UUID } from "@/@types/brand"; import type { Queue } from "@/@types/queue"; import type { ApiRequestLoad } from "@/@types/request.renderer"; @@ -50,6 +51,11 @@ export type ApiRequestGetNiconicoMovieMetadata = { nicoId: string; }; +export type ApiRequestInterruptQueue = { + type: "interruptQueue"; + queueId: UUID; +}; + export type ApiRequestsFromController = | ApiRequestAppendQueue | ApiRequestSelectComment @@ -61,6 +67,7 @@ export type ApiRequestsFromController = | ApiRequestSetSetting | ApiRequestDownloadMovie | ApiRequestGetAvailableProfiles - | ApiRequestGetNiconicoMovieMetadata; + | ApiRequestGetNiconicoMovieMetadata + | ApiRequestInterruptQueue; export {};