@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.
- package/CHANGELOG.md +10 -0
- package/cjs/Error.cjs +12 -13
- package/cjs/Literal.cjs +10 -11
- package/cjs/Node.cjs +26 -32
- package/cjs/ParseResult.cjs +5 -12
- package/cjs/Position.cjs +25 -32
- package/cjs/index.cjs +9 -1
- package/cjs/json/nodes/JsonArray.cjs +5 -11
- package/cjs/json/nodes/JsonDocument.cjs +5 -12
- package/cjs/json/nodes/JsonEscapeSequence.cjs +3 -6
- package/cjs/json/nodes/JsonFalse.cjs +3 -6
- package/cjs/json/nodes/JsonKey.cjs +3 -6
- package/cjs/json/nodes/JsonNode.cjs +1 -2
- package/cjs/json/nodes/JsonNull.cjs +3 -6
- package/cjs/json/nodes/JsonNumber.cjs +3 -6
- package/cjs/json/nodes/JsonObject.cjs +5 -11
- package/cjs/json/nodes/JsonProperty.cjs +8 -17
- package/cjs/json/nodes/JsonString.cjs +8 -16
- package/cjs/json/nodes/JsonStringContent.cjs +3 -6
- package/cjs/json/nodes/JsonTrue.cjs +3 -6
- package/cjs/json/nodes/JsonValue.cjs +11 -12
- package/cjs/json/nodes/predicates.cjs +24 -12
- package/cjs/predicates.cjs +9 -5
- package/cjs/yaml/anchors-aliases/ReferenceManager.cjs +28 -0
- package/cjs/yaml/errors/YamlError.cjs +7 -0
- package/cjs/yaml/errors/YamlReferenceError.cjs +8 -0
- package/cjs/yaml/errors/YamlSchemaError.cjs +3 -2
- package/cjs/yaml/errors/YamlTagError.cjs +6 -0
- package/cjs/yaml/nodes/YamlAlias.cjs +11 -12
- package/cjs/yaml/nodes/YamlAnchor.cjs +11 -12
- package/cjs/yaml/nodes/YamlCollection.cjs +1 -2
- package/cjs/yaml/nodes/YamlComment.cjs +11 -12
- package/cjs/yaml/nodes/YamlDirective.cjs +16 -17
- package/cjs/yaml/nodes/YamlDocument.cjs +3 -6
- package/cjs/yaml/nodes/YamlKeyValuePair.cjs +29 -27
- package/cjs/yaml/nodes/YamlMapping.cjs +7 -13
- package/cjs/yaml/nodes/YamlNode.cjs +16 -15
- package/cjs/yaml/nodes/YamlScalar.cjs +11 -12
- package/cjs/yaml/nodes/YamlSequence.cjs +10 -16
- package/cjs/yaml/nodes/YamlStream.cjs +7 -15
- package/cjs/yaml/nodes/YamlStyle.cjs +2 -11
- package/cjs/yaml/nodes/YamlTag.cjs +12 -13
- package/cjs/yaml/nodes/predicates.cjs +23 -11
- package/cjs/yaml/schemas/ScalarTag.cjs +23 -32
- package/cjs/yaml/schemas/Tag.cjs +16 -7
- package/cjs/yaml/schemas/failsafe/GenericMapping.cjs +7 -19
- package/cjs/yaml/schemas/failsafe/GenericSequence.cjs +7 -19
- package/cjs/yaml/schemas/failsafe/GenericString.cjs +3 -16
- package/cjs/yaml/schemas/failsafe/index.cjs +83 -87
- package/cjs/yaml/schemas/json/Boolean.cjs +13 -21
- package/cjs/yaml/schemas/json/FloatingPoint.cjs +13 -21
- package/cjs/yaml/schemas/json/Integer.cjs +13 -21
- package/cjs/yaml/schemas/json/Null.cjs +12 -20
- package/cjs/yaml/schemas/json/index.cjs +20 -26
- package/dist/apidom-ast.browser.js +1672 -1889
- package/dist/apidom-ast.browser.min.js +1 -1
- package/es/Error.mjs +12 -13
- package/es/Literal.mjs +10 -11
- package/es/Node.mjs +26 -31
- package/es/ParseResult.mjs +5 -12
- package/es/Position.mjs +24 -31
- package/es/index.mjs +4 -1
- package/es/json/nodes/JsonArray.mjs +5 -11
- package/es/json/nodes/JsonDocument.mjs +5 -12
- package/es/json/nodes/JsonEscapeSequence.mjs +3 -6
- package/es/json/nodes/JsonFalse.mjs +3 -6
- package/es/json/nodes/JsonKey.mjs +3 -6
- package/es/json/nodes/JsonNode.mjs +1 -2
- package/es/json/nodes/JsonNull.mjs +3 -6
- package/es/json/nodes/JsonNumber.mjs +3 -6
- package/es/json/nodes/JsonObject.mjs +5 -11
- package/es/json/nodes/JsonProperty.mjs +8 -17
- package/es/json/nodes/JsonString.mjs +8 -16
- package/es/json/nodes/JsonStringContent.mjs +3 -6
- package/es/json/nodes/JsonTrue.mjs +3 -6
- package/es/json/nodes/JsonValue.mjs +11 -12
- package/es/json/nodes/predicates.mjs +12 -12
- package/es/predicates.mjs +5 -5
- package/es/yaml/anchors-aliases/ReferenceManager.mjs +24 -0
- package/es/yaml/errors/YamlError.mjs +3 -0
- package/es/yaml/errors/YamlReferenceError.mjs +3 -0
- package/es/yaml/errors/YamlSchemaError.mjs +2 -2
- package/es/yaml/errors/YamlTagError.mjs +6 -0
- package/es/yaml/nodes/YamlAlias.mjs +11 -12
- package/es/yaml/nodes/YamlAnchor.mjs +11 -12
- package/es/yaml/nodes/YamlCollection.mjs +1 -2
- package/es/yaml/nodes/YamlComment.mjs +11 -12
- package/es/yaml/nodes/YamlDirective.mjs +16 -17
- package/es/yaml/nodes/YamlDocument.mjs +3 -6
- package/es/yaml/nodes/YamlKeyValuePair.mjs +29 -27
- package/es/yaml/nodes/YamlMapping.mjs +7 -13
- package/es/yaml/nodes/YamlNode.mjs +16 -15
- package/es/yaml/nodes/YamlScalar.mjs +11 -12
- package/es/yaml/nodes/YamlSequence.mjs +10 -16
- package/es/yaml/nodes/YamlStream.mjs +7 -15
- package/es/yaml/nodes/YamlStyle.mjs +1 -9
- package/es/yaml/nodes/YamlTag.mjs +12 -13
- package/es/yaml/nodes/predicates.mjs +11 -10
- package/es/yaml/schemas/ScalarTag.mjs +23 -31
- package/es/yaml/schemas/Tag.mjs +17 -6
- package/es/yaml/schemas/failsafe/GenericMapping.mjs +8 -19
- package/es/yaml/schemas/failsafe/GenericSequence.mjs +8 -19
- package/es/yaml/schemas/failsafe/GenericString.mjs +3 -16
- package/es/yaml/schemas/failsafe/index.mjs +86 -90
- package/es/yaml/schemas/json/Boolean.mjs +14 -21
- package/es/yaml/schemas/json/FloatingPoint.mjs +14 -21
- package/es/yaml/schemas/json/Integer.mjs +14 -21
- package/es/yaml/schemas/json/Null.mjs +13 -20
- package/es/yaml/schemas/json/index.mjs +24 -30
- package/package.json +3 -4
- 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
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
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
|
-
|
11
|
-
|
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(
|
16
|
-
this.registerTag(
|
17
|
-
this.registerTag(
|
18
|
-
this.registerTag(
|
19
|
-
}
|
20
|
-
|
21
|
-
toSpecificTagName(node)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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.
|
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.
|
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": "
|
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
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
char: number | null;
|
3
|
+
interface PointOptions {
|
4
|
+
readonly row: number;
|
5
|
+
readonly column: number;
|
6
|
+
readonly char: number;
|
9
7
|
}
|
10
|
-
declare
|
11
|
-
|
12
|
-
type:
|
13
|
-
|
14
|
-
|
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
|
19
|
-
|
20
|
-
|
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
|
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
|
-
|
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
|
-
|
35
|
-
|
46
|
+
declare class JsonDocument extends JsonNode {
|
47
|
+
static readonly type = "document";
|
48
|
+
get child(): unknown;
|
49
|
+
}
|
36
50
|
|
37
|
-
|
38
|
-
|
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
|
-
|
43
|
-
|
56
|
+
declare class JsonKey extends JsonString {
|
57
|
+
static readonly type = "key";
|
58
|
+
}
|
44
59
|
|
45
|
-
interface
|
46
|
-
|
47
|
-
|
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
|
-
|
52
|
-
|
69
|
+
declare class JsonFalse extends JsonValue$1 {
|
70
|
+
static readonly type = "false";
|
71
|
+
}
|
53
72
|
|
54
|
-
|
55
|
-
|
73
|
+
declare class JsonTrue extends JsonValue$1 {
|
74
|
+
static readonly type = "true";
|
56
75
|
}
|
57
|
-
declare const JsonValue: stampit.Stamp<JsonValue>;
|
58
76
|
|
59
|
-
|
60
|
-
|
77
|
+
declare class JsonNull extends JsonValue$1 {
|
78
|
+
static readonly type = "null";
|
79
|
+
}
|
61
80
|
|
62
|
-
|
63
|
-
|
81
|
+
declare class JsonNumber extends JsonValue$1 {
|
82
|
+
static readonly type = "number";
|
83
|
+
}
|
64
84
|
|
65
|
-
|
66
|
-
|
85
|
+
declare class JsonArray extends JsonNode {
|
86
|
+
static readonly type = "array";
|
87
|
+
get items(): unknown[];
|
88
|
+
}
|
67
89
|
|
68
|
-
type
|
69
|
-
declare
|
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
|
-
|
72
|
-
|
97
|
+
declare class JsonObject extends JsonNode {
|
98
|
+
static readonly type = "object";
|
99
|
+
get properties(): Array<JsonProperty>;
|
100
|
+
}
|
73
101
|
|
74
|
-
|
75
|
-
|
102
|
+
declare class JsonStringContent extends JsonValue$1 {
|
103
|
+
static readonly type = "stringContent";
|
104
|
+
}
|
76
105
|
|
77
|
-
declare
|
78
|
-
|
79
|
-
|
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
|
-
|
91
|
-
|
92
|
-
|
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
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
109
|
-
|
110
|
-
|
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
|
136
|
-
anchor
|
137
|
-
tag
|
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
|
-
|
144
|
-
|
187
|
+
declare class YamlCollection extends YamlNode {
|
188
|
+
}
|
145
189
|
|
146
|
-
interface
|
147
|
-
|
148
|
-
|
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
|
154
|
-
handle
|
155
|
-
prefix
|
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
|
-
|
158
|
-
type
|
159
|
-
|
160
|
-
|
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
|
-
|
165
|
-
type
|
228
|
+
declare class YamlMapping extends YamlCollection {
|
229
|
+
static readonly type = "mapping";
|
166
230
|
}
|
167
|
-
declare const YamlDocument: stampit.Stamp<YamlDocument>;
|
168
231
|
|
169
|
-
interface
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
readonly
|
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
|
-
|
178
|
-
type
|
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
|
-
|
185
|
-
type
|
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
|
-
|
191
|
-
|
192
|
-
|
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
|
-
|
197
|
-
|
198
|
-
|
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
|
265
|
+
declare class ReferenceManager {
|
266
|
+
addAnchor(node: YamlNode): void;
|
267
|
+
resolveAlias(alias: YamlAlias): YamlScalar;
|
268
|
+
}
|
204
269
|
|
205
|
-
declare const
|
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
|
208
|
-
|
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
|
288
|
+
declare class YamlSchemaError extends YamlError {
|
218
289
|
}
|
219
290
|
|
220
|
-
interface YamlTagErrorOptions<T extends Node
|
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
|
239
|
-
|
240
|
-
|
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
|
245
|
-
value
|
246
|
-
isUnexpected
|
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
|
-
|
251
|
-
type:
|
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:
|
257
|
-
declare const isPosition: (node:
|
258
|
-
declare const isPoint: (node:
|
259
|
-
declare const isParseResult: (node:
|
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 };
|