UNPKG

vite-plugin-csp-guard

Version:

A Vite plugin that lets SPA applications generate a Content Security Policy (CSP).

26 lines 1.23 kB
import type { IndexHtmlTransformContext, Rolldown, ViteDevServer } from "vite"; import { type CSPPluginContext, type MyPluginOptions, TransformationStatus } from "../types"; export interface TransformHandlerProps { code: string; id: string; cspContext: CSPPluginContext; transformationStatus: TransformationStatus; transformMode: "pre" | "post"; server?: ViteDevServer; } export declare const transformHandler: ({ code, id, cspContext, transformationStatus, transformMode, server, }: TransformHandlerProps) => Promise<null>; export interface TransformIndexHtmlHandlerProps { html: string; context: IndexHtmlTransformContext; pluginContext: Rolldown.PluginContext | undefined; isTransformationStatusEmpty: boolean; cspContext: CSPPluginContext; sri: boolean; chunkHashes?: Map<string, string>; transformPolicy?: MyPluginOptions["transformPolicy"]; } export declare const transformIndexHtmlHandler: ({ html, context: { server, bundle, chunk, path, filename }, pluginContext, isTransformationStatusEmpty, cspContext, sri, chunkHashes, transformPolicy, }: TransformIndexHtmlHandlerProps) => { html: string; tags: never[]; } | undefined; //# sourceMappingURL=index.d.ts.map