UNPKG

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