示例工程 29-menu-tray

29-menu-tray/app/.tsc/shared/ipc.d.ts

typescript · 1.4 KB

export declare const CH: {
    readonly get: "menu:get";
    readonly invoke: "menu:invoke";
    readonly setFlag: "menu:set-flag";
    readonly popup: "menu:popup";
    readonly reset: "menu:reset";
    readonly changed: "menu:changed";
};
export type FlagKey = "compact" | "statusbar";
export type MenuItemView = {
    id?: string;
    label: string;
    accelerator?: string;
    type: "normal" | "checkbox" | "separator";
    checked?: boolean;
    enabled?: boolean;
    role?: string;
};
export type MenuGroup = {
    label: string;
    role?: string;
    items: MenuItemView[];
};
export type MenuEvent = {
    at: number;
    source: "menu" | "tray" | "context" | "inspector";
    id: string;
    label: string;
};
export type MenuSnapshot = {
    platform: string;
    compact: boolean;
    statusbar: boolean;
    syncing: boolean;
    lastEvent: string;
    appMenu: MenuGroup[];
    trayMenu: MenuItemView[];
    contextMenu: MenuItemView[];
    events: MenuEvent[];
    trayIcon: string;
    windowVisible: boolean;
    trayCreated: boolean;
};
export declare function assertInvokeReq(value: unknown): asserts value is {
    id: string;
};
export declare function assertFlagReq(value: unknown): asserts value is {
    key: FlagKey;
    value: boolean;
};
export declare function assertPopupReq(value: unknown): asserts value is {
    x: number;
    y: number;
};
//# sourceMappingURL=ipc.d.ts.map