-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.d.ts
73 lines (56 loc) · 1.76 KB
/
index.d.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import type { Plugin, PluginBuild } from 'esbuild';
declare type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;
declare type LocalsConventionFunction = (
originalClassName: string,
generatedClassName: string,
inputFile: string
) => string;
declare class Loader {
constructor(root: string, plugins: Plugin[]);
fetch(file: string, relativeTo: string, depTrace: string): Promise<{ [key: string]: string }>;
finalSource?: string | undefined;
}
declare interface CssModulesOptions {
getJSON?(cssFilename: string, json: { [name: string]: string }, outputFilename?: string): void;
localsConvention?:
| 'camelCase'
| 'camelCaseOnly'
| 'dashes'
| 'dashesOnly'
| LocalsConventionFunction;
scopeBehaviour?: 'global' | 'local';
globalModulePaths?: RegExp[];
generateScopedName?: string | GenerateScopedNameFunction;
hashPrefix?: string;
exportGlobals?: boolean;
root?: string;
Loader?: typeof Loader;
resolve?: (file: string) => string | Promise<string>;
}
declare interface PluginOptions {
inject?: boolean | string | ((css: string, digest: string) => string);
localsConvention?: CssModulesOptions['localsConvention'];
generateScopedName?: CssModulesOptions['generateScopedName'];
cssModulesOption?: CssModulesOptions;
v2?: boolean;
root?: string;
package?: {
name: string,
main?: string,
module?: string,
version?: string
}
}
declare interface BuildContext {
buildId: string;
buildRoot: string;
packageRoot?: string;
}
declare function CssModulesPlugin(options?: PluginOptions): Plugin;
declare namespace CssModulesPlugin {
export type Options = PluginOptions;
export interface Build extends PluginBuild {
context: BuildContext;
}
}
export = CssModulesPlugin;