1 | import type {loader} from 'webpack';
|
2 | import type glob from 'glob';
|
3 |
|
4 | export type Loader = loader.Loader;
|
5 |
|
6 | export type LoaderContext = loader.LoaderContext;
|
7 |
|
8 | export type LoaderCallback = loader.loaderCallback;
|
9 |
|
10 | export type StyleResourcesFileFormat = 'css' | 'sass' | 'scss' | 'less' | 'styl';
|
11 |
|
12 | export interface StyleResource {
|
13 | file: string;
|
14 | content: string;
|
15 | }
|
16 |
|
17 | export type StyleResources = StyleResource[];
|
18 |
|
19 | export type StyleResourcesFunctionalInjector = (source: string, resources: StyleResources) => string | Promise<string>;
|
20 |
|
21 | export type StyleResourcesInjector = 'prepend' | 'append' | StyleResourcesFunctionalInjector;
|
22 |
|
23 | export type StyleResourcesNormalizedInjector = StyleResourcesFunctionalInjector;
|
24 |
|
25 | export interface StyleResourcesLoaderOptions {
|
26 | patterns: string | string[];
|
27 | injector?: StyleResourcesInjector;
|
28 | globOptions?: glob.IOptions;
|
29 | resolveUrl?: boolean;
|
30 | }
|
31 |
|
32 | export interface StyleResourcesLoaderNormalizedOptions extends NonNullable<StyleResourcesLoaderOptions> {
|
33 | patterns: string[];
|
34 | injector: StyleResourcesNormalizedInjector;
|
35 | }
|