示例工程 46-csp-navigation-integrity
46-csp-navigation-integrity/app/.tsc/shared/ipc.d.ts
export declare const CH: {
readonly snapshot: "integrity:snapshot";
readonly runCsp: "integrity:run-csp";
readonly navigate: "integrity:navigate";
readonly tamper: "integrity:tamper";
readonly refresh: "integrity:refresh";
};
export type EventRow = {
at: number;
kind: string;
detail: string;
};
export type Check = {
id: string;
label: string;
pass: boolean;
detail: string;
};
export type CspViolation = {
directive: string;
blockedURI: string;
disposition: string;
};
export type CspResult = {
id: string;
label: string;
blocked: boolean;
evidence: string;
};
export type CspState = {
policy: string;
violations: CspViolation[];
results: CspResult[];
};
export type NavAttempt = {
label: string;
url: string;
allowed: boolean;
reason: string;
observed: string;
};
export type IntegrityFile = {
fileName: string;
expected: string;
actual: string;
ok: boolean;
};
export type IntegrityState = {
manifestVersion: number;
good: IntegrityFile;
tampered: IntegrityFile | null;
};
export type PackagingState = {
isPackaged: boolean;
appPath: string;
asar: boolean;
fusesVerified: false;
note: string;
};
export type Snapshot = {
platform: string;
electronVersion: string;
nodeVersion: string;
checks: Check[];
score: number;
csp: CspState;
navigation: {
policy: NavAttempt[];
attempts: NavAttempt[];
};
integrity: IntegrityState;
packaging: PackagingState;
events: EventRow[];
};
export declare function isAllowedNavigation(raw: string, appUrl: string): {
allowed: boolean;
reason: string;
};
export declare function parseCsp(policy: string): Record<string, string[]>;
export declare function assertCspRequest(value: unknown): asserts value is {
id: string;
};
export declare function assertNavigateRequest(value: unknown): asserts value is {
url: string;
};
//# sourceMappingURL=ipc.d.ts.map