@swagger-api/apidom-ast 0.92.0 → 0.94.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 (111) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cjs/Error.cjs +12 -13
  3. package/cjs/Literal.cjs +10 -11
  4. package/cjs/Node.cjs +26 -32
  5. package/cjs/ParseResult.cjs +5 -12
  6. package/cjs/Position.cjs +25 -32
  7. package/cjs/index.cjs +9 -1
  8. package/cjs/json/nodes/JsonArray.cjs +5 -11
  9. package/cjs/json/nodes/JsonDocument.cjs +5 -12
  10. package/cjs/json/nodes/JsonEscapeSequence.cjs +3 -6
  11. package/cjs/json/nodes/JsonFalse.cjs +3 -6
  12. package/cjs/json/nodes/JsonKey.cjs +3 -6
  13. package/cjs/json/nodes/JsonNode.cjs +1 -2
  14. package/cjs/json/nodes/JsonNull.cjs +3 -6
  15. package/cjs/json/nodes/JsonNumber.cjs +3 -6
  16. package/cjs/json/nodes/JsonObject.cjs +5 -11
  17. package/cjs/json/nodes/JsonProperty.cjs +8 -17
  18. package/cjs/json/nodes/JsonString.cjs +8 -16
  19. package/cjs/json/nodes/JsonStringContent.cjs +3 -6
  20. package/cjs/json/nodes/JsonTrue.cjs +3 -6
  21. package/cjs/json/nodes/JsonValue.cjs +11 -12
  22. package/cjs/json/nodes/predicates.cjs +24 -12
  23. package/cjs/predicates.cjs +9 -5
  24. package/cjs/yaml/anchors-aliases/ReferenceManager.cjs +28 -0
  25. package/cjs/yaml/errors/YamlError.cjs +7 -0
  26. package/cjs/yaml/errors/YamlReferenceError.cjs +8 -0
  27. package/cjs/yaml/errors/YamlSchemaError.cjs +3 -2
  28. package/cjs/yaml/errors/YamlTagError.cjs +6 -0
  29. package/cjs/yaml/nodes/YamlAlias.cjs +11 -12
  30. package/cjs/yaml/nodes/YamlAnchor.cjs +11 -12
  31. package/cjs/yaml/nodes/YamlCollection.cjs +1 -2
  32. package/cjs/yaml/nodes/YamlComment.cjs +11 -12
  33. package/cjs/yaml/nodes/YamlDirective.cjs +16 -17
  34. package/cjs/yaml/nodes/YamlDocument.cjs +3 -6
  35. package/cjs/yaml/nodes/YamlKeyValuePair.cjs +29 -27
  36. package/cjs/yaml/nodes/YamlMapping.cjs +7 -13
  37. package/cjs/yaml/nodes/YamlNode.cjs +16 -15
  38. package/cjs/yaml/nodes/YamlScalar.cjs +11 -12
  39. package/cjs/yaml/nodes/YamlSequence.cjs +10 -16
  40. package/cjs/yaml/nodes/YamlStream.cjs +7 -15
  41. package/cjs/yaml/nodes/YamlStyle.cjs +2 -11
  42. package/cjs/yaml/nodes/YamlTag.cjs +12 -13
  43. package/cjs/yaml/nodes/predicates.cjs +23 -11
  44. package/cjs/yaml/schemas/ScalarTag.cjs +23 -32
  45. package/cjs/yaml/schemas/Tag.cjs +16 -7
  46. package/cjs/yaml/schemas/failsafe/GenericMapping.cjs +7 -19
  47. package/cjs/yaml/schemas/failsafe/GenericSequence.cjs +7 -19
  48. package/cjs/yaml/schemas/failsafe/GenericString.cjs +3 -16
  49. package/cjs/yaml/schemas/failsafe/index.cjs +83 -87
  50. package/cjs/yaml/schemas/json/Boolean.cjs +13 -21
  51. package/cjs/yaml/schemas/json/FloatingPoint.cjs +13 -21
  52. package/cjs/yaml/schemas/json/Integer.cjs +13 -21
  53. package/cjs/yaml/schemas/json/Null.cjs +12 -20
  54. package/cjs/yaml/schemas/json/index.cjs +20 -26
  55. package/dist/apidom-ast.browser.js +1672 -1889
  56. package/dist/apidom-ast.browser.min.js +1 -1
  57. package/es/Error.mjs +12 -13
  58. package/es/Literal.mjs +10 -11
  59. package/es/Node.mjs +26 -31
  60. package/es/ParseResult.mjs +5 -12
  61. package/es/Position.mjs +24 -31
  62. package/es/index.mjs +4 -1
  63. package/es/json/nodes/JsonArray.mjs +5 -11
  64. package/es/json/nodes/JsonDocument.mjs +5 -12
  65. package/es/json/nodes/JsonEscapeSequence.mjs +3 -6
  66. package/es/json/nodes/JsonFalse.mjs +3 -6
  67. package/es/json/nodes/JsonKey.mjs +3 -6
  68. package/es/json/nodes/JsonNode.mjs +1 -2
  69. package/es/json/nodes/JsonNull.mjs +3 -6
  70. package/es/json/nodes/JsonNumber.mjs +3 -6
  71. package/es/json/nodes/JsonObject.mjs +5 -11
  72. package/es/json/nodes/JsonProperty.mjs +8 -17
  73. package/es/json/nodes/JsonString.mjs +8 -16
  74. package/es/json/nodes/JsonStringContent.mjs +3 -6
  75. package/es/json/nodes/JsonTrue.mjs +3 -6
  76. package/es/json/nodes/JsonValue.mjs +11 -12
  77. package/es/json/nodes/predicates.mjs +12 -12
  78. package/es/predicates.mjs +5 -5
  79. package/es/yaml/anchors-aliases/ReferenceManager.mjs +24 -0
  80. package/es/yaml/errors/YamlError.mjs +3 -0
  81. package/es/yaml/errors/YamlReferenceError.mjs +3 -0
  82. package/es/yaml/errors/YamlSchemaError.mjs +2 -2
  83. package/es/yaml/errors/YamlTagError.mjs +6 -0
  84. package/es/yaml/nodes/YamlAlias.mjs +11 -12
  85. package/es/yaml/nodes/YamlAnchor.mjs +11 -12
  86. package/es/yaml/nodes/YamlCollection.mjs +1 -2
  87. package/es/yaml/nodes/YamlComment.mjs +11 -12
  88. package/es/yaml/nodes/YamlDirective.mjs +16 -17
  89. package/es/yaml/nodes/YamlDocument.mjs +3 -6
  90. package/es/yaml/nodes/YamlKeyValuePair.mjs +29 -27
  91. package/es/yaml/nodes/YamlMapping.mjs +7 -13
  92. package/es/yaml/nodes/YamlNode.mjs +16 -15
  93. package/es/yaml/nodes/YamlScalar.mjs +11 -12
  94. package/es/yaml/nodes/YamlSequence.mjs +10 -16
  95. package/es/yaml/nodes/YamlStream.mjs +7 -15
  96. package/es/yaml/nodes/YamlStyle.mjs +1 -9
  97. package/es/yaml/nodes/YamlTag.mjs +12 -13
  98. package/es/yaml/nodes/predicates.mjs +11 -10
  99. package/es/yaml/schemas/ScalarTag.mjs +23 -31
  100. package/es/yaml/schemas/Tag.mjs +17 -6
  101. package/es/yaml/schemas/failsafe/GenericMapping.mjs +8 -19
  102. package/es/yaml/schemas/failsafe/GenericSequence.mjs +8 -19
  103. package/es/yaml/schemas/failsafe/GenericString.mjs +3 -16
  104. package/es/yaml/schemas/failsafe/index.mjs +86 -90
  105. package/es/yaml/schemas/json/Boolean.mjs +14 -21
  106. package/es/yaml/schemas/json/FloatingPoint.mjs +14 -21
  107. package/es/yaml/schemas/json/Integer.mjs +14 -21
  108. package/es/yaml/schemas/json/Null.mjs +13 -20
  109. package/es/yaml/schemas/json/index.mjs +24 -30
  110. package/package.json +3 -4
  111. package/types/dist.d.ts +236 -158
