tl-shared-security
Version:
Enterprise-grade security module for frontend and backend applications with comprehensive protection against XSS, CSRF, SQL injection, and other security vulnerabilities
28 lines • 865 B
TypeScript
export interface SecurityHeadersOptions {
xssProtection?: boolean;
contentTypeOptions?: boolean;
frameOptions?: 'deny' | 'sameorigin' | null;
referrerPolicy?: string;
strictTransportSecurity?: {
maxAge: number;
includeSubDomains?: boolean;
preload?: boolean;
} | null;
}
export declare class SecurityHeaders {
private options;
constructor(options?: SecurityHeadersOptions);
/**
* Applies security headers to the document using meta tags
* Only works in browser environment
*/
applyToDocument(): void;
/**
* Gets security headers for server-side rendering
* @returns Object with security headers
*/
getHeaders(): Record<string, string>;
private addMetaTag;
}
export declare const securityHeaders: SecurityHeaders;
//# sourceMappingURL=security-headers.d.ts.map