File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,15 +25,18 @@ export type Transformed<T extends Record<string, any>> = {
2525 [ K in keyof T ] : Mapped < T [ K ] > ;
2626} ;
2727
28+ type TransformResult < T > = T extends readonly [ string , any ]
29+ ? Mapped < T >
30+ : T extends Record < string , any >
31+ ? Transformed < T >
32+ : never ;
33+
2834export type XmlInput = string | Uint8Array | ArrayBuffer | Buffer ;
2935
3036export function prettyPrint (
3137 xml : XmlInput ,
3238 opts ?: { indentSize : number }
3339) : Promise < string > ;
3440export function toJson ( xml : XmlInput ) : Promise < any > ;
35- export function transform < const T extends Record < string , any > > (
36- xml : XmlInput ,
37- template : T
38- ) : Promise < Transformed < T > > ;
41+ export function transform < const T > ( xml : XmlInput , template : T ) : Promise < TransformResult < T > > ;
3942export function destroy ( ) : Promise < void > ;
You can’t perform that action at this time.
0 commit comments