@@ -1,41 +1,35 @@
1
- import stampit from 'stampit';
2
1
  import FailsafeSchema from "../failsafe/index.mjs";
3
- import Boolean from "./Boolean.mjs";
4
- import FloatingPoint from "./FloatingPoint.mjs";
5
- import Integer from "./Integer.mjs";
6
- import Null from "./Null.mjs";
2
+ import BooleanTag from "./Boolean.mjs";
3
+ import FloatingPointTag from "./FloatingPoint.mjs";
4
+ import IntegerTag from "./Integer.mjs";
5
+ import NullTag from "./Null.mjs";
7
6
  import { YamlNodeKind } from "../../nodes/YamlTag.mjs";
8
7
  import GenericSequence from "../failsafe/GenericSequence.mjs";
9
8
  import GenericMapping from "../failsafe/GenericMapping.mjs";
10
- const JsonSchema = stampit(FailsafeSchema, {
11
- init() {
9
+ class JsonSchema extends FailsafeSchema {
10
+ constructor() {
11
+ super();
12
12
  /**
13
13
  * We're registering more specific tags before more generic ones from Failsafe schema.
14
14
  */
15
- this.registerTag(Boolean(), true);
16
- this.registerTag(FloatingPoint(), true);
17
- this.registerTag(Integer(), true);
18
- this.registerTag(Null(), true);
19
- },
20
- methods: {
21
- toSpecificTagName(node) {
22
- // @ts-ignore
23
- let specificTagName = FailsafeSchema.compose.methods.toSpecificTagName.call(this, node);
24
- if (specificTagName === '?') {
25
- if (node.tag.vkind === YamlNodeKind.Sequence) {
26
- // @ts-ignore
27
- specificTagName = GenericSequence.uri;
28
- } else if (node.tag.kind === YamlNodeKind.Mapping) {
29
- // @ts-ignore
30
- specificTagName = GenericMapping.uri;
31
- } else if (node.tag.kind === YamlNodeKind.Scalar) {
32
- // @ts-ignore
33
- const foundTag = this.tags.find(tag => tag.test(node));
34
- specificTagName = (foundTag === null || foundTag === void 0 ? void 0 : foundTag.tag) || '?';
35
- }
15
+ this.registerTag(new BooleanTag(), true);
16
+ this.registerTag(new FloatingPointTag(), true);
17
+ this.registerTag(new IntegerTag(), true);
18
+ this.registerTag(new NullTag(), true);
19
+ }
20
+ toSpecificTagName(node) {
21
+ let specificTagName = super.toSpecificTagName(node);
22
+ if (specificTagName === '?') {
23
+ if (node.tag.vkind === YamlNodeKind.Sequence) {
24
+ specificTagName = GenericSequence.uri;
25
+ } else if (node.tag.kind === YamlNodeKind.Mapping) {
26
+ specificTagName = GenericMapping.uri;
27
+ } else if (node.tag.kind === YamlNodeKind.Scalar) {
28
+ const foundTag = this.tags.find(tag => tag.test(node));
29
+ specificTagName = (foundTag === null || foundTag === void 0 ? void 0 : foundTag.tag) || '?';
36
30
  }
37
- return specificTagName;
38
31
  }
32
+ return specificTagName;
39
33
  }
40
- });
34
+ }
41
35
  export default JsonSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-ast",
3
- "version": "0.92.0",
3
+ "version": "0.94.0",
4
4
  "description": "Tools necessary for parsing stage of ApiDOM, specifically for syntactic analysis.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -42,11 +42,10 @@
42
42
  "homepage": "https://github.com/swagger-api/apidom#readme",
43
43
  "dependencies": {
44
44
  "@babel/runtime-corejs3": "^7.20.7",
45
- "@swagger-api/apidom-error": "^0.92.0",
45
+ "@swagger-api/apidom-error": "^0.94.0",
46
46
  "@types/ramda": "~0.29.6",
47
47
  "ramda": "~0.29.1",
48
48
  "ramda-adjunct": "^4.1.1",
49
- "stampit": "^4.3.2",
50
49
  "unraw": "^3.0.0"
51
50
  },
52
51
  "files": [
@@ -59,5 +58,5 @@
59
58
  "README.md",
60
59
  "CHANGELOG.md"
61
60
  ],
62
- "gitHead": "c7a45ee8d68ac82ac2ab93ebb639a95ced1d6e86"
61
+ "gitHead": "ad476d69176bc6246acad271c435fe3cfcdcd52c"
63
62
  }
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
42
 
26
- type JsonNode = Node$1;
27
- declare const JsonNode: stampit.Stamp<JsonNode>;
28
-
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,126 @@ 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;
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;
156
221
  }
157
- interface YamlDirective extends Node$1 {
158
- type: 'directive';
159
- name: string | null;
160
- parameters: YamlDirectiveParameters;
222
+ declare class YamlKeyValuePair extends Node {
223
+ static readonly type = "keyValuePair";
224
+ readonly styleGroup: YamlStyleGroup;
225
+ constructor({ styleGroup, ...rest }: YamlKeyValuePairOptions);
161
226
  }
162
- declare const YamlDirective: stampit.Stamp<YamlDirective>;
163
227
 
164
- interface YamlDocument extends Node$1 {
165
- type: 'document';
228
+ declare class YamlMapping extends YamlCollection {
229
+ static readonly type = "mapping";
166
230
  }
167
- declare const YamlDocument: stampit.Stamp<YamlDocument>;
168
231
 
169
- interface YamlScalar extends YamlNode {
170
- type: 'scalar';
171
- format: string | null;
172
- text: string;
173
- readonly content: string | null;
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);
174
239
  }
175
- declare const YamlScalar: stampit.Stamp<YamlScalar>;
176
240
 
177
- interface YamlKeyValuePair extends Node$1, YamlStyleModel {
178
- type: 'keyValuePair';
179
- readonly key: YamlScalar;
180
- readonly value: any;
241
+ declare class YamlSequence extends YamlCollection {
242
+ static readonly type = "sequence";
181
243
  }
182
- declare const YamlKeyValuePair: stampit.Stamp<YamlKeyValuePair>;
183
244
 
184
- interface YamlMapping extends YamlCollection {
185
- type: 'mapping';
186
- readonly content: Array<YamlKeyValuePair>;
245
+ declare class YamlStream extends Node {
246
+ static readonly type = "stream";
187
247
  }
188
- declare const YamlMapping: stampit.Stamp<YamlMapping>;
189
248
 
190
- interface YamlSequence extends YamlCollection {
191
- type: 'sequence';
192
- readonly content: Array<YamlSequence | YamlMapping | YamlScalar | YamlAlias>;
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;
193
258
  }
194
- declare const YamlSequence: stampit.Stamp<YamlSequence>;
195
259
 
196
- interface YamlStream extends Node$1 {
197
- type: 'stream';
198
- readonly content: Array<YamlDocument | YamlComment>;
199
- children: Array<YamlDocument>;
260
+ declare class JsonSchema extends FailsafeSchema {
261
+ constructor();
262
+ toSpecificTagName(node: any): any;
200
263
  }
201
- declare const YamlStream: stampit.Stamp<YamlStream>;
202
264
 
203
- declare const FailsafeSchema: stampit.Stamp<any>;
265
+ declare class ReferenceManager {
266
+ addAnchor(node: YamlNode): void;
267
+ resolveAlias(alias: YamlAlias): YamlScalar;
268
+ }
204
269
 
205
- declare const JsonSchema: stampit.Stamp<any>;
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
+ }
206
284
 
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;
285
+ declare class YamlReferenceError extends YamlError {
286
+ }
216
287
 
217
- declare class YamlSchemaError extends ApiDOMStructuredError {
288
+ declare class YamlSchemaError extends YamlError {
218
289
  }
219
290
 
220
- interface YamlTagErrorOptions<T extends Node$1 = Node$1> extends ApiDOMErrorOptions {
291
+ interface YamlTagErrorOptions<T extends Node = Node> extends ApiDOMErrorOptions {
221
292
  readonly specificTagName: string;
222
293
  readonly explicitTagName: string;
223
294
  readonly tagKind: string;
@@ -235,28 +306,35 @@ declare class YamlTagError extends YamlSchemaError {
235
306
  constructor(message?: string, structuredOptions?: YamlTagErrorOptions);
236
307
  }
237
308
 
238
- interface Literal extends Node$1 {
239
- type: 'literal';
240
- value: unknown;
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);
241
316
  }
242
- declare const Literal: stampit.Stamp<Literal>;
243
317
 
244
- interface Error extends Node$1 {
245
- value: unknown;
246
- isUnexpected: boolean;
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);
247
327
  }
248
- declare const Error: stampit.Stamp<Error>;
249
328
 
250
- interface ParseResult extends Node$1 {
251
- type: 'parseResult';
252
- rootNode: unknown;
329
+ declare class ParseResult extends Node {
330
+ static readonly type: string;
331
+ get rootNode(): unknown;
253
332
  }
254
- declare const ParseResult: stampit.Stamp<ParseResult>;
255
333
 
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;
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;
260
338
 
261
339
  /**
262
340
  * SPDX-FileCopyrightText: Copyright (c) GraphQL Contributors
@@ -388,4 +466,4 @@ declare const visit: (root: any, visitor: any, { keyMap, state, breakSymbol, del
388
466
  detectCycles?: boolean | undefined;
389
467
  }) => any;
390
468
 
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 };
469
+ 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, 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 };