/** * COOP/COEP Handler * * P1 - Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy management * * Supports: * - COOP header parsing and validation * - COEP header parsing and validation * - Cross-origin isolation detection * - SharedArrayBuffer availability check * - High-resolution timers availability check * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cross-Origin-Opener-Policy * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cross-Origin-Embedder-Policy */ export type COOPValue = 'unsafe-none' | 'same-origin' | 'same-origin-allow-popups'; export type COEPValue = 'unsafe-none' | 'require-corp' | 'credentialless'; export interface COOPConfig { /** COOP header value */ value: COOPValue; /** Reporting endpoint */ reportTo?: string; /** Report-only mode */ reportOnly?: boolean; } export interface COEPConfig { /** COEP header value */ value: COEPValue; /** Reporting endpoint */ reportTo?: string; /** Report-only mode */ reportOnly?: boolean; } export interface CrossOriginIsolationStatus { /** Is cross-origin isolated */ isIsolated: boolean; /** COOP header present */ hasCOOP: boolean; /** COOP header value */ coopValue: COOPValue | null; /** COEP header present */ hasCOEP: boolean; /** COEP header value */ coepValue: COEPValue | null; /** SharedArrayBuffer available */ sharedArrayBufferAvailable: boolean; /** High-resolution timers available */ highResTimersAvailable: boolean; /** Can use performance.measureUserAgentSpecificMemory() */ memoryMeasurementAvailable: boolean; /** Security score (0-100) */ securityScore: number; /** Recommendations */ recommendations: string[]; } /** * COOP/COEP Handler class */ export declare class COOPCOEPHandler { private page; constructor(page: any); /** * Get COOP header from response */ getCOOPHeader(): Promise; /** * Get COEP header from response */ getCOEPHeader(): Promise; /** * Check if value is valid COOP */ private isValidCOOP; /** * Check if value is valid COEP */ private isValidCOEP; /** * Check cross-origin isolation status */ getCrossOriginIsolationStatus(): Promise; /** * Check if SharedArrayBuffer is usable */ canUseSharedArrayBuffer(): Promise; /** * Check if high-resolution timers are available */ hasHighResolutionTimers(): Promise; /** * Check if memory measurement is available */ canMeasureMemory(): Promise; /** * Measure memory usage (if available) */ measureMemory(): Promise<{ breakdown: Array<{ bytes: number; attribution: string[]; }>; bytes: number; } | null>; /** * Test COOP behavior with window.open() */ testCOOPBehavior(): Promise<{ canAccessOpener: boolean; openerAccessible: boolean; }>; /** * Get COOP/COEP recommendations based on use case */ getRecommendations(useCase: 'default' | 'sharedarraybuffer' | 'high-performance' | 'security'): { coop: COOPValue; coep: COEPValue; reason: string; }; /** * Validate COOP/COEP configuration */ validateConfiguration(): Promise<{ valid: boolean; errors: string[]; warnings: string[]; }>; /** * Get COOP/COEP documentation link */ getDocumentation(): string; } /** * Factory function to create COOP/COEP Handler */ export declare function createCOOPCOEPHandler(page: any): COOPCOEPHandler; export default COOPCOEPHandler;