File size: 2,324 Bytes
a053984
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
74
75
76
77
78
79
import { Options } from 'prettier';
import { Config as Config$1 } from 'svgo';
import { Options as Options$1 } from '@svgr/babel-preset';
import { TransformOptions } from '@babel/core';

interface State {
    filePath?: string;
    componentName: string;
    caller?: {
        name?: string;
        previousExport?: string | null;
        defaultPlugins?: ConfigPlugin[];
    };
}

interface Plugin {
    (code: string, config: Config, state: State): string;
}
type ConfigPlugin = string | Plugin;

interface Config {
    ref?: boolean;
    titleProp?: boolean;
    descProp?: boolean;
    expandProps?: boolean | 'start' | 'end';
    dimensions?: boolean;
    icon?: boolean | string | number;
    native?: boolean;
    svgProps?: {
        [key: string]: string;
    };
    replaceAttrValues?: {
        [key: string]: string;
    };
    runtimeConfig?: boolean;
    typescript?: boolean;
    prettier?: boolean;
    prettierConfig?: Options;
    svgo?: boolean;
    svgoConfig?: Config$1;
    configFile?: string;
    template?: Options$1['template'];
    memo?: boolean;
    exportType?: 'named' | 'default';
    namedExport?: string;
    jsxRuntime?: 'classic' | 'classic-preact' | 'automatic';
    jsxRuntimeImport?: {
        source: string;
        namespace?: string;
        specifiers?: string[];
        defaultSpecifier?: string;
    };
    index?: boolean;
    plugins?: ConfigPlugin[];
    jsx?: {
        babelConfig?: TransformOptions;
    };
}
declare const DEFAULT_CONFIG: Config;
declare const resolveConfig: {
    (searchFrom?: string, configFile?: string): Promise<Config | null>;
    sync(searchFrom?: string, configFile?: string): Config | null;
};
declare const resolveConfigFile: {
    (filePath: string): Promise<string | null>;
    sync(filePath: string): string | null;
};
declare const loadConfig: {
    ({ configFile, ...baseConfig }: Config, state?: Pick<State, 'filePath'>): Promise<Config>;
    sync({ configFile, ...baseConfig }: Config, state?: Pick<State, 'filePath'>): Config;
};

declare const transform: {
    (code: string, config?: Config, state?: Partial<State>): Promise<string>;
    sync(code: string, config?: Config, state?: Partial<State>): string;
};

export { Config, ConfigPlugin, DEFAULT_CONFIG, Plugin, State, loadConfig, resolveConfig, resolveConfigFile, transform };