1 | import type { StringifyOptions, DataUri, Plugin as PluginFn } from './types';
|
2 | import type {
|
3 | BuiltinsWithOptionalParams,
|
4 | BuiltinsWithRequiredParams,
|
5 | } from '../plugins/plugins-types';
|
6 |
|
7 | type CustomPlugin = {
|
8 | name: string;
|
9 | fn: PluginFn<void>;
|
10 | };
|
11 |
|
12 | type PluginConfig =
|
13 | | keyof BuiltinsWithOptionalParams
|
14 | | {
|
15 | [Name in keyof BuiltinsWithOptionalParams]: {
|
16 | name: Name;
|
17 | params?: BuiltinsWithOptionalParams[Name];
|
18 | };
|
19 | }[keyof BuiltinsWithOptionalParams]
|
20 | | {
|
21 | [Name in keyof BuiltinsWithRequiredParams]: {
|
22 | name: Name;
|
23 | params: BuiltinsWithRequiredParams[Name];
|
24 | };
|
25 | }[keyof BuiltinsWithRequiredParams]
|
26 | | CustomPlugin;
|
27 |
|
28 | export type Config = {
|
29 |
|
30 | path?: string;
|
31 |
|
32 | multipass?: boolean;
|
33 |
|
34 | floatPrecision?: number;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | plugins?: PluginConfig[];
|
44 |
|
45 | js2svg?: StringifyOptions;
|
46 |
|
47 | datauri?: DataUri;
|
48 | };
|
49 |
|
50 | type Output = {
|
51 | data: string;
|
52 | };
|
53 |
|
54 |
|
55 | export declare function optimize(input: string, config?: Config): Output;
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | export declare function loadConfig(
|
63 | configFile: string,
|
64 | cwd?: string,
|
65 | ): Promise<Config>;
|
66 | export declare function loadConfig(
|
67 | configFile?: null,
|
68 | cwd?: string,
|
69 | ): Promise<Config | null>;
|