@swagger-api/apidom-ast 0.92.0 → 0.93.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cjs/Error.cjs +10 -13
  3. package/cjs/Literal.cjs +9 -11
  4. package/cjs/Node.cjs +23 -32
  5. package/cjs/ParseResult.cjs +5 -12
  6. package/cjs/Position.cjs +20 -32
  7. package/cjs/json/nodes/JsonArray.cjs +5 -11
  8. package/cjs/json/nodes/JsonDocument.cjs +5 -12
  9. package/cjs/json/nodes/JsonEscapeSequence.cjs +3 -6
  10. package/cjs/json/nodes/JsonFalse.cjs +3 -6
  11. package/cjs/json/nodes/JsonKey.cjs +3 -6
  12. package/cjs/json/nodes/JsonNode.cjs +1 -2
  13. package/cjs/json/nodes/JsonNull.cjs +3 -6
  14. package/cjs/json/nodes/JsonNumber.cjs +3 -6
  15. package/cjs/json/nodes/JsonObject.cjs +5 -11
  16. package/cjs/json/nodes/JsonProperty.cjs +8 -17
  17. package/cjs/json/nodes/JsonString.cjs +8 -16
  18. package/cjs/json/nodes/JsonStringContent.cjs +3 -6
  19. package/cjs/json/nodes/JsonTrue.cjs +3 -6
  20. package/cjs/json/nodes/JsonValue.cjs +10 -12
  21. package/cjs/json/nodes/predicates.cjs +24 -12
  22. package/cjs/predicates.cjs +9 -5
  23. package/cjs/yaml/nodes/YamlAlias.cjs +10 -12
  24. package/cjs/yaml/nodes/YamlAnchor.cjs +10 -12
  25. package/cjs/yaml/nodes/YamlCollection.cjs +1 -2
  26. package/cjs/yaml/nodes/YamlComment.cjs +10 -12
  27. package/cjs/yaml/nodes/YamlDirective.cjs +14 -17
  28. package/cjs/yaml/nodes/YamlDocument.cjs +3 -6
  29. package/cjs/yaml/nodes/YamlKeyValuePair.cjs +28 -27
  30. package/cjs/yaml/nodes/YamlMapping.cjs +7 -13
  31. package/cjs/yaml/nodes/YamlNode.cjs +12 -15
  32. package/cjs/yaml/nodes/YamlScalar.cjs +10 -12
  33. package/cjs/yaml/nodes/YamlSequence.cjs +10 -16
  34. package/cjs/yaml/nodes/YamlStream.cjs +7 -15
  35. package/cjs/yaml/nodes/YamlStyle.cjs +2 -11
  36. package/cjs/yaml/nodes/YamlTag.cjs +10 -13
  37. package/cjs/yaml/nodes/predicates.cjs +20 -10
  38. package/cjs/yaml/schemas/ScalarTag.cjs +23 -32
  39. package/cjs/yaml/schemas/Tag.cjs +16 -7
  40. package/cjs/yaml/schemas/failsafe/GenericMapping.cjs +7 -19
  41. package/cjs/yaml/schemas/failsafe/GenericSequence.cjs +7 -19
  42. package/cjs/yaml/schemas/failsafe/GenericString.cjs +3 -16
  43. package/cjs/yaml/schemas/failsafe/index.cjs +81 -87
  44. package/cjs/yaml/schemas/json/Boolean.cjs +13 -21
  45. package/cjs/yaml/schemas/json/FloatingPoint.cjs +13 -21
  46. package/cjs/yaml/schemas/json/Integer.cjs +13 -21
  47. package/cjs/yaml/schemas/json/Null.cjs +12 -20
  48. package/cjs/yaml/schemas/json/index.cjs +20 -26
  49. package/dist/apidom-ast.browser.js +577 -893
  50. package/dist/apidom-ast.browser.min.js +1 -1
  51. package/es/Error.mjs +10 -13
  52. package/es/Literal.mjs +9 -11
  53. package/es/Node.mjs +23 -31
  54. package/es/ParseResult.mjs +5 -12
  55. package/es/Position.mjs +19 -31
  56. package/es/json/nodes/JsonArray.mjs +5 -11
  57. package/es/json/nodes/JsonDocument.mjs +5 -12
  58. package/es/json/nodes/JsonEscapeSequence.mjs +3 -6
  59. package/es/json/nodes/JsonFalse.mjs +3 -6
  60. package/es/json/nodes/JsonKey.mjs +3 -6
  61. package/es/json/nodes/JsonNode.mjs +1 -2
  62. package/es/json/nodes/JsonNull.mjs +3 -6
  63. package/es/json/nodes/JsonNumber.mjs +3 -6
  64. package/es/json/nodes/JsonObject.mjs +5 -11
  65. package/es/json/nodes/JsonProperty.mjs +8 -17
  66. package/es/json/nodes/JsonString.mjs +8 -16
  67. package/es/json/nodes/JsonStringContent.mjs +3 -6
  68. package/es/json/nodes/JsonTrue.mjs +3 -6
  69. package/es/json/nodes/JsonValue.mjs +10 -12
  70. package/es/json/nodes/predicates.mjs +12 -12
  71. package/es/predicates.mjs +5 -5
  72. package/es/yaml/nodes/YamlAlias.mjs +10 -12
  73. package/es/yaml/nodes/YamlAnchor.mjs +10 -12
  74. package/es/yaml/nodes/YamlCollection.mjs +1 -2
  75. package/es/yaml/nodes/YamlComment.mjs +10 -12
  76. package/es/yaml/nodes/YamlDirective.mjs +14 -17
  77. package/es/yaml/nodes/YamlDocument.mjs +3 -6
  78. package/es/yaml/nodes/YamlKeyValuePair.mjs +28 -27
  79. package/es/yaml/nodes/YamlMapping.mjs +7 -13
  80. package/es/yaml/nodes/YamlNode.mjs +12 -15
  81. package/es/yaml/nodes/YamlScalar.mjs +10 -12
  82. package/es/yaml/nodes/YamlSequence.mjs +10 -16
  83. package/es/yaml/nodes/YamlStream.mjs +7 -15
  84. package/es/yaml/nodes/YamlStyle.mjs +1 -9
  85. package/es/yaml/nodes/YamlTag.mjs +10 -13
  86. package/es/yaml/nodes/predicates.mjs +10 -10
  87. package/es/yaml/schemas/ScalarTag.mjs +23 -31
  88. package/es/yaml/schemas/Tag.mjs +17 -6
  89. package/es/yaml/schemas/failsafe/GenericMapping.mjs +8 -19
  90. package/es/yaml/schemas/failsafe/GenericSequence.mjs +8 -19
  91. package/es/yaml/schemas/failsafe/GenericString.mjs +3 -16
  92. package/es/yaml/schemas/failsafe/index.mjs +84 -90
  93. package/es/yaml/schemas/json/Boolean.mjs +14 -21
  94. package/es/yaml/schemas/json/FloatingPoint.mjs +14 -21
  95. package/es/yaml/schemas/json/Integer.mjs +14 -21
  96. package/es/yaml/schemas/json/Null.mjs +13 -20
  97. package/es/yaml/schemas/json/index.mjs +24 -30
  98. package/package.json +3 -4
  99. package/types/dist.d.ts +222 -157
