示例工程 40-node-api-native-modules

40-node-api-native-modules/app/.tsc/shared/ipc.d.ts

typescript · 1.4 KB

export declare const CH: {
    readonly snapshot: "native:snapshot";
    readonly hash: "native:hash";
    readonly benchmark: "native:benchmark";
    readonly setFallback: "native:set-fallback";
    readonly reload: "native:reload";
    readonly refresh: "native:refresh";
};
export type EventRow = {
    at: number;
    kind: string;
    detail: string;
};
export type AbiInfo = {
    platform: string;
    arch: string;
    modules: string;
    napi: string;
    node: string;
    electron: string;
};
export type NativeInfo = {
    loaded: boolean;
    path: string;
    version: string;
    error: string;
    forcedFallback: boolean;
    source: "native" | "fallback";
};
export type HashResult = {
    inputLength: number;
    byteLength: number;
    nativeHash: string;
    jsHash: string;
    equal: boolean;
    usedNative: boolean;
    nativeMs: number;
    jsMs: number;
    at: number;
};
export type BenchRow = {
    label: string;
    size: number;
    nativeMs: number;
    jsMs: number;
    equal: boolean;
    nativeRepeats: number;
    jsRepeats: number;
};
export type Snapshot = {
    abi: AbiInfo;
    native: NativeInfo;
    lastHash: HashResult | null;
    bench: BenchRow[];
    events: EventRow[];
};
export declare function assertHashReq(value: unknown): asserts value is {
    text: string;
};
export declare function assertFallbackReq(value: unknown): asserts value is {
    enabled: boolean;
};
//# sourceMappingURL=ipc.d.ts.map