import { CSPDirective, SecurityEvent } from './types.js'; /** * Content Security Policy (CSP) service for miura Framework * Handles CSP generation, validation, and enforcement */ export declare class CSPService { private static instance; private directives; private eventListeners; private constructor(); static getInstance(): CSPService; /** * Generate CSP policy string (for meta or header) */ generateCSPPolicyString({ forMeta }?: { forMeta?: boolean; }): string; /** * Generate CSP header string (for HTTP header) */ generateCSPHeader(reportOnly?: boolean): string; /** * Set CSP directive */ setDirective(directive: keyof CSPDirective, sources: string[] | boolean): void; /** * Add source to directive */ addSource(directive: keyof CSPDirective, source: string): void; /** * Remove source from directive */ removeSource(directive: keyof CSPDirective, source: string): void; /** * Validate CSP directive */ validateDirective(directive: string, sources: string[]): { valid: boolean; errors: string[]; }; /** * Apply CSP to current page (via tag) */ applyToPage(reportOnly?: boolean): void; /** * Handle CSP violation reports */ handleViolation(violation: any): void; /** * Get current directives */ getDirectives(): CSPDirective; /** * Add event listener */ on(event: string, callback: (event: SecurityEvent) => void): void; /** * Remove event listener */ off(event: string, callback: (event: SecurityEvent) => void): void; private getDefaultDirectives; private isValidSource; private isUnsafeSource; private emitSecurityEvent; } export declare const csp: CSPService; //# sourceMappingURL=csp.d.ts.map