-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
plugin-state.ts
34 lines (30 loc) · 1.07 KB
/
plugin-state.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { AbortController } from 'node-abort-controller';
import type { FullTap } from 'tapable';
import type { FilesChange } from './files-change';
import type { FilesMatch } from './files-match';
import type { Issue } from './issue';
interface ForkTsCheckerWebpackPluginState {
issuesPromise: Promise<Issue[] | undefined>;
dependenciesPromise: Promise<FilesMatch | undefined>;
abortController: AbortController | undefined;
aggregatedFilesChange: FilesChange | undefined;
lastDependencies: FilesMatch | undefined;
watching: boolean;
initialized: boolean;
iteration: number;
webpackDevServerDoneTap: FullTap | undefined;
}
function createPluginState(): ForkTsCheckerWebpackPluginState {
return {
issuesPromise: Promise.resolve(undefined),
dependenciesPromise: Promise.resolve(undefined),
abortController: undefined,
aggregatedFilesChange: undefined,
lastDependencies: undefined,
watching: false,
initialized: false,
iteration: 0,
webpackDevServerDoneTap: undefined,
};
}
export { ForkTsCheckerWebpackPluginState, createPluginState };