package/types/dist.d.ts CHANGED
@@ -1,115 +1,158 @@
1
- import stampit from 'stampit';
2
1
  import { ApiDOMStructuredError, ApiDOMErrorOptions } from '@swagger-api/apidom-error';
3
2
 
4
- interface Point {
5
- type: 'point';
6
- row: number | null;
7
- column: number | null;
8
- char: number | null;
3
+ interface PointOptions {
4
+ readonly row: number;
5
+ readonly column: number;
6
+ readonly char: number;
9
7
  }
10
- declare const Point: stampit.Stamp<Point>;
11
- interface Position extends Node {
12
- type: 'position';
13
- start: Point | null;
14
- end: Point | null;
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);
15
26
  }
16
- declare const Position: stampit.Stamp<Position>;
17
27
 
18
- interface Node$1 {
19
- type: string | null;
20
- isMissing: boolean;
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;
21
37
  children: unknown[];
22
- position: Position | null;
38
+ position?: Position;
39
+ constructor({ children, position, isMissing }?: NodeOptions);
40
+ clone(): Node;
23
41
  }
24
- declare const Node$1: stampit.Stamp<Node$1>;
25
-
26
- type JsonNode = Node$1;
27
- declare const JsonNode: stampit.Stamp<JsonNode>;
28
42
 
