import { UseCSPNonceResult } from '../types';
/**
* Options for the useCSPNonce hook
*/
export interface UseCSPNonceOptions {
/** Auto-regenerate nonce at this interval (ms) */
regenerateInterval?: number;
/** Whether to initialize CSP Manager if not already */
autoInitialize?: boolean;
}
/**
* Hook for accessing CSP nonce values
*
* Provides nonce values for inline scripts and styles that comply
* with Content Security Policy requirements.
*
* @param options - Hook options
* @returns CSP nonce operations and values
*
* @example
* ```tsx
* function ScriptLoader() {
* const { nonce, scriptNonce } = useCSPNonce();
*
* return (
*
* );
* }
*
* // Or with style
* function InlineStyle() {
* const { nonce, styleNonce } = useCSPNonce();
*
* return (
*
* );
* }
* ```
*/
export declare function useCSPNonce(options?: UseCSPNonceOptions): UseCSPNonceResult;
/**
* Hook for creating nonce-protected inline script props
*
* @example
* ```tsx
* function TrackerScript() {
* const scriptProps = useNonceScript('console.log("tracked")');
*
* return ;
* }
* ```
*/
export declare function useNonceScript(scriptContent: string): {
nonce: string;
dangerouslySetInnerHTML: {
__html: string;
};
};
/**
* Hook for creating nonce-protected inline style props
*
* @example
* ```tsx
* function CustomStyles() {
* const styleProps = useNonceStyle('.custom { color: red; }');
*
* return ;
* }
* ```
*/
export declare function useNonceStyle(styleContent: string): {
nonce: string;
dangerouslySetInnerHTML: {
__html: string;
};
};