示例工程 28-project-approval-panel

28-project-approval-panel/app/.tsc/src/lib/store.d.ts

typescript · 0.7 KB

import type { ApprovalState, Decision, Risk, Tool } from "../../shared/ipc";
export type RequestInput = {
    tool: Tool;
    risk: Risk;
    detail: string;
    ttlMs: number;
};
export type ApprovalStore = {
    getState: () => ApprovalState;
    subscribe: (fn: () => void) => () => void;
    decide: (id: string, decision: Decision) => Promise<void>;
    request: (input: RequestInput) => Promise<void>;
    reset: () => Promise<void>;
    dispose: () => void;
};
export declare function createApprovalStore(): ApprovalStore;
export declare function remainingSeconds(expiresAt: number, now: number): number;
export declare function riskLabel(risk: Risk): string;
//# sourceMappingURL=store.d.ts.map