http-directives
Version:
A TypeScript-friendly package that provides strongly-typed HTTP constants
57 lines (55 loc) • 2.55 kB
TypeScript
declare class CSPDirectives {
static readonly BASE_URI = "base-uri";
static readonly DEFAULT_SRC = "default-src";
static readonly CONNECT_SRC = "connect-src";
static readonly PREFETCH_SRC = "prefetch-src";
static readonly SCRIPT_SRC = "script-src";
static readonly STYLE_SRC = "style-src";
static readonly IMG_SRC = "img-src";
static readonly FONT_SRC = "font-src";
static readonly MEDIA_SRC = "media-src";
static readonly OBJECT_SRC = "object-src";
static readonly MANIFEST_SRC = "manifest-src";
static readonly WORKER_SRC = "worker-src";
static readonly FRAME_SRC = "frame-src";
/** @deprecated Use frame-src and worker-src instead */
static readonly CHILD_SRC = "child-src";
static readonly FRAME_ANCESTORS = "frame-ancestors";
static readonly SANDBOX = "sandbox";
static readonly FORM_ACTION = "form-action";
static readonly NAVIGATE_TO = "navigate-to";
static readonly UPGRADE_INSECURE_REQUESTS = "upgrade-insecure-requests";
static readonly BLOCK_ALL_MIXED_CONTENT = "block-all-mixed-content";
/** @deprecated Replaced by Referrer-Policy header. */
static readonly REFERRER = "referrer";
/** @deprecated Use report-to instead. */
static readonly REPORT_URI = "report-uri";
static readonly REPORT_TO = "report-to";
/** @deprecated */
static readonly REQUIRE_SRI_FOR = "require-sri-for";
/** @deprecated */
static readonly PLUGIN_TYPES = "plugin-types";
}
declare class CSPSources {
static readonly SELF = "self";
static readonly NONE = "none";
static readonly STRICT_DYNAMIC = "strict-dynamic";
static readonly UNSAFE_INLINE = "unsafe-inline";
static readonly UNSAFE_EVAL = "unsafe-eval";
static readonly UNSAFE_HASHES = "unsafe-hashes";
static readonly WASM_UNSAFE_EVAL = "wasm-unsafe-eval";
static readonly REPORT_SAMPLE = "report-sample";
static readonly SELF_QTD = "'self'";
static readonly NONE_QTD = "'none'";
static readonly STRICT_DYNAMIC_QTD = "'strict-dynamic'";
static readonly UNSAFE_INLINE_QTD = "'unsafe-inline'";
static readonly UNSAFE_EVAL_QTD = "'unsafe-eval'";
static readonly UNSAFE_HASHES_QTD = "'unsafe-hashes'";
static readonly WASM_UNSAFE_EVAL_QTD = "'wasm-unsafe-eval'";
static readonly REPORT_SAMPLE_QTD = "'report-sample'";
static nonce(value: string): string;
static sha256(value: string): string;
static sha384(value: string): string;
static sha512(value: string): string;
}
export { CSPDirectives, CSPSources };