File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1313 "svgo-jsx" : " ./svgo-jsx-bin.js"
1414 },
1515 "exports" : " ./svgo-jsx.js" ,
16+ "types" : " ./svgo-jsx.d.ts" ,
1617 "files" : [
1718 " svgo-jsx-bin.js" ,
1819 " svgo-jsx-cli.js" ,
1920 " svgo-jsx.js" ,
21+ " svgo-jsx.d.ts" ,
2022 " mappings.js"
2123 ],
2224 "dependencies" : {
Original file line number Diff line number Diff line change 1+ import type { Config as SvgoConfig } from "svgo" ;
2+
3+ type Target = "react-dom" | "react-native-svg" | "preact" | "custom" ;
4+
5+ type SvgProps = Record < string , null | string > ;
6+
7+ type Options = {
8+ file : string ;
9+ svg : string ;
10+ target ?: Target ;
11+ svgProps ?: SvgProps ;
12+ plugins ?: SvgoConfig [ "plugins" ] ;
13+ } ;
14+
15+ type Output = {
16+ jsx : string ;
17+ components : string [ ] ;
18+ } ;
19+
20+ export declare function convertSvgToJsx ( options : Options ) : Output ;
21+
22+ type TemplateOptions = {
23+ target : Target ;
24+ sourceFile : string ;
25+ targetFile : string ;
26+ componentName : string ;
27+ jsx : string ;
28+ components : string [ ] ;
29+ } ;
30+
31+ type AfterOptions = {
32+ targets : Array < {
33+ file : string ;
34+ componentName : string ;
35+ } > ;
36+ } ;
37+
38+ export type Config = {
39+ inputDir : string ;
40+ outputDir : string ;
41+ target ?: Target ;
42+ svgProps ?: SvgProps ;
43+ plugins ?: SvgoConfig [ "plugins" ] ;
44+ template ?: ( options : TemplateOptions ) => string ;
45+ transformFilename ?: ( file : string ) => string ;
46+ after ?: AfterOptions ;
47+ } ;
You can’t perform that action at this time.
0 commit comments