-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathtypes.d.ts
More file actions
28 lines (22 loc) · 710 Bytes
/
types.d.ts
File metadata and controls
28 lines (22 loc) · 710 Bytes
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
declare module 'svgson' {
export interface INode {
name: string
type: string
value: string
attributes: Record<string, string>
children: INode[]
}
interface IParseOptions {
transformNode?: (node: INode) => INode
camelcase?: boolean
}
type TEscape = (text?: string) => string
interface IStringifyOptions {
transformAttr?: (key: string, value: string, escape: TEscape) => string
transformNode?: (node: INode) => INode
selfClose?: boolean
}
function parse(input: string, options?: IParseOptions): Promise<INode>
function parseSync(input: string, options?: IParseOptions): INode
function stringify(ast: INode, options?: IStringifyOptions): string
}