import type { Compilation, Compiler, sources } from 'webpack'; export type EntryCache = { source: sources.RawSource; sprite: string; filename: string; svgPaths: string[]; svgNames: string[]; }; export type Svgs = { name: string; content: string; }; export type SvgsData = { svgPaths: string[]; svgNames: string[]; svgs: Svgs[]; }; export type SpriteManifest = Record; export type Sprite = { entryName: string; source: sources.RawSource; sprite: string; svgs: string[]; }; export type LoaderOptions = { configFile: string | boolean; }; export type LoaderThis = { getOptions: () => LoaderOptions; context: string; _compiler: Compiler; async: () => (error: any, result?: string) => string; _module: { factoryMeta: { sideEffectFree: boolean; }; buildInfo: { SVG_CHUNK_WEBPACK_PLUGIN: true; }; }; emitError: (error: Error) => void; }; export type SvgstoreConfig = { cleanDefs?: boolean | string[]; cleanSymbols?: boolean | string[]; svgAttrs?: boolean | Record string)>; symbolAttrs?: boolean | Record string)>; copyAttrs?: boolean | string[]; renameDefs?: boolean; inline?: boolean; }; export type HtmlWebpackPluginAfterEmitPayload = { html: string; plugin: { options: { chunks: string[]; }; }; }; /** * Minimal interface for HtmlWebpackPlugin constructor * Used to avoid direct dependency on the optional html-webpack-plugin package */ export interface HtmlWebpackPluginConstructor { getCompilationHooks(compilation: Compilation): { afterTemplateExecution: { tapAsync(options: { name: string; }, callback: (data: HtmlWebpackPluginAfterEmitPayload, callback: (err: null, data: HtmlWebpackPluginAfterEmitPayload) => void) => void): void; }; }; } export type PluginOptions = { filename: string; svgstoreConfig: SvgstoreConfig; generateSpritesManifest: boolean; generateSpritesPreview: boolean; injectSpritesInTemplates: boolean; };