@swagger-api/apidom-ast 1.0.0-alpha.8 → 1.0.0-beta.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/CHANGELOG.md +12 -0
- package/dist/apidom-ast.browser.js +797 -406
- package/dist/apidom-ast.browser.min.js +1 -1
- package/package.json +16 -16
- package/{cjs → src}/Error.cjs +7 -0
- package/{es → src}/Error.mjs +6 -0
- package/{cjs → src}/Literal.cjs +7 -0
- package/{es → src}/Literal.mjs +6 -0
- package/{cjs → src}/Node.cjs +7 -0
- package/{es → src}/Node.mjs +7 -0
- package/{cjs → src}/ParseResult.cjs +3 -0
- package/{es → src}/ParseResult.mjs +3 -0
- package/{cjs → src}/Position.cjs +14 -0
- package/{es → src}/Position.mjs +15 -0
- package/{es → src}/index.mjs +1 -2
- package/{cjs → src}/json/nodes/JsonArray.cjs +3 -0
- package/{es → src}/json/nodes/JsonArray.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonDocument.cjs +3 -0
- package/{es → src}/json/nodes/JsonDocument.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonEscapeSequence.cjs +3 -0
- package/{es → src}/json/nodes/JsonEscapeSequence.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonFalse.cjs +3 -0
- package/{es → src}/json/nodes/JsonFalse.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonKey.cjs +3 -0
- package/{es → src}/json/nodes/JsonKey.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonNode.cjs +3 -0
- package/{es → src}/json/nodes/JsonNode.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonNull.cjs +3 -0
- package/{es → src}/json/nodes/JsonNull.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonNumber.cjs +3 -0
- package/{es → src}/json/nodes/JsonNumber.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonObject.cjs +3 -0
- package/{es → src}/json/nodes/JsonObject.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonProperty.cjs +7 -0
- package/{es → src}/json/nodes/JsonProperty.mjs +6 -0
- package/{cjs → src}/json/nodes/JsonString.cjs +3 -0
- package/{es → src}/json/nodes/JsonString.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonStringContent.cjs +3 -0
- package/{es → src}/json/nodes/JsonStringContent.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonTrue.cjs +3 -0
- package/{es → src}/json/nodes/JsonTrue.mjs +3 -0
- package/{cjs → src}/json/nodes/JsonValue.cjs +7 -0
- package/{es → src}/json/nodes/JsonValue.mjs +6 -0
- package/{cjs → src}/json/nodes/predicates.cjs +47 -0
- package/{es → src}/json/nodes/predicates.mjs +47 -0
- package/{cjs → src}/predicates.cjs +19 -0
- package/{es → src}/predicates.mjs +19 -0
- package/{cjs → src}/traversal/visitor.cjs +43 -16
- package/{es → src}/traversal/visitor.mjs +43 -16
- package/{cjs → src}/yaml/anchors-aliases/ReferenceManager.cjs +3 -0
- package/{es → src}/yaml/anchors-aliases/ReferenceManager.mjs +3 -0
- package/{cjs → src}/yaml/errors/YamlError.cjs +3 -0
- package/{es → src}/yaml/errors/YamlError.mjs +4 -0
- package/{cjs → src}/yaml/errors/YamlReferenceError.cjs +3 -0
- package/{es → src}/yaml/errors/YamlReferenceError.mjs +3 -0
- package/{cjs → src}/yaml/errors/YamlSchemaError.cjs +3 -0
- package/{es → src}/yaml/errors/YamlSchemaError.mjs +3 -0
- package/{cjs → src}/yaml/errors/YamlTagError.cjs +7 -0
- package/{es → src}/yaml/errors/YamlTagError.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlAlias.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlAlias.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlAnchor.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlAnchor.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlCollection.cjs +3 -0
- package/{es → src}/yaml/nodes/YamlCollection.mjs +3 -0
- package/{cjs → src}/yaml/nodes/YamlComment.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlComment.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlDirective.cjs +11 -0
- package/{es → src}/yaml/nodes/YamlDirective.mjs +9 -0
- package/{cjs → src}/yaml/nodes/YamlDocument.cjs +3 -0
- package/{es → src}/yaml/nodes/YamlDocument.mjs +3 -0
- package/{cjs → src}/yaml/nodes/YamlKeyValuePair.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlKeyValuePair.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlMapping.cjs +3 -0
- package/{es → src}/yaml/nodes/YamlMapping.mjs +3 -0
- package/{cjs → src}/yaml/nodes/YamlNode.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlNode.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlScalar.cjs +7 -0
- package/{es → src}/yaml/nodes/YamlScalar.mjs +6 -0
- package/{cjs → src}/yaml/nodes/YamlSequence.cjs +3 -0
- package/{es → src}/yaml/nodes/YamlSequence.mjs +3 -0
- package/{cjs → src}/yaml/nodes/YamlStream.cjs +3 -0
- package/{es → src}/yaml/nodes/YamlStream.mjs +3 -0
- package/{cjs → src}/yaml/nodes/YamlStyle.cjs +6 -0
- package/{es → src}/yaml/nodes/YamlStyle.mjs +7 -0
- package/{cjs → src}/yaml/nodes/YamlTag.cjs +9 -0
- package/{es → src}/yaml/nodes/YamlTag.mjs +11 -0
- package/{cjs → src}/yaml/nodes/predicates.cjs +43 -0
- package/{es → src}/yaml/nodes/predicates.mjs +43 -0
- package/{cjs → src}/yaml/schemas/failsafe/index.cjs +3 -0
- package/{es → src}/yaml/schemas/failsafe/index.mjs +3 -0
- package/{cjs → src}/yaml/schemas/json/index.cjs +3 -0
- package/{es → src}/yaml/schemas/json/index.mjs +3 -0
- package/types/apidom-ast.d.ts +826 -0
- package/types/dist.d.ts +0 -486
- /package/{cjs → src}/index.cjs +0 -0
- /package/{cjs → src}/yaml/schemas/ScalarTag.cjs +0 -0
- /package/{es → src}/yaml/schemas/ScalarTag.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/Tag.cjs +0 -0
- /package/{es → src}/yaml/schemas/Tag.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/canonical-format.cjs +0 -0
- /package/{es → src}/yaml/schemas/canonical-format.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/failsafe/GenericMapping.cjs +0 -0
- /package/{es → src}/yaml/schemas/failsafe/GenericMapping.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/failsafe/GenericSequence.cjs +0 -0
- /package/{es → src}/yaml/schemas/failsafe/GenericSequence.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/failsafe/GenericString.cjs +0 -0
- /package/{es → src}/yaml/schemas/failsafe/GenericString.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/json/Boolean.cjs +0 -0
- /package/{es → src}/yaml/schemas/json/Boolean.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/json/FloatingPoint.cjs +0 -0
- /package/{es → src}/yaml/schemas/json/FloatingPoint.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/json/Integer.cjs +0 -0
- /package/{es → src}/yaml/schemas/json/Integer.mjs +0 -0
- /package/{cjs → src}/yaml/schemas/json/Null.cjs +0 -0
- /package/{es → src}/yaml/schemas/json/Null.mjs +0 -0
package/types/dist.d.ts
DELETED
@@ -1,486 +0,0 @@
|
|
1
|
-
import { ApiDOMStructuredError, ApiDOMErrorOptions } from '@swagger-api/apidom-error';
|
2
|
-
|
3
|
-
interface PointOptions {
|
4
|
-
readonly row: number;
|
5
|
-
readonly column: number;
|
6
|
-
readonly char: number;
|
7
|
-
}
|
8
|
-
declare class Point {
|
9
|
-
static readonly type: string;
|
10
|
-
readonly type: string;
|
11
|
-
readonly row: number;
|
12
|
-
readonly column: number;
|
13
|
-
readonly char: number;
|
14
|
-
constructor({ row, column, char }: PointOptions);
|
15
|
-
}
|
16
|
-
interface PositionOptions {
|
17
|
-
readonly start: Point;
|
18
|
-
readonly end: Point;
|
19
|
-
}
|
20
|
-
declare class Position {
|
21
|
-
static readonly type: string;
|
22
|
-
readonly type: string;
|
23
|
-
readonly start: Point;
|
24
|
-
readonly end: Point;
|
25
|
-
constructor({ start, end }: PositionOptions);
|
26
|
-
}
|
27
|
-
|
28
|
-
interface NodeOptions {
|
29
|
-
readonly children?: unknown[];
|
30
|
-
readonly position?: Position;
|
31
|
-
readonly isMissing?: boolean;
|
32
|
-
}
|
33
|
-
declare class Node {
|
34
|
-
static readonly type: string;
|
35
|
-
readonly type: string;
|
36
|
-
readonly isMissing: boolean;
|
37
|
-
children: unknown[];
|
38
|
-
position?: Position;
|
39
|
-
constructor({ children, position, isMissing }?: NodeOptions);
|
40
|
-
clone(): Node;
|
41
|
-
}
|
42
|
-
|
43
|
-
declare class JsonNode extends Node {
|
44
|
-
}
|
45
|
-
|
46
|
-
declare class JsonDocument extends JsonNode {
|
47
|
-
static readonly type = "document";
|
48
|
-
get child(): unknown;
|
49
|
-
}
|
50
|
-
|
51
|
-
declare class JsonString extends JsonNode {
|
52
|
-
static readonly type: string;
|
53
|
-
get value(): string;
|
54
|
-
}
|
55
|
-
|
56
|
-
declare class JsonKey extends JsonString {
|
57
|
-
static readonly type = "key";
|
58
|
-
}
|
59
|
-
|
60
|
-
interface JsonValueOptions extends NodeOptions {
|
61
|
-
value: string;
|
62
|
-
}
|
63
|
-
declare class JsonValue$1 extends JsonNode {
|
64
|
-
static readonly type: string;
|
65
|
-
readonly value: string;
|
66
|
-
constructor({ value, ...rest }: JsonValueOptions);
|
67
|
-
}
|
68
|
-
|
69
|
-
declare class JsonFalse extends JsonValue$1 {
|
70
|
-
static readonly type = "false";
|
71
|
-
}
|
72
|
-
|
73
|
-
declare class JsonTrue extends JsonValue$1 {
|
74
|
-
static readonly type = "true";
|
75
|
-
}
|
76
|
-
|
77
|
-
declare class JsonNull extends JsonValue$1 {
|
78
|
-
static readonly type = "null";
|
79
|
-
}
|
80
|
-
|
81
|
-
declare class JsonNumber extends JsonValue$1 {
|
82
|
-
static readonly type = "number";
|
83
|
-
}
|
84
|
-
|
85
|
-
declare class JsonArray extends JsonNode {
|
86
|
-
static readonly type = "array";
|
87
|
-
get items(): unknown[];
|
88
|
-
}
|
89
|
-
|
90
|
-
type JsonValue = JsonFalse | JsonTrue | JsonNull | JsonNumber | JsonString | JsonArray | JsonObject;
|
91
|
-
declare class JsonProperty extends JsonNode {
|
92
|
-
static readonly type = "property";
|
93
|
-
get key(): JsonKey | undefined;
|
94
|
-
get value(): JsonValue | undefined;
|
95
|
-
}
|
96
|
-
|
97
|
-
declare class JsonObject extends JsonNode {
|
98
|
-
static readonly type = "object";
|
99
|
-
get properties(): Array<JsonProperty>;
|
100
|
-
}
|
101
|
-
|
102
|
-
declare class JsonStringContent extends JsonValue$1 {
|
103
|
-
static readonly type = "stringContent";
|
104
|
-
}
|
105
|
-
|
106
|
-
declare class JsonEscapeSequence extends JsonValue$1 {
|
107
|
-
static readonly type = "escapeSequence";
|
108
|
-
}
|
109
|
-
|
110
|
-
declare const isDocument$1: (node: unknown) => node is JsonDocument;
|
111
|
-
declare const isString: (node: unknown) => node is JsonString;
|
112
|
-
declare const isFalse: (node: unknown) => node is JsonFalse;
|
113
|
-
declare const isTrue: (node: unknown) => node is JsonTrue;
|
114
|
-
declare const isNull: (node: unknown) => node is JsonNull;
|
115
|
-
declare const isNumber: (node: unknown) => node is JsonNumber;
|
116
|
-
declare const isArray: (node: unknown) => node is JsonArray;
|
117
|
-
declare const isObject: (node: unknown) => node is JsonObject;
|
118
|
-
declare const isStringContent: (node: unknown) => node is JsonStringContent;
|
119
|
-
declare const isEscapeSequence: (node: unknown) => node is JsonEscapeSequence;
|
120
|
-
declare const isProperty: (node: unknown) => node is JsonProperty;
|
121
|
-
declare const isKey: (node: unknown) => node is JsonKey;
|
122
|
-
|
123
|
-
interface YamlAliasOptions extends NodeOptions {
|
124
|
-
readonly content: string;
|
125
|
-
}
|
126
|
-
declare class YamlAlias extends Node {
|
127
|
-
static readonly type = "alias";
|
128
|
-
readonly content: string;
|
129
|
-
constructor({ content, ...rest }: YamlAliasOptions);
|
130
|
-
}
|
131
|
-
|
132
|
-
declare enum YamlNodeKind {
|
133
|
-
Scalar = "Scalar",
|
134
|
-
Sequence = "Sequence",
|
135
|
-
Mapping = "Mapping"
|
136
|
-
}
|
137
|
-
interface YamlTagOptions extends NodeOptions {
|
138
|
-
readonly explicitName: string;
|
139
|
-
readonly kind: YamlNodeKind;
|
140
|
-
}
|
141
|
-
declare class YamlTag extends Node {
|
142
|
-
static readonly type = "tag";
|
143
|
-
readonly explicitName: string;
|
144
|
-
readonly kind: YamlNodeKind;
|
145
|
-
constructor({ explicitName, kind, ...rest }: YamlTagOptions);
|
146
|
-
}
|
147
|
-
|
148
|
-
interface YamlAnchorOptions extends NodeOptions {
|
149
|
-
readonly name: string;
|
150
|
-
}
|
151
|
-
declare class YamlAnchor extends Node {
|
152
|
-
static readonly type = "anchor";
|
153
|
-
readonly name: string;
|
154
|
-
constructor({ name, ...rest }: YamlAnchorOptions);
|
155
|
-
}
|
156
|
-
|
157
|
-
declare enum YamlStyle {
|
158
|
-
Plain = "Plain",
|
159
|
-
SingleQuoted = "SingleQuoted",
|
160
|
-
DoubleQuoted = "DoubleQuoted",
|
161
|
-
Literal = "Literal",
|
162
|
-
Folded = "Folded",
|
163
|
-
Explicit = "Explicit",
|
164
|
-
SinglePair = "SinglePair",
|
165
|
-
NextLine = "NextLine",
|
166
|
-
InLine = "InLine"
|
167
|
-
}
|
168
|
-
declare enum YamlStyleGroup {
|
169
|
-
Flow = "Flow",
|
170
|
-
Block = "Block"
|
171
|
-
}
|
172
|
-
|
173
|
-
interface YamlNodeOptions extends NodeOptions {
|
174
|
-
readonly anchor?: YamlAnchor;
|
175
|
-
readonly tag?: YamlTag;
|
176
|
-
readonly style: YamlStyle;
|
177
|
-
readonly styleGroup: YamlStyleGroup;
|
178
|
-
}
|
179
|
-
declare class YamlNode extends Node {
|
180
|
-
readonly anchor?: YamlAnchor;
|
181
|
-
readonly tag?: YamlTag;
|
182
|
-
readonly style: YamlStyle;
|
183
|
-
readonly styleGroup: YamlStyleGroup;
|
184
|
-
constructor({ anchor, tag, style, styleGroup, ...rest }: YamlNodeOptions);
|
185
|
-
}
|
186
|
-
|
187
|
-
declare class YamlCollection extends YamlNode {
|
188
|
-
}
|
189
|
-
|
190
|
-
interface YamlCommentOptions extends NodeOptions {
|
191
|
-
readonly content: string;
|
192
|
-
}
|
193
|
-
declare class YamlComment extends Node {
|
194
|
-
static readonly type = "comment";
|
195
|
-
readonly content: string;
|
196
|
-
constructor({ content, ...rest }: YamlCommentOptions);
|
197
|
-
}
|
198
|
-
|
199
|
-
interface YamlDirectiveParameters {
|
200
|
-
readonly version?: string;
|
201
|
-
readonly handle?: string;
|
202
|
-
readonly prefix?: string;
|
203
|
-
}
|
204
|
-
interface YamlDirectiveOptions extends NodeOptions {
|
205
|
-
readonly name?: string;
|
206
|
-
readonly parameters: YamlDirectiveParameters;
|
207
|
-
}
|
208
|
-
declare class YamlDirective extends Node {
|
209
|
-
static readonly type = "directive";
|
210
|
-
readonly name?: string;
|
211
|
-
readonly parameters: YamlDirectiveParameters;
|
212
|
-
constructor({ name, parameters, ...rest }: YamlDirectiveOptions);
|
213
|
-
}
|
214
|
-
|
215
|
-
declare class YamlDocument extends Node {
|
216
|
-
static readonly type = "document";
|
217
|
-
}
|
218
|
-
|
219
|
-
interface YamlKeyValuePairOptions extends NodeOptions {
|
220
|
-
readonly styleGroup: YamlStyleGroup;
|
221
|
-
}
|
222
|
-
declare class YamlKeyValuePair extends Node {
|
223
|
-
static readonly type = "keyValuePair";
|
224
|
-
readonly styleGroup: YamlStyleGroup;
|
225
|
-
constructor({ styleGroup, ...rest }: YamlKeyValuePairOptions);
|
226
|
-
}
|
227
|
-
|
228
|
-
declare class YamlMapping extends YamlCollection {
|
229
|
-
static readonly type = "mapping";
|
230
|
-
}
|
231
|
-
|
232
|
-
interface YamlScalarOptions extends YamlNodeOptions {
|
233
|
-
readonly content: string;
|
234
|
-
}
|
235
|
-
declare class YamlScalar extends YamlNode {
|
236
|
-
static readonly type = "scalar";
|
237
|
-
readonly content: string;
|
238
|
-
constructor({ content, ...rest }: YamlScalarOptions);
|
239
|
-
}
|
240
|
-
|
241
|
-
declare class YamlSequence extends YamlCollection {
|
242
|
-
static readonly type = "sequence";
|
243
|
-
}
|
244
|
-
|
245
|
-
declare class YamlStream extends Node {
|
246
|
-
static readonly type = "stream";
|
247
|
-
}
|
248
|
-
|
249
|
-
declare class FailsafeSchema {
|
250
|
-
tags: any[];
|
251
|
-
tagDirectives: YamlDirective[];
|
252
|
-
constructor();
|
253
|
-
toSpecificTagName(node: any): string;
|
254
|
-
registerTagDirective(tagDirective: YamlDirective): void;
|
255
|
-
registerTag(tag: any, beginning?: boolean): this;
|
256
|
-
overrideTag(tag: any): this;
|
257
|
-
resolve(node: any): any;
|
258
|
-
}
|
259
|
-
|
260
|
-
declare class JsonSchema extends FailsafeSchema {
|
261
|
-
constructor();
|
262
|
-
toSpecificTagName(node: any): any;
|
263
|
-
}
|
264
|
-
|
265
|
-
declare class ReferenceManager {
|
266
|
-
addAnchor(node: YamlNode): void;
|
267
|
-
resolveAlias(alias: YamlAlias): YamlScalar;
|
268
|
-
}
|
269
|
-
|
270
|
-
declare const isStream: (node: unknown) => node is YamlStream;
|
271
|
-
declare const isDocument: (node: unknown) => node is YamlDocument;
|
272
|
-
declare const isMapping: (node: unknown) => node is YamlMapping;
|
273
|
-
declare const isSequence: (node: unknown) => node is YamlSequence;
|
274
|
-
declare const isKeyValuePair: (node: unknown) => node is YamlKeyValuePair;
|
275
|
-
declare const isTag: (node: unknown) => node is YamlTag;
|
276
|
-
declare const isAnchor: (node: unknown) => node is YamlAnchor;
|
277
|
-
declare const isScalar: (node: unknown) => node is YamlScalar;
|
278
|
-
declare const isAlias: (node: unknown) => node is YamlAlias;
|
279
|
-
declare const isDirective: (node: unknown) => node is YamlDirective;
|
280
|
-
declare const isComment: (node: unknown) => node is YamlComment;
|
281
|
-
|
282
|
-
declare class YamlError extends ApiDOMStructuredError {
|
283
|
-
}
|
284
|
-
|
285
|
-
declare class YamlReferenceError extends YamlError {
|
286
|
-
}
|
287
|
-
|
288
|
-
declare class YamlSchemaError extends YamlError {
|
289
|
-
}
|
290
|
-
|
291
|
-
interface YamlTagErrorOptions<T extends Node = Node> extends ApiDOMErrorOptions {
|
292
|
-
readonly specificTagName: string;
|
293
|
-
readonly explicitTagName: string;
|
294
|
-
readonly tagKind: string;
|
295
|
-
readonly tagPosition?: Position;
|
296
|
-
readonly nodeCanonicalContent?: string;
|
297
|
-
readonly node?: T;
|
298
|
-
}
|
299
|
-
declare class YamlTagError extends YamlSchemaError {
|
300
|
-
readonly specificTagName: string;
|
301
|
-
readonly explicitTagName: string;
|
302
|
-
readonly tagKind: string;
|
303
|
-
readonly tagPosition?: Position;
|
304
|
-
readonly nodeCanonicalContent?: string;
|
305
|
-
readonly node?: unknown;
|
306
|
-
constructor(message?: string, structuredOptions?: YamlTagErrorOptions);
|
307
|
-
}
|
308
|
-
|
309
|
-
interface LiteralOptions extends NodeOptions {
|
310
|
-
readonly value?: unknown;
|
311
|
-
}
|
312
|
-
declare class Literal extends Node {
|
313
|
-
static readonly type: string;
|
314
|
-
readonly value: unknown;
|
315
|
-
constructor({ value, ...rest }?: LiteralOptions);
|
316
|
-
}
|
317
|
-
|
318
|
-
interface ErrorOptions extends NodeOptions {
|
319
|
-
readonly value?: unknown;
|
320
|
-
readonly isUnexpected?: boolean;
|
321
|
-
}
|
322
|
-
declare class Error extends Node {
|
323
|
-
static readonly type: string;
|
324
|
-
readonly value: unknown;
|
325
|
-
readonly isUnexpected: boolean;
|
326
|
-
constructor({ value, isUnexpected, ...rest }?: ErrorOptions);
|
327
|
-
}
|
328
|
-
|
329
|
-
declare class ParseResult extends Node {
|
330
|
-
static readonly type: string;
|
331
|
-
get rootNode(): unknown;
|
332
|
-
}
|
333
|
-
|
334
|
-
declare const isLiteral: (node: unknown) => node is Literal;
|
335
|
-
declare const isPosition: (node: unknown) => node is Position;
|
336
|
-
declare const isPoint: (node: unknown) => node is Point;
|
337
|
-
declare const isParseResult: (node: unknown) => node is ParseResult;
|
338
|
-
|
339
|
-
/**
|
340
|
-
* SPDX-FileCopyrightText: Copyright (c) GraphQL Contributors
|
341
|
-
*
|
342
|
-
* SPDX-License-Identifier: MIT
|
343
|
-
*/
|
344
|
-
declare const getVisitFn: (visitor: any, type: string, isLeaving: boolean) => any;
|
345
|
-
declare const BREAK: {};
|
346
|
-
declare const getNodeType: (node: any) => any;
|
347
|
-
declare const isNode: (node: any) => boolean;
|
348
|
-
declare const cloneNode: (node: any) => any;
|
349
|
-
/**
|
350
|
-
* Creates a new visitor instance which delegates to many visitors to run in
|
351
|
-
* parallel. Each visitor will be visited for each node before moving on.
|
352
|
-
*
|
353
|
-
* If a prior visitor edits a node, no following visitors will see that node.
|
354
|
-
* `exposeEdits=true` can be used to expose the edited node from the previous visitors.
|
355
|
-
*/
|
356
|
-
interface MergeAllSync {
|
357
|
-
(visitors: any[], options?: {
|
358
|
-
visitFnGetter?: typeof getVisitFn;
|
359
|
-
nodeTypeGetter?: typeof getNodeType;
|
360
|
-
breakSymbol?: typeof BREAK;
|
361
|
-
deleteNodeSymbol?: any;
|
362
|
-
skipVisitingNodeSymbol?: boolean;
|
363
|
-
exposeEdits?: boolean;
|
364
|
-
}): {
|
365
|
-
enter: (node: any, ...rest: any[]) => any;
|
366
|
-
leave: (node: any, ...rest: any[]) => any;
|
367
|
-
};
|
368
|
-
[key: symbol]: MergeAllAsync;
|
369
|
-
}
|
370
|
-
interface MergeAllAsync {
|
371
|
-
(visitors: any[], options?: {
|
372
|
-
visitFnGetter?: typeof getVisitFn;
|
373
|
-
nodeTypeGetter?: typeof getNodeType;
|
374
|
-
breakSymbol?: typeof BREAK;
|
375
|
-
deleteNodeSymbol?: any;
|
376
|
-
skipVisitingNodeSymbol?: boolean;
|
377
|
-
exposeEdits?: boolean;
|
378
|
-
}): {
|
379
|
-
enter: (node: any, ...rest: any[]) => Promise<any>;
|
380
|
-
leave: (node: any, ...rest: any[]) => Promise<any>;
|
381
|
-
};
|
382
|
-
}
|
383
|
-
declare const mergeAll: MergeAllSync;
|
384
|
-
/**
|
385
|
-
* visit() will walk through an AST using a preorder depth first traversal, calling
|
386
|
-
* the visitor's enter function at each node in the traversal, and calling the
|
387
|
-
* leave function after visiting that node and all of its child nodes.
|
388
|
-
*
|
389
|
-
* By returning different values from the enter and leave functions, the
|
390
|
-
* behavior of the visitor can be altered, including skipping over a sub-tree of
|
391
|
-
* the AST (by returning false), editing the AST by returning a value or null
|
392
|
-
* to remove the value, or to stop the whole traversal by returning BREAK.
|
393
|
-
*
|
394
|
-
* When using visit() to edit an AST, the original AST will not be modified, and
|
395
|
-
* a new version of the AST with the changes applied will be returned from the
|
396
|
-
* visit function.
|
397
|
-
*
|
398
|
-
* const editedAST = visit(ast, {
|
399
|
-
* enter(node, key, parent, path, ancestors) {
|
400
|
-
* // @return
|
401
|
-
* // undefined: no action
|
402
|
-
* // false: skip visiting this node
|
403
|
-
* // BREAK: stop visiting altogether
|
404
|
-
* // null: delete this node
|
405
|
-
* // any value: replace this node with the returned value
|
406
|
-
* },
|
407
|
-
* leave(node, key, parent, path, ancestors) {
|
408
|
-
* // @return
|
409
|
-
* // undefined: no action
|
410
|
-
* // false: no action
|
411
|
-
* // BREAK: stop visiting altogether
|
412
|
-
* // null: delete this node
|
413
|
-
* // any value: replace this node with the returned value
|
414
|
-
* }
|
415
|
-
* });
|
416
|
-
*
|
417
|
-
* Alternatively to providing enter() and leave() functions, a visitor can
|
418
|
-
* instead provide functions named the same as the kinds of AST nodes, or
|
419
|
-
* enter/leave visitors at a named key, leading to four permutations of
|
420
|
-
* visitor API:
|
421
|
-
*
|
422
|
-
* 1) Named visitors triggered when entering a node a specific kind.
|
423
|
-
*
|
424
|
-
* visit(ast, {
|
425
|
-
* Kind(node) {
|
426
|
-
* // enter the "Kind" node
|
427
|
-
* }
|
428
|
-
* })
|
429
|
-
*
|
430
|
-
* 2) Named visitors that trigger upon entering and leaving a node of
|
431
|
-
* a specific kind.
|
432
|
-
*
|
433
|
-
* visit(ast, {
|
434
|
-
* Kind: {
|
435
|
-
* enter(node) {
|
436
|
-
* // enter the "Kind" node
|
437
|
-
* }
|
438
|
-
* leave(node) {
|
439
|
-
* // leave the "Kind" node
|
440
|
-
* }
|
441
|
-
* }
|
442
|
-
* })
|
443
|
-
*
|
444
|
-
* 3) Generic visitors that trigger upon entering and leaving any node.
|
445
|
-
*
|
446
|
-
* visit(ast, {
|
447
|
-
* enter(node) {
|
448
|
-
* // enter any node
|
449
|
-
* },
|
450
|
-
* leave(node) {
|
451
|
-
* // leave any node
|
452
|
-
* }
|
453
|
-
* })
|
454
|
-
*
|
455
|
-
* 4) Parallel visitors for entering and leaving nodes of a specific kind.
|
456
|
-
*
|
457
|
-
* visit(ast, {
|
458
|
-
* enter: {
|
459
|
-
* Kind(node) {
|
460
|
-
* // enter the "Kind" node
|
461
|
-
* }
|
462
|
-
* },
|
463
|
-
* leave: {
|
464
|
-
* Kind(node) {
|
465
|
-
* // leave the "Kind" node
|
466
|
-
* }
|
467
|
-
* }
|
468
|
-
* })
|
469
|
-
*
|
470
|
-
* @sig visit :: (Node, Visitor, Options)
|
471
|
-
* @sig Options = { keyMap: Object, state: Object }
|
472
|
-
*/
|
473
|
-
declare const visit: (root: any, visitor: any, { keyMap, state, breakSymbol, deleteNodeSymbol, skipVisitingNodeSymbol, visitFnGetter, nodeTypeGetter, nodePredicate, nodeCloneFn, detectCycles, }?: {
|
474
|
-
keyMap?: null | undefined;
|
475
|
-
state?: {} | undefined;
|
476
|
-
breakSymbol?: {} | undefined;
|
477
|
-
deleteNodeSymbol?: null | undefined;
|
478
|
-
skipVisitingNodeSymbol?: boolean | undefined;
|
479
|
-
visitFnGetter?: ((visitor: any, type: string, isLeaving: boolean) => any) | undefined;
|
480
|
-
nodeTypeGetter?: ((node: any) => any) | undefined;
|
481
|
-
nodePredicate?: ((node: any) => boolean) | undefined;
|
482
|
-
nodeCloneFn?: ((node: any) => any) | undefined;
|
483
|
-
detectCycles?: boolean | undefined;
|
484
|
-
}) => any;
|
485
|
-
|
486
|
-
export { BREAK, Error, JsonArray, JsonDocument, JsonEscapeSequence, JsonFalse, JsonKey, JsonNode, JsonNull, JsonNumber, JsonObject, JsonProperty, JsonString, JsonStringContent, JsonTrue, JsonValue$1 as JsonValue, Literal, type MergeAllAsync, type MergeAllSync, ParseResult, Point, Position, YamlAlias, YamlAnchor, YamlCollection, YamlComment, YamlDirective, YamlDocument, YamlError, FailsafeSchema as YamlFailsafeSchema, JsonSchema as YamlJsonSchema, YamlKeyValuePair, YamlMapping, YamlNode, YamlNodeKind, YamlReferenceError, ReferenceManager as YamlReferenceManager, YamlScalar, YamlSchemaError, YamlSequence, YamlStream, YamlStyle, YamlStyleGroup, YamlTag, YamlTagError, type YamlTagErrorOptions, cloneNode, getNodeType, getVisitFn, isArray as isJsonArray, isDocument$1 as isJsonDocument, isEscapeSequence as isJsonEscapeSequence, isFalse as isJsonFalse, isKey as isJsonKey, isNull as isJsonNull, isNumber as isJsonNumber, isObject as isJsonObject, isProperty as isJsonProperty, isString as isJsonString, isStringContent as isJsonStringContent, isTrue as isJsonTrue, isLiteral, isNode, isParseResult, isPoint, isPosition, isAlias as isYamlAlias, isAnchor as isYamlAnchor, isComment as isYamlComment, isDirective as isYamlDirective, isDocument as isYamlDocument, isKeyValuePair as isYamlKeyValuePair, isMapping as isYamlMapping, isScalar as isYamlScalar, isSequence as isYamlSequence, isStream as isYamlStream, isTag as isYamlTag, mergeAll as mergeAllVisitors, visit };
|
/package/{cjs → src}/index.cjs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|