UNPKG

1.2 kBTypeScriptView Raw
1import { Plugin } from 'rollup'
2import { CreateFilter } from 'rollup-pluginutils'
3
4type FunctionType<T = any, U = any> = (...args: readonly T[]) => U;
5
6type onExtract = (asset: Readonly<{
7 code: any;
8 map: any;
9 codeFileName: string;
10 mapFileName: string;
11}>) => boolean;
12
13export type PostCSSPluginConf = {
14 inject?:
15 | boolean
16 | Record<string, any>
17 | ((cssVariableName: string, id: string) => string);
18 extract?: boolean | string;
19 onExtract?: onExtract;
20 modules?: boolean | Record<string, any>;
21 extensions?: string[];
22 plugins?: any[];
23 autoModules?: boolean;
24 namedExports?: boolean | ((id: string) => string);
25 minimize?: boolean | any;
26 parser?: string | FunctionType;
27 stringifier?: string | FunctionType;
28 syntax?: string | FunctionType;
29 exec?: boolean;
30 config?:
31 | boolean
32 | {
33 path: string;
34 ctx: any;
35 };
36 to?: string;
37 name?: any[] | any[][];
38 loaders?: any[];
39 onImport?: (id: string) => void;
40 use?: string[] | { [key in 'sass' | 'stylus' | 'less']: any };
41 /**
42 * @default: false
43 **/
44 sourceMap?: boolean | 'inline';
45 include?: Parameters<CreateFilter>[0];
46 exclude?: Parameters<CreateFilter>[1];
47};
48
49export default function (options?: Readonly<PostCSSPluginConf>): Plugin
50
\No newline at end of file