示例工程 34-global-shortcuts-autostart
34-global-shortcuts-autostart/app/.tsc/shared/ipc.d.ts
import type { AttemptVerdict } from "./accelerator";
import type { AutostartPlan, BlockerKind } from "./power-policy";
export declare const CH: {
readonly snapshot: "hub:snapshot";
readonly register: "hub:register";
readonly trigger: "hub:trigger";
readonly setResidency: "hub:set-residency";
readonly closeWindow: "hub:close-window";
readonly showWindow: "hub:show-window";
readonly startBlocker: "hub:start-blocker";
readonly stopBlocker: "hub:stop-blocker";
readonly applyAutostart: "hub:apply-autostart";
readonly quit: "hub:quit";
readonly refresh: "hub:refresh";
};
export type ShortcutId = "toggle-window" | "quick-note" | "focus-search";
export type ShortcutStatus = "registered" | "conflict" | "invalid" | "spare";
export type ShortcutRow = {
id: ShortcutId;
label: string;
accelerator: string;
registered: boolean;
status: ShortcutStatus;
detail: string;
};
export type RegisterRow = {
at: number;
accelerator: string;
verdict: AttemptVerdict;
detail: string;
};
export type BlockerRow = {
id: number;
kind: BlockerKind;
startedAt: number;
};
export type EventRow = {
at: number;
kind: string;
detail: string;
};
export type AutostartInfo = {
platform: string;
openAtLogin: boolean;
wasOpenedAtLogin: boolean;
executableWillLaunchAtLogin: boolean;
status: string;
launchArgs: string[];
isAutostartLaunch: boolean;
isHiddenLaunch: boolean;
packaged: boolean;
};
export type ResidencyInfo = {
enabled: boolean;
hiddenCount: number;
showCount: number;
visible: boolean;
};
export type PowerInfo = {
idleSeconds: number;
onBattery: boolean;
blockers: BlockerRow[];
lastDecision: string;
};
export type Snapshot = {
platform: string;
shortcuts: ShortcutRow[];
attempts: RegisterRow[];
lastAttempt: RegisterRow | null;
events: EventRow[];
notes: string[];
residency: ResidencyInfo;
power: PowerInfo;
autostart: AutostartInfo;
plan: AutostartPlan;
planOpenAtLogin: boolean;
};
export declare function assertRegisterReq(value: unknown): asserts value is {
id: ShortcutId;
accelerator: string;
};
export declare function assertActionReq(value: unknown): asserts value is {
id: ShortcutId;
};
export declare function assertResidencyReq(value: unknown): asserts value is {
enabled: boolean;
};
export declare function assertBlockerReq(value: unknown): asserts value is {
kind: BlockerKind;
};
export declare function assertBlockerIdReq(value: unknown): asserts value is {
id: number;
};
export declare function assertAutostartReq(value: unknown): asserts value is {
enabled: boolean;
dryRun: boolean;
};
//# sourceMappingURL=ipc.d.ts.map