29
- interface JsonDocument extends JsonNode {
30
- child: unknown | null;
43
+ declare class JsonNode extends Node {
31
44
  }
32
- declare const JsonDocument: stampit.Stamp<JsonDocument>;
33
45
 
34
- type JsonObject = JsonNode;
35
- declare const JsonObject: stampit.Stamp<JsonObject>;
46
+ declare class JsonDocument extends JsonNode {
47
+ static readonly type = "document";
48
+ get child(): unknown;
49
+ }
36
50
 
37
- interface JsonString extends JsonNode {
38
- value: string;
51
+ declare class JsonString extends JsonNode {
52
+ static readonly type: string;
53
+ get value(): string;
39
54
  }
40
- declare const JsonString: stampit.Stamp<JsonString>;
41
55
 
42
- type JsonKey = JsonString;
43
- declare const JsonKey: stampit.Stamp<JsonKey>;
56
+ declare class JsonKey extends JsonString {
57
+ static readonly type = "key";
58
+ }
44
59
 
45
- interface JsonProperty extends JsonNode {
46
- key: JsonKey;
47
- value: unknown;
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);
48
67
  }
49
- declare const JsonProperty: stampit.Stamp<JsonProperty>;
50
68
 
51
- type JsonArray = JsonNode;
52
- declare const JsonArray: stampit.Stamp<JsonArray>;
69
+ declare class JsonFalse extends JsonValue$1 {
70
+ static readonly type = "false";
71
+ }
53
72
 
54
- interface JsonValue extends JsonNode {
55
- value: unknown;
73
+ declare class JsonTrue extends JsonValue$1 {
74
+ static readonly type = "true";
56
75
  }
57
- declare const JsonValue: stampit.Stamp<JsonValue>;
58
76
 
59
- type JsonStringContent = JsonValue;
60
- declare const JsonStringContent: stampit.Stamp<JsonStringContent>;
77
+ declare class JsonNull extends JsonValue$1 {
78
+ static readonly type = "null";
79
+ }
61
80
 
62
- type JsonEscapeSequence = JsonValue;
63
- declare const JsonEscapeSequence: stampit.Stamp<JsonEscapeSequence>;
81
+ declare class JsonNumber extends JsonValue$1 {
82
+ static readonly type = "number";
83
+ }
64
84
 
65
- type JsonNumber = JsonValue;
66
- declare const JsonNumber: stampit.Stamp<JsonNumber>;
85
+ declare class JsonArray extends JsonNode {
86
+ static readonly type = "array";
87
+ get items(): unknown[];
88
+ }
67
89
 
68
- type JsonTrue = JsonValue;
69
- declare const JsonTrue: stampit.Stamp<JsonTrue>;
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
+ }
70
96
 
71
- type JsonFalse = JsonValue;
72
- declare const JsonFalse: stampit.Stamp<JsonFalse>;
97
+ declare class JsonObject extends JsonNode {
98
+ static readonly type = "object";
99
+ get properties(): Array<JsonProperty>;
100
+ }
73
101
 
74
- type JsonNull = JsonValue;
75
- declare const JsonNull: stampit.Stamp<JsonNull>;
102
+ declare class JsonStringContent extends JsonValue$1 {
103
+ static readonly type = "stringContent";
104
+ }
76
105
 
77
- declare const isDocument$1: (node: any) => boolean;
78
- declare const isString: (node: any) => boolean;
79
- declare const isFalse: (node: any) => boolean;
80
- declare const isTrue: (node: any) => boolean;
81
- declare const isNull: (node: any) => boolean;
82
- declare const isNumber: (node: any) => boolean;
83
- declare const isArray: (node: any) => boolean;
84
- declare const isObject: (node: any) => boolean;
85
- declare const isStringContent: (node: any) => boolean;
86
- declare const isEscapeSequence: (node: any) => boolean;
87
- declare const isProperty: (node: any) => boolean;
88
- declare const isKey: (node: any) => boolean;
106
+ declare class JsonEscapeSequence extends JsonValue$1 {
107
+ static readonly type = "escapeSequence";
108
+ }
89
109
 
90
- interface YamlAlias extends Node$1 {
91
- type: 'alias';
92
- content: string | null;
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);
93
130
  }
94
- declare const YamlAlias: stampit.Stamp<YamlAlias>;
95
131
 
96
132
  declare enum YamlNodeKind {
97
133
  Scalar = "Scalar",
98
134
  Sequence = "Sequence",
99
135
  Mapping = "Mapping"
100
136
  }
101
- interface YamlTag extends Node$1 {
102
- type: 'tag';
103
- explicitName: string;
104
- kind: YamlNodeKind;
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);
105
146
  }
106
- declare const YamlTag: stampit.Stamp<YamlTag>;
107
147
 
108
- interface YamlAnchor extends Node$1 {
109
- type: 'anchor';
110
- name: string | null;
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);
111
155
  }
112
- declare const YamlAnchor: stampit.Stamp<YamlAnchor>;
113
156
 
