-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
54 lines (50 loc) · 1.17 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
export 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?: PrettierOptions
svgo?: boolean
// svgoConfig?: SvgoConfig
configFile?: string
// template?: TransformOptions['template']
memo?: boolean
exportType?: 'named' | 'default'
namedExport?: string
jsxRuntime?: 'classic' | 'classic-preact' | 'automatic'
jsxRuntimeImport?: {
source: string
namespace?: string
specifiers?: string[]
defaultSpecifier?: string
}
// CLI only
index?: boolean
// plugins?: ConfigPlugin[]
// JSX
// jsx?: {
// babelConfig?: BabelTransformOptions
// }
}
export interface State {
filePath?: string
componentName: string
caller?: {
name?: string
previousExport?: string | null
// defaultPlugins?: ConfigPlugin[]
}
}
export function transform(code: string, config?: Config, state?: Partial<State>): Promise<string>