import { scriptTagsContents, styleTagsContents } from './html-parsers.js'; import type { SrcKey } from './schemas/sources.js'; export type HashAlgorithmMapConfig = { [key: string]: string[] | boolean | undefined; }; export type HashAlgorithmMap = { [key in SrcKey]: string | undefined; }; /** * Detects the hash algorithm to use for all CSP source values in a CSP directive. * Different directives might use different hash algorithms. */ export declare const hashAlgorithmMap: (config: HashAlgorithmMapConfig) => HashAlgorithmMap; export declare enum Algorithm { sha256 = "sha256", sha384 = "sha384", sha512 = "sha512" } interface Config { algorithm: Algorithm; patterns: string[]; } interface UniqueHashesConfig extends Config { parser: typeof scriptTagsContents | typeof styleTagsContents; } /** * @internal */ export declare const uniqueHashes: ({ algorithm, parser, patterns }: UniqueHashesConfig) => Promise; /** * @internal */ export declare const hashesScriptSrcAttr: ({ algorithm, patterns }: Config) => Promise; /** * @internal */ export declare const hashesScriptSrcElem: ({ algorithm, patterns }: Config) => Promise; /** * @internal */ export declare const hashesStyleSrcAttr: ({ algorithm, patterns }: Config) => Promise; /** * @internal */ export declare const hashesStyleSrcElem: ({ algorithm, patterns }: Config) => Promise; /** * @internal */ export declare const noHashSpecifiedMessage: (directive: string) => string; export {}; //# sourceMappingURL=hash.d.ts.map