jsonc-morph 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -22
- package/esm/lib/rs_lib.internal.d.ts +1120 -129
- package/esm/lib/rs_lib.internal.d.ts.map +1 -1
- package/esm/lib/rs_lib.internal.js +1750 -270
- package/esm/lib/rs_lib.js +3116 -2782
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/package.json +1 -1
- package/script/lib/rs_lib.internal.d.ts +1120 -129
- package/script/lib/rs_lib.internal.d.ts.map +1 -1
- package/script/lib/rs_lib.internal.js +1776 -289
- package/script/lib/rs_lib.js +3116 -2782
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +8 -1
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export function __wbg_set_wasm(val: any): void;
|
|
2
|
+
/**
|
|
3
|
+
* Parses a JSONC (JSON with Comments) string into a concrete syntax tree.
|
|
4
|
+
* @param text - The JSONC text to parse
|
|
5
|
+
* @param options - Optional parsing options
|
|
6
|
+
* @returns The root node of the parsed CST
|
|
7
|
+
* @param {string} text
|
|
8
|
+
* @param {{ allowComments?: boolean; allowTrailingCommas?: boolean; allowLooseObjectPropertyNames?: boolean; } | null} [options]
|
|
9
|
+
* @returns {RootNode}
|
|
10
|
+
*/
|
|
11
|
+
export function parse(text: string, options?: {
|
|
12
|
+
allowComments?: boolean;
|
|
13
|
+
allowTrailingCommas?: boolean;
|
|
14
|
+
allowLooseObjectPropertyNames?: boolean;
|
|
15
|
+
} | null): any;
|
|
2
16
|
export function __wbg_Error_90f14b053b2af32f(arg0: any, arg1: any): Error;
|
|
3
17
|
export function __wbg_String_8f0eb39a4a4c2f66(arg0: any, arg1: any): void;
|
|
4
18
|
export function __wbg_call_90bf4b9978d51034(...args: any[]): any;
|
|
@@ -38,645 +52,1622 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0: any, arg1: any): any;
|
|
|
38
52
|
export function __wbindgen_cast_4625c577ab2ec9ee(arg0: any): bigint;
|
|
39
53
|
export function __wbindgen_cast_9ae0607507abb057(arg0: any): any;
|
|
40
54
|
export function __wbindgen_init_externref_table(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Represents a boolean literal node in the CST.
|
|
57
|
+
* Provides methods for manipulating boolean values.
|
|
58
|
+
*/
|
|
59
|
+
export class BooleanLit {
|
|
60
|
+
static __wrap(ptr: any): any;
|
|
61
|
+
__destroy_into_raw(): number | undefined;
|
|
62
|
+
__wbg_ptr: number | undefined;
|
|
63
|
+
free(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the boolean value (true or false).
|
|
66
|
+
* @returns The boolean value
|
|
67
|
+
* @returns {boolean}
|
|
68
|
+
*/
|
|
69
|
+
value(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Sets the boolean value.
|
|
72
|
+
* @param value - The new boolean value (true or false)
|
|
73
|
+
* @param {boolean} value
|
|
74
|
+
*/
|
|
75
|
+
setValue(value: boolean): void;
|
|
76
|
+
/**
|
|
77
|
+
* Replaces this boolean literal with a new value.
|
|
78
|
+
* @param replacement - The new value to replace this boolean with
|
|
79
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
80
|
+
* @param {any} replacement
|
|
81
|
+
* @returns {Node | undefined}
|
|
82
|
+
*/
|
|
83
|
+
replaceWith(replacement: any): any;
|
|
84
|
+
/**
|
|
85
|
+
* Removes this node from its parent.
|
|
86
|
+
* After calling this method, the node is detached from the CST and can no longer be used.
|
|
87
|
+
*/
|
|
88
|
+
remove(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the parent node in the CST.
|
|
91
|
+
* @returns The parent node, or undefined if this is the root
|
|
92
|
+
* @returns {Node | undefined}
|
|
93
|
+
*/
|
|
94
|
+
parent(): any;
|
|
95
|
+
/**
|
|
96
|
+
* Returns all ancestor nodes from parent to root.
|
|
97
|
+
* @returns Array of ancestor nodes
|
|
98
|
+
* @returns {Node[]}
|
|
99
|
+
*/
|
|
100
|
+
ancestors(): any[];
|
|
101
|
+
/**
|
|
102
|
+
* Returns the index of this node within its parent's children.
|
|
103
|
+
* @returns The child index
|
|
104
|
+
* @returns {number}
|
|
105
|
+
*/
|
|
106
|
+
childIndex(): number;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the previous sibling node.
|
|
109
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
110
|
+
* @returns {Node | undefined}
|
|
111
|
+
*/
|
|
112
|
+
previousSibling(): any;
|
|
113
|
+
/**
|
|
114
|
+
* Returns all previous sibling nodes.
|
|
115
|
+
* @returns Array of previous siblings
|
|
116
|
+
* @returns {Node[]}
|
|
117
|
+
*/
|
|
118
|
+
previousSiblings(): any[];
|
|
119
|
+
/**
|
|
120
|
+
* Returns the next sibling node.
|
|
121
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
122
|
+
* @returns {Node | undefined}
|
|
123
|
+
*/
|
|
124
|
+
nextSibling(): any;
|
|
125
|
+
/**
|
|
126
|
+
* Returns all next sibling nodes.
|
|
127
|
+
* @returns Array of next siblings
|
|
128
|
+
* @returns {Node[]}
|
|
129
|
+
*/
|
|
130
|
+
nextSiblings(): any[];
|
|
131
|
+
/**
|
|
132
|
+
* Returns the root node of the document.
|
|
133
|
+
* @returns The root node, or undefined if detached
|
|
134
|
+
* @returns {RootNode | undefined}
|
|
135
|
+
*/
|
|
136
|
+
rootNode(): any;
|
|
137
|
+
/**
|
|
138
|
+
* Returns the indentation string used at this node's depth.
|
|
139
|
+
* @returns The indentation string, or undefined if not applicable
|
|
140
|
+
* @returns {string | undefined}
|
|
141
|
+
*/
|
|
142
|
+
indentText(): any;
|
|
143
|
+
/**
|
|
144
|
+
* Returns whether this node's container uses trailing commas.
|
|
145
|
+
* @returns true if trailing commas are used
|
|
146
|
+
* @returns {boolean}
|
|
147
|
+
*/
|
|
148
|
+
usesTrailingCommas(): boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Represents a JSON array node in the CST.
|
|
152
|
+
* Provides methods for manipulating array elements.
|
|
153
|
+
*/
|
|
41
154
|
export class JsonArray {
|
|
42
155
|
static __wrap(ptr: any): any;
|
|
43
156
|
__destroy_into_raw(): number | undefined;
|
|
44
157
|
__wbg_ptr: number | undefined;
|
|
45
158
|
free(): void;
|
|
46
159
|
/**
|
|
160
|
+
* Returns all element nodes in the array.
|
|
161
|
+
* @returns Array of element nodes
|
|
47
162
|
* @returns {Node[]}
|
|
48
163
|
*/
|
|
49
|
-
elements():
|
|
164
|
+
elements(): any[];
|
|
165
|
+
/**
|
|
166
|
+
* Removes this array from its parent.
|
|
167
|
+
* After calling this method, the array is detached from the CST and can no longer be used.
|
|
168
|
+
*/
|
|
50
169
|
remove(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Ensures the array is formatted with each element on its own line.
|
|
172
|
+
*/
|
|
51
173
|
ensureMultiline(): void;
|
|
52
174
|
/**
|
|
175
|
+
* Returns all child nodes including whitespace and punctuation.
|
|
176
|
+
* @returns Array of all child nodes
|
|
53
177
|
* @returns {Node[]}
|
|
54
178
|
*/
|
|
55
|
-
children():
|
|
179
|
+
children(): any[];
|
|
56
180
|
/**
|
|
181
|
+
* Appends a new element to the end of the array.
|
|
182
|
+
* @param value - The value to append
|
|
183
|
+
* @returns The newly created element node
|
|
57
184
|
* @param {any} value
|
|
58
185
|
* @returns {Node}
|
|
59
186
|
*/
|
|
60
|
-
append(value: any):
|
|
187
|
+
append(value: any): any;
|
|
61
188
|
/**
|
|
189
|
+
* Inserts a new element at the specified index.
|
|
190
|
+
* @param index - The position to insert at
|
|
191
|
+
* @param value - The value to insert
|
|
192
|
+
* @returns The newly created element node
|
|
62
193
|
* @param {number} index
|
|
63
194
|
* @param {any} value
|
|
64
195
|
* @returns {Node}
|
|
65
196
|
*/
|
|
66
|
-
insert(index: number, value: any):
|
|
197
|
+
insert(index: number, value: any): any;
|
|
67
198
|
/**
|
|
199
|
+
* Configures whether trailing commas should be used in this array.
|
|
200
|
+
* When enabled, trailing commas are added for multiline formatting.
|
|
201
|
+
* @param enabled - Whether to enable trailing commas
|
|
68
202
|
* @param {boolean} enabled
|
|
69
203
|
*/
|
|
70
204
|
setTrailingCommas(enabled: boolean): void;
|
|
71
205
|
/**
|
|
72
|
-
*
|
|
206
|
+
* Replaces this array with a new value.
|
|
207
|
+
* @param value - The new value to replace this array with
|
|
208
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
209
|
+
* @param {any} value
|
|
73
210
|
* @returns {Node | undefined}
|
|
74
211
|
*/
|
|
75
|
-
replaceWith(
|
|
212
|
+
replaceWith(value: any): any;
|
|
76
213
|
/**
|
|
214
|
+
* Returns the parent node in the CST.
|
|
215
|
+
* @returns The parent node, or undefined if this is the root
|
|
77
216
|
* @returns {Node | undefined}
|
|
78
217
|
*/
|
|
79
|
-
parent():
|
|
218
|
+
parent(): any;
|
|
80
219
|
/**
|
|
220
|
+
* Returns the index of this node within its parent's children.
|
|
221
|
+
* @returns The child index
|
|
81
222
|
* @returns {number}
|
|
82
223
|
*/
|
|
83
224
|
childIndex(): number;
|
|
84
225
|
/**
|
|
226
|
+
* Returns all ancestor nodes from parent to root.
|
|
227
|
+
* @returns Array of ancestor nodes
|
|
85
228
|
* @returns {Node[]}
|
|
86
229
|
*/
|
|
87
|
-
ancestors():
|
|
230
|
+
ancestors(): any[];
|
|
88
231
|
/**
|
|
232
|
+
* Returns the previous sibling node.
|
|
233
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
89
234
|
* @returns {Node | undefined}
|
|
90
235
|
*/
|
|
91
|
-
previousSibling():
|
|
236
|
+
previousSibling(): any;
|
|
92
237
|
/**
|
|
238
|
+
* Returns all previous sibling nodes.
|
|
239
|
+
* @returns Array of previous siblings
|
|
93
240
|
* @returns {Node[]}
|
|
94
241
|
*/
|
|
95
|
-
previousSiblings():
|
|
242
|
+
previousSiblings(): any[];
|
|
96
243
|
/**
|
|
244
|
+
* Returns the next sibling node.
|
|
245
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
97
246
|
* @returns {Node | undefined}
|
|
98
247
|
*/
|
|
99
|
-
nextSibling():
|
|
248
|
+
nextSibling(): any;
|
|
100
249
|
/**
|
|
250
|
+
* Returns all next sibling nodes.
|
|
251
|
+
* @returns Array of next siblings
|
|
101
252
|
* @returns {Node[]}
|
|
102
253
|
*/
|
|
103
|
-
nextSiblings():
|
|
254
|
+
nextSiblings(): any[];
|
|
104
255
|
/**
|
|
256
|
+
* Returns the root node of the document.
|
|
257
|
+
* @returns The root node, or undefined if detached
|
|
105
258
|
* @returns {RootNode | undefined}
|
|
106
259
|
*/
|
|
107
|
-
rootNode():
|
|
260
|
+
rootNode(): any;
|
|
108
261
|
/**
|
|
262
|
+
* Returns the indentation string used at this node's depth.
|
|
263
|
+
* @returns The indentation string, or undefined if not applicable
|
|
109
264
|
* @returns {string | undefined}
|
|
110
265
|
*/
|
|
111
|
-
indentText():
|
|
266
|
+
indentText(): any;
|
|
112
267
|
/**
|
|
268
|
+
* Returns whether this node's container uses trailing commas.
|
|
269
|
+
* @returns true if trailing commas are used
|
|
113
270
|
* @returns {boolean}
|
|
114
271
|
*/
|
|
115
272
|
usesTrailingCommas(): boolean;
|
|
116
273
|
/**
|
|
274
|
+
* Returns child nodes excluding whitespace, comments, and punctuation.
|
|
275
|
+
* @returns Array of significant child nodes
|
|
117
276
|
* @returns {Node[]}
|
|
118
277
|
*/
|
|
119
|
-
childrenExcludeTriviaAndTokens():
|
|
278
|
+
childrenExcludeTriviaAndTokens(): any[];
|
|
120
279
|
/**
|
|
280
|
+
* Returns the child node at the specified index.
|
|
281
|
+
* @param index - The child index
|
|
282
|
+
* @returns The child node, or undefined if index is out of bounds
|
|
121
283
|
* @param {number} index
|
|
122
284
|
* @returns {Node | undefined}
|
|
123
285
|
*/
|
|
124
|
-
childAtIndex(index: number):
|
|
286
|
+
childAtIndex(index: number): any;
|
|
125
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Represents a JSON object node in the CST.
|
|
290
|
+
* Provides methods for manipulating object properties.
|
|
291
|
+
*/
|
|
126
292
|
export class JsonObject {
|
|
127
293
|
static __wrap(ptr: any): any;
|
|
128
294
|
__destroy_into_raw(): number | undefined;
|
|
129
295
|
__wbg_ptr: number | undefined;
|
|
130
296
|
free(): void;
|
|
131
297
|
/**
|
|
298
|
+
* Returns all properties in the object.
|
|
299
|
+
* @returns Array of object properties
|
|
132
300
|
* @returns {ObjectProp[]}
|
|
133
301
|
*/
|
|
134
|
-
properties():
|
|
302
|
+
properties(): any[];
|
|
135
303
|
/**
|
|
304
|
+
* Gets a property by name.
|
|
305
|
+
* @param key - The property name to look up
|
|
306
|
+
* @returns The property, or undefined if not found
|
|
136
307
|
* @param {string} key
|
|
137
308
|
* @returns {ObjectProp | undefined}
|
|
138
309
|
*/
|
|
139
|
-
get(key: string):
|
|
310
|
+
get(key: string): any;
|
|
140
311
|
/**
|
|
312
|
+
* Gets a property by name, throwing if not found.
|
|
313
|
+
* @param key - The property name to look up
|
|
314
|
+
* @returns The property
|
|
315
|
+
* @throws If the property is not found
|
|
141
316
|
* @param {string} key
|
|
142
317
|
* @returns {ObjectProp}
|
|
143
318
|
*/
|
|
144
|
-
getOrThrow(key: string):
|
|
319
|
+
getOrThrow(key: string): any;
|
|
145
320
|
/**
|
|
321
|
+
* Gets a property value if it's an object.
|
|
322
|
+
* @param name - The property name to look up
|
|
323
|
+
* @returns The object value, or undefined if property doesn't exist or is not an object
|
|
146
324
|
* @param {string} name
|
|
147
325
|
* @returns {JsonObject | undefined}
|
|
148
326
|
*/
|
|
149
|
-
|
|
327
|
+
getIfObject(name: string): any;
|
|
150
328
|
/**
|
|
329
|
+
* Gets a property value as an object, throwing if not found or wrong type.
|
|
330
|
+
* @param name - The property name to look up
|
|
331
|
+
* @returns The object value
|
|
332
|
+
* @throws If the property doesn't exist or is not an object
|
|
151
333
|
* @param {string} name
|
|
152
334
|
* @returns {JsonObject}
|
|
153
335
|
*/
|
|
154
|
-
|
|
336
|
+
getIfObjectOrThrow(name: string): any;
|
|
155
337
|
/**
|
|
338
|
+
* Gets a property value as an object, creating an empty object if the property doesn't exist.
|
|
339
|
+
* Returns undefined if the property exists but has a non-object value.
|
|
340
|
+
* @param name - The property name to get
|
|
341
|
+
* @returns The object value, or undefined if property has a non-object value
|
|
156
342
|
* @param {string} name
|
|
157
343
|
* @returns {JsonObject | undefined}
|
|
158
344
|
*/
|
|
159
|
-
|
|
345
|
+
getIfObjectOrCreate(name: string): any;
|
|
160
346
|
/**
|
|
347
|
+
* Gets a property value as an object, creating or replacing the value with an empty object if needed.
|
|
348
|
+
* Unlike getIfObjectOrCreate, this always returns an object by replacing non-object values.
|
|
349
|
+
* @param name - The property name to get
|
|
350
|
+
* @returns The object value (always succeeds)
|
|
161
351
|
* @param {string} name
|
|
162
352
|
* @returns {JsonObject}
|
|
163
353
|
*/
|
|
164
|
-
|
|
354
|
+
getIfObjectOrForce(name: string): any;
|
|
165
355
|
/**
|
|
356
|
+
* Gets a property value if it's an array.
|
|
357
|
+
* @param name - The property name to look up
|
|
358
|
+
* @returns The array value, or undefined if property doesn't exist or is not an array
|
|
166
359
|
* @param {string} name
|
|
167
360
|
* @returns {JsonArray | undefined}
|
|
168
361
|
*/
|
|
169
|
-
|
|
362
|
+
getIfArray(name: string): any;
|
|
170
363
|
/**
|
|
364
|
+
* Gets a property value as an array, throwing if not found or wrong type.
|
|
365
|
+
* @param name - The property name to look up
|
|
366
|
+
* @returns The array value
|
|
367
|
+
* @throws If the property doesn't exist or is not an array
|
|
171
368
|
* @param {string} name
|
|
172
369
|
* @returns {JsonArray}
|
|
173
370
|
*/
|
|
174
|
-
|
|
371
|
+
getIfArrayOrThrow(name: string): any;
|
|
175
372
|
/**
|
|
373
|
+
* Gets a property value as an array, creating an empty array if the property doesn't exist.
|
|
374
|
+
* Returns undefined if the property exists but has a non-array value.
|
|
375
|
+
* @param name - The property name to get
|
|
376
|
+
* @returns The array value, or undefined if property has a non-array value
|
|
176
377
|
* @param {string} name
|
|
177
378
|
* @returns {JsonArray | undefined}
|
|
178
379
|
*/
|
|
179
|
-
|
|
380
|
+
getIfArrayOrCreate(name: string): any;
|
|
180
381
|
/**
|
|
382
|
+
* Gets a property value as an array, creating or replacing the value with an empty array if needed.
|
|
383
|
+
* Unlike getIfArrayOrCreate, this always returns an array by replacing non-array values.
|
|
384
|
+
* @param name - The property name to get
|
|
385
|
+
* @returns The array value (always succeeds)
|
|
181
386
|
* @param {string} name
|
|
182
387
|
* @returns {JsonArray}
|
|
183
388
|
*/
|
|
184
|
-
|
|
389
|
+
getIfArrayOrForce(name: string): any;
|
|
390
|
+
/**
|
|
391
|
+
* Removes this object from its parent.
|
|
392
|
+
* After calling this method, the object is detached from the CST and can no longer be used.
|
|
393
|
+
*/
|
|
185
394
|
remove(): void;
|
|
186
395
|
/**
|
|
396
|
+
* Returns all child nodes including whitespace and punctuation.
|
|
397
|
+
* @returns Array of all child nodes
|
|
187
398
|
* @returns {Node[]}
|
|
188
399
|
*/
|
|
189
|
-
children():
|
|
400
|
+
children(): any[];
|
|
190
401
|
/**
|
|
191
|
-
*
|
|
402
|
+
* Appends a new property to the object.
|
|
403
|
+
* @param key - The name of the property to add
|
|
404
|
+
* @param value - The value to set for the property
|
|
405
|
+
* @returns The newly created property
|
|
406
|
+
* @param {string} key
|
|
192
407
|
* @param {any} value
|
|
193
408
|
* @returns {ObjectProp}
|
|
194
409
|
*/
|
|
195
|
-
append(
|
|
410
|
+
append(key: string, value: any): any;
|
|
196
411
|
/**
|
|
412
|
+
* Inserts a new property at the specified index.
|
|
413
|
+
* @param index - The position to insert the property at
|
|
414
|
+
* @param key - The name of the property to add
|
|
415
|
+
* @param value - The value to set for the property
|
|
416
|
+
* @returns The newly created property
|
|
197
417
|
* @param {number} index
|
|
198
|
-
* @param {string}
|
|
418
|
+
* @param {string} key
|
|
199
419
|
* @param {any} value
|
|
200
420
|
* @returns {ObjectProp}
|
|
201
421
|
*/
|
|
202
|
-
insert(index: number,
|
|
422
|
+
insert(index: number, key: string, value: any): any;
|
|
203
423
|
/**
|
|
424
|
+
* Configures whether trailing commas should be used in this object.
|
|
425
|
+
* When enabled, trailing commas are added for multiline formatting.
|
|
426
|
+
* @param enabled - Whether to enable trailing commas
|
|
204
427
|
* @param {boolean} enabled
|
|
205
428
|
*/
|
|
206
429
|
setTrailingCommas(enabled: boolean): void;
|
|
430
|
+
/**
|
|
431
|
+
* Ensures the object is formatted with each property on its own line.
|
|
432
|
+
*/
|
|
207
433
|
ensureMultiline(): void;
|
|
208
434
|
/**
|
|
209
|
-
*
|
|
435
|
+
* Replaces this object with a new value.
|
|
436
|
+
* @param replacement - The new value to replace this object with
|
|
437
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
438
|
+
* @param {any} replacement
|
|
210
439
|
* @returns {Node | undefined}
|
|
211
440
|
*/
|
|
212
|
-
replaceWith(replacement:
|
|
441
|
+
replaceWith(replacement: any): any;
|
|
213
442
|
/**
|
|
443
|
+
* Returns the parent node in the CST.
|
|
444
|
+
* @returns The parent node, or undefined if this is the root
|
|
214
445
|
* @returns {Node | undefined}
|
|
215
446
|
*/
|
|
216
|
-
parent():
|
|
447
|
+
parent(): any;
|
|
217
448
|
/**
|
|
449
|
+
* Returns all ancestor nodes from parent to root.
|
|
450
|
+
* @returns Array of ancestor nodes
|
|
218
451
|
* @returns {Node[]}
|
|
219
452
|
*/
|
|
220
|
-
ancestors():
|
|
453
|
+
ancestors(): any[];
|
|
221
454
|
/**
|
|
455
|
+
* Returns the index of this node within its parent's children.
|
|
456
|
+
* @returns The child index
|
|
222
457
|
* @returns {number}
|
|
223
458
|
*/
|
|
224
459
|
childIndex(): number;
|
|
225
460
|
/**
|
|
461
|
+
* Returns the previous sibling node.
|
|
462
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
226
463
|
* @returns {Node | undefined}
|
|
227
464
|
*/
|
|
228
|
-
previousSibling():
|
|
465
|
+
previousSibling(): any;
|
|
229
466
|
/**
|
|
467
|
+
* Returns all previous sibling nodes.
|
|
468
|
+
* @returns Array of previous siblings
|
|
230
469
|
* @returns {Node[]}
|
|
231
470
|
*/
|
|
232
|
-
previousSiblings():
|
|
471
|
+
previousSiblings(): any[];
|
|
233
472
|
/**
|
|
473
|
+
* Returns the next sibling node.
|
|
474
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
234
475
|
* @returns {Node | undefined}
|
|
235
476
|
*/
|
|
236
|
-
nextSibling():
|
|
477
|
+
nextSibling(): any;
|
|
237
478
|
/**
|
|
479
|
+
* Returns all next sibling nodes.
|
|
480
|
+
* @returns Array of next siblings
|
|
238
481
|
* @returns {Node[]}
|
|
239
482
|
*/
|
|
240
|
-
nextSiblings():
|
|
483
|
+
nextSiblings(): any[];
|
|
241
484
|
/**
|
|
485
|
+
* Returns the root node of the document.
|
|
486
|
+
* @returns The root node, or undefined if detached
|
|
242
487
|
* @returns {RootNode | undefined}
|
|
243
488
|
*/
|
|
244
|
-
rootNode():
|
|
489
|
+
rootNode(): any;
|
|
245
490
|
/**
|
|
491
|
+
* Returns the indentation string used at this node's depth.
|
|
492
|
+
* @returns The indentation string, or undefined if not applicable
|
|
246
493
|
* @returns {string | undefined}
|
|
247
494
|
*/
|
|
248
|
-
indentText():
|
|
495
|
+
indentText(): any;
|
|
249
496
|
/**
|
|
497
|
+
* Returns whether this node's container uses trailing commas.
|
|
498
|
+
* @returns true if trailing commas are used
|
|
250
499
|
* @returns {boolean}
|
|
251
500
|
*/
|
|
252
501
|
usesTrailingCommas(): boolean;
|
|
253
502
|
/**
|
|
503
|
+
* Returns child nodes excluding whitespace, comments, and punctuation.
|
|
504
|
+
* @returns Array of significant child nodes
|
|
254
505
|
* @returns {Node[]}
|
|
255
506
|
*/
|
|
256
|
-
childrenExcludeTriviaAndTokens():
|
|
507
|
+
childrenExcludeTriviaAndTokens(): any[];
|
|
257
508
|
/**
|
|
509
|
+
* Returns the child node at the specified index.
|
|
510
|
+
* @param index - The child index
|
|
511
|
+
* @returns The child node, or undefined if index is out of bounds
|
|
258
512
|
* @param {number} index
|
|
259
513
|
* @returns {Node | undefined}
|
|
260
514
|
*/
|
|
261
|
-
childAtIndex(index: number):
|
|
515
|
+
childAtIndex(index: number): any;
|
|
262
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Represents a generic node in the CST.
|
|
519
|
+
* Can be a container node (object, array, property) or a leaf node (string, number, boolean, null).
|
|
520
|
+
*/
|
|
263
521
|
export class Node {
|
|
264
522
|
static __wrap(ptr: any): any;
|
|
265
523
|
__destroy_into_raw(): number | undefined;
|
|
266
524
|
__wbg_ptr: number | undefined;
|
|
267
525
|
free(): void;
|
|
268
526
|
/**
|
|
527
|
+
* Returns true if this node is a container (object, array, or property).
|
|
528
|
+
* @returns true if this is a container node
|
|
269
529
|
* @returns {boolean}
|
|
270
530
|
*/
|
|
271
531
|
isContainer(): boolean;
|
|
272
532
|
/**
|
|
533
|
+
* Returns true if this node is a leaf value (string, number, boolean, null).
|
|
534
|
+
* @returns true if this is a leaf node
|
|
273
535
|
* @returns {boolean}
|
|
274
536
|
*/
|
|
275
537
|
isLeaf(): boolean;
|
|
276
538
|
/**
|
|
539
|
+
* Converts this node to an object if it is one.
|
|
540
|
+
* @returns The object, or undefined if this node is not an object
|
|
277
541
|
* @returns {JsonObject | undefined}
|
|
278
542
|
*/
|
|
279
|
-
asObject():
|
|
543
|
+
asObject(): any;
|
|
280
544
|
/**
|
|
545
|
+
* Converts this node to an object, throwing if it's not an object.
|
|
546
|
+
* @returns The object
|
|
547
|
+
* @throws If this node is not an object
|
|
281
548
|
* @returns {JsonObject}
|
|
282
549
|
*/
|
|
283
|
-
asObjectOrThrow():
|
|
550
|
+
asObjectOrThrow(): any;
|
|
284
551
|
/**
|
|
552
|
+
* Converts this node to an array if it is one.
|
|
553
|
+
* @returns The array, or undefined if this node is not an array
|
|
285
554
|
* @returns {JsonArray | undefined}
|
|
286
555
|
*/
|
|
287
|
-
asArray():
|
|
556
|
+
asArray(): any;
|
|
288
557
|
/**
|
|
558
|
+
* Converts this node to an array, throwing if it's not an array.
|
|
559
|
+
* @returns The array
|
|
560
|
+
* @throws If this node is not an array
|
|
289
561
|
* @returns {JsonArray}
|
|
290
562
|
*/
|
|
291
|
-
asArrayOrThrow():
|
|
563
|
+
asArrayOrThrow(): any;
|
|
292
564
|
/**
|
|
565
|
+
* Converts this node to the root node if it is one.
|
|
566
|
+
* @returns The root node, or undefined if this is not a root node
|
|
293
567
|
* @returns {RootNode | undefined}
|
|
294
568
|
*/
|
|
295
|
-
asRootNode():
|
|
569
|
+
asRootNode(): any;
|
|
296
570
|
/**
|
|
571
|
+
* Converts this node to the root node, throwing if it's not a root node.
|
|
572
|
+
* @returns The root node
|
|
573
|
+
* @throws If this node is not a root node
|
|
297
574
|
* @returns {RootNode}
|
|
298
575
|
*/
|
|
299
|
-
asRootNodeOrThrow():
|
|
576
|
+
asRootNodeOrThrow(): any;
|
|
300
577
|
/**
|
|
578
|
+
* Returns the decoded string value if this node is a string literal.
|
|
579
|
+
* @returns The string value, or undefined if this node is not a string
|
|
301
580
|
* @returns {string | undefined}
|
|
302
581
|
*/
|
|
303
|
-
asString():
|
|
582
|
+
asString(): any;
|
|
304
583
|
/**
|
|
584
|
+
* Returns the decoded string value, throwing if not a string.
|
|
585
|
+
* @returns The string value
|
|
586
|
+
* @throws If this node is not a string
|
|
305
587
|
* @returns {string}
|
|
306
588
|
*/
|
|
307
|
-
asStringOrThrow():
|
|
589
|
+
asStringOrThrow(): any;
|
|
308
590
|
/**
|
|
591
|
+
* Returns the raw string representation of a number literal.
|
|
592
|
+
* Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
|
|
593
|
+
* @returns The number as a string, or undefined if this node is not a number
|
|
309
594
|
* @returns {string | undefined}
|
|
310
595
|
*/
|
|
311
|
-
numberValue():
|
|
596
|
+
numberValue(): any;
|
|
312
597
|
/**
|
|
598
|
+
* Returns the raw string representation of a number literal, throwing if not a number.
|
|
599
|
+
* Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
|
|
600
|
+
* @returns The number as a string
|
|
601
|
+
* @throws If this node is not a number
|
|
313
602
|
* @returns {string}
|
|
314
603
|
*/
|
|
315
|
-
numberValueOrThrow():
|
|
604
|
+
numberValueOrThrow(): any;
|
|
316
605
|
/**
|
|
606
|
+
* Returns the boolean value if this node is a boolean literal.
|
|
607
|
+
* @returns The boolean value, or undefined if this node is not a boolean
|
|
317
608
|
* @returns {boolean | undefined}
|
|
318
609
|
*/
|
|
319
610
|
asBoolean(): boolean | undefined;
|
|
320
611
|
/**
|
|
612
|
+
* Returns the boolean value, throwing if not a boolean.
|
|
613
|
+
* @returns The boolean value
|
|
614
|
+
* @throws If this node is not a boolean
|
|
321
615
|
* @returns {boolean}
|
|
322
616
|
*/
|
|
323
617
|
asBooleanOrThrow(): boolean;
|
|
324
618
|
/**
|
|
619
|
+
* Returns true if this node is a null keyword.
|
|
620
|
+
* @returns true if this node represents null
|
|
325
621
|
* @returns {boolean}
|
|
326
622
|
*/
|
|
327
623
|
isNull(): boolean;
|
|
328
624
|
/**
|
|
625
|
+
* Returns true if this node is a string literal.
|
|
626
|
+
* @returns true if this node is a string
|
|
329
627
|
* @returns {boolean}
|
|
330
628
|
*/
|
|
331
629
|
isString(): boolean;
|
|
332
630
|
/**
|
|
631
|
+
* Returns true if this node is a number literal.
|
|
632
|
+
* @returns true if this node is a number
|
|
333
633
|
* @returns {boolean}
|
|
334
634
|
*/
|
|
335
635
|
isNumber(): boolean;
|
|
336
636
|
/**
|
|
637
|
+
* Returns true if this node is a boolean literal.
|
|
638
|
+
* @returns true if this node is a boolean
|
|
337
639
|
* @returns {boolean}
|
|
338
640
|
*/
|
|
339
641
|
isBoolean(): boolean;
|
|
340
642
|
/**
|
|
643
|
+
* Returns this node as a StringLit if it is one.
|
|
644
|
+
* @returns The StringLit, or undefined if this node is not a string literal
|
|
645
|
+
* @returns {StringLit | undefined}
|
|
646
|
+
*/
|
|
647
|
+
asStringLit(): any;
|
|
648
|
+
/**
|
|
649
|
+
* Returns this node as a StringLit, throwing if it's not a string literal.
|
|
650
|
+
* @returns The StringLit
|
|
651
|
+
* @throws If this node is not a string literal
|
|
652
|
+
* @returns {StringLit}
|
|
653
|
+
*/
|
|
654
|
+
asStringLitOrThrow(): any;
|
|
655
|
+
/**
|
|
656
|
+
* Returns this node as a NumberLit if it is one.
|
|
657
|
+
* @returns The NumberLit, or undefined if this node is not a number literal
|
|
658
|
+
* @returns {NumberLit | undefined}
|
|
659
|
+
*/
|
|
660
|
+
asNumberLit(): any;
|
|
661
|
+
/**
|
|
662
|
+
* Returns this node as a NumberLit, throwing if it's not a number literal.
|
|
663
|
+
* @returns The NumberLit
|
|
664
|
+
* @throws If this node is not a number literal
|
|
665
|
+
* @returns {NumberLit}
|
|
666
|
+
*/
|
|
667
|
+
asNumberLitOrThrow(): any;
|
|
668
|
+
/**
|
|
669
|
+
* Returns this node as a BooleanLit if it is one.
|
|
670
|
+
* @returns The BooleanLit, or undefined if this node is not a boolean literal
|
|
671
|
+
* @returns {BooleanLit | undefined}
|
|
672
|
+
*/
|
|
673
|
+
asBooleanLit(): any;
|
|
674
|
+
/**
|
|
675
|
+
* Returns this node as a BooleanLit, throwing if it's not a boolean literal.
|
|
676
|
+
* @returns The BooleanLit
|
|
677
|
+
* @throws If this node is not a boolean literal
|
|
678
|
+
* @returns {BooleanLit}
|
|
679
|
+
*/
|
|
680
|
+
asBooleanLitOrThrow(): any;
|
|
681
|
+
/**
|
|
682
|
+
* Returns this node as a NullKeyword if it is one.
|
|
683
|
+
* @returns The NullKeyword, or undefined if this node is not a null keyword
|
|
684
|
+
* @returns {NullKeyword | undefined}
|
|
685
|
+
*/
|
|
686
|
+
asNullKeyword(): any;
|
|
687
|
+
/**
|
|
688
|
+
* Returns this node as a NullKeyword, throwing if it's not a null keyword.
|
|
689
|
+
* @returns The NullKeyword
|
|
690
|
+
* @throws If this node is not a null keyword
|
|
691
|
+
* @returns {NullKeyword}
|
|
692
|
+
*/
|
|
693
|
+
asNullKeywordOrThrow(): any;
|
|
694
|
+
/**
|
|
695
|
+
* Returns this node as a WordLit if it is one.
|
|
696
|
+
* @returns The WordLit, or undefined if this node is not a word literal
|
|
697
|
+
* @returns {WordLit | undefined}
|
|
698
|
+
*/
|
|
699
|
+
asWordLit(): any;
|
|
700
|
+
/**
|
|
701
|
+
* Returns this node as a WordLit, throwing if it's not a word literal.
|
|
702
|
+
* @returns The WordLit
|
|
703
|
+
* @throws If this node is not a word literal
|
|
704
|
+
* @returns {WordLit}
|
|
705
|
+
*/
|
|
706
|
+
asWordLitOrThrow(): any;
|
|
707
|
+
/**
|
|
708
|
+
* Returns the parent node in the CST.
|
|
709
|
+
* @returns The parent node, or undefined if this is the root
|
|
341
710
|
* @returns {Node | undefined}
|
|
342
711
|
*/
|
|
343
|
-
parent():
|
|
712
|
+
parent(): any;
|
|
344
713
|
/**
|
|
714
|
+
* Returns the parent node, throwing if this is the root.
|
|
715
|
+
* @returns The parent node
|
|
716
|
+
* @throws If this node has no parent
|
|
345
717
|
* @returns {Node}
|
|
346
718
|
*/
|
|
347
|
-
parentOrThrow():
|
|
719
|
+
parentOrThrow(): any;
|
|
348
720
|
/**
|
|
721
|
+
* Returns the index of this node within its parent's children.
|
|
722
|
+
* @returns The child index
|
|
349
723
|
* @returns {number}
|
|
350
724
|
*/
|
|
351
725
|
childIndex(): number;
|
|
352
726
|
/**
|
|
727
|
+
* Returns all ancestor nodes from parent to root.
|
|
728
|
+
* @returns Array of ancestor nodes
|
|
353
729
|
* @returns {Node[]}
|
|
354
730
|
*/
|
|
355
|
-
ancestors():
|
|
731
|
+
ancestors(): any[];
|
|
356
732
|
/**
|
|
733
|
+
* Returns the previous sibling node.
|
|
734
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
357
735
|
* @returns {Node | undefined}
|
|
358
736
|
*/
|
|
359
|
-
previousSibling():
|
|
737
|
+
previousSibling(): any;
|
|
360
738
|
/**
|
|
739
|
+
* Returns all previous sibling nodes.
|
|
740
|
+
* @returns Array of previous siblings
|
|
361
741
|
* @returns {Node[]}
|
|
362
742
|
*/
|
|
363
|
-
previousSiblings():
|
|
743
|
+
previousSiblings(): any[];
|
|
364
744
|
/**
|
|
745
|
+
* Returns the next sibling node.
|
|
746
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
365
747
|
* @returns {Node | undefined}
|
|
366
748
|
*/
|
|
367
|
-
nextSibling():
|
|
749
|
+
nextSibling(): any;
|
|
368
750
|
/**
|
|
751
|
+
* Returns all next sibling nodes.
|
|
752
|
+
* @returns Array of next siblings
|
|
369
753
|
* @returns {Node[]}
|
|
370
754
|
*/
|
|
371
|
-
nextSiblings():
|
|
755
|
+
nextSiblings(): any[];
|
|
372
756
|
/**
|
|
757
|
+
* Returns the root node of the document.
|
|
758
|
+
* @returns The root node, or undefined if detached
|
|
373
759
|
* @returns {RootNode | undefined}
|
|
374
760
|
*/
|
|
375
|
-
rootNode():
|
|
761
|
+
rootNode(): any;
|
|
376
762
|
/**
|
|
763
|
+
* Returns the root node, throwing if detached.
|
|
764
|
+
* @returns The root node
|
|
765
|
+
* @throws If this node is detached from the CST
|
|
377
766
|
* @returns {RootNode}
|
|
378
767
|
*/
|
|
379
|
-
rootNodeOrThrow():
|
|
768
|
+
rootNodeOrThrow(): any;
|
|
380
769
|
/**
|
|
770
|
+
* Returns the indentation string used at this node's depth.
|
|
771
|
+
* @returns The indentation string, or undefined if not applicable
|
|
381
772
|
* @returns {string | undefined}
|
|
382
773
|
*/
|
|
383
|
-
indentText():
|
|
774
|
+
indentText(): any;
|
|
384
775
|
/**
|
|
776
|
+
* Returns whether this node's container uses trailing commas.
|
|
777
|
+
* @returns true if trailing commas are used
|
|
385
778
|
* @returns {boolean}
|
|
386
779
|
*/
|
|
387
780
|
usesTrailingCommas(): boolean;
|
|
388
781
|
/**
|
|
782
|
+
* Returns true if this node is trivia (whitespace or comments).
|
|
783
|
+
* @returns true if this node is trivia
|
|
389
784
|
* @returns {boolean}
|
|
390
785
|
*/
|
|
391
786
|
isTrivia(): boolean;
|
|
392
787
|
/**
|
|
788
|
+
* Returns true if this node is a newline character.
|
|
789
|
+
* @returns true if this node is a newline
|
|
393
790
|
* @returns {boolean}
|
|
394
791
|
*/
|
|
395
792
|
isNewline(): boolean;
|
|
396
793
|
/**
|
|
794
|
+
* Returns true if this node is a comma token.
|
|
795
|
+
* @returns true if this node is a comma
|
|
397
796
|
* @returns {boolean}
|
|
398
797
|
*/
|
|
399
798
|
isComma(): boolean;
|
|
400
799
|
/**
|
|
800
|
+
* Returns true if this node is a comment.
|
|
801
|
+
* @returns true if this node is a comment
|
|
401
802
|
* @returns {boolean}
|
|
402
803
|
*/
|
|
403
804
|
isComment(): boolean;
|
|
404
805
|
/**
|
|
806
|
+
* Returns true if this node is a punctuation token (bracket, brace, colon, comma).
|
|
807
|
+
* @returns true if this node is a token
|
|
405
808
|
* @returns {boolean}
|
|
406
809
|
*/
|
|
407
810
|
isToken(): boolean;
|
|
408
811
|
/**
|
|
812
|
+
* Returns true if this node is whitespace.
|
|
813
|
+
* @returns true if this node is whitespace
|
|
409
814
|
* @returns {boolean}
|
|
410
815
|
*/
|
|
411
816
|
isWhitespace(): boolean;
|
|
412
817
|
/**
|
|
818
|
+
* Returns the character if this node is a single-character token.
|
|
819
|
+
* @returns The token character, or undefined if not a token
|
|
413
820
|
* @returns {string | undefined}
|
|
414
821
|
*/
|
|
415
|
-
tokenChar():
|
|
822
|
+
tokenChar(): any;
|
|
416
823
|
/**
|
|
824
|
+
* Returns the element index if this node is an array element.
|
|
825
|
+
* @returns The element index, or undefined if not an array element
|
|
417
826
|
* @returns {number | undefined}
|
|
418
827
|
*/
|
|
419
|
-
elementIndex():
|
|
828
|
+
elementIndex(): any;
|
|
420
829
|
/**
|
|
830
|
+
* Returns all child nodes including whitespace and punctuation.
|
|
831
|
+
* @returns Array of all child nodes
|
|
421
832
|
* @returns {Node[]}
|
|
422
833
|
*/
|
|
423
|
-
children():
|
|
834
|
+
children(): any[];
|
|
424
835
|
/**
|
|
836
|
+
* Returns child nodes excluding whitespace, comments, and punctuation.
|
|
837
|
+
* @returns Array of significant child nodes
|
|
425
838
|
* @returns {Node[]}
|
|
426
839
|
*/
|
|
427
|
-
childrenExcludeTriviaAndTokens():
|
|
840
|
+
childrenExcludeTriviaAndTokens(): any[];
|
|
428
841
|
/**
|
|
842
|
+
* Returns the child node at the specified index.
|
|
843
|
+
* @param index - The child index
|
|
844
|
+
* @returns The child node, or undefined if index is out of bounds
|
|
429
845
|
* @param {number} index
|
|
430
846
|
* @returns {Node | undefined}
|
|
431
847
|
*/
|
|
432
|
-
childAtIndex(index: number):
|
|
848
|
+
childAtIndex(index: number): any;
|
|
433
849
|
}
|
|
434
|
-
|
|
850
|
+
/**
|
|
851
|
+
* Represents a null keyword node in the CST.
|
|
852
|
+
*/
|
|
853
|
+
export class NullKeyword {
|
|
435
854
|
static __wrap(ptr: any): any;
|
|
436
855
|
__destroy_into_raw(): number | undefined;
|
|
437
856
|
__wbg_ptr: number | undefined;
|
|
438
857
|
free(): void;
|
|
439
858
|
/**
|
|
859
|
+
* Replaces this null keyword with a new value.
|
|
860
|
+
* @param replacement - The new value to replace this null with
|
|
861
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
862
|
+
* @param {any} replacement
|
|
863
|
+
* @returns {Node | undefined}
|
|
864
|
+
*/
|
|
865
|
+
replaceWith(replacement: any): any;
|
|
866
|
+
/**
|
|
867
|
+
* Removes this node from its parent.
|
|
868
|
+
* After calling this method, the node is detached from the CST and can no longer be used.
|
|
869
|
+
*/
|
|
870
|
+
remove(): void;
|
|
871
|
+
/**
|
|
872
|
+
* Returns the parent node in the CST.
|
|
873
|
+
* @returns The parent node, or undefined if this is the root
|
|
874
|
+
* @returns {Node | undefined}
|
|
875
|
+
*/
|
|
876
|
+
parent(): any;
|
|
877
|
+
/**
|
|
878
|
+
* Returns all ancestor nodes from parent to root.
|
|
879
|
+
* @returns Array of ancestor nodes
|
|
880
|
+
* @returns {Node[]}
|
|
881
|
+
*/
|
|
882
|
+
ancestors(): any[];
|
|
883
|
+
/**
|
|
884
|
+
* Returns the index of this node within its parent's children.
|
|
885
|
+
* @returns The child index
|
|
886
|
+
* @returns {number}
|
|
887
|
+
*/
|
|
888
|
+
childIndex(): number;
|
|
889
|
+
/**
|
|
890
|
+
* Returns the previous sibling node.
|
|
891
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
892
|
+
* @returns {Node | undefined}
|
|
893
|
+
*/
|
|
894
|
+
previousSibling(): any;
|
|
895
|
+
/**
|
|
896
|
+
* Returns all previous sibling nodes.
|
|
897
|
+
* @returns Array of previous siblings
|
|
898
|
+
* @returns {Node[]}
|
|
899
|
+
*/
|
|
900
|
+
previousSiblings(): any[];
|
|
901
|
+
/**
|
|
902
|
+
* Returns the next sibling node.
|
|
903
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
904
|
+
* @returns {Node | undefined}
|
|
905
|
+
*/
|
|
906
|
+
nextSibling(): any;
|
|
907
|
+
/**
|
|
908
|
+
* Returns all next sibling nodes.
|
|
909
|
+
* @returns Array of next siblings
|
|
910
|
+
* @returns {Node[]}
|
|
911
|
+
*/
|
|
912
|
+
nextSiblings(): any[];
|
|
913
|
+
/**
|
|
914
|
+
* Returns the root node of the document.
|
|
915
|
+
* @returns The root node, or undefined if detached
|
|
916
|
+
* @returns {RootNode | undefined}
|
|
917
|
+
*/
|
|
918
|
+
rootNode(): any;
|
|
919
|
+
/**
|
|
920
|
+
* Returns the indentation string used at this node's depth.
|
|
921
|
+
* @returns The indentation string, or undefined if not applicable
|
|
440
922
|
* @returns {string | undefined}
|
|
441
923
|
*/
|
|
442
|
-
|
|
924
|
+
indentText(): any;
|
|
443
925
|
/**
|
|
926
|
+
* Returns whether this node's container uses trailing commas.
|
|
927
|
+
* @returns true if trailing commas are used
|
|
928
|
+
* @returns {boolean}
|
|
929
|
+
*/
|
|
930
|
+
usesTrailingCommas(): boolean;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Represents a number literal node in the CST.
|
|
934
|
+
* Provides methods for manipulating number values.
|
|
935
|
+
*/
|
|
936
|
+
export class NumberLit {
|
|
937
|
+
static __wrap(ptr: any): any;
|
|
938
|
+
__destroy_into_raw(): number | undefined;
|
|
939
|
+
__wbg_ptr: number | undefined;
|
|
940
|
+
free(): void;
|
|
941
|
+
/**
|
|
942
|
+
* Returns the raw string representation of the number.
|
|
943
|
+
* Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
|
|
944
|
+
* @returns The number as a string
|
|
444
945
|
* @returns {string}
|
|
445
946
|
*/
|
|
446
|
-
|
|
947
|
+
value(): any;
|
|
948
|
+
/**
|
|
949
|
+
* Sets the raw number value.
|
|
950
|
+
* The value should be a valid JSON number string (e.g., "42", "3.14", "1e10").
|
|
951
|
+
* @param value - The raw number string to set
|
|
952
|
+
* @param {string} value
|
|
953
|
+
*/
|
|
954
|
+
setRawValue(value: string): void;
|
|
955
|
+
/**
|
|
956
|
+
* Replaces this number literal with a new value.
|
|
957
|
+
* @param replacement - The new value to replace this number with
|
|
958
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
959
|
+
* @param {any} replacement
|
|
960
|
+
* @returns {Node | undefined}
|
|
961
|
+
*/
|
|
962
|
+
replaceWith(replacement: any): any;
|
|
963
|
+
/**
|
|
964
|
+
* Removes this node from its parent.
|
|
965
|
+
* After calling this method, the node is detached from the CST and can no longer be used.
|
|
966
|
+
*/
|
|
967
|
+
remove(): void;
|
|
968
|
+
/**
|
|
969
|
+
* Returns the parent node in the CST.
|
|
970
|
+
* @returns The parent node, or undefined if this is the root
|
|
971
|
+
* @returns {Node | undefined}
|
|
972
|
+
*/
|
|
973
|
+
parent(): any;
|
|
974
|
+
/**
|
|
975
|
+
* Returns all ancestor nodes from parent to root.
|
|
976
|
+
* @returns Array of ancestor nodes
|
|
977
|
+
* @returns {Node[]}
|
|
978
|
+
*/
|
|
979
|
+
ancestors(): any[];
|
|
980
|
+
/**
|
|
981
|
+
* Returns the index of this node within its parent's children.
|
|
982
|
+
* @returns The child index
|
|
983
|
+
* @returns {number}
|
|
984
|
+
*/
|
|
985
|
+
childIndex(): number;
|
|
986
|
+
/**
|
|
987
|
+
* Returns the previous sibling node.
|
|
988
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
989
|
+
* @returns {Node | undefined}
|
|
990
|
+
*/
|
|
991
|
+
previousSibling(): any;
|
|
992
|
+
/**
|
|
993
|
+
* Returns all previous sibling nodes.
|
|
994
|
+
* @returns Array of previous siblings
|
|
995
|
+
* @returns {Node[]}
|
|
996
|
+
*/
|
|
997
|
+
previousSiblings(): any[];
|
|
998
|
+
/**
|
|
999
|
+
* Returns the next sibling node.
|
|
1000
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
1001
|
+
* @returns {Node | undefined}
|
|
1002
|
+
*/
|
|
1003
|
+
nextSibling(): any;
|
|
1004
|
+
/**
|
|
1005
|
+
* Returns all next sibling nodes.
|
|
1006
|
+
* @returns Array of next siblings
|
|
1007
|
+
* @returns {Node[]}
|
|
1008
|
+
*/
|
|
1009
|
+
nextSiblings(): any[];
|
|
1010
|
+
/**
|
|
1011
|
+
* Returns the root node of the document.
|
|
1012
|
+
* @returns The root node, or undefined if detached
|
|
1013
|
+
* @returns {RootNode | undefined}
|
|
1014
|
+
*/
|
|
1015
|
+
rootNode(): any;
|
|
1016
|
+
/**
|
|
1017
|
+
* Returns the indentation string used at this node's depth.
|
|
1018
|
+
* @returns The indentation string, or undefined if not applicable
|
|
1019
|
+
* @returns {string | undefined}
|
|
1020
|
+
*/
|
|
1021
|
+
indentText(): any;
|
|
1022
|
+
/**
|
|
1023
|
+
* Returns whether this node's container uses trailing commas.
|
|
1024
|
+
* @returns true if trailing commas are used
|
|
1025
|
+
* @returns {boolean}
|
|
1026
|
+
*/
|
|
1027
|
+
usesTrailingCommas(): boolean;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Represents an object property (key-value pair) in the CST.
|
|
1031
|
+
* Provides methods for accessing and manipulating both the property name and its value.
|
|
1032
|
+
*/
|
|
1033
|
+
export class ObjectProp {
|
|
1034
|
+
static __wrap(ptr: any): any;
|
|
1035
|
+
__destroy_into_raw(): number | undefined;
|
|
1036
|
+
__wbg_ptr: number | undefined;
|
|
1037
|
+
free(): void;
|
|
1038
|
+
/**
|
|
1039
|
+
* Returns the property name.
|
|
1040
|
+
* @returns The property name, or undefined if malformed
|
|
1041
|
+
* @returns {ObjectPropName | undefined}
|
|
1042
|
+
*/
|
|
1043
|
+
name(): any;
|
|
1044
|
+
/**
|
|
1045
|
+
* Returns the property name, throwing if malformed.
|
|
1046
|
+
* @returns The property name
|
|
1047
|
+
* @throws If the property name is malformed
|
|
1048
|
+
* @returns {ObjectPropName}
|
|
1049
|
+
*/
|
|
1050
|
+
nameOrThrow(): any;
|
|
447
1051
|
/**
|
|
1052
|
+
* Returns the property value.
|
|
1053
|
+
* @returns The property value, or undefined if malformed
|
|
448
1054
|
* @returns {Node | undefined}
|
|
449
1055
|
*/
|
|
450
|
-
value():
|
|
1056
|
+
value(): any;
|
|
451
1057
|
/**
|
|
1058
|
+
* Returns the property value, throwing if malformed.
|
|
1059
|
+
* @returns The property value
|
|
1060
|
+
* @throws If the property value is malformed
|
|
452
1061
|
* @returns {Node}
|
|
453
1062
|
*/
|
|
454
|
-
valueOrThrow():
|
|
1063
|
+
valueOrThrow(): any;
|
|
455
1064
|
/**
|
|
1065
|
+
* Returns the property value if it's an object.
|
|
1066
|
+
* @returns The object value, or undefined if not an object
|
|
456
1067
|
* @returns {JsonObject | undefined}
|
|
457
1068
|
*/
|
|
458
|
-
|
|
1069
|
+
valueIfObject(): any;
|
|
459
1070
|
/**
|
|
1071
|
+
* Returns the property value as an object, throwing if not an object.
|
|
1072
|
+
* @returns The object value
|
|
1073
|
+
* @throws If the property value is not an object
|
|
460
1074
|
* @returns {JsonObject}
|
|
461
1075
|
*/
|
|
462
|
-
|
|
1076
|
+
valueIfObjectOrThrow(): any;
|
|
463
1077
|
/**
|
|
1078
|
+
* Gets the property value as an object, replacing the value with an empty object if needed.
|
|
1079
|
+
* Always returns an object by replacing non-object values.
|
|
1080
|
+
* @returns The object value (always succeeds)
|
|
464
1081
|
* @returns {JsonObject}
|
|
465
1082
|
*/
|
|
466
|
-
|
|
1083
|
+
valueIfObjectOrForce(): any;
|
|
467
1084
|
/**
|
|
1085
|
+
* Returns the property value if it's an array.
|
|
1086
|
+
* @returns The array value, or undefined if not an array
|
|
468
1087
|
* @returns {JsonArray | undefined}
|
|
469
1088
|
*/
|
|
470
|
-
|
|
1089
|
+
valueIfArray(): any;
|
|
471
1090
|
/**
|
|
1091
|
+
* Returns the property value as an array, throwing if not an array.
|
|
1092
|
+
* @returns The array value
|
|
1093
|
+
* @throws If the property value is not an array
|
|
472
1094
|
* @returns {JsonArray}
|
|
473
1095
|
*/
|
|
474
|
-
|
|
1096
|
+
valueIfArrayOrThrow(): any;
|
|
475
1097
|
/**
|
|
1098
|
+
* Gets the property value as an array, replacing the value with an empty array if needed.
|
|
1099
|
+
* Always returns an array by replacing non-array values.
|
|
1100
|
+
* @returns The array value (always succeeds)
|
|
476
1101
|
* @returns {JsonArray}
|
|
477
1102
|
*/
|
|
478
|
-
|
|
1103
|
+
valueIfArrayOrForce(): any;
|
|
1104
|
+
/**
|
|
1105
|
+
* Removes this property from its parent object.
|
|
1106
|
+
* After calling this method, the property is detached from the CST and can no longer be used.
|
|
1107
|
+
*/
|
|
479
1108
|
remove(): void;
|
|
480
1109
|
/**
|
|
1110
|
+
* Returns the index of this property within its parent object.
|
|
1111
|
+
* @returns The property index
|
|
481
1112
|
* @returns {number}
|
|
482
1113
|
*/
|
|
483
1114
|
propertyIndex(): number;
|
|
484
1115
|
/**
|
|
1116
|
+
* Sets the value of this property.
|
|
1117
|
+
* @param value - The new value to set
|
|
485
1118
|
* @param {any} value
|
|
486
1119
|
*/
|
|
487
1120
|
setValue(value: any): void;
|
|
488
1121
|
/**
|
|
1122
|
+
* Replaces this property with a new property.
|
|
1123
|
+
* This allows changing both the property name and its value.
|
|
1124
|
+
* @param key - The new property name
|
|
1125
|
+
* @param replacement - The new value for the property
|
|
1126
|
+
* @returns The new node that replaced this property, or undefined if this was the root value
|
|
489
1127
|
* @param {string} key
|
|
490
|
-
* @param {
|
|
1128
|
+
* @param {any} replacement
|
|
491
1129
|
* @returns {Node | undefined}
|
|
492
1130
|
*/
|
|
493
|
-
replaceWith(key: string, replacement:
|
|
1131
|
+
replaceWith(key: string, replacement: any): any;
|
|
494
1132
|
/**
|
|
1133
|
+
* Returns the parent node in the CST.
|
|
1134
|
+
* @returns The parent node, or undefined if this is the root
|
|
495
1135
|
* @returns {Node | undefined}
|
|
496
1136
|
*/
|
|
497
|
-
parent():
|
|
1137
|
+
parent(): any;
|
|
498
1138
|
/**
|
|
1139
|
+
* Returns all ancestor nodes from parent to root.
|
|
1140
|
+
* @returns Array of ancestor nodes
|
|
499
1141
|
* @returns {Node[]}
|
|
500
1142
|
*/
|
|
501
|
-
ancestors():
|
|
1143
|
+
ancestors(): any[];
|
|
502
1144
|
/**
|
|
1145
|
+
* Returns the index of this node within its parent's children.
|
|
1146
|
+
* @returns The child index
|
|
503
1147
|
* @returns {number}
|
|
504
1148
|
*/
|
|
505
1149
|
childIndex(): number;
|
|
506
1150
|
/**
|
|
1151
|
+
* Returns the previous sibling node.
|
|
1152
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
507
1153
|
* @returns {Node | undefined}
|
|
508
1154
|
*/
|
|
509
|
-
previousSibling():
|
|
1155
|
+
previousSibling(): any;
|
|
510
1156
|
/**
|
|
1157
|
+
* Returns all previous sibling nodes.
|
|
1158
|
+
* @returns Array of previous siblings
|
|
511
1159
|
* @returns {Node[]}
|
|
512
1160
|
*/
|
|
513
|
-
previousSiblings():
|
|
1161
|
+
previousSiblings(): any[];
|
|
514
1162
|
/**
|
|
1163
|
+
* Returns the next sibling node.
|
|
1164
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
515
1165
|
* @returns {Node | undefined}
|
|
516
1166
|
*/
|
|
517
|
-
nextSibling():
|
|
1167
|
+
nextSibling(): any;
|
|
518
1168
|
/**
|
|
1169
|
+
* Returns all next sibling nodes.
|
|
1170
|
+
* @returns Array of next siblings
|
|
519
1171
|
* @returns {Node[]}
|
|
520
1172
|
*/
|
|
521
|
-
nextSiblings():
|
|
1173
|
+
nextSiblings(): any[];
|
|
522
1174
|
/**
|
|
1175
|
+
* Returns the previous property in the same object.
|
|
1176
|
+
* @returns The previous property, or undefined if this is the first property
|
|
523
1177
|
* @returns {ObjectProp | undefined}
|
|
524
1178
|
*/
|
|
525
|
-
previousProperty():
|
|
1179
|
+
previousProperty(): any;
|
|
526
1180
|
/**
|
|
1181
|
+
* Returns the next property in the same object.
|
|
1182
|
+
* @returns The next property, or undefined if this is the last property
|
|
527
1183
|
* @returns {ObjectProp | undefined}
|
|
528
1184
|
*/
|
|
529
|
-
nextProperty():
|
|
1185
|
+
nextProperty(): any;
|
|
530
1186
|
/**
|
|
1187
|
+
* Returns the root node of the document.
|
|
1188
|
+
* @returns The root node, or undefined if detached
|
|
531
1189
|
* @returns {RootNode | undefined}
|
|
532
1190
|
*/
|
|
533
|
-
rootNode():
|
|
1191
|
+
rootNode(): any;
|
|
534
1192
|
/**
|
|
1193
|
+
* Returns the indentation string used at this node's depth.
|
|
1194
|
+
* @returns The indentation string, or undefined if not applicable
|
|
535
1195
|
* @returns {string | undefined}
|
|
536
1196
|
*/
|
|
537
|
-
indentText():
|
|
1197
|
+
indentText(): any;
|
|
538
1198
|
/**
|
|
1199
|
+
* Returns whether this node's container uses trailing commas.
|
|
1200
|
+
* @returns true if trailing commas are used
|
|
539
1201
|
* @returns {boolean}
|
|
540
1202
|
*/
|
|
541
1203
|
usesTrailingCommas(): boolean;
|
|
542
1204
|
/**
|
|
1205
|
+
* Returns all child nodes including whitespace and punctuation.
|
|
1206
|
+
* @returns Array of all child nodes
|
|
543
1207
|
* @returns {Node[]}
|
|
544
1208
|
*/
|
|
545
|
-
children():
|
|
1209
|
+
children(): any[];
|
|
546
1210
|
/**
|
|
1211
|
+
* Returns child nodes excluding whitespace, comments, and punctuation.
|
|
1212
|
+
* @returns Array of significant child nodes
|
|
547
1213
|
* @returns {Node[]}
|
|
548
1214
|
*/
|
|
549
|
-
childrenExcludeTriviaAndTokens():
|
|
1215
|
+
childrenExcludeTriviaAndTokens(): any[];
|
|
550
1216
|
/**
|
|
1217
|
+
* Returns the child node at the specified index.
|
|
1218
|
+
* @param index - The child index
|
|
1219
|
+
* @returns The child node, or undefined if index is out of bounds
|
|
551
1220
|
* @param {number} index
|
|
552
1221
|
* @returns {Node | undefined}
|
|
553
1222
|
*/
|
|
554
|
-
childAtIndex(index: number):
|
|
1223
|
+
childAtIndex(index: number): any;
|
|
555
1224
|
}
|
|
556
|
-
|
|
1225
|
+
/**
|
|
1226
|
+
* Represents the name part of an object property in the CST.
|
|
1227
|
+
* Can be either a quoted string or an unquoted word literal (when allowLooseObjectPropertyNames is enabled).
|
|
1228
|
+
*/
|
|
1229
|
+
export class ObjectPropName {
|
|
557
1230
|
static __wrap(ptr: any): any;
|
|
1231
|
+
__destroy_into_raw(): number | undefined;
|
|
1232
|
+
__wbg_ptr: number | undefined;
|
|
1233
|
+
free(): void;
|
|
558
1234
|
/**
|
|
559
|
-
*
|
|
560
|
-
* @
|
|
561
|
-
* @returns {
|
|
1235
|
+
* Returns the decoded property name (unquoted and unescaped).
|
|
1236
|
+
* @returns The decoded property name
|
|
1237
|
+
* @returns {string}
|
|
1238
|
+
*/
|
|
1239
|
+
decodedValue(): any;
|
|
1240
|
+
/**
|
|
1241
|
+
* Returns the parent node in the CST.
|
|
1242
|
+
* @returns The parent node, or undefined if this is the root
|
|
1243
|
+
* @returns {Node | undefined}
|
|
1244
|
+
*/
|
|
1245
|
+
parent(): any;
|
|
1246
|
+
/**
|
|
1247
|
+
* Returns the root node of the document.
|
|
1248
|
+
* @returns The root node, or undefined if detached
|
|
1249
|
+
* @returns {RootNode | undefined}
|
|
1250
|
+
*/
|
|
1251
|
+
rootNode(): any;
|
|
1252
|
+
/**
|
|
1253
|
+
* Returns the index of this node within its parent's children.
|
|
1254
|
+
* @returns The child index
|
|
1255
|
+
* @returns {number}
|
|
1256
|
+
*/
|
|
1257
|
+
childIndex(): number;
|
|
1258
|
+
/**
|
|
1259
|
+
* Returns all ancestor nodes from parent to root.
|
|
1260
|
+
* @returns Array of ancestor nodes
|
|
1261
|
+
* @returns {Node[]}
|
|
1262
|
+
*/
|
|
1263
|
+
ancestors(): any[];
|
|
1264
|
+
/**
|
|
1265
|
+
* Returns the previous sibling node.
|
|
1266
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
1267
|
+
* @returns {Node | undefined}
|
|
562
1268
|
*/
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
1269
|
+
previousSibling(): any;
|
|
1270
|
+
/**
|
|
1271
|
+
* Returns the next sibling node.
|
|
1272
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
1273
|
+
* @returns {Node | undefined}
|
|
1274
|
+
*/
|
|
1275
|
+
nextSibling(): any;
|
|
1276
|
+
/**
|
|
1277
|
+
* Returns the indentation string used at this node's depth.
|
|
1278
|
+
* @returns The indentation string, or undefined if not applicable
|
|
1279
|
+
* @returns {string | undefined}
|
|
1280
|
+
*/
|
|
1281
|
+
indentText(): any;
|
|
1282
|
+
/**
|
|
1283
|
+
* Returns whether this node's container uses trailing commas.
|
|
1284
|
+
* @returns true if trailing commas are used
|
|
1285
|
+
* @returns {boolean}
|
|
1286
|
+
*/
|
|
1287
|
+
usesTrailingCommas(): boolean;
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Represents the root node of a JSONC document.
|
|
1291
|
+
* This is the entry point for manipulating the concrete syntax tree.
|
|
1292
|
+
*/
|
|
1293
|
+
export class RootNode {
|
|
1294
|
+
static __wrap(ptr: any): any;
|
|
568
1295
|
__destroy_into_raw(): number | undefined;
|
|
569
1296
|
__wbg_ptr: number | undefined;
|
|
570
1297
|
free(): void;
|
|
571
1298
|
/**
|
|
1299
|
+
* Returns the root value node.
|
|
1300
|
+
* @returns The root value, or undefined if the document is empty
|
|
572
1301
|
* @returns {Node | undefined}
|
|
573
1302
|
*/
|
|
574
|
-
value():
|
|
1303
|
+
value(): any;
|
|
575
1304
|
/**
|
|
1305
|
+
* Returns the root value node, throwing if empty.
|
|
1306
|
+
* @returns The root value
|
|
1307
|
+
* @throws If the document is empty
|
|
576
1308
|
* @returns {Node}
|
|
577
1309
|
*/
|
|
578
|
-
valueOrThrow():
|
|
1310
|
+
valueOrThrow(): any;
|
|
579
1311
|
/**
|
|
1312
|
+
* Returns the root value as an object if it is one.
|
|
1313
|
+
* @returns The object, or undefined if root is not an object
|
|
580
1314
|
* @returns {JsonObject | undefined}
|
|
581
1315
|
*/
|
|
582
|
-
|
|
1316
|
+
asObject(): any;
|
|
583
1317
|
/**
|
|
1318
|
+
* Returns the root value as an object, throwing if it's not an object.
|
|
1319
|
+
* @returns The object
|
|
1320
|
+
* @throws If the root is not an object
|
|
584
1321
|
* @returns {JsonObject}
|
|
585
1322
|
*/
|
|
586
|
-
|
|
1323
|
+
asObjectOrThrow(): any;
|
|
587
1324
|
/**
|
|
1325
|
+
* Returns the root value as an object, creating an empty object if the root is empty.
|
|
1326
|
+
* Returns undefined if the root contains a value of a different type.
|
|
1327
|
+
* @returns The object, or undefined if a non-object value exists
|
|
588
1328
|
* @returns {JsonObject | undefined}
|
|
589
1329
|
*/
|
|
590
|
-
|
|
1330
|
+
asObjectOrCreate(): any;
|
|
591
1331
|
/**
|
|
1332
|
+
* Returns the root value as an object, replacing any existing value with an empty object if needed.
|
|
1333
|
+
* Unlike asObjectOrCreate, this always returns an object by replacing non-object values.
|
|
1334
|
+
* @returns The object (always succeeds)
|
|
592
1335
|
* @returns {JsonObject}
|
|
593
1336
|
*/
|
|
594
|
-
|
|
1337
|
+
asObjectOrForce(): any;
|
|
595
1338
|
/**
|
|
1339
|
+
* Returns the root value as an array if it is one.
|
|
1340
|
+
* @returns The array, or undefined if root is not an array
|
|
596
1341
|
* @returns {JsonArray | undefined}
|
|
597
1342
|
*/
|
|
598
|
-
|
|
1343
|
+
asArray(): any;
|
|
599
1344
|
/**
|
|
1345
|
+
* Returns the root value as an array, throwing if it's not an array.
|
|
1346
|
+
* @returns The array
|
|
1347
|
+
* @throws If the root is not an array
|
|
600
1348
|
* @returns {JsonArray}
|
|
601
1349
|
*/
|
|
602
|
-
|
|
1350
|
+
asArrayOrThrow(): any;
|
|
603
1351
|
/**
|
|
1352
|
+
* Returns the root value as an array, creating an empty array if the root is empty.
|
|
1353
|
+
* Returns undefined if the root contains a value of a different type.
|
|
1354
|
+
* @returns The array, or undefined if a non-array value exists
|
|
604
1355
|
* @returns {JsonArray | undefined}
|
|
605
1356
|
*/
|
|
606
|
-
|
|
1357
|
+
asArrayOrCreate(): any;
|
|
607
1358
|
/**
|
|
1359
|
+
* Returns the root value as an array, replacing any existing value with an empty array if needed.
|
|
1360
|
+
* Unlike asArrayOrCreate, this always returns an array by replacing non-array values.
|
|
1361
|
+
* @returns The array (always succeeds)
|
|
608
1362
|
* @returns {JsonArray}
|
|
609
1363
|
*/
|
|
610
|
-
|
|
1364
|
+
asArrayOrForce(): any;
|
|
611
1365
|
/**
|
|
1366
|
+
* Converts the CST back to a string representation.
|
|
1367
|
+
* @returns The JSONC string
|
|
612
1368
|
* @returns {string}
|
|
613
1369
|
*/
|
|
614
|
-
toString():
|
|
1370
|
+
toString(): any;
|
|
615
1371
|
/**
|
|
1372
|
+
* Returns all child nodes including whitespace and punctuation.
|
|
1373
|
+
* @returns Array of all child nodes
|
|
616
1374
|
* @returns {Node[]}
|
|
617
1375
|
*/
|
|
618
|
-
children():
|
|
1376
|
+
children(): any[];
|
|
619
1377
|
/**
|
|
620
|
-
*
|
|
1378
|
+
* Sets the root value of the document.
|
|
1379
|
+
* Accepts any JSON value: string, number, boolean, null, array, or object.
|
|
1380
|
+
* @param value - The new value to set
|
|
1381
|
+
* @param {any} value
|
|
621
1382
|
*/
|
|
622
|
-
setValue(
|
|
1383
|
+
setValue(value: any): void;
|
|
623
1384
|
/**
|
|
1385
|
+
* Configures whether trailing commas should be used throughout the document.
|
|
1386
|
+
* When enabled, trailing commas are added for multiline formatting in objects and arrays.
|
|
1387
|
+
* @param enabled - Whether to enable trailing commas
|
|
624
1388
|
* @param {boolean} enabled
|
|
625
1389
|
*/
|
|
626
1390
|
setTrailingCommas(enabled: boolean): void;
|
|
1391
|
+
/**
|
|
1392
|
+
* Clears all children from the root node, leaving an empty document.
|
|
1393
|
+
*/
|
|
627
1394
|
clearChildren(): void;
|
|
628
1395
|
/**
|
|
1396
|
+
* Returns the indentation string used for a single level.
|
|
1397
|
+
* @returns The single-level indentation string (e.g., " " or "\t")
|
|
629
1398
|
* @returns {string | undefined}
|
|
630
1399
|
*/
|
|
631
|
-
singleIndentText():
|
|
1400
|
+
singleIndentText(): any;
|
|
632
1401
|
/**
|
|
1402
|
+
* Returns the newline kind used in the document.
|
|
1403
|
+
* @returns Either "\n" or "\r\n"
|
|
633
1404
|
* @returns {string}
|
|
634
1405
|
*/
|
|
635
|
-
newlineKind():
|
|
1406
|
+
newlineKind(): any;
|
|
636
1407
|
/**
|
|
1408
|
+
* Returns the parent node in the CST.
|
|
1409
|
+
* @returns The parent node, or undefined if this is the root
|
|
637
1410
|
* @returns {Node | undefined}
|
|
638
1411
|
*/
|
|
639
|
-
parent():
|
|
1412
|
+
parent(): any;
|
|
640
1413
|
/**
|
|
1414
|
+
* Returns the index of this node within its parent's children.
|
|
1415
|
+
* @returns The child index
|
|
641
1416
|
* @returns {number}
|
|
642
1417
|
*/
|
|
643
1418
|
childIndex(): number;
|
|
644
1419
|
/**
|
|
1420
|
+
* Returns all ancestor nodes from parent to root.
|
|
1421
|
+
* @returns Array of ancestor nodes
|
|
645
1422
|
* @returns {Node[]}
|
|
646
1423
|
*/
|
|
647
|
-
ancestors():
|
|
1424
|
+
ancestors(): any[];
|
|
648
1425
|
/**
|
|
1426
|
+
* Returns the previous sibling node.
|
|
1427
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
649
1428
|
* @returns {Node | undefined}
|
|
650
1429
|
*/
|
|
651
|
-
previousSibling():
|
|
1430
|
+
previousSibling(): any;
|
|
652
1431
|
/**
|
|
1432
|
+
* Returns all previous sibling nodes.
|
|
1433
|
+
* @returns Array of previous siblings
|
|
653
1434
|
* @returns {Node[]}
|
|
654
1435
|
*/
|
|
655
|
-
previousSiblings():
|
|
1436
|
+
previousSiblings(): any[];
|
|
656
1437
|
/**
|
|
1438
|
+
* Returns the next sibling node.
|
|
1439
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
657
1440
|
* @returns {Node | undefined}
|
|
658
1441
|
*/
|
|
659
|
-
nextSibling():
|
|
1442
|
+
nextSibling(): any;
|
|
660
1443
|
/**
|
|
1444
|
+
* Returns all next sibling nodes.
|
|
1445
|
+
* @returns Array of next siblings
|
|
661
1446
|
* @returns {Node[]}
|
|
662
1447
|
*/
|
|
663
|
-
nextSiblings():
|
|
1448
|
+
nextSiblings(): any[];
|
|
664
1449
|
/**
|
|
1450
|
+
* Returns the indentation string used at this node's depth.
|
|
1451
|
+
* @returns The indentation string, or undefined if not applicable
|
|
665
1452
|
* @returns {string | undefined}
|
|
666
1453
|
*/
|
|
667
|
-
indentText():
|
|
1454
|
+
indentText(): any;
|
|
668
1455
|
/**
|
|
1456
|
+
* Returns whether this node's container uses trailing commas.
|
|
1457
|
+
* @returns true if trailing commas are used
|
|
669
1458
|
* @returns {boolean}
|
|
670
1459
|
*/
|
|
671
1460
|
usesTrailingCommas(): boolean;
|
|
672
1461
|
/**
|
|
1462
|
+
* Returns child nodes excluding whitespace, comments, and punctuation.
|
|
1463
|
+
* @returns Array of significant child nodes
|
|
673
1464
|
* @returns {Node[]}
|
|
674
1465
|
*/
|
|
675
|
-
childrenExcludeTriviaAndTokens():
|
|
1466
|
+
childrenExcludeTriviaAndTokens(): any[];
|
|
676
1467
|
/**
|
|
1468
|
+
* Returns the child node at the specified index.
|
|
1469
|
+
* @param index - The child index
|
|
1470
|
+
* @returns The child node, or undefined if index is out of bounds
|
|
677
1471
|
* @param {number} index
|
|
678
1472
|
* @returns {Node | undefined}
|
|
679
1473
|
*/
|
|
680
|
-
childAtIndex(index: number):
|
|
1474
|
+
childAtIndex(index: number): any;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Represents a string literal node in the CST.
|
|
1478
|
+
* Provides methods for manipulating string values and their formatting.
|
|
1479
|
+
*/
|
|
1480
|
+
export class StringLit {
|
|
1481
|
+
static __wrap(ptr: any): any;
|
|
1482
|
+
__destroy_into_raw(): number | undefined;
|
|
1483
|
+
__wbg_ptr: number | undefined;
|
|
1484
|
+
free(): void;
|
|
1485
|
+
/**
|
|
1486
|
+
* Returns the decoded string value (without quotes and with escape sequences processed).
|
|
1487
|
+
* @returns The decoded string value
|
|
1488
|
+
* @returns {string}
|
|
1489
|
+
*/
|
|
1490
|
+
decodedValue(): any;
|
|
1491
|
+
/**
|
|
1492
|
+
* Returns the raw string value including quotes and escape sequences.
|
|
1493
|
+
* @returns The raw string representation
|
|
1494
|
+
* @returns {string}
|
|
1495
|
+
*/
|
|
1496
|
+
rawValue(): any;
|
|
1497
|
+
/**
|
|
1498
|
+
* Sets the raw string value (should include quotes).
|
|
1499
|
+
* @param value - The new raw string value
|
|
1500
|
+
* @param {string} value
|
|
1501
|
+
*/
|
|
1502
|
+
setRawValue(value: string): void;
|
|
1503
|
+
/**
|
|
1504
|
+
* Replaces this string literal with a new value.
|
|
1505
|
+
* @param replacement - The new value to replace this string with
|
|
1506
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
1507
|
+
* @param {any} replacement
|
|
1508
|
+
* @returns {Node | undefined}
|
|
1509
|
+
*/
|
|
1510
|
+
replaceWith(replacement: any): any;
|
|
1511
|
+
/**
|
|
1512
|
+
* Removes this string literal from its parent.
|
|
1513
|
+
* After calling this method, the node is detached from the CST and can no longer be used.
|
|
1514
|
+
*/
|
|
1515
|
+
remove(): void;
|
|
1516
|
+
/**
|
|
1517
|
+
* Returns the parent node in the CST.
|
|
1518
|
+
* @returns The parent node, or undefined if this is the root
|
|
1519
|
+
* @returns {Node | undefined}
|
|
1520
|
+
*/
|
|
1521
|
+
parent(): any;
|
|
1522
|
+
/**
|
|
1523
|
+
* Returns all ancestor nodes from parent to root.
|
|
1524
|
+
* @returns Array of ancestor nodes
|
|
1525
|
+
* @returns {Node[]}
|
|
1526
|
+
*/
|
|
1527
|
+
ancestors(): any[];
|
|
1528
|
+
/**
|
|
1529
|
+
* Returns the index of this node within its parent's children.
|
|
1530
|
+
* @returns The child index
|
|
1531
|
+
* @returns {number}
|
|
1532
|
+
*/
|
|
1533
|
+
childIndex(): number;
|
|
1534
|
+
/**
|
|
1535
|
+
* Returns the previous sibling node.
|
|
1536
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
1537
|
+
* @returns {Node | undefined}
|
|
1538
|
+
*/
|
|
1539
|
+
previousSibling(): any;
|
|
1540
|
+
/**
|
|
1541
|
+
* Returns all previous sibling nodes.
|
|
1542
|
+
* @returns Array of previous siblings
|
|
1543
|
+
* @returns {Node[]}
|
|
1544
|
+
*/
|
|
1545
|
+
previousSiblings(): any[];
|
|
1546
|
+
/**
|
|
1547
|
+
* Returns the next sibling node.
|
|
1548
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
1549
|
+
* @returns {Node | undefined}
|
|
1550
|
+
*/
|
|
1551
|
+
nextSibling(): any;
|
|
1552
|
+
/**
|
|
1553
|
+
* Returns all next sibling nodes.
|
|
1554
|
+
* @returns Array of next siblings
|
|
1555
|
+
* @returns {Node[]}
|
|
1556
|
+
*/
|
|
1557
|
+
nextSiblings(): any[];
|
|
1558
|
+
/**
|
|
1559
|
+
* Returns the root node of the document.
|
|
1560
|
+
* @returns The root node, or undefined if detached
|
|
1561
|
+
* @returns {RootNode | undefined}
|
|
1562
|
+
*/
|
|
1563
|
+
rootNode(): any;
|
|
1564
|
+
/**
|
|
1565
|
+
* Returns the indentation string used at this node's depth.
|
|
1566
|
+
* @returns The indentation string, or undefined if not applicable
|
|
1567
|
+
* @returns {string | undefined}
|
|
1568
|
+
*/
|
|
1569
|
+
indentText(): any;
|
|
1570
|
+
/**
|
|
1571
|
+
* Returns whether this node's container uses trailing commas.
|
|
1572
|
+
* @returns true if trailing commas are used
|
|
1573
|
+
* @returns {boolean}
|
|
1574
|
+
*/
|
|
1575
|
+
usesTrailingCommas(): boolean;
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Represents an unquoted word literal node in the CST.
|
|
1579
|
+
* Used for unquoted property names when `allowLooseObjectPropertyNames` is enabled.
|
|
1580
|
+
*/
|
|
1581
|
+
export class WordLit {
|
|
1582
|
+
static __wrap(ptr: any): any;
|
|
1583
|
+
__destroy_into_raw(): number | undefined;
|
|
1584
|
+
__wbg_ptr: number | undefined;
|
|
1585
|
+
free(): void;
|
|
1586
|
+
/**
|
|
1587
|
+
* Returns the unquoted word value.
|
|
1588
|
+
* @returns The word literal as a string
|
|
1589
|
+
* @returns {string}
|
|
1590
|
+
*/
|
|
1591
|
+
value(): any;
|
|
1592
|
+
/**
|
|
1593
|
+
* Sets the raw word value.
|
|
1594
|
+
* The value should be a valid unquoted identifier (alphanumeric and underscores).
|
|
1595
|
+
* @param value - The raw word string to set
|
|
1596
|
+
* @param {string} value
|
|
1597
|
+
*/
|
|
1598
|
+
setRawValue(value: string): void;
|
|
1599
|
+
/**
|
|
1600
|
+
* Replaces this word literal with a new value.
|
|
1601
|
+
* @param replacement - The new value to replace this word with
|
|
1602
|
+
* @returns The new node that replaced this one, or undefined if this was the root value
|
|
1603
|
+
* @param {any} replacement
|
|
1604
|
+
* @returns {Node | undefined}
|
|
1605
|
+
*/
|
|
1606
|
+
replaceWith(replacement: any): any;
|
|
1607
|
+
/**
|
|
1608
|
+
* Removes this node from its parent.
|
|
1609
|
+
* After calling this method, the node is detached from the CST and can no longer be used.
|
|
1610
|
+
*/
|
|
1611
|
+
remove(): void;
|
|
1612
|
+
/**
|
|
1613
|
+
* Returns the parent node in the CST.
|
|
1614
|
+
* @returns The parent node, or undefined if this is the root
|
|
1615
|
+
* @returns {Node | undefined}
|
|
1616
|
+
*/
|
|
1617
|
+
parent(): any;
|
|
1618
|
+
/**
|
|
1619
|
+
* Returns all ancestor nodes from parent to root.
|
|
1620
|
+
* @returns Array of ancestor nodes
|
|
1621
|
+
* @returns {Node[]}
|
|
1622
|
+
*/
|
|
1623
|
+
ancestors(): any[];
|
|
1624
|
+
/**
|
|
1625
|
+
* Returns the index of this node within its parent's children.
|
|
1626
|
+
* @returns The child index
|
|
1627
|
+
* @returns {number}
|
|
1628
|
+
*/
|
|
1629
|
+
childIndex(): number;
|
|
1630
|
+
/**
|
|
1631
|
+
* Returns the previous sibling node.
|
|
1632
|
+
* @returns The previous sibling, or undefined if this is the first child
|
|
1633
|
+
* @returns {Node | undefined}
|
|
1634
|
+
*/
|
|
1635
|
+
previousSibling(): any;
|
|
1636
|
+
/**
|
|
1637
|
+
* Returns all previous sibling nodes.
|
|
1638
|
+
* @returns Array of previous siblings
|
|
1639
|
+
* @returns {Node[]}
|
|
1640
|
+
*/
|
|
1641
|
+
previousSiblings(): any[];
|
|
1642
|
+
/**
|
|
1643
|
+
* Returns the next sibling node.
|
|
1644
|
+
* @returns The next sibling, or undefined if this is the last child
|
|
1645
|
+
* @returns {Node | undefined}
|
|
1646
|
+
*/
|
|
1647
|
+
nextSibling(): any;
|
|
1648
|
+
/**
|
|
1649
|
+
* Returns all next sibling nodes.
|
|
1650
|
+
* @returns Array of next siblings
|
|
1651
|
+
* @returns {Node[]}
|
|
1652
|
+
*/
|
|
1653
|
+
nextSiblings(): any[];
|
|
1654
|
+
/**
|
|
1655
|
+
* Returns the root node of the document.
|
|
1656
|
+
* @returns The root node, or undefined if detached
|
|
1657
|
+
* @returns {RootNode | undefined}
|
|
1658
|
+
*/
|
|
1659
|
+
rootNode(): any;
|
|
1660
|
+
/**
|
|
1661
|
+
* Returns the indentation string used at this node's depth.
|
|
1662
|
+
* @returns The indentation string, or undefined if not applicable
|
|
1663
|
+
* @returns {string | undefined}
|
|
1664
|
+
*/
|
|
1665
|
+
indentText(): any;
|
|
1666
|
+
/**
|
|
1667
|
+
* Returns whether this node's container uses trailing commas.
|
|
1668
|
+
* @returns true if trailing commas are used
|
|
1669
|
+
* @returns {boolean}
|
|
1670
|
+
*/
|
|
1671
|
+
usesTrailingCommas(): boolean;
|
|
681
1672
|
}
|
|
682
1673
|
//# sourceMappingURL=rs_lib.internal.d.ts.map
|