-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathindex.d.ts
1771 lines (1644 loc) · 50.7 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Writable } from 'stream';
export = xmlbuilder;
/**
* Type definitions for [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js)
*
* Original definitions on [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) by:
* - Wallymathieu <https://github.com/wallymathieu>
* - GaikwadPratik <https://github.com/GaikwadPratik>
*/
declare namespace xmlbuilder {
/**
* Creates a new XML document and returns the root element node.
*
* @param nameOrObject - name of the root element or a JS object to be
* converted to an XML tree
* @param xmldecOrOptions - XML declaration or create options
* @param doctypeOrOptions - Doctype declaration or create options
* @param options - create options
*/
function create(nameOrObject: string | { [name: string]: Object },
xmldecOrOptions?: CreateOptions, doctypeOrOptions?: CreateOptions,
options?: CreateOptions): XMLElement;
/**
* Defines the options used while creating an XML document with the `create`
* function.
*/
interface CreateOptions {
/**
* A version number string, e.g. `1.0`
*/
version?: string;
/**
* Encoding declaration, e.g. `UTF-8`
*/
encoding?: string;
/**
* Standalone document declaration: `true` or `false`
*/
standalone?: boolean;
/**
* Public identifier of the DTD
*/
pubID?: string;
/**
* System identifier of the DTD
*/
sysID?: string;
/**
* Whether XML declaration and doctype will be included
*/
headless?: boolean;
/**
* Whether nodes with `null` values will be kept or ignored
*/
keepNullNodes?: boolean;
/**
* Whether attributes with `null` values will be kept or ignored
*/
keepNullAttributes?: boolean;
/**
* Whether decorator strings will be ignored when converting JS
* objects
*/
ignoreDecorators?: boolean;
/**
* Whether array items are created as separate nodes when passed
* as an object value
*/
separateArrayItems?: boolean;
/**
* Whether existing html entities are encoded
*/
noDoubleEncoding?: boolean;
/**
* Whether values will be validated and escaped or returned as is
*/
noValidation?: boolean;
/**
* A character to replace invalid characters in all values. This also
* disables character validation.
*/
invalidCharReplacement?: string;
/**
* A set of functions to use for converting values to strings
*/
stringify?: XMLStringifier;
/**
* The default XML writer to use for converting nodes to string.
* If the default writer is not set, the built-in `XMLStringWriter`
* will be used instead.
*/
writer?: XMLWriter;
}
/**
* Defines the functions used for converting values to strings.
*/
interface XMLStringifier {
/**
* Converts an element or attribute name to string
*/
name?: (v: any) => string;
/**
* Converts the contents of a text node to string
*/
text?: (v: any) => string;
/**
* Converts the contents of a CDATA node to string
*/
cdata?: (v: any) => string;
/**
* Converts the contents of a comment node to string
*/
comment?: (v: any) => string;
/**
* Converts the contents of a raw text node to string
*/
raw?: (v: any) => string;
/**
* Converts attribute value to string
*/
attValue?: (v: any) => string;
/**
* Converts processing instruction target to string
*/
insTarget?: (v: any) => string;
/**
* Converts processing instruction value to string
*/
insValue?: (v: any) => string;
/**
* Converts XML version to string
*/
xmlVersion?: (v: any) => string;
/**
* Converts XML encoding to string
*/
xmlEncoding?: (v: any) => string;
/**
* Converts standalone document declaration to string
*/
xmlStandalone?: (v: any) => string;
/**
* Converts DocType public identifier to string
*/
dtdPubID?: (v: any) => string;
/**
* Converts DocType system identifier to string
*/
dtdSysID?: (v: any) => string;
/**
* Converts `!ELEMENT` node content inside Doctype to string
*/
dtdElementValue?: (v: any) => string;
/**
* Converts `!ATTLIST` node type inside DocType to string
*/
dtdAttType?: (v: any) => string;
/**
* Converts `!ATTLIST` node default value inside DocType to string
*/
dtdAttDefault?: (v: any) => string;
/**
* Converts `!ENTITY` node content inside Doctype to string
*/
dtdEntityValue?: (v: any) => string;
/**
* Converts `!NOTATION` node content inside Doctype to string
*/
dtdNData?: (v: any) => string;
/**
* When prepended to a JS object key, converts the key-value pair
* to an attribute.
*/
convertAttKey?: string;
/**
* When prepended to a JS object key, converts the key-value pair
* to a processing instruction node.
*/
convertPIKey?: string;
/**
* When prepended to a JS object key, converts its value to a text node.
*
* _Note:_ Since JS objects cannot contain duplicate keys, multiple text
* nodes can be created by adding some unique text after each object
* key. For example: `{ '#text1': 'some text', '#text2': 'more text' };`
*/
convertTextKey?: string;
/**
* When prepended to a JS object key, converts its value to a CDATA
* node.
*/
convertCDataKey?: string;
/**
* When prepended to a JS object key, converts its value to a
* comment node.
*/
convertCommentKey?: string;
/**
* When prepended to a JS object key, converts its value to a raw
* text node.
*/
convertRawKey?: string;
/**
* Escapes special characters in text.
*/
textEscape?: (v: string) => string;
/**
* Escapes special characters in attribute values.
*/
attEscape?: (v: string) => string;
}
/**
* Represents a writer which outputs an XML document.
*/
interface XMLWriter {
/**
* Writes the indentation string for the given level.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
indent?: (node: XMLNode, options: WriterOptions, level: number) => any
/**
* Writes the newline string.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
endline?: (node: XMLNode, options: WriterOptions, level: number) => any
/**
* Writes an attribute.
*
* @param att - current attribute
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
attribute?: (att: XMLAttribute, options: WriterOptions,
level: number) => any
/**
* Writes a CDATA node.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
cdata?: (node: XMLCData, options: WriterOptions, level: number) => any
/**
* Writes a comment node.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
comment?: (node: XMLComment, options: WriterOptions,
level: number) => any
/**
* Writes the XML declaration (e.g. `<?xml version="1.0"?>`).
*
* @param node - XML declaration node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
declaration?: (node: XMLDeclaration, options: WriterOptions,
level: number) => any
/**
* Writes the DocType node and its children.
*
* _Note:_ Be careful when overriding this function as this function
* is also responsible for writing the internal subset of the DTD.
*
* @param node - DOCTYPE node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
docType?: (node: XMLDocType, options: WriterOptions,
level: number) => any
/**
* Writes an element node.
*
* _Note:_ Be careful when overriding this function as this function
* is also responsible for writing the element attributes and child
* nodes.
*
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
element?: (node: XMLElement, options: WriterOptions,
level: number) => any
/**
* Writes a processing instruction node.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
processingInstruction?: (node: XMLProcessingInstruction,
options: WriterOptions, level: number) => any
/**
* Writes a raw text node.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
raw?: (node: XMLRaw, options: WriterOptions, level: number) => any
/**
* Writes a text node.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
text?: (node: XMLText, options: WriterOptions, level: number) => any
/**
* Writes an attribute node (`!ATTLIST`) inside the DTD.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
dtdAttList?: (node: XMLDTDAttList, options: WriterOptions,
level: number) => any
/**
* Writes an element node (`!ELEMENT`) inside the DTD.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
dtdElement?: (node: XMLDTDElement, options: WriterOptions,
level: number) => any
/**
* Writes an entity node (`!ENTITY`) inside the DTD.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
dtdEntity?: (node: XMLDTDEntity, options: WriterOptions,
level: number) => any
/**
* Writes a notation node (`!NOTATION`) inside the DTD.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
dtdNotation?: (node: XMLDTDNotation, options: WriterOptions,
level: number) => any
/**
* Called right after starting writing a node. This function does not
* produce any output, but can be used to alter the state of the writer.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
openNode?: (node: XMLNode, options: WriterOptions,
level: number) => void
/**
* Called right before completing writing a node. This function does not
* produce any output, but can be used to alter the state of the writer.
*
* @param node - current node
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
closeNode?: (node: XMLNode, options: WriterOptions,
level: number) => void
/**
* Called right after starting writing an attribute. This function does
* not produce any output, but can be used to alter the state of the
* writer.
*
* @param node - current attribute
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
openAttribute?: (att: XMLAttribute, options: WriterOptions,
level: number) => void
/**
* Called right before completing writing an attribute. This function
* does not produce any output, but can be used to alter the state of
* the writer.
*
* @param node - current attribute
* @param options - writer options and state information
* @param level - current depth of the XML tree
*/
closeAttribute?: (att: XMLAttribute, options: WriterOptions,
level: number) => void
}
/**
* Defines the options passed to the XML writer.
*/
interface WriterOptions {
/**
* Pretty print the XML tree
*/
pretty?: boolean;
/**
* Indentation string for pretty printing
*/
indent?: string;
/**
* Newline string for pretty printing
*/
newline?: string;
/**
* A fixed number of indents to offset strings
*/
offset?: number;
/**
* Maximum column width
*/
width?: number;
/**
* Whether to output closing tags for empty element nodes
*/
allowEmpty?: boolean;
/**
* Whether to pretty print text nodes
*/
dontPrettyTextNodes?: boolean;
/**
* A string to insert before closing slash character
*/
spaceBeforeSlash?: string | boolean;
/**
* User state object that is saved between writer functions
*/
user?: any;
/**
* The current state of the writer
*/
state?: WriterState;
/**
* Writer function overrides
*/
writer?: XMLWriter;
}
/**
* Defines the state of the writer.
*/
enum WriterState {
/**
* Writer state is unknown
*/
None = 0,
/**
* Writer is at an opening tag, e.g. `<node>`
*/
OpenTag = 1,
/**
* Writer is inside an element
*/
InsideTag = 2,
/**
* Writer is at a closing tag, e.g. `</node>`
*/
CloseTag = 3
}
/**
* Creates a new XML document and returns the document node.
* This function creates an empty document without the XML prolog or
* a root element.
*
* @param options - create options
*/
function begin(options?: BeginOptions): XMLDocument;
/**
* Defines the options used while creating an XML document with the `begin`
* function.
*/
interface BeginOptions {
/**
* Whether nodes with null values will be kept or ignored
*/
keepNullNodes?: boolean;
/**
* Whether attributes with null values will be kept or ignored
*/
keepNullAttributes?: boolean;
/**
* Whether decorator strings will be ignored when converting JS
* objects
*/
ignoreDecorators?: boolean;
/**
* Whether array items are created as separate nodes when passed
* as an object value
*/
separateArrayItems?: boolean;
/**
* Whether existing html entities are encoded
*/
noDoubleEncoding?: boolean;
/**
* Whether values will be validated and escaped or returned as is
*/
noValidation?: boolean;
/**
* A character to replace invalid characters in all values. This also
* disables character validation.
*/
invalidCharReplacement?: string;
/**
* A set of functions to use for converting values to strings
*/
stringify?: XMLStringifier;
/**
* The default XML writer to use for converting nodes to string.
* If the default writer is not set, the built-in XMLStringWriter
* will be used instead.
*/
writer?: XMLWriter | WriterOptions;
}
/**
* A function to be called when a chunk of XML is written.
*
* @param chunk - a chunk of string that was written
* @param level - current depth of the XML tree
*/
type OnDataCallback = (chunk: string, level: number) => void;
/**
* A function to be called when the XML doucment is completed.
*/
type OnEndCallback = () => void;
/**
* Creates a new XML document in callback mode and returns the document
* node.
*
* @param options - create options
* @param onData - the function to be called when a new chunk of XML is
* output. The string containing the XML chunk is passed to `onData` as
* its first argument and the current depth of the tree is passed as its
* second argument.
* @param onEnd - the function to be called when the XML document is
* completed with `end`. `onEnd` does not receive any arguments.
*/
function begin(options?: BeginOptions | OnDataCallback,
onData?: OnDataCallback | OnEndCallback,
onEnd?: OnEndCallback): XMLDocumentCB;
/**
* Creates and returns a default string writer.
*
* @param options - writer options
*/
function stringWriter(options?: WriterOptions): XMLWriter
/**
* Creates and returns a default stream writer.
*
* @param stream - a writeable stream
* @param options - writer options
*/
function streamWriter(stream: Writable, options?: WriterOptions): XMLWriter
/**
* Defines the type of a node in the XML document.
*/
enum NodeType {
/**
* An element node
*/
Element = 1,
/**
* An attribute node
*/
Attribute = 2,
/**
* A text node
*/
Text = 3,
/**
* A CDATA node
*/
CData = 4,
/**
* An entity reference node inside DocType
*/
EntityReference = 5,
/**
* An entity declaration node inside DocType
*/
EntityDeclaration = 6,
/**
* A processing instruction node
*/
ProcessingInstruction = 7,
/**
* A comment node
*/
Comment = 8,
/**
* A document node
*/
Document = 9,
/**
* A Doctype node
*/
DocType = 10,
/**
* A document fragment node
*/
DocumentFragment = 11,
/**
* A notation declaration node inside DocType
*/
NotationDeclaration = 12,
/**
* An XML declaration node
*/
Declaration = 201,
/**
* A raw text node
*/
Raw = 202,
/**
* An attribute declaraiton node inside DocType
*/
AttributeDeclaration = 203,
/**
* An element declaration node inside DocType
*/
ElementDeclaration = 204
}
/**
* Defines the type of a node in the XML document.
*/
export import nodeType = NodeType;
/**
* Defines the state of the writer.
*/
export import writerState = WriterState;
/**
* Defines the settings used when converting the XML document to string.
*/
interface XMLToStringOptions {
/**
* Pretty print the XML tree
*/
pretty?: boolean;
/**
* Indentation string for pretty printing
*/
indent?: string;
/**
* Newline string for pretty printing
*/
newline?: string;
/**
* A fixed number of indents to offset strings
*/
offset?: number;
/**
* Maximum column width
*/
width?: number;
/**
* Whether to output closing tags for empty element nodes
*/
allowEmpty?: boolean;
/**
* Whether to pretty print text nodes
*/
dontPrettyTextNodes?: boolean;
/**
* A string to insert before closing slash character
*/
spaceBeforeSlash?: string | boolean;
/**
* The default XML writer to use for converting nodes to string.
* If the default writer is not set, the built-in `XMLStringWriter`
* will be used instead.
*/
writer?: XMLWriter;
}
/**
* Represents the XML document.
*/
class XMLDocument extends XMLNode {
/**
* Converts the node to string
*
* @param options - conversion options
*/
toString(options?: XMLToStringOptions): string;
}
/**
* Represents an XML attribute.
*/
class XMLAttribute {
/**
* Type of the node
*/
type: NodeType;
/**
* Parent element node
*/
parent: XMLElement;
/**
* Attribute name
*/
name: string;
/**
* Attribute value
*/
value: string;
/**
* Creates a clone of this node
*/
clone(): XMLAttribute;
/**
* Converts the node to string
*
* @param options - conversion options
*/
toString(options?: XMLToStringOptions): string;
}
/**
* Represents the base class of XML nodes.
*/
abstract class XMLNode {
/**
* Type of the node
*/
type: NodeType;
/**
* Parent element node
*/
parent: XMLElement;
/**
* Child nodes
*/
children: XMLNode[]
/**
* Creates a new child node and appends it to the list of child nodes.
*
* _Aliases:_ `ele` and `e`
*
* @param name - node name or a JS object defining the nodes to insert
* @param attributes - node attributes
* @param text - node text
*
* @returns the last top level node created
*/
element(name: any, attributes?: Object, text?: any): XMLElement;
ele(name: any, attributes?: Object, text?: any): XMLElement;
e(name: any, attributes?: Object, text?: any): XMLElement;
/**
* Adds or modifies an attribute.
*
* _Aliases:_ `att`, `a`
*
* @param name - attribute name
* @param value - attribute value
*
* @returns the parent element node
*/
attribute(name: any, value?: any): XMLElement;
att(name: any, value?: any): XMLElement;
a(name: any, value?: any): XMLElement;
/**
* Creates a new sibling node and inserts it before this node.
*
* @param name - node name or a JS object defining the nodes to insert
* @param attributes - node attributes
* @param text - node text
*
* @returns the new node
*/
insertBefore(name: any, attributes?: Object, text?: any): XMLElement;
/**
* Creates a new sibling node and inserts it after this node.
*
* @param name - node name or a JS object defining the nodes to insert
* @param attributes - node attributes
* @param text - node text
*
* @returns the new node
*/
insertAfter(name: any, attributes?: Object, text?: any): XMLElement;
/**
* Removes this node from the tree.
*
* @returns the parent node
*/
remove(): XMLElement;
/**
* Creates a new element node and appends it to the list of child nodes.
*
* _Aliases:_ `nod` and `n`
*
* @param name - element node name
* @param attributes - node attributes
* @param text - node text
*
* @returns the node created
*/
node(name: string, attributes?: Object, text?: any): XMLElement;
nod(name: string, attributes?: Object, text?: any): XMLElement;
n(name: string, attributes?: Object, text?: any): XMLElement;
/**
* Creates a new text node and appends it to the list of child nodes.
*
* _Aliases:_ `txt` and `t`
*
* @param value - node value
*
* @returns the parent node
*/
text(value: string): XMLElement;
txt(value: string): XMLElement;
t(value: string): XMLElement;
/**
* Creates a new CDATA node and appends it to the list of child nodes.
*
* _Aliases:_ `dat` and `d`
*
* @param value - node value
*
* @returns the parent node
*/
cdata(value: string): XMLElement;
dat(value: string): XMLElement;
d(value: string): XMLElement;
/**
* Creates a new comment node and appends it to the list of child nodes.
*
* _Aliases:_ `com` and `c`
*
* @param value - node value
*
* @returns the parent node
*/
comment(value: string): XMLElement;
com(value: string): XMLElement;
c(value: string): XMLElement;
/**
* Creates a comment node before the current node
*
* @param value - node value
*
* @returns the parent node
*/
commentBefore(value: string): XMLElement;
/**
* Creates a comment node after the current node
*
* @param value - node value
*
* @returns the parent node
*/
commentAfter(value: string): XMLElement;
/**
* Creates a new raw text node and appends it to the list of child
* nodes.
*
* _Alias:_ `r`
*
* @param value - node value
*
* @returns the parent node
*/
raw(value: string): XMLElement;
r(value: string): XMLElement;
/**
* Creates a new processing instruction node and appends it to the list
* of child nodes.
*
* _Aliases:_ `ins` and `i`
*
* @param target - node target
* @param value - node value
*
* @returns the parent node
*/
instruction(target: string, value: any): XMLElement;
instruction(array: Array<any>): XMLElement;
instruction(obj: Object): XMLElement;
ins(target: string, value: any): XMLElement;
ins(array: Array<any>): XMLElement;
ins(obj: Object): XMLElement;
i(target: string, value: any): XMLElement;
i(array: Array<any>): XMLElement;
i(obj: Object): XMLElement;
/**
* Creates a processing instruction node before the current node.
*
* @param target - node target
* @param value - node value
*
* @returns the parent node
*/
instructionBefore(target: string, value: any): XMLElement;
/**
* Creates a processing instruction node after the current node.
*
* @param target - node target
* @param value - node value
*
* @returns the parent node
*/
instructionAfter(target: string, value: any): XMLElement;
/**
* Creates the XML declaration.
*
* _Alias:_ `dec`
*
* @param version - version number string, e.g. `1.0`
* @param encoding - encoding declaration, e.g. `UTF-8`
* @param standalone - standalone document declaration: `true` or `false`
*
* @returns the root element node
*/
declaration(version?: string |
{ version?: string, encoding?: string, standalone?: boolean },
encoding?: string, standalone?: boolean): XMLElement;
dec(version?: string |
{ version?: string, encoding?: string, standalone?: boolean },
encoding?: string, standalone?: boolean): XMLElement;
/**
* Creates the document type definition.
*
* _Alias:_ `dtd`
*
* @param pubID - public identifier of the DTD
* @param sysID - system identifier of the DTD
*
* @returns the DOCTYPE node
*/
doctype(pubID?: string | { pubID?: string, sysID?: string },
sysID?: string): XMLDocType;
dtd(pubID?: string | { pubID?: string, sysID?: string },
sysID?: string): XMLDocType;