|
| 1 | +declare module 'replace-in-file-webpack-plugin' { |
| 2 | + import { Compiler, Plugin } from 'webpack'; |
| 3 | + |
| 4 | + interface ReplaceRule { |
| 5 | + search: string | RegExp; |
| 6 | + replace: string | ((match: string) => string); |
| 7 | + } |
| 8 | + |
| 9 | + interface ReplaceOption { |
| 10 | + dir?: string; |
| 11 | + files?: string[]; |
| 12 | + test?: RegExp | RegExp[]; |
| 13 | + rules: ReplaceRule[]; |
| 14 | + } |
| 15 | + |
| 16 | + class ReplaceInFilePlugin extends Plugin { |
| 17 | + constructor(options?: ReplaceOption[]); |
| 18 | + options: ReplaceOption[]; |
| 19 | + apply(compiler: Compiler): void; |
| 20 | + } |
| 21 | + |
| 22 | + export = ReplaceInFilePlugin; |
| 23 | +} |
| 24 | + |
| 25 | +declare module 'webpack-livereload-plugin' { |
| 26 | + import { ServerOptions } from 'https'; |
| 27 | + import { Compiler, Plugin, Stats, Compilation } from 'webpack'; |
| 28 | + |
| 29 | + interface Options extends Pick<ServerOptions, 'cert' | 'key' | 'pfx'> { |
| 30 | + /** |
| 31 | + * protocol for livereload `<script>` src attribute value |
| 32 | + * @default protocol of the page, either `http` or `https` |
| 33 | + */ |
| 34 | + protocol?: string | undefined; |
| 35 | + /** |
| 36 | + * The desired port for the livereload server. |
| 37 | + * If you define port 0, an available port will be searched for, starting from 35729. |
| 38 | + * @default 35729 |
| 39 | + */ |
| 40 | + port?: number | undefined; |
| 41 | + /** |
| 42 | + * he desired hostname for the appended `<script>` (if present) to point to |
| 43 | + * @default hostname of the page, like `localhost` or 10.0.2.2 |
| 44 | + */ |
| 45 | + hostname?: string | undefined; |
| 46 | + /** |
| 47 | + * livereload `<script>` automatically to `<head>`. |
| 48 | + * @default false |
| 49 | + */ |
| 50 | + appendScriptTag?: boolean | undefined; |
| 51 | + /** |
| 52 | + * RegExp of files to ignore. Null value means ignore nothing. |
| 53 | + * It is also possible to define an array and use multiple anymatch patterns |
| 54 | + */ |
| 55 | + ignore?: RegExp | RegExp[] | null | undefined; |
| 56 | + /** |
| 57 | + * amount of milliseconds by which to delay the live reload (in case build takes longer) |
| 58 | + * @default 0 |
| 59 | + */ |
| 60 | + delay?: number | undefined; |
| 61 | + /** |
| 62 | + * create hash for each file source and only notify livereload if hash has changed |
| 63 | + * @default false |
| 64 | + */ |
| 65 | + useSourceHash?: boolean | undefined; |
| 66 | + } |
| 67 | + |
| 68 | + class LiveReloadPlugin extends Plugin { |
| 69 | + readonly isRunning: boolean; |
| 70 | + constructor(options?: Options); |
| 71 | + |
| 72 | + apply(compiler: Compiler): void; |
| 73 | + |
| 74 | + start(watching: any, cb: () => void): void; |
| 75 | + done(stats: Stats): void; |
| 76 | + failed(): void; |
| 77 | + autoloadJs(): string; |
| 78 | + scriptTag(source: string): string; |
| 79 | + applyCompilation(compilation: Compilation): void; |
| 80 | + } |
| 81 | + |
| 82 | + export = LiveReloadPlugin; |
| 83 | +} |
0 commit comments