fix: openToast to toastService

This commit is contained in:
JellyBrick
2024-09-17 21:05:35 +09:00
parent 10ecf5d2fe
commit 178bfa483f
2 changed files with 46 additions and 18 deletions

View File

@ -30,11 +30,39 @@ export type QueueAPI = {
continuation?: string;
autoPlaying?: boolean;
};
export type ToastElement = HTMLElement & {
autoFitOnAttach: boolean;
duration: number;
expandSizingTargetForScrollbars: boolean;
horizontalAlign: 'left' | 'right' | 'center';
importPath?: unknown;
label: string;
noAutoFocus: boolean;
noCancelOnEscKey: boolean;
noCancelOnOutsideClick: boolean;
noIronAnnounce: boolean;
restoreFocusOnClose: boolean;
root: ToastElement;
rootPath: string;
sizingTarget: ToastElement;
verticalAlign: 'bottom' | 'top' | 'center';
};
export interface ToastService {
attached: boolean;
displaying: boolean;
messageQueue: string[];
toastElement: ToastElement;
show: (message: string) => void;
}
export type AppElement = HTMLElement & AppAPI;
export type AppAPI = {
queue_: QueueAPI;
playerApi_: YoutubePlayer;
openToast: (message: string) => void;
queue: QueueAPI;
playerApi: YoutubePlayer;
toastService: ToastService;
// TODO: Add more
};