114
157
  declare enum YamlStyle {
115
158
  Plain = "Plain",
@@ -126,98 +169,113 @@ declare enum YamlStyleGroup {
126
169
  Flow = "Flow",
127
170
  Block = "Block"
128
171
  }
129
- interface YamlStyleModel {
130
- styleGroup: YamlStyleGroup | null;
131
- style: YamlStyle | null;
132
- }
133
- declare const YamlStyleModel: stampit.Stamp<YamlStyleModel>;
134
172
 
135
- interface YamlNode extends Node$1 {
136
- anchor: YamlAnchor | null;
137
- tag: YamlTag | null;
138
- style: YamlStyle;
139
- styleGroup: YamlStyleGroup;
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);
140
185
  }
141
- declare const YamlNode: stampit.Stamp<YamlNode>;
142
186
 
143
- type YamlCollection = YamlNode;
144
- declare const YamlCollection: stampit.Stamp<YamlCollection>;
187
+ declare class YamlCollection extends YamlNode {
188
+ }
145
189
 
146
- interface YamlComment extends Node$1 {
147
- type: 'comment';
148
- content: string | null;
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);
149
197
  }
150
- declare const YamlComment: stampit.Stamp<YamlComment>;
151
198
 
152
199
  interface YamlDirectiveParameters {
153
- version: string | null;
154
- handle: string | null;
155
- prefix: string | null;
200
+ readonly version?: string;
201
+ readonly handle?: string;
202
+ readonly prefix?: string;
156
203
  }
157
- interface YamlDirective extends Node$1 {
158
- type: 'directive';
159
- name: string | null;
160
- parameters: YamlDirectiveParameters;
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);
161
213
  }
162
- declare const YamlDirective: stampit.Stamp<YamlDirective>;
163
214
 
164
- interface YamlDocument extends Node$1 {
165
- type: 'document';
215
+ declare class YamlDocument extends Node {
216
+ static readonly type = "document";
166
217
  }
167
- declare const YamlDocument: stampit.Stamp<YamlDocument>;
168
218
 
169
- interface YamlScalar extends YamlNode {
170
- type: 'scalar';
171
- format: string | null;
172
- text: string;
173
- readonly content: string | null;
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);
174
226
  }
175
- declare const YamlScalar: stampit.Stamp<YamlScalar>;
176
227
 
177
- interface YamlKeyValuePair extends Node$1, YamlStyleModel {
178
- type: 'keyValuePair';
179
- readonly key: YamlScalar;
180
- readonly value: any;
228
+ declare class YamlMapping extends YamlCollection {
229
+ static readonly type = "mapping";
181
230
  }
182
- declare const YamlKeyValuePair: stampit.Stamp<YamlKeyValuePair>;
183
231
 
184
- interface YamlMapping extends YamlCollection {
185
- type: 'mapping';
186
- readonly content: Array<YamlKeyValuePair>;
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);
187
239
  }
188
- declare const YamlMapping: stampit.Stamp<YamlMapping>;
189
240
 
