From a919edb37329bb650c00addcc923dc9a78a812a4 Mon Sep 17 00:00:00 2001 From: xpadev Date: Tue, 21 Nov 2023 10:49:58 +0900 Subject: [PATCH] [wip] add: interrupt request --- electron/typeGuard.ts | 5 +++++ src/@types/request.controller.d.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 {};