@alloy-js/json 0.16.0 → 0.17.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 +4 -0
- package/dist/src/components/JsonArray.d.ts.map +1 -1
- package/dist/src/components/JsonArray.js +4 -6
- package/dist/src/components/JsonObject.d.ts.map +1 -1
- package/dist/src/components/JsonObject.js +4 -6
- package/dist/src/components/JsonValue.d.ts +1 -1
- package/dist/src/components/JsonValue.d.ts.map +1 -1
- package/dist/src/components/Reference.d.ts +1 -1
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +2 -4
- package/dist/src/components/stc/index.d.ts +8 -7
- package/dist/src/components/stc/index.d.ts.map +1 -1
- package/dist/src/components/stc/index.js +8 -8
- package/dist/src/symbols/json-symbol.d.ts +7 -7
- package/dist/src/symbols/json-symbol.d.ts.map +1 -1
- package/dist/src/symbols/json-symbol.js +17 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/JsonArray.tsx +5 -6
- package/src/components/JsonObject.tsx +5 -6
- package/src/components/SourceFile.tsx +2 -4
- package/src/components/stc/index.ts +8 -8
- package/src/symbols/json-symbol.ts +25 -44
- package/temp/api.json +75 -140
- package/tsdoc-metadata.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CreateSymbolOptions,
|
|
3
|
-
OutputScope,
|
|
4
2
|
OutputSymbol,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
OutputSymbolOptions,
|
|
4
|
+
track,
|
|
5
|
+
TrackOpTypes,
|
|
6
|
+
trigger,
|
|
7
|
+
TriggerOpTypes,
|
|
8
8
|
} from "@alloy-js/core";
|
|
9
9
|
|
|
10
10
|
// prettier-ignore
|
|
@@ -20,49 +20,30 @@ export enum JsonSymbolFlags {
|
|
|
20
20
|
* values that are members of an object or an array, the symbol will have the
|
|
21
21
|
* `StaticMember` flag.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
jsonFlags: JsonSymbolFlags
|
|
26
|
-
|
|
23
|
+
export class JsonOutputSymbol extends OutputSymbol {
|
|
24
|
+
#jsonFlags: JsonSymbolFlags;
|
|
25
|
+
get jsonFlags(): JsonSymbolFlags {
|
|
26
|
+
track(this, TrackOpTypes.GET, "jsonFlags");
|
|
27
|
+
return this.#jsonFlags;
|
|
28
|
+
}
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
set jsonFlags(value: JsonSymbolFlags) {
|
|
31
|
+
const old = this.#jsonFlags;
|
|
32
|
+
if (old === value) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const scope =
|
|
36
|
-
options.scope ??
|
|
37
|
-
(useDefaultScope(options.flags) as OutputScope) ??
|
|
38
|
-
useBinder().globalScope;
|
|
36
|
+
this.#jsonFlags = value;
|
|
37
|
+
trigger(this, TriggerOpTypes.SET, "jsonFlags", value, old);
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
name: options.name,
|
|
43
|
-
scope,
|
|
44
|
-
refkey: options.refkey,
|
|
45
|
-
flags: options.flags ?? OutputSymbolFlags.None,
|
|
46
|
-
jsonFlags: options.jsonFlags ?? JsonSymbolFlags.None,
|
|
47
|
-
});
|
|
40
|
+
constructor(name: string, options: CreateJsonSymbolOptions = {}) {
|
|
41
|
+
super(name, options);
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
this.#jsonFlags = options.jsonFlags ?? JsonSymbolFlags.None;
|
|
44
|
+
}
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
) {
|
|
55
|
-
if ((flags & OutputSymbolFlags.Member) === 0) {
|
|
56
|
-
return useBinder().globalScope;
|
|
57
|
-
} else {
|
|
58
|
-
const memberScope = useMemberScope();
|
|
59
|
-
if (!memberScope) {
|
|
60
|
-
throw new Error("Cannot declare member symbols without a member scope");
|
|
61
|
-
}
|
|
62
|
-
if (flags & OutputSymbolFlags.InstanceMember) {
|
|
63
|
-
return memberScope.instanceMembers;
|
|
64
|
-
} else {
|
|
65
|
-
return memberScope.staticMembers;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
47
|
+
export interface CreateJsonSymbolOptions extends OutputSymbolOptions {
|
|
48
|
+
jsonFlags?: JsonSymbolFlags;
|
|
68
49
|
}
|
package/temp/api.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.52.8",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -172,66 +172,19 @@
|
|
|
172
172
|
"name": "",
|
|
173
173
|
"preserveMemberOrder": false,
|
|
174
174
|
"members": [
|
|
175
|
-
{
|
|
176
|
-
"kind": "Function",
|
|
177
|
-
"canonicalReference": "@alloy-js/json!createJsonOutputSymbol:function(1)",
|
|
178
|
-
"docComment": "",
|
|
179
|
-
"excerptTokens": [
|
|
180
|
-
{
|
|
181
|
-
"kind": "Content",
|
|
182
|
-
"text": "export declare function createJsonOutputSymbol(options: "
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"kind": "Reference",
|
|
186
|
-
"text": "createJsonSymbolOptions",
|
|
187
|
-
"canonicalReference": "@alloy-js/json!createJsonSymbolOptions:interface"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"kind": "Content",
|
|
191
|
-
"text": "): "
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"kind": "Reference",
|
|
195
|
-
"text": "JsonOutputSymbol",
|
|
196
|
-
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:interface"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"kind": "Content",
|
|
200
|
-
"text": ";"
|
|
201
|
-
}
|
|
202
|
-
],
|
|
203
|
-
"fileUrlPath": "src/symbols/json-symbol.ts",
|
|
204
|
-
"returnTypeTokenRange": {
|
|
205
|
-
"startIndex": 3,
|
|
206
|
-
"endIndex": 4
|
|
207
|
-
},
|
|
208
|
-
"releaseTag": "Public",
|
|
209
|
-
"overloadIndex": 1,
|
|
210
|
-
"parameters": [
|
|
211
|
-
{
|
|
212
|
-
"parameterName": "options",
|
|
213
|
-
"parameterTypeTokenRange": {
|
|
214
|
-
"startIndex": 1,
|
|
215
|
-
"endIndex": 2
|
|
216
|
-
},
|
|
217
|
-
"isOptional": false
|
|
218
|
-
}
|
|
219
|
-
],
|
|
220
|
-
"name": "createJsonOutputSymbol"
|
|
221
|
-
},
|
|
222
175
|
{
|
|
223
176
|
"kind": "Interface",
|
|
224
|
-
"canonicalReference": "@alloy-js/json!
|
|
177
|
+
"canonicalReference": "@alloy-js/json!CreateJsonSymbolOptions:interface",
|
|
225
178
|
"docComment": "",
|
|
226
179
|
"excerptTokens": [
|
|
227
180
|
{
|
|
228
181
|
"kind": "Content",
|
|
229
|
-
"text": "export interface
|
|
182
|
+
"text": "export interface CreateJsonSymbolOptions extends "
|
|
230
183
|
},
|
|
231
184
|
{
|
|
232
185
|
"kind": "Reference",
|
|
233
|
-
"text": "
|
|
234
|
-
"canonicalReference": "@alloy-js/core!
|
|
186
|
+
"text": "OutputSymbolOptions",
|
|
187
|
+
"canonicalReference": "@alloy-js/core!OutputSymbolOptions:interface"
|
|
235
188
|
},
|
|
236
189
|
{
|
|
237
190
|
"kind": "Content",
|
|
@@ -240,12 +193,12 @@
|
|
|
240
193
|
],
|
|
241
194
|
"fileUrlPath": "src/symbols/json-symbol.ts",
|
|
242
195
|
"releaseTag": "Public",
|
|
243
|
-
"name": "
|
|
196
|
+
"name": "CreateJsonSymbolOptions",
|
|
244
197
|
"preserveMemberOrder": false,
|
|
245
198
|
"members": [
|
|
246
199
|
{
|
|
247
200
|
"kind": "PropertySignature",
|
|
248
|
-
"canonicalReference": "@alloy-js/json!
|
|
201
|
+
"canonicalReference": "@alloy-js/json!CreateJsonSymbolOptions#jsonFlags:member",
|
|
249
202
|
"docComment": "",
|
|
250
203
|
"excerptTokens": [
|
|
251
204
|
{
|
|
@@ -768,7 +721,7 @@
|
|
|
768
721
|
{
|
|
769
722
|
"kind": "Reference",
|
|
770
723
|
"text": "JsonOutputSymbol",
|
|
771
|
-
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:
|
|
724
|
+
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:class"
|
|
772
725
|
},
|
|
773
726
|
{
|
|
774
727
|
"kind": "Content",
|
|
@@ -1205,18 +1158,18 @@
|
|
|
1205
1158
|
]
|
|
1206
1159
|
},
|
|
1207
1160
|
{
|
|
1208
|
-
"kind": "
|
|
1209
|
-
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:
|
|
1161
|
+
"kind": "Class",
|
|
1162
|
+
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:class",
|
|
1210
1163
|
"docComment": "/**\n * JsonOutputSymbol is created for JSON Values with a refkey. For JSON objects\n * and arrays, the symbol will have the `StaticMemberContainer` flag. For JSON\n * values that are members of an object or an array, the symbol will have the\n * `StaticMember` flag.\n */\n",
|
|
1211
1164
|
"excerptTokens": [
|
|
1212
1165
|
{
|
|
1213
1166
|
"kind": "Content",
|
|
1214
|
-
"text": "export
|
|
1167
|
+
"text": "export declare class JsonOutputSymbol extends "
|
|
1215
1168
|
},
|
|
1216
1169
|
{
|
|
1217
1170
|
"kind": "Reference",
|
|
1218
1171
|
"text": "OutputSymbol",
|
|
1219
|
-
"canonicalReference": "@alloy-js/core!OutputSymbol:
|
|
1172
|
+
"canonicalReference": "@alloy-js/core!OutputSymbol:class"
|
|
1220
1173
|
},
|
|
1221
1174
|
{
|
|
1222
1175
|
"kind": "Content",
|
|
@@ -1225,72 +1178,105 @@
|
|
|
1225
1178
|
],
|
|
1226
1179
|
"fileUrlPath": "src/symbols/json-symbol.ts",
|
|
1227
1180
|
"releaseTag": "Public",
|
|
1181
|
+
"isAbstract": false,
|
|
1228
1182
|
"name": "JsonOutputSymbol",
|
|
1229
1183
|
"preserveMemberOrder": false,
|
|
1230
1184
|
"members": [
|
|
1231
1185
|
{
|
|
1232
|
-
"kind": "
|
|
1233
|
-
"canonicalReference": "@alloy-js/json!JsonOutputSymbol
|
|
1234
|
-
"docComment": "",
|
|
1186
|
+
"kind": "Constructor",
|
|
1187
|
+
"canonicalReference": "@alloy-js/json!JsonOutputSymbol:constructor(1)",
|
|
1188
|
+
"docComment": "/**\n * Constructs a new instance of the `JsonOutputSymbol` class\n */\n",
|
|
1235
1189
|
"excerptTokens": [
|
|
1236
1190
|
{
|
|
1237
1191
|
"kind": "Content",
|
|
1238
|
-
"text": "
|
|
1192
|
+
"text": "constructor(name: "
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"kind": "Content",
|
|
1196
|
+
"text": "string"
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
"kind": "Content",
|
|
1200
|
+
"text": ", options?: "
|
|
1239
1201
|
},
|
|
1240
1202
|
{
|
|
1241
1203
|
"kind": "Reference",
|
|
1242
|
-
"text": "
|
|
1243
|
-
"canonicalReference": "@alloy-js/json!
|
|
1204
|
+
"text": "CreateJsonSymbolOptions",
|
|
1205
|
+
"canonicalReference": "@alloy-js/json!CreateJsonSymbolOptions:interface"
|
|
1244
1206
|
},
|
|
1245
1207
|
{
|
|
1246
1208
|
"kind": "Content",
|
|
1247
|
-
"text": ";"
|
|
1209
|
+
"text": ");"
|
|
1248
1210
|
}
|
|
1249
1211
|
],
|
|
1250
|
-
"isReadonly": false,
|
|
1251
|
-
"isOptional": false,
|
|
1252
1212
|
"releaseTag": "Public",
|
|
1253
|
-
"
|
|
1254
|
-
"
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1213
|
+
"isProtected": false,
|
|
1214
|
+
"overloadIndex": 1,
|
|
1215
|
+
"parameters": [
|
|
1216
|
+
{
|
|
1217
|
+
"parameterName": "name",
|
|
1218
|
+
"parameterTypeTokenRange": {
|
|
1219
|
+
"startIndex": 1,
|
|
1220
|
+
"endIndex": 2
|
|
1221
|
+
},
|
|
1222
|
+
"isOptional": false
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
"parameterName": "options",
|
|
1226
|
+
"parameterTypeTokenRange": {
|
|
1227
|
+
"startIndex": 3,
|
|
1228
|
+
"endIndex": 4
|
|
1229
|
+
},
|
|
1230
|
+
"isOptional": true
|
|
1231
|
+
}
|
|
1232
|
+
]
|
|
1258
1233
|
},
|
|
1259
1234
|
{
|
|
1260
|
-
"kind": "
|
|
1261
|
-
"canonicalReference": "@alloy-js/json!JsonOutputSymbol#
|
|
1235
|
+
"kind": "Property",
|
|
1236
|
+
"canonicalReference": "@alloy-js/json!JsonOutputSymbol#jsonFlags:member",
|
|
1262
1237
|
"docComment": "",
|
|
1263
1238
|
"excerptTokens": [
|
|
1264
1239
|
{
|
|
1265
1240
|
"kind": "Content",
|
|
1266
|
-
"text": "
|
|
1241
|
+
"text": "get jsonFlags(): "
|
|
1267
1242
|
},
|
|
1268
1243
|
{
|
|
1269
1244
|
"kind": "Reference",
|
|
1270
|
-
"text": "
|
|
1271
|
-
"canonicalReference": "@alloy-js/
|
|
1245
|
+
"text": "JsonSymbolFlags",
|
|
1246
|
+
"canonicalReference": "@alloy-js/json!JsonSymbolFlags:enum"
|
|
1272
1247
|
},
|
|
1273
1248
|
{
|
|
1274
1249
|
"kind": "Content",
|
|
1275
|
-
"text": "
|
|
1250
|
+
"text": ";\n\nset jsonFlags(value: "
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"kind": "Reference",
|
|
1254
|
+
"text": "JsonSymbolFlags",
|
|
1255
|
+
"canonicalReference": "@alloy-js/json!JsonSymbolFlags:enum"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"kind": "Content",
|
|
1259
|
+
"text": ");"
|
|
1276
1260
|
}
|
|
1277
1261
|
],
|
|
1278
1262
|
"isReadonly": false,
|
|
1279
1263
|
"isOptional": false,
|
|
1280
1264
|
"releaseTag": "Public",
|
|
1281
|
-
"name": "
|
|
1265
|
+
"name": "jsonFlags",
|
|
1282
1266
|
"propertyTypeTokenRange": {
|
|
1283
1267
|
"startIndex": 1,
|
|
1284
1268
|
"endIndex": 2
|
|
1285
|
-
}
|
|
1269
|
+
},
|
|
1270
|
+
"isStatic": false,
|
|
1271
|
+
"isProtected": false,
|
|
1272
|
+
"isAbstract": false
|
|
1286
1273
|
}
|
|
1287
1274
|
],
|
|
1288
|
-
"
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
]
|
|
1275
|
+
"extendsTokenRange": {
|
|
1276
|
+
"startIndex": 1,
|
|
1277
|
+
"endIndex": 2
|
|
1278
|
+
},
|
|
1279
|
+
"implementsTokenRanges": []
|
|
1294
1280
|
},
|
|
1295
1281
|
{
|
|
1296
1282
|
"kind": "Enum",
|
|
@@ -1392,7 +1378,7 @@
|
|
|
1392
1378
|
},
|
|
1393
1379
|
{
|
|
1394
1380
|
"kind": "Content",
|
|
1395
|
-
"text": "import(\"@alloy-js/core\")."
|
|
1381
|
+
"text": "import(\"@alloy-js/core/jsx-runtime\")."
|
|
1396
1382
|
},
|
|
1397
1383
|
{
|
|
1398
1384
|
"kind": "Reference",
|
|
@@ -1756,7 +1742,7 @@
|
|
|
1756
1742
|
},
|
|
1757
1743
|
{
|
|
1758
1744
|
"kind": "Content",
|
|
1759
|
-
"text": "import(\"@alloy-js/core\")."
|
|
1745
|
+
"text": "import(\"@alloy-js/core/jsx-runtime\")."
|
|
1760
1746
|
},
|
|
1761
1747
|
{
|
|
1762
1748
|
"kind": "Reference",
|
|
@@ -1953,57 +1939,6 @@
|
|
|
1953
1939
|
],
|
|
1954
1940
|
"extendsTokenRanges": []
|
|
1955
1941
|
},
|
|
1956
|
-
{
|
|
1957
|
-
"kind": "Function",
|
|
1958
|
-
"canonicalReference": "@alloy-js/json!useDefaultScope:function(1)",
|
|
1959
|
-
"docComment": "",
|
|
1960
|
-
"excerptTokens": [
|
|
1961
|
-
{
|
|
1962
|
-
"kind": "Content",
|
|
1963
|
-
"text": "export declare function useDefaultScope(flags?: "
|
|
1964
|
-
},
|
|
1965
|
-
{
|
|
1966
|
-
"kind": "Reference",
|
|
1967
|
-
"text": "OutputSymbolFlags",
|
|
1968
|
-
"canonicalReference": "@alloy-js/core!OutputSymbolFlags:enum"
|
|
1969
|
-
},
|
|
1970
|
-
{
|
|
1971
|
-
"kind": "Content",
|
|
1972
|
-
"text": "): "
|
|
1973
|
-
},
|
|
1974
|
-
{
|
|
1975
|
-
"kind": "Reference",
|
|
1976
|
-
"text": "OutputScope",
|
|
1977
|
-
"canonicalReference": "@alloy-js/core!OutputScope:interface"
|
|
1978
|
-
},
|
|
1979
|
-
{
|
|
1980
|
-
"kind": "Content",
|
|
1981
|
-
"text": " | undefined"
|
|
1982
|
-
},
|
|
1983
|
-
{
|
|
1984
|
-
"kind": "Content",
|
|
1985
|
-
"text": ";"
|
|
1986
|
-
}
|
|
1987
|
-
],
|
|
1988
|
-
"fileUrlPath": "src/symbols/json-symbol.ts",
|
|
1989
|
-
"returnTypeTokenRange": {
|
|
1990
|
-
"startIndex": 3,
|
|
1991
|
-
"endIndex": 5
|
|
1992
|
-
},
|
|
1993
|
-
"releaseTag": "Public",
|
|
1994
|
-
"overloadIndex": 1,
|
|
1995
|
-
"parameters": [
|
|
1996
|
-
{
|
|
1997
|
-
"parameterName": "flags",
|
|
1998
|
-
"parameterTypeTokenRange": {
|
|
1999
|
-
"startIndex": 1,
|
|
2000
|
-
"endIndex": 2
|
|
2001
|
-
},
|
|
2002
|
-
"isOptional": true
|
|
2003
|
-
}
|
|
2004
|
-
],
|
|
2005
|
-
"name": "useDefaultScope"
|
|
2006
|
-
},
|
|
2007
1942
|
{
|
|
2008
1943
|
"kind": "Function",
|
|
2009
1944
|
"canonicalReference": "@alloy-js/json!useJsonFileContext:function(1)",
|