import { Compiler, WebpackPluginInstance } from "webpack"; import { Options } from "fast-glob"; import { CopyOptions } from "fs-extra"; import { Options as DelOptions } from "del"; import { ArchiverOptions } from "archiver"; //#region src/actions/copy.d.ts type FsCopyOptions = Pick; interface CopyActionOptions extends FsCopyOptions { /** * If true, the copy operation will not preserve the directory structure * and will copy all files to the destination directory. */ flat?: boolean; } type CopyGlobOptions = Omit; //#endregion //#region src/actions/archive.d.ts /** {@link https://github.com/Yqnn/node-readdir-glob#options} */ interface ReaddirGlobOptions { /** Glob pattern or Array of Glob patterns to match the found files with. A file has to match at least one of the provided patterns to be returned. */ pattern?: string | string[]; /** Glob pattern or Array of Glob patterns to exclude matches. If a file or a folder matches at least one of the provided patterns, it's not returned. It doesn't prevent files from folder content to be returned. Note: ignore patterns are always in dot:true mode. */ ignore?: string | string[]; /** Glob pattern or Array of Glob patterns to exclude folders. If a folder matches one of the provided patterns, it's not returned, and it's not explored: this prevents any of its children to be returned. Note: skip patterns are always in dot:true mode. */ skip?: string | string[]; /** Add a / character to directory matches. */ mark?: boolean; /** Set to true to stat all results. This reduces performance. */ stat?: boolean; /** When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the silent option to true to suppress these warnings. */ silent?: boolean; /** Do not match directories, only files. */ nodir?: boolean; /** Follow symlinked directories. Note that requires to stat all results, and so reduces performance. */ follow?: boolean; /** Allow pattern to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot. */ dot?: boolean; /** Disable ** matching against multiple folder names. */ noglobstar?: boolean; /** Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since stat and readdir will not raise errors. */ nocase?: boolean; /** Perform a basename-only match if the pattern does not contain any slash characters. That is, *.js would be treated as equivalent to ** /*.js, matching all js files in all directories. */ matchBase?: boolean; } type ArchiverOptions$1 = ArchiverOptions & { globOptions?: ReaddirGlobOptions; }; //#endregion //#region src/index.d.ts type CopyAction = { source: string; destination: string; options?: CopyActionOptions; globOptions?: CopyGlobOptions; }; type DeleteAction = { source: string; options: DelOptions; } | string; type MoveAction = { source: string; destination: string; }; type ArchiveAction = { source: string; destination: string; format?: 'zip' | 'tar'; options?: ArchiverOptions$1; }; type MkdirAction = string; interface Actions { copy?: CopyAction[]; delete?: DeleteAction[]; move?: MoveAction[]; mkdir?: MkdirAction[]; archive?: ArchiveAction[]; } interface FileManagerPluginOptions { events?: { /** * Commands to execute before Webpack begins the bundling process * Note: OnStart might execute twice for file changes in webpack context. */ onStart?: Actions | Actions[]; /** * Commands to execute after Webpack has finished the bundling process */ onEnd?: Actions | Actions[]; }; /** * Run tasks in an action in series */ runTasksInSeries?: boolean; /** * Run tasks only at first compilation in watch mode */ runOnceInWatchMode?: boolean; /** * The directory, an absolute path, for resolving files. Defaults to webpack context */ context?: string | null; /** * If true, will throw an error if any action fails * @default false */ throwOnError?: boolean; } declare class FileManagerPlugin implements WebpackPluginInstance { private options; private context; private logger; constructor(options: FileManagerPluginOptions); private applyAction; private run; private execute; apply(compiler: Compiler): void; } //#endregion export { FileManagerPluginOptions, FileManagerPlugin as default }; //# sourceMappingURL=index.d.cts.map