190
- interface YamlSequence extends YamlCollection {
191
- type: 'sequence';
192
- readonly content: Array<YamlSequence | YamlMapping | YamlScalar | YamlAlias>;
241
+ declare class YamlSequence extends YamlCollection {
242
+ static readonly type = "sequence";
193
243
  }
194
- declare const YamlSequence: stampit.Stamp<YamlSequence>;
195
244
 
196
- interface YamlStream extends Node$1 {
197
- type: 'stream';
198
- readonly content: Array<YamlDocument | YamlComment>;
199
- children: Array<YamlDocument>;
245
+ declare class YamlStream extends Node {
246
+ static readonly type = "stream";
200
247
  }
201
- declare const YamlStream: stampit.Stamp<YamlStream>;
202
248
 
203
- declare const FailsafeSchema: stampit.Stamp<any>;
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
+ }
204
259
 
205
- declare const JsonSchema: stampit.Stamp<any>;
260
+ declare class JsonSchema extends FailsafeSchema {
261
+ constructor();
262
+ toSpecificTagName(node: any): any;
263
+ }
206
264
 
207
- declare const isStream: (node: any) => boolean;
208
- declare const isDocument: (node: any) => boolean;
209
- declare const isMapping: (node: any) => boolean;
210
- declare const isSequence: (node: any) => boolean;
211
- declare const isKeyValuePair: (node: any) => boolean;
212
- declare const isTag: (node: any) => boolean;
213
- declare const isScalar: (node: any) => boolean;
214
- declare const isAlias: (node: any) => boolean;
215
- declare const isDirective: (node: any) => boolean;
265
+ declare const isStream: (node: unknown) => node is YamlStream;
266
+ declare const isDocument: (node: unknown) => node is YamlDocument;
267
+ declare const isMapping: (node: unknown) => node is YamlMapping;
268
+ declare const isSequence: (node: unknown) => node is YamlSequence;
269
+ declare const isKeyValuePair: (node: unknown) => node is YamlKeyValuePair;
270
+ declare const isTag: (node: unknown) => node is YamlTag;
271
+ declare const isScalar: (node: unknown) => node is YamlScalar;
272
+ declare const isAlias: (node: unknown) => node is YamlAlias;
273
+ declare const isDirective: (node: unknown) => node is YamlDirective;
216
274
 
217
275
  declare class YamlSchemaError extends ApiDOMStructuredError {
218
276
  }
219
277
 
220
- interface YamlTagErrorOptions<T extends Node$1 = Node$1> extends ApiDOMErrorOptions {
278
+ interface YamlTagErrorOptions<T extends Node = Node> extends ApiDOMErrorOptions {
221
279
  readonly specificTagName: string;
222
280
  readonly explicitTagName: string;
223
281
  readonly tagKind: string;
@@ -235,28 +293,35 @@ declare class YamlTagError extends YamlSchemaError {
235
293
  constructor(message?: string, structuredOptions?: YamlTagErrorOptions);
236
294
  }
237
295
 
238
- interface Literal extends Node$1 {
239
- type: 'literal';
240
- value: unknown;
296
+ interface LiteralOptions extends NodeOptions {
297
+ readonly value?: unknown;
298
+ }
299
+ declare class Literal extends Node {
300
+ static readonly type: string;
301
+ readonly value: unknown;
302
+ constructor({ value, ...rest }?: LiteralOptions);
241
303
  }
242
- declare const Literal: stampit.Stamp<Literal>;
243
304
 
244
- interface Error extends Node$1 {
245
- value: unknown;
246
- isUnexpected: boolean;
305
+ interface ErrorOptions extends NodeOptions {
306
+ readonly value?: unknown;
307
+ readonly isUnexpected?: boolean;
308
+ }
309
+ declare class Error extends Node {
310
+ static readonly type: string;
311
+ readonly value: unknown;
312
+ readonly isUnexpected: boolean;
313
+ constructor({ value, isUnexpected, ...rest }?: ErrorOptions);
247
314
  }
248
- declare const Error: stampit.Stamp<Error>;
249
315
 
250
- interface ParseResult extends Node$1 {
251
- type: 'parseResult';
252
- rootNode: unknown;
316
+ declare class ParseResult extends Node {
317
+ static readonly type: string;
318
+ get rootNode(): unknown;
253
319
  }
254
- declare const ParseResult: stampit.Stamp<ParseResult>;
255
320
 
256
- declare const isLiteral: (node: any) => boolean;
257
- declare const isPosition: (node: any) => boolean;
258
- declare const isPoint: (node: any) => boolean;
259
- declare const isParseResult: (node: any) => boolean;
321
+ declare const isLiteral: (node: unknown) => node is Literal;
322
+ declare const isPosition: (node: unknown) => node is Position;
323
+ declare const isPoint: (node: unknown) => node is Point;
324
+ declare const isParseResult: (node: unknown) => node is ParseResult;
260
325
 
261
326
  /**
262
327
  * SPDX-FileCopyrightText: Copyright (c) GraphQL Contributors
@@ -388,4 +453,4 @@ declare const visit: (root: any, visitor: any, { keyMap, state, breakSymbol, del
388
453
  detectCycles?: boolean | undefined;
389
454
  }) => any;
390
455
 
391
- export { BREAK, Error, JsonArray, JsonDocument, JsonEscapeSequence, JsonFalse, JsonKey, JsonNode, JsonNull, JsonNumber, JsonObject, JsonProperty, JsonString, JsonStringContent, JsonTrue, JsonValue, Literal, ParseResult, Point, Position, YamlAlias, YamlAnchor, YamlCollection, YamlComment, YamlDirective, YamlDocument, FailsafeSchema as YamlFailsafeSchema, JsonSchema as YamlJsonSchema, YamlKeyValuePair, YamlMapping, YamlNode, YamlNodeKind, 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, 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 };
456
+ export { BREAK, Error, JsonArray, JsonDocument, JsonEscapeSequence, JsonFalse, JsonKey, JsonNode, JsonNull, JsonNumber, JsonObject, JsonProperty, JsonString, JsonStringContent, JsonTrue, JsonValue$1 as JsonValue, Literal, ParseResult, Point, Position, YamlAlias, YamlAnchor, YamlCollection, YamlComment, YamlDirective, YamlDocument, FailsafeSchema as YamlFailsafeSchema, JsonSchema as YamlJsonSchema, YamlKeyValuePair, YamlMapping, YamlNode, YamlNodeKind, 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, 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 };