Skip to content

Commit

Permalink
[wip] add: interrupt request
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Nov 21, 2023
1 parent 10c6366 commit a919edb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions electron/typeGuard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
ApiRequestGetAvailableProfiles,
ApiRequestGetNiconicoMovieMetadata,
ApiRequestGetSetting,
ApiRequestInterruptQueue,
ApiRequestSelectComment,
ApiRequestSelectFile,
ApiRequestSelectMovie,
Expand Down Expand Up @@ -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 =>
Expand Down
9 changes: 8 additions & 1 deletion src/@types/request.controller.d.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -50,6 +51,11 @@ export type ApiRequestGetNiconicoMovieMetadata = {
nicoId: string;
};

export type ApiRequestInterruptQueue = {
type: "interruptQueue";
queueId: UUID;
};

export type ApiRequestsFromController =
| ApiRequestAppendQueue
| ApiRequestSelectComment
Expand All @@ -61,6 +67,7 @@ export type ApiRequestsFromController =
| ApiRequestSetSetting
| ApiRequestDownloadMovie
| ApiRequestGetAvailableProfiles
| ApiRequestGetNiconicoMovieMetadata;
| ApiRequestGetNiconicoMovieMetadata
| ApiRequestInterruptQueue;

export {};

0 comments on commit a919edb

Please sign in to comment.