1 | import { Options } from 'prettier';
|
2 | import { Config as Config$1 } from 'svgo';
|
3 | import { Options as Options$1 } from '@svgr/babel-preset';
|
4 | import { TransformOptions } from '@babel/core';
|
5 |
|
6 | interface State {
|
7 | filePath?: string;
|
8 | componentName: string;
|
9 | caller?: {
|
10 | name?: string;
|
11 | previousExport?: string | null;
|
12 | defaultPlugins?: ConfigPlugin[];
|
13 | };
|
14 | }
|
15 |
|
16 | interface Plugin {
|
17 | (code: string, config: Config, state: State): string;
|
18 | }
|
19 | type ConfigPlugin = string | Plugin;
|
20 |
|
21 | interface Config {
|
22 | ref?: boolean;
|
23 | titleProp?: boolean;
|
24 | descProp?: boolean;
|
25 | expandProps?: boolean | 'start' | 'end';
|
26 | dimensions?: boolean;
|
27 | icon?: boolean | string | number;
|
28 | native?: boolean;
|
29 | svgProps?: {
|
30 | [key: string]: string;
|
31 | };
|
32 | replaceAttrValues?: {
|
33 | [key: string]: string;
|
34 | };
|
35 | runtimeConfig?: boolean;
|
36 | typescript?: boolean;
|
37 | prettier?: boolean;
|
38 | prettierConfig?: Options;
|
39 | svgo?: boolean;
|
40 | svgoConfig?: Config$1;
|
41 | configFile?: string;
|
42 | template?: Options$1['template'];
|
43 | memo?: boolean;
|
44 | exportType?: 'named' | 'default';
|
45 | namedExport?: string;
|
46 | jsxRuntime?: 'classic' | 'classic-preact' | 'automatic';
|
47 | jsxRuntimeImport?: {
|
48 | source: string;
|
49 | namespace?: string;
|
50 | specifiers?: string[];
|
51 | defaultSpecifier?: string;
|
52 | };
|
53 | index?: boolean;
|
54 | plugins?: ConfigPlugin[];
|
55 | jsx?: {
|
56 | babelConfig?: TransformOptions;
|
57 | };
|
58 | }
|
59 | declare const DEFAULT_CONFIG: Config;
|
60 | declare const resolveConfig: {
|
61 | (searchFrom?: string, configFile?: string): Promise<Config | null>;
|
62 | sync(searchFrom?: string, configFile?: string): Config | null;
|
63 | };
|
64 | declare const resolveConfigFile: {
|
65 | (filePath: string): Promise<string | null>;
|
66 | sync(filePath: string): string | null;
|
67 | };
|
68 | declare const loadConfig: {
|
69 | ({ configFile, ...baseConfig }: Config, state?: Pick<State, 'filePath'>): Promise<Config>;
|
70 | sync({ configFile, ...baseConfig }: Config, state?: Pick<State, 'filePath'>): Config;
|
71 | };
|
72 |
|
73 | declare const transform: {
|
74 | (code: string, config?: Config, state?: Partial<State>): Promise<string>;
|
75 | sync(code: string, config?: Config, state?: Partial<State>): string;
|
76 | };
|
77 |
|
78 | export { Config, ConfigPlugin, DEFAULT_CONFIG, Plugin, State, loadConfig, resolveConfig, resolveConfigFile, transform };
|