@typespec/html-program-viewer 0.67.0-dev.3 → 0.67.0-dev.4
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/dist/emitter/index.js
CHANGED
|
@@ -5338,8 +5338,7 @@ const TypeConfig = {
|
|
|
5338
5338
|
operations: "nested",
|
|
5339
5339
|
unions: "nested",
|
|
5340
5340
|
enums: "nested",
|
|
5341
|
-
decoratorDeclarations: "nested"
|
|
5342
|
-
functionDeclarations: "nested"
|
|
5341
|
+
decoratorDeclarations: "nested"
|
|
5343
5342
|
},
|
|
5344
5343
|
Interface: {
|
|
5345
5344
|
operations: "nested",
|
|
@@ -5424,10 +5423,7 @@ const TypeConfig = {
|
|
|
5424
5423
|
default: "value"
|
|
5425
5424
|
},
|
|
5426
5425
|
// Don't want to expose those for now
|
|
5427
|
-
|
|
5428
|
-
Object: null,
|
|
5429
|
-
Intrinsic: null,
|
|
5430
|
-
Projection: null
|
|
5426
|
+
Intrinsic: null
|
|
5431
5427
|
};
|
|
5432
5428
|
const CommonPropsConfig = {
|
|
5433
5429
|
namespace: "parent"
|
|
@@ -5443,11 +5439,7 @@ const HiddenProps = [
|
|
|
5443
5439
|
"templateMapper",
|
|
5444
5440
|
"instantiationParameters",
|
|
5445
5441
|
"decorators",
|
|
5446
|
-
"projectionBase",
|
|
5447
|
-
"projectionsByName",
|
|
5448
|
-
"projectionSource",
|
|
5449
5442
|
"projector",
|
|
5450
|
-
"projections",
|
|
5451
5443
|
"isFinished"
|
|
5452
5444
|
];
|
|
5453
5445
|
new Set(HiddenProps);
|
package/dist/react/index.js
CHANGED
|
@@ -18018,61 +18018,30 @@ var SyntaxKind;
|
|
|
18018
18018
|
SyntaxKind[SyntaxKind["UnknownKeyword"] = 43] = "UnknownKeyword";
|
|
18019
18019
|
SyntaxKind[SyntaxKind["ValueOfExpression"] = 44] = "ValueOfExpression";
|
|
18020
18020
|
SyntaxKind[SyntaxKind["TypeReference"] = 45] = "TypeReference";
|
|
18021
|
-
SyntaxKind[SyntaxKind["
|
|
18022
|
-
SyntaxKind[SyntaxKind["
|
|
18023
|
-
SyntaxKind[SyntaxKind["
|
|
18024
|
-
SyntaxKind[SyntaxKind["
|
|
18025
|
-
SyntaxKind[SyntaxKind["
|
|
18026
|
-
SyntaxKind[SyntaxKind["
|
|
18027
|
-
SyntaxKind[SyntaxKind["
|
|
18028
|
-
SyntaxKind[SyntaxKind["
|
|
18029
|
-
SyntaxKind[SyntaxKind["
|
|
18030
|
-
SyntaxKind[SyntaxKind["
|
|
18031
|
-
SyntaxKind[SyntaxKind["
|
|
18032
|
-
SyntaxKind[SyntaxKind["
|
|
18033
|
-
SyntaxKind[SyntaxKind["
|
|
18034
|
-
SyntaxKind[SyntaxKind["
|
|
18035
|
-
SyntaxKind[SyntaxKind["
|
|
18036
|
-
SyntaxKind[SyntaxKind["
|
|
18037
|
-
SyntaxKind[SyntaxKind["
|
|
18038
|
-
SyntaxKind[SyntaxKind["
|
|
18039
|
-
SyntaxKind[SyntaxKind["
|
|
18040
|
-
SyntaxKind[SyntaxKind["
|
|
18041
|
-
SyntaxKind[SyntaxKind["
|
|
18042
|
-
SyntaxKind[SyntaxKind["
|
|
18043
|
-
SyntaxKind[SyntaxKind["
|
|
18044
|
-
SyntaxKind[SyntaxKind["
|
|
18045
|
-
SyntaxKind[SyntaxKind["ProjectionEnumMemberSelector"] = 70] = "ProjectionEnumMemberSelector";
|
|
18046
|
-
SyntaxKind[SyntaxKind["ProjectionExpressionStatement"] = 71] = "ProjectionExpressionStatement";
|
|
18047
|
-
SyntaxKind[SyntaxKind["ProjectionIfExpression"] = 72] = "ProjectionIfExpression";
|
|
18048
|
-
SyntaxKind[SyntaxKind["ProjectionBlockExpression"] = 73] = "ProjectionBlockExpression";
|
|
18049
|
-
SyntaxKind[SyntaxKind["ProjectionMemberExpression"] = 74] = "ProjectionMemberExpression";
|
|
18050
|
-
SyntaxKind[SyntaxKind["ProjectionLogicalExpression"] = 75] = "ProjectionLogicalExpression";
|
|
18051
|
-
SyntaxKind[SyntaxKind["ProjectionEqualityExpression"] = 76] = "ProjectionEqualityExpression";
|
|
18052
|
-
SyntaxKind[SyntaxKind["ProjectionUnaryExpression"] = 77] = "ProjectionUnaryExpression";
|
|
18053
|
-
SyntaxKind[SyntaxKind["ProjectionRelationalExpression"] = 78] = "ProjectionRelationalExpression";
|
|
18054
|
-
SyntaxKind[SyntaxKind["ProjectionArithmeticExpression"] = 79] = "ProjectionArithmeticExpression";
|
|
18055
|
-
SyntaxKind[SyntaxKind["ProjectionCallExpression"] = 80] = "ProjectionCallExpression";
|
|
18056
|
-
SyntaxKind[SyntaxKind["ProjectionLambdaExpression"] = 81] = "ProjectionLambdaExpression";
|
|
18057
|
-
SyntaxKind[SyntaxKind["ProjectionLambdaParameterDeclaration"] = 82] = "ProjectionLambdaParameterDeclaration";
|
|
18058
|
-
SyntaxKind[SyntaxKind["ProjectionModelExpression"] = 83] = "ProjectionModelExpression";
|
|
18059
|
-
SyntaxKind[SyntaxKind["ProjectionModelProperty"] = 84] = "ProjectionModelProperty";
|
|
18060
|
-
SyntaxKind[SyntaxKind["ProjectionModelSpreadProperty"] = 85] = "ProjectionModelSpreadProperty";
|
|
18061
|
-
SyntaxKind[SyntaxKind["ProjectionSpreadProperty"] = 86] = "ProjectionSpreadProperty";
|
|
18062
|
-
SyntaxKind[SyntaxKind["ProjectionTupleExpression"] = 87] = "ProjectionTupleExpression";
|
|
18063
|
-
SyntaxKind[SyntaxKind["ProjectionStatement"] = 88] = "ProjectionStatement";
|
|
18064
|
-
SyntaxKind[SyntaxKind["ProjectionDecoratorReferenceExpression"] = 89] = "ProjectionDecoratorReferenceExpression";
|
|
18065
|
-
SyntaxKind[SyntaxKind["Return"] = 90] = "Return";
|
|
18066
|
-
SyntaxKind[SyntaxKind["JsNamespaceDeclaration"] = 91] = "JsNamespaceDeclaration";
|
|
18067
|
-
SyntaxKind[SyntaxKind["TemplateArgument"] = 92] = "TemplateArgument";
|
|
18068
|
-
SyntaxKind[SyntaxKind["TypeOfExpression"] = 93] = "TypeOfExpression";
|
|
18069
|
-
SyntaxKind[SyntaxKind["ObjectLiteral"] = 94] = "ObjectLiteral";
|
|
18070
|
-
SyntaxKind[SyntaxKind["ObjectLiteralProperty"] = 95] = "ObjectLiteralProperty";
|
|
18071
|
-
SyntaxKind[SyntaxKind["ObjectLiteralSpreadProperty"] = 96] = "ObjectLiteralSpreadProperty";
|
|
18072
|
-
SyntaxKind[SyntaxKind["ArrayLiteral"] = 97] = "ArrayLiteral";
|
|
18073
|
-
SyntaxKind[SyntaxKind["ConstStatement"] = 98] = "ConstStatement";
|
|
18074
|
-
SyntaxKind[SyntaxKind["CallExpression"] = 99] = "CallExpression";
|
|
18075
|
-
SyntaxKind[SyntaxKind["ScalarConstructor"] = 100] = "ScalarConstructor";
|
|
18021
|
+
SyntaxKind[SyntaxKind["TemplateParameterDeclaration"] = 46] = "TemplateParameterDeclaration";
|
|
18022
|
+
SyntaxKind[SyntaxKind["EmptyStatement"] = 47] = "EmptyStatement";
|
|
18023
|
+
SyntaxKind[SyntaxKind["InvalidStatement"] = 48] = "InvalidStatement";
|
|
18024
|
+
SyntaxKind[SyntaxKind["LineComment"] = 49] = "LineComment";
|
|
18025
|
+
SyntaxKind[SyntaxKind["BlockComment"] = 50] = "BlockComment";
|
|
18026
|
+
SyntaxKind[SyntaxKind["Doc"] = 51] = "Doc";
|
|
18027
|
+
SyntaxKind[SyntaxKind["DocText"] = 52] = "DocText";
|
|
18028
|
+
SyntaxKind[SyntaxKind["DocParamTag"] = 53] = "DocParamTag";
|
|
18029
|
+
SyntaxKind[SyntaxKind["DocPropTag"] = 54] = "DocPropTag";
|
|
18030
|
+
SyntaxKind[SyntaxKind["DocReturnsTag"] = 55] = "DocReturnsTag";
|
|
18031
|
+
SyntaxKind[SyntaxKind["DocErrorsTag"] = 56] = "DocErrorsTag";
|
|
18032
|
+
SyntaxKind[SyntaxKind["DocTemplateTag"] = 57] = "DocTemplateTag";
|
|
18033
|
+
SyntaxKind[SyntaxKind["DocUnknownTag"] = 58] = "DocUnknownTag";
|
|
18034
|
+
SyntaxKind[SyntaxKind["Return"] = 59] = "Return";
|
|
18035
|
+
SyntaxKind[SyntaxKind["JsNamespaceDeclaration"] = 60] = "JsNamespaceDeclaration";
|
|
18036
|
+
SyntaxKind[SyntaxKind["TemplateArgument"] = 61] = "TemplateArgument";
|
|
18037
|
+
SyntaxKind[SyntaxKind["TypeOfExpression"] = 62] = "TypeOfExpression";
|
|
18038
|
+
SyntaxKind[SyntaxKind["ObjectLiteral"] = 63] = "ObjectLiteral";
|
|
18039
|
+
SyntaxKind[SyntaxKind["ObjectLiteralProperty"] = 64] = "ObjectLiteralProperty";
|
|
18040
|
+
SyntaxKind[SyntaxKind["ObjectLiteralSpreadProperty"] = 65] = "ObjectLiteralSpreadProperty";
|
|
18041
|
+
SyntaxKind[SyntaxKind["ArrayLiteral"] = 66] = "ArrayLiteral";
|
|
18042
|
+
SyntaxKind[SyntaxKind["ConstStatement"] = 67] = "ConstStatement";
|
|
18043
|
+
SyntaxKind[SyntaxKind["CallExpression"] = 68] = "CallExpression";
|
|
18044
|
+
SyntaxKind[SyntaxKind["ScalarConstructor"] = 69] = "ScalarConstructor";
|
|
18076
18045
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
18077
18046
|
var IdentifierKind;
|
|
18078
18047
|
(function (IdentifierKind) {
|
|
@@ -18101,7 +18070,7 @@ let manifest;
|
|
|
18101
18070
|
try {
|
|
18102
18071
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18103
18072
|
// @ts-ignore
|
|
18104
|
-
manifest = (await import('../manifest-
|
|
18073
|
+
manifest = (await import('../manifest-DRAJnEGG.js')).default;
|
|
18105
18074
|
}
|
|
18106
18075
|
catch {
|
|
18107
18076
|
const name = "../dist/manifest.js";
|
|
@@ -18419,7 +18388,6 @@ const diagnostics = {
|
|
|
18419
18388
|
unexpected: paramMessage `Unexpected token ${"token"}`,
|
|
18420
18389
|
numericOrStringLiteral: "Expected numeric or string literal.",
|
|
18421
18390
|
identifier: "Identifier expected.",
|
|
18422
|
-
projectionDirection: "from or to expected.",
|
|
18423
18391
|
expression: "Expression expected.",
|
|
18424
18392
|
statement: "Statement expected.",
|
|
18425
18393
|
property: "Property expected.",
|
|
@@ -18472,15 +18440,6 @@ const diagnostics = {
|
|
|
18472
18440
|
default: paramMessage `Cannot decorate ${"nodeName"}.`,
|
|
18473
18441
|
},
|
|
18474
18442
|
},
|
|
18475
|
-
"invalid-projection": {
|
|
18476
|
-
severity: "error",
|
|
18477
|
-
messages: {
|
|
18478
|
-
default: "Invalid projection",
|
|
18479
|
-
wrongType: "Non-projection can't be used to project",
|
|
18480
|
-
noTo: "Projection missing to projection",
|
|
18481
|
-
projectionError: paramMessage `An error occurred when projecting this type: ${"message"}`,
|
|
18482
|
-
},
|
|
18483
|
-
},
|
|
18484
18443
|
"default-required": {
|
|
18485
18444
|
severity: "error",
|
|
18486
18445
|
messages: {
|
|
@@ -18820,6 +18779,12 @@ const diagnostics = {
|
|
|
18820
18779
|
default: "A function declaration must be prefixed with the 'extern' modifier.",
|
|
18821
18780
|
},
|
|
18822
18781
|
},
|
|
18782
|
+
"function-unsupported": {
|
|
18783
|
+
severity: "error",
|
|
18784
|
+
messages: {
|
|
18785
|
+
default: "Function are currently not supported.",
|
|
18786
|
+
},
|
|
18787
|
+
},
|
|
18823
18788
|
"missing-implementation": {
|
|
18824
18789
|
severity: "error",
|
|
18825
18790
|
messages: {
|
|
@@ -28284,7 +28249,7 @@ function getSourceLocation(target, options = {}) {
|
|
|
28284
28249
|
return getSourceLocationOfNode(target.node, options);
|
|
28285
28250
|
}
|
|
28286
28251
|
// symbol
|
|
28287
|
-
if (target.flags &
|
|
28252
|
+
if (target.flags & 8192 /* SymbolFlags.Using */) {
|
|
28288
28253
|
target = target.symbolSource;
|
|
28289
28254
|
}
|
|
28290
28255
|
if (!target.declarations[0]) {
|
|
@@ -29230,9 +29195,7 @@ function getVisibilityForClass(program, property, visibilityClass) {
|
|
|
29230
29195
|
// #endregion
|
|
29231
29196
|
|
|
29232
29197
|
function isIntrinsicType(program, type, kind) {
|
|
29233
|
-
return ignoreDiagnostics(program.checker.isTypeAssignableTo(
|
|
29234
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
29235
|
-
type.projectionBase ?? type, program.checker.getStdType(kind), type));
|
|
29198
|
+
return ignoreDiagnostics(program.checker.isTypeAssignableTo(type, program.checker.getStdType(kind), type));
|
|
29236
29199
|
}
|
|
29237
29200
|
|
|
29238
29201
|
const deprecatedKey = createStateSymbol("deprecated");
|
|
@@ -29361,69 +29324,234 @@ function getDiscriminator(program, entity) {
|
|
|
29361
29324
|
const [getDiscriminatedOptions, setDiscriminatedOptions] = useStateMap(createStateSymbol("discriminated"));
|
|
29362
29325
|
// #endregion
|
|
29363
29326
|
|
|
29364
|
-
|
|
29365
|
-
|
|
29366
|
-
|
|
29367
|
-
|
|
29368
|
-
|
|
29327
|
+
function getDiscriminatedUnion(typeOrProgram, typeOrDiscriminator) {
|
|
29328
|
+
if ("propertyName" in typeOrDiscriminator) {
|
|
29329
|
+
const type = typeOrProgram;
|
|
29330
|
+
switch (type.kind) {
|
|
29331
|
+
case "Model":
|
|
29332
|
+
return getDiscriminatedUnionFromInheritance(type, typeOrDiscriminator);
|
|
29333
|
+
case "Union":
|
|
29334
|
+
return getDiscriminatedUnionForUnionLegacy(type, typeOrDiscriminator);
|
|
29335
|
+
}
|
|
29369
29336
|
}
|
|
29370
|
-
|
|
29371
|
-
|
|
29372
|
-
|
|
29337
|
+
else {
|
|
29338
|
+
return getDiscriminatedUnionForUnion(typeOrProgram, typeOrDiscriminator);
|
|
29339
|
+
}
|
|
29340
|
+
}
|
|
29341
|
+
function getDiscriminatedUnionForUnion(program, type) {
|
|
29342
|
+
const options = getDiscriminatedOptions(program, type);
|
|
29343
|
+
const diagnostics = [];
|
|
29344
|
+
if (options === undefined) {
|
|
29345
|
+
return [undefined, []];
|
|
29346
|
+
}
|
|
29347
|
+
const variants = new Map();
|
|
29348
|
+
let defaultVariant;
|
|
29349
|
+
// If there is not envelope then every variant needs to be a model.
|
|
29350
|
+
for (const variant of type.variants.values()) {
|
|
29351
|
+
if (typeof variant.name !== "string") {
|
|
29352
|
+
if (defaultVariant) {
|
|
29353
|
+
diagnostics.push(createDiagnostic({
|
|
29354
|
+
code: "invalid-discriminated-union-variant",
|
|
29355
|
+
messageId: "duplicateDefaultVariant",
|
|
29356
|
+
target: variant,
|
|
29357
|
+
}));
|
|
29358
|
+
}
|
|
29359
|
+
else {
|
|
29360
|
+
defaultVariant = variant.type;
|
|
29361
|
+
}
|
|
29362
|
+
continue;
|
|
29363
|
+
}
|
|
29364
|
+
variants.set(variant.name, variant.type);
|
|
29365
|
+
if (options.envelope === "none") {
|
|
29366
|
+
if (variant.type.kind !== "Model") {
|
|
29367
|
+
diagnostics.push(createDiagnostic({
|
|
29368
|
+
code: "invalid-discriminated-union-variant",
|
|
29369
|
+
messageId: "noEnvelopeModel",
|
|
29370
|
+
format: { name: variant.name.toString() },
|
|
29371
|
+
target: variant,
|
|
29372
|
+
}));
|
|
29373
|
+
continue;
|
|
29374
|
+
}
|
|
29375
|
+
const prop = variant.type.properties.get(options.discriminatorPropertyName);
|
|
29376
|
+
if (prop !== undefined) {
|
|
29377
|
+
const key = getStringValue(prop.type);
|
|
29378
|
+
if (key !== variant.name) {
|
|
29379
|
+
diagnostics.push(createDiagnostic({
|
|
29380
|
+
code: "invalid-discriminated-union-variant",
|
|
29381
|
+
messageId: "discriminantMismatch",
|
|
29382
|
+
format: {
|
|
29383
|
+
name: variant.name.toString(),
|
|
29384
|
+
discriminant: options.discriminatorPropertyName,
|
|
29385
|
+
propertyValue: key,
|
|
29386
|
+
variantName: String(variant.name),
|
|
29387
|
+
},
|
|
29388
|
+
target: variant.type,
|
|
29389
|
+
}));
|
|
29390
|
+
}
|
|
29391
|
+
}
|
|
29392
|
+
}
|
|
29393
|
+
}
|
|
29394
|
+
return [
|
|
29395
|
+
{
|
|
29396
|
+
type,
|
|
29397
|
+
options,
|
|
29398
|
+
variants,
|
|
29399
|
+
},
|
|
29400
|
+
diagnostics,
|
|
29401
|
+
];
|
|
29402
|
+
}
|
|
29403
|
+
function getDiscriminatedUnionForUnionLegacy(type, discriminator) {
|
|
29404
|
+
const variants = new Map();
|
|
29405
|
+
const diagnostics = [];
|
|
29406
|
+
const duplicates = new DuplicateTracker();
|
|
29407
|
+
for (const variant of type.variants.values()) {
|
|
29408
|
+
if (variant.type.kind !== "Model") {
|
|
29409
|
+
diagnostics.push(createDiagnostic({
|
|
29410
|
+
code: "invalid-discriminated-union-variant",
|
|
29411
|
+
format: { name: variant.name.toString() },
|
|
29412
|
+
target: variant,
|
|
29413
|
+
}));
|
|
29414
|
+
continue;
|
|
29415
|
+
}
|
|
29416
|
+
const prop = getDiscriminatorProperty(variant.type, discriminator, diagnostics);
|
|
29417
|
+
if (prop === undefined) {
|
|
29418
|
+
diagnostics.push(createDiagnostic({
|
|
29419
|
+
code: "invalid-discriminated-union-variant",
|
|
29420
|
+
messageId: "noDiscriminant",
|
|
29421
|
+
format: { name: variant.name.toString(), discriminant: discriminator.propertyName },
|
|
29422
|
+
target: variant,
|
|
29423
|
+
}));
|
|
29424
|
+
continue;
|
|
29425
|
+
}
|
|
29426
|
+
const key = getStringValue(prop.type);
|
|
29427
|
+
if (key) {
|
|
29428
|
+
duplicates.track(key, variant.type);
|
|
29429
|
+
variants.set(key, variant.type);
|
|
29430
|
+
}
|
|
29431
|
+
else {
|
|
29432
|
+
diagnostics.push(createDiagnostic({
|
|
29433
|
+
code: "invalid-discriminated-union-variant",
|
|
29434
|
+
messageId: "wrongDiscriminantType",
|
|
29435
|
+
format: { name: variant.name.toString(), discriminant: discriminator.propertyName },
|
|
29436
|
+
target: variant.type,
|
|
29437
|
+
}));
|
|
29438
|
+
}
|
|
29439
|
+
}
|
|
29440
|
+
reportDuplicateDiscriminatorValues(duplicates, diagnostics);
|
|
29441
|
+
const discriminatedUnion = {
|
|
29442
|
+
kind: "legacy",
|
|
29443
|
+
propertyName: discriminator.propertyName,
|
|
29444
|
+
variants,
|
|
29373
29445
|
};
|
|
29374
|
-
return
|
|
29446
|
+
return [discriminatedUnion, diagnostics];
|
|
29375
29447
|
}
|
|
29376
|
-
function
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
const
|
|
29380
|
-
|
|
29448
|
+
function getDiscriminatedUnionFromInheritance(type, discriminator) {
|
|
29449
|
+
const variants = new Map();
|
|
29450
|
+
const diagnostics = [];
|
|
29451
|
+
const duplicates = new DuplicateTracker();
|
|
29452
|
+
function checkForVariantsIn(current) {
|
|
29453
|
+
for (const derivedModel of current.derivedModels) {
|
|
29454
|
+
if (isTemplateDeclarationOrInstance(derivedModel)) {
|
|
29455
|
+
continue; // Skip template instances as they should be used with `model is`
|
|
29456
|
+
}
|
|
29457
|
+
const keys = getDiscriminatorValues(derivedModel, discriminator, diagnostics);
|
|
29458
|
+
if (keys === undefined) {
|
|
29459
|
+
if (derivedModel.derivedModels.length === 0) {
|
|
29460
|
+
diagnostics.push(createDiagnostic({
|
|
29461
|
+
code: "missing-discriminator-property",
|
|
29462
|
+
format: { discriminator: discriminator.propertyName },
|
|
29463
|
+
target: derivedModel,
|
|
29464
|
+
}));
|
|
29465
|
+
}
|
|
29466
|
+
else {
|
|
29467
|
+
checkForVariantsIn(derivedModel);
|
|
29468
|
+
}
|
|
29469
|
+
}
|
|
29470
|
+
else {
|
|
29471
|
+
for (const key of keys) {
|
|
29472
|
+
duplicates.track(key, derivedModel);
|
|
29473
|
+
variants.set(key, derivedModel);
|
|
29474
|
+
}
|
|
29475
|
+
}
|
|
29476
|
+
}
|
|
29477
|
+
}
|
|
29478
|
+
checkForVariantsIn(type);
|
|
29479
|
+
reportDuplicateDiscriminatorValues(duplicates, diagnostics);
|
|
29480
|
+
const discriminatedUnion = {
|
|
29481
|
+
kind: "legacy",
|
|
29482
|
+
propertyName: discriminator.propertyName,
|
|
29483
|
+
variants,
|
|
29484
|
+
};
|
|
29485
|
+
return [discriminatedUnion, diagnostics];
|
|
29381
29486
|
}
|
|
29382
|
-
|
|
29383
|
-
const [
|
|
29384
|
-
|
|
29385
|
-
|
|
29386
|
-
|
|
29487
|
+
function reportDuplicateDiscriminatorValues(duplicates, diagnostics) {
|
|
29488
|
+
for (const [duplicateKey, models] of duplicates.entries()) {
|
|
29489
|
+
for (const model of models) {
|
|
29490
|
+
diagnostics.push(createDiagnostic({
|
|
29491
|
+
code: "invalid-discriminator-value",
|
|
29492
|
+
messageId: "duplicate",
|
|
29493
|
+
format: { discriminator: duplicateKey },
|
|
29494
|
+
target: model,
|
|
29495
|
+
}));
|
|
29496
|
+
}
|
|
29497
|
+
}
|
|
29498
|
+
}
|
|
29499
|
+
function getDiscriminatorProperty(model, discriminator, diagnostics) {
|
|
29500
|
+
const prop = model.properties.get(discriminator.propertyName);
|
|
29501
|
+
if (prop && prop.optional) {
|
|
29502
|
+
diagnostics.push(createDiagnostic({
|
|
29503
|
+
code: "invalid-discriminator-value",
|
|
29504
|
+
messageId: "required",
|
|
29505
|
+
target: prop,
|
|
29506
|
+
}));
|
|
29507
|
+
}
|
|
29508
|
+
return prop;
|
|
29509
|
+
}
|
|
29510
|
+
function getDiscriminatorValues(model, discriminator, diagnostics) {
|
|
29511
|
+
const prop = getDiscriminatorProperty(model, discriminator, diagnostics);
|
|
29512
|
+
if (!prop)
|
|
29387
29513
|
return undefined;
|
|
29514
|
+
const keys = getStringValues(prop.type);
|
|
29515
|
+
if (keys.length === 0) {
|
|
29516
|
+
diagnostics.push(createDiagnostic({
|
|
29517
|
+
code: "invalid-discriminator-value",
|
|
29518
|
+
format: { kind: prop.type.kind },
|
|
29519
|
+
target: prop,
|
|
29520
|
+
}));
|
|
29521
|
+
}
|
|
29522
|
+
return keys;
|
|
29523
|
+
}
|
|
29524
|
+
function getStringValues(type) {
|
|
29525
|
+
switch (type.kind) {
|
|
29526
|
+
case "String":
|
|
29527
|
+
return [type.value];
|
|
29528
|
+
case "Union":
|
|
29529
|
+
return [...type.variants.values()].flatMap((x) => getStringValues(x.type)).filter(isDefined);
|
|
29530
|
+
case "EnumMember":
|
|
29531
|
+
return typeof type.value !== "number" ? [type.value ?? type.name] : [];
|
|
29532
|
+
case "UnionVariant":
|
|
29533
|
+
return getStringValues(type.type);
|
|
29534
|
+
default:
|
|
29535
|
+
return [];
|
|
29536
|
+
}
|
|
29537
|
+
}
|
|
29538
|
+
function getStringValue(type) {
|
|
29539
|
+
switch (type.kind) {
|
|
29540
|
+
case "String":
|
|
29541
|
+
return type.value;
|
|
29542
|
+
case "EnumMember":
|
|
29543
|
+
return typeof type.value !== "number" ? (type.value ?? type.name) : undefined;
|
|
29544
|
+
default:
|
|
29545
|
+
return undefined;
|
|
29388
29546
|
}
|
|
29389
|
-
const resolvedMimeType = mimeTypeObj?.suffix
|
|
29390
|
-
? `${mimeTypeObj.type}/${mimeTypeObj.suffix}`
|
|
29391
|
-
: mimeType;
|
|
29392
|
-
return getEncodedNamesMap(program, target)?.get(resolvedMimeType);
|
|
29393
29547
|
}
|
|
29548
|
+
|
|
29549
|
+
//
|
|
29550
|
+
// Generated by scripts/regen-nonascii-map.js
|
|
29551
|
+
// on node v18.16.0 with unicode 15.0.
|
|
29552
|
+
//
|
|
29394
29553
|
/**
|
|
29395
|
-
*
|
|
29396
|
-
* If a specific value was provided by `@encodedName` decorator for that mime type it will return that otherwise it will return the name of the type.
|
|
29397
|
-
*
|
|
29398
|
-
* @example
|
|
29399
|
-
*
|
|
29400
|
-
* For the given
|
|
29401
|
-
* ```tsp
|
|
29402
|
-
* model Certificate {
|
|
29403
|
-
* @encodedName("application/json", "exp")
|
|
29404
|
-
* @encodedName("application/xml", "expiry")
|
|
29405
|
-
* expireAt: utcDateTime;
|
|
29406
|
-
*
|
|
29407
|
-
* }
|
|
29408
|
-
* ```
|
|
29409
|
-
*
|
|
29410
|
-
* ```ts
|
|
29411
|
-
* resolveEncodedName(program, type, "application/json") // exp
|
|
29412
|
-
* resolveEncodedName(program, type, "application/merge-patch+json") // exp
|
|
29413
|
-
* resolveEncodedName(program, type, "application/xml") // expireAt
|
|
29414
|
-
* resolveEncodedName(program, type, "application/yaml") // expiry
|
|
29415
|
-
* ```
|
|
29416
|
-
*/
|
|
29417
|
-
function resolveEncodedName(program, target, mimeType) {
|
|
29418
|
-
return getEncodedName(program, target, mimeType) ?? target.name;
|
|
29419
|
-
}
|
|
29420
|
-
|
|
29421
|
-
//
|
|
29422
|
-
// Generated by scripts/regen-nonascii-map.js
|
|
29423
|
-
// on node v18.16.0 with unicode 15.0.
|
|
29424
|
-
//
|
|
29425
|
-
/**
|
|
29426
|
-
* @internal
|
|
29554
|
+
* @internal
|
|
29427
29555
|
*
|
|
29428
29556
|
* Map of non-ascii characters that are valid in an identifier. Each pair of
|
|
29429
29557
|
* numbers represents an inclusive range of code points.
|
|
@@ -30685,6 +30813,71 @@ function getStringTemplateName(type) {
|
|
|
30685
30813
|
return "string";
|
|
30686
30814
|
}
|
|
30687
30815
|
|
|
30816
|
+
const regex = /^(application|audio|font|example|image|message|model|multipart|text|video|x-(?:[0-9A-Za-z!#$%&'*+.^_`|~-]+))\/([0-9A-Za-z!#$%&'*+.^_`|~-]+)$/;
|
|
30817
|
+
function parseMimeType(mimeType) {
|
|
30818
|
+
const match = mimeType.match(regex);
|
|
30819
|
+
if (match == null) {
|
|
30820
|
+
return undefined;
|
|
30821
|
+
}
|
|
30822
|
+
const type = {
|
|
30823
|
+
type: match[1],
|
|
30824
|
+
...parseSubType(match[2]),
|
|
30825
|
+
};
|
|
30826
|
+
return type;
|
|
30827
|
+
}
|
|
30828
|
+
function parseSubType(value) {
|
|
30829
|
+
if (!value.includes("+"))
|
|
30830
|
+
return { subtype: value };
|
|
30831
|
+
const [subtype, suffix] = value.split("+", 2);
|
|
30832
|
+
return { subtype, suffix };
|
|
30833
|
+
}
|
|
30834
|
+
|
|
30835
|
+
const [getEncodedNamesMap, setEncodedNamesMap, getEncodedNamesStateMap] = useStateMap(createStateSymbol("encodedName"));
|
|
30836
|
+
function getEncodedName(program, target, mimeType) {
|
|
30837
|
+
const mimeTypeObj = parseMimeType(mimeType);
|
|
30838
|
+
if (mimeTypeObj === undefined) {
|
|
30839
|
+
return undefined;
|
|
30840
|
+
}
|
|
30841
|
+
const resolvedMimeType = mimeTypeObj?.suffix
|
|
30842
|
+
? `${mimeTypeObj.type}/${mimeTypeObj.suffix}`
|
|
30843
|
+
: mimeType;
|
|
30844
|
+
return getEncodedNamesMap(program, target)?.get(resolvedMimeType);
|
|
30845
|
+
}
|
|
30846
|
+
/**
|
|
30847
|
+
* Resolve the encoded name for the given type when serialized to the given mime type.
|
|
30848
|
+
* If a specific value was provided by `@encodedName` decorator for that mime type it will return that otherwise it will return the name of the type.
|
|
30849
|
+
*
|
|
30850
|
+
* @example
|
|
30851
|
+
*
|
|
30852
|
+
* For the given
|
|
30853
|
+
* ```tsp
|
|
30854
|
+
* model Certificate {
|
|
30855
|
+
* @encodedName("application/json", "exp")
|
|
30856
|
+
* @encodedName("application/xml", "expiry")
|
|
30857
|
+
* expireAt: utcDateTime;
|
|
30858
|
+
*
|
|
30859
|
+
* }
|
|
30860
|
+
* ```
|
|
30861
|
+
*
|
|
30862
|
+
* ```ts
|
|
30863
|
+
* resolveEncodedName(program, type, "application/json") // exp
|
|
30864
|
+
* resolveEncodedName(program, type, "application/merge-patch+json") // exp
|
|
30865
|
+
* resolveEncodedName(program, type, "application/xml") // expireAt
|
|
30866
|
+
* resolveEncodedName(program, type, "application/yaml") // expiry
|
|
30867
|
+
* ```
|
|
30868
|
+
*/
|
|
30869
|
+
function resolveEncodedName(program, target, mimeType) {
|
|
30870
|
+
return getEncodedName(program, target, mimeType) ?? target.name;
|
|
30871
|
+
}
|
|
30872
|
+
|
|
30873
|
+
function getLocationContext(program, type) {
|
|
30874
|
+
const sourceLocation = getSourceLocation(type);
|
|
30875
|
+
if (sourceLocation.isSynthetic) {
|
|
30876
|
+
return { type: "synthetic" };
|
|
30877
|
+
}
|
|
30878
|
+
return program.getSourceFileLocationContext(sourceLocation.file);
|
|
30879
|
+
}
|
|
30880
|
+
|
|
30688
30881
|
/**
|
|
30689
30882
|
* Flow control for mutators.
|
|
30690
30883
|
*
|
|
@@ -30984,228 +31177,6 @@ function extendsStdType(typeName) {
|
|
|
30984
31177
|
};
|
|
30985
31178
|
}
|
|
30986
31179
|
|
|
30987
|
-
function getDiscriminatedUnion(typeOrProgram, typeOrDiscriminator) {
|
|
30988
|
-
if ("propertyName" in typeOrDiscriminator) {
|
|
30989
|
-
const type = typeOrProgram;
|
|
30990
|
-
switch (type.kind) {
|
|
30991
|
-
case "Model":
|
|
30992
|
-
return getDiscriminatedUnionFromInheritance(type, typeOrDiscriminator);
|
|
30993
|
-
case "Union":
|
|
30994
|
-
return getDiscriminatedUnionForUnionLegacy(type, typeOrDiscriminator);
|
|
30995
|
-
}
|
|
30996
|
-
}
|
|
30997
|
-
else {
|
|
30998
|
-
return getDiscriminatedUnionForUnion(typeOrProgram, typeOrDiscriminator);
|
|
30999
|
-
}
|
|
31000
|
-
}
|
|
31001
|
-
function getDiscriminatedUnionForUnion(program, type) {
|
|
31002
|
-
const options = getDiscriminatedOptions(program, type);
|
|
31003
|
-
const diagnostics = [];
|
|
31004
|
-
if (options === undefined) {
|
|
31005
|
-
return [undefined, []];
|
|
31006
|
-
}
|
|
31007
|
-
const variants = new Map();
|
|
31008
|
-
let defaultVariant;
|
|
31009
|
-
// If there is not envelope then every variant needs to be a model.
|
|
31010
|
-
for (const variant of type.variants.values()) {
|
|
31011
|
-
if (typeof variant.name !== "string") {
|
|
31012
|
-
if (defaultVariant) {
|
|
31013
|
-
diagnostics.push(createDiagnostic({
|
|
31014
|
-
code: "invalid-discriminated-union-variant",
|
|
31015
|
-
messageId: "duplicateDefaultVariant",
|
|
31016
|
-
target: variant,
|
|
31017
|
-
}));
|
|
31018
|
-
}
|
|
31019
|
-
else {
|
|
31020
|
-
defaultVariant = variant.type;
|
|
31021
|
-
}
|
|
31022
|
-
continue;
|
|
31023
|
-
}
|
|
31024
|
-
variants.set(variant.name, variant.type);
|
|
31025
|
-
if (options.envelope === "none") {
|
|
31026
|
-
if (variant.type.kind !== "Model") {
|
|
31027
|
-
diagnostics.push(createDiagnostic({
|
|
31028
|
-
code: "invalid-discriminated-union-variant",
|
|
31029
|
-
messageId: "noEnvelopeModel",
|
|
31030
|
-
format: { name: variant.name.toString() },
|
|
31031
|
-
target: variant,
|
|
31032
|
-
}));
|
|
31033
|
-
continue;
|
|
31034
|
-
}
|
|
31035
|
-
const prop = variant.type.properties.get(options.discriminatorPropertyName);
|
|
31036
|
-
if (prop !== undefined) {
|
|
31037
|
-
const key = getStringValue(prop.type);
|
|
31038
|
-
if (key !== variant.name) {
|
|
31039
|
-
diagnostics.push(createDiagnostic({
|
|
31040
|
-
code: "invalid-discriminated-union-variant",
|
|
31041
|
-
messageId: "discriminantMismatch",
|
|
31042
|
-
format: {
|
|
31043
|
-
name: variant.name.toString(),
|
|
31044
|
-
discriminant: options.discriminatorPropertyName,
|
|
31045
|
-
propertyValue: key,
|
|
31046
|
-
variantName: String(variant.name),
|
|
31047
|
-
},
|
|
31048
|
-
target: variant.type,
|
|
31049
|
-
}));
|
|
31050
|
-
}
|
|
31051
|
-
}
|
|
31052
|
-
}
|
|
31053
|
-
}
|
|
31054
|
-
return [
|
|
31055
|
-
{
|
|
31056
|
-
type,
|
|
31057
|
-
options,
|
|
31058
|
-
variants,
|
|
31059
|
-
},
|
|
31060
|
-
diagnostics,
|
|
31061
|
-
];
|
|
31062
|
-
}
|
|
31063
|
-
function getDiscriminatedUnionForUnionLegacy(type, discriminator) {
|
|
31064
|
-
const variants = new Map();
|
|
31065
|
-
const diagnostics = [];
|
|
31066
|
-
const duplicates = new DuplicateTracker();
|
|
31067
|
-
for (const variant of type.variants.values()) {
|
|
31068
|
-
if (variant.type.kind !== "Model") {
|
|
31069
|
-
diagnostics.push(createDiagnostic({
|
|
31070
|
-
code: "invalid-discriminated-union-variant",
|
|
31071
|
-
format: { name: variant.name.toString() },
|
|
31072
|
-
target: variant,
|
|
31073
|
-
}));
|
|
31074
|
-
continue;
|
|
31075
|
-
}
|
|
31076
|
-
const prop = getDiscriminatorProperty(variant.type, discriminator, diagnostics);
|
|
31077
|
-
if (prop === undefined) {
|
|
31078
|
-
diagnostics.push(createDiagnostic({
|
|
31079
|
-
code: "invalid-discriminated-union-variant",
|
|
31080
|
-
messageId: "noDiscriminant",
|
|
31081
|
-
format: { name: variant.name.toString(), discriminant: discriminator.propertyName },
|
|
31082
|
-
target: variant,
|
|
31083
|
-
}));
|
|
31084
|
-
continue;
|
|
31085
|
-
}
|
|
31086
|
-
const key = getStringValue(prop.type);
|
|
31087
|
-
if (key) {
|
|
31088
|
-
duplicates.track(key, variant.type);
|
|
31089
|
-
variants.set(key, variant.type);
|
|
31090
|
-
}
|
|
31091
|
-
else {
|
|
31092
|
-
diagnostics.push(createDiagnostic({
|
|
31093
|
-
code: "invalid-discriminated-union-variant",
|
|
31094
|
-
messageId: "wrongDiscriminantType",
|
|
31095
|
-
format: { name: variant.name.toString(), discriminant: discriminator.propertyName },
|
|
31096
|
-
target: variant.type,
|
|
31097
|
-
}));
|
|
31098
|
-
}
|
|
31099
|
-
}
|
|
31100
|
-
reportDuplicateDiscriminatorValues(duplicates, diagnostics);
|
|
31101
|
-
const discriminatedUnion = {
|
|
31102
|
-
kind: "legacy",
|
|
31103
|
-
propertyName: discriminator.propertyName,
|
|
31104
|
-
variants,
|
|
31105
|
-
};
|
|
31106
|
-
return [discriminatedUnion, diagnostics];
|
|
31107
|
-
}
|
|
31108
|
-
function getDiscriminatedUnionFromInheritance(type, discriminator) {
|
|
31109
|
-
const variants = new Map();
|
|
31110
|
-
const diagnostics = [];
|
|
31111
|
-
const duplicates = new DuplicateTracker();
|
|
31112
|
-
function checkForVariantsIn(current) {
|
|
31113
|
-
for (const derivedModel of current.derivedModels) {
|
|
31114
|
-
if (isTemplateDeclarationOrInstance(derivedModel)) {
|
|
31115
|
-
continue; // Skip template instances as they should be used with `model is`
|
|
31116
|
-
}
|
|
31117
|
-
const keys = getDiscriminatorValues(derivedModel, discriminator, diagnostics);
|
|
31118
|
-
if (keys === undefined) {
|
|
31119
|
-
if (derivedModel.derivedModels.length === 0) {
|
|
31120
|
-
diagnostics.push(createDiagnostic({
|
|
31121
|
-
code: "missing-discriminator-property",
|
|
31122
|
-
format: { discriminator: discriminator.propertyName },
|
|
31123
|
-
target: derivedModel,
|
|
31124
|
-
}));
|
|
31125
|
-
}
|
|
31126
|
-
else {
|
|
31127
|
-
checkForVariantsIn(derivedModel);
|
|
31128
|
-
}
|
|
31129
|
-
}
|
|
31130
|
-
else {
|
|
31131
|
-
for (const key of keys) {
|
|
31132
|
-
duplicates.track(key, derivedModel);
|
|
31133
|
-
variants.set(key, derivedModel);
|
|
31134
|
-
}
|
|
31135
|
-
}
|
|
31136
|
-
}
|
|
31137
|
-
}
|
|
31138
|
-
checkForVariantsIn(type);
|
|
31139
|
-
reportDuplicateDiscriminatorValues(duplicates, diagnostics);
|
|
31140
|
-
const discriminatedUnion = {
|
|
31141
|
-
kind: "legacy",
|
|
31142
|
-
propertyName: discriminator.propertyName,
|
|
31143
|
-
variants,
|
|
31144
|
-
};
|
|
31145
|
-
return [discriminatedUnion, diagnostics];
|
|
31146
|
-
}
|
|
31147
|
-
function reportDuplicateDiscriminatorValues(duplicates, diagnostics) {
|
|
31148
|
-
for (const [duplicateKey, models] of duplicates.entries()) {
|
|
31149
|
-
for (const model of models) {
|
|
31150
|
-
diagnostics.push(createDiagnostic({
|
|
31151
|
-
code: "invalid-discriminator-value",
|
|
31152
|
-
messageId: "duplicate",
|
|
31153
|
-
format: { discriminator: duplicateKey },
|
|
31154
|
-
target: model,
|
|
31155
|
-
}));
|
|
31156
|
-
}
|
|
31157
|
-
}
|
|
31158
|
-
}
|
|
31159
|
-
function getDiscriminatorProperty(model, discriminator, diagnostics) {
|
|
31160
|
-
const prop = model.properties.get(discriminator.propertyName);
|
|
31161
|
-
if (prop && prop.optional) {
|
|
31162
|
-
diagnostics.push(createDiagnostic({
|
|
31163
|
-
code: "invalid-discriminator-value",
|
|
31164
|
-
messageId: "required",
|
|
31165
|
-
target: prop,
|
|
31166
|
-
}));
|
|
31167
|
-
}
|
|
31168
|
-
return prop;
|
|
31169
|
-
}
|
|
31170
|
-
function getDiscriminatorValues(model, discriminator, diagnostics) {
|
|
31171
|
-
const prop = getDiscriminatorProperty(model, discriminator, diagnostics);
|
|
31172
|
-
if (!prop)
|
|
31173
|
-
return undefined;
|
|
31174
|
-
const keys = getStringValues(prop.type);
|
|
31175
|
-
if (keys.length === 0) {
|
|
31176
|
-
diagnostics.push(createDiagnostic({
|
|
31177
|
-
code: "invalid-discriminator-value",
|
|
31178
|
-
format: { kind: prop.type.kind },
|
|
31179
|
-
target: prop,
|
|
31180
|
-
}));
|
|
31181
|
-
}
|
|
31182
|
-
return keys;
|
|
31183
|
-
}
|
|
31184
|
-
function getStringValues(type) {
|
|
31185
|
-
switch (type.kind) {
|
|
31186
|
-
case "String":
|
|
31187
|
-
return [type.value];
|
|
31188
|
-
case "Union":
|
|
31189
|
-
return [...type.variants.values()].flatMap((x) => getStringValues(x.type)).filter(isDefined);
|
|
31190
|
-
case "EnumMember":
|
|
31191
|
-
return typeof type.value !== "number" ? [type.value ?? type.name] : [];
|
|
31192
|
-
case "UnionVariant":
|
|
31193
|
-
return getStringValues(type.type);
|
|
31194
|
-
default:
|
|
31195
|
-
return [];
|
|
31196
|
-
}
|
|
31197
|
-
}
|
|
31198
|
-
function getStringValue(type) {
|
|
31199
|
-
switch (type.kind) {
|
|
31200
|
-
case "String":
|
|
31201
|
-
return type.value;
|
|
31202
|
-
case "EnumMember":
|
|
31203
|
-
return typeof type.value !== "number" ? (type.value ?? type.name) : undefined;
|
|
31204
|
-
default:
|
|
31205
|
-
return undefined;
|
|
31206
|
-
}
|
|
31207
|
-
}
|
|
31208
|
-
|
|
31209
31180
|
/**
|
|
31210
31181
|
* Get a plausible name for the given type.
|
|
31211
31182
|
* @experimental
|
|
@@ -31271,15 +31242,12 @@ defineKit({
|
|
|
31271
31242
|
instantiationParameters: type.instantiationParameters
|
|
31272
31243
|
? [...type.instantiationParameters]
|
|
31273
31244
|
: undefined,
|
|
31274
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
31275
|
-
projections: [...type.projections],
|
|
31276
31245
|
models: copyMap(type.models),
|
|
31277
31246
|
decoratorDeclarations: copyMap(type.decoratorDeclarations),
|
|
31278
31247
|
enums: copyMap(type.enums),
|
|
31279
31248
|
unions: copyMap(type.unions),
|
|
31280
31249
|
operations: copyMap(type.operations),
|
|
31281
31250
|
interfaces: copyMap(type.interfaces),
|
|
31282
|
-
functionDeclarations: copyMap(type.functionDeclarations),
|
|
31283
31251
|
namespaces: copyMap(type.namespaces),
|
|
31284
31252
|
scalars: copyMap(type.scalars),
|
|
31285
31253
|
});
|
|
@@ -31842,14 +31810,6 @@ class Realm {
|
|
|
31842
31810
|
}
|
|
31843
31811
|
_a = Realm;
|
|
31844
31812
|
|
|
31845
|
-
function getLocationContext(program, type) {
|
|
31846
|
-
const sourceLocation = getSourceLocation(type);
|
|
31847
|
-
if (sourceLocation.isSynthetic) {
|
|
31848
|
-
return { type: "synthetic" };
|
|
31849
|
-
}
|
|
31850
|
-
return program.getSourceFileLocationContext(sourceLocation.file);
|
|
31851
|
-
}
|
|
31852
|
-
|
|
31853
31813
|
/**
|
|
31854
31814
|
* The fixed set of options for each of the kinds of delimited lists in TypeSpec.
|
|
31855
31815
|
*/
|
|
@@ -31968,18 +31928,6 @@ var ListKind;
|
|
|
31968
31928
|
close: Token.CloseParen,
|
|
31969
31929
|
invalidAnnotationTarget: "expression",
|
|
31970
31930
|
};
|
|
31971
|
-
ListKind.ProjectionExpression = {
|
|
31972
|
-
...ExpresionsBase,
|
|
31973
|
-
allowEmpty: true,
|
|
31974
|
-
open: Token.OpenParen,
|
|
31975
|
-
close: Token.CloseParen,
|
|
31976
|
-
};
|
|
31977
|
-
ListKind.ProjectionParameter = {
|
|
31978
|
-
...ExpresionsBase,
|
|
31979
|
-
allowEmpty: true,
|
|
31980
|
-
open: Token.OpenParen,
|
|
31981
|
-
close: Token.CloseParen,
|
|
31982
|
-
};
|
|
31983
31931
|
})(ListKind || (ListKind = {}));
|
|
31984
31932
|
|
|
31985
31933
|
/**
|
|
@@ -32011,7 +31959,6 @@ var ListKind;
|
|
|
32011
31959
|
],
|
|
32012
31960
|
});
|
|
32013
31961
|
|
|
32014
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
32015
31962
|
var Related;
|
|
32016
31963
|
(function (Related) {
|
|
32017
31964
|
Related[Related["false"] = 0] = "false";
|
|
@@ -32020,7 +31967,6 @@ var Related;
|
|
|
32020
31967
|
})(Related || (Related = {}));
|
|
32021
31968
|
// #endregion
|
|
32022
31969
|
|
|
32023
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
32024
31970
|
/**
|
|
32025
31971
|
* Find all named models that could have been the source of the given
|
|
32026
31972
|
* property. This includes the named parents of all property sources in a
|
|
@@ -33521,11 +33467,6 @@ var CommentCheckFlags;
|
|
|
33521
33467
|
CommentCheckFlags[CommentCheckFlags["Last"] = 256] = "Last";
|
|
33522
33468
|
})(CommentCheckFlags || (CommentCheckFlags = {}));
|
|
33523
33469
|
|
|
33524
|
-
const globalLibraryUrlsLoadedSym = Symbol.for("TYPESPEC_LIBRARY_URLS_LOADED");
|
|
33525
|
-
if (globalThis[globalLibraryUrlsLoadedSym] === undefined) {
|
|
33526
|
-
globalThis[globalLibraryUrlsLoadedSym] = new Set();
|
|
33527
|
-
}
|
|
33528
|
-
|
|
33529
33470
|
// prettier-ignore
|
|
33530
33471
|
var UsageFlags;
|
|
33531
33472
|
(function (UsageFlags) {
|
|
@@ -33534,6 +33475,11 @@ var UsageFlags;
|
|
|
33534
33475
|
UsageFlags[UsageFlags["Output"] = 4] = "Output";
|
|
33535
33476
|
})(UsageFlags || (UsageFlags = {}));
|
|
33536
33477
|
|
|
33478
|
+
const globalLibraryUrlsLoadedSym = Symbol.for("TYPESPEC_LIBRARY_URLS_LOADED");
|
|
33479
|
+
if (globalThis[globalLibraryUrlsLoadedSym] === undefined) {
|
|
33480
|
+
globalThis[globalLibraryUrlsLoadedSym] = new Set();
|
|
33481
|
+
}
|
|
33482
|
+
|
|
33537
33483
|
const CompilerPackageRoot = undefined;
|
|
33538
33484
|
|
|
33539
33485
|
var main$4 = {};
|
|
@@ -44671,8 +44617,7 @@ const TypeConfig = {
|
|
|
44671
44617
|
operations: "nested",
|
|
44672
44618
|
unions: "nested",
|
|
44673
44619
|
enums: "nested",
|
|
44674
|
-
decoratorDeclarations: "nested"
|
|
44675
|
-
functionDeclarations: "nested"
|
|
44620
|
+
decoratorDeclarations: "nested"
|
|
44676
44621
|
},
|
|
44677
44622
|
Interface: {
|
|
44678
44623
|
operations: "nested",
|
|
@@ -44757,10 +44702,7 @@ const TypeConfig = {
|
|
|
44757
44702
|
default: "value"
|
|
44758
44703
|
},
|
|
44759
44704
|
// Don't want to expose those for now
|
|
44760
|
-
|
|
44761
|
-
Object: null,
|
|
44762
|
-
Intrinsic: null,
|
|
44763
|
-
Projection: null
|
|
44705
|
+
Intrinsic: null
|
|
44764
44706
|
};
|
|
44765
44707
|
const CommonPropsConfig = {
|
|
44766
44708
|
namespace: "parent"
|
|
@@ -44776,11 +44718,7 @@ const HiddenProps = [
|
|
|
44776
44718
|
"templateMapper",
|
|
44777
44719
|
"instantiationParameters",
|
|
44778
44720
|
"decorators",
|
|
44779
|
-
"projectionBase",
|
|
44780
|
-
"projectionsByName",
|
|
44781
|
-
"projectionSource",
|
|
44782
44721
|
"projector",
|
|
44783
|
-
"projections",
|
|
44784
44722
|
"isFinished"
|
|
44785
44723
|
];
|
|
44786
44724
|
new Set(HiddenProps);
|
|
@@ -11,9 +11,9 @@ type TypeGraphConfig = {
|
|
|
11
11
|
export declare const CommonPropsConfig: {
|
|
12
12
|
namespace: string;
|
|
13
13
|
};
|
|
14
|
-
declare const HiddenProps: readonly ["entityKind", "kind", "name", "node", "symbol", "templateNode", "templateArguments", "templateMapper", "instantiationParameters", "decorators", "
|
|
14
|
+
declare const HiddenProps: readonly ["entityKind", "kind", "name", "node", "symbol", "templateNode", "templateArguments", "templateMapper", "instantiationParameters", "decorators", "projector", "isFinished"];
|
|
15
15
|
type HiddenPropsType = (typeof HiddenProps)[number];
|
|
16
|
-
export declare const HiddenPropsSet: Set<"symbol" | "kind" | "entityKind" | "name" | "node" | "templateNode" | "templateArguments" | "templateMapper" | "instantiationParameters" | "decorators" | "
|
|
16
|
+
export declare const HiddenPropsSet: Set<"symbol" | "kind" | "entityKind" | "name" | "node" | "templateNode" | "templateArguments" | "templateMapper" | "instantiationParameters" | "decorators" | "projector" | "isFinished">;
|
|
17
17
|
export declare function getPropertyRendering<T extends Type, K extends keyof T>(type: T, key: K): EntityPropertyConfig;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=type-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-config.d.ts","sourceRoot":"","sources":["../../src/react/type-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAElF,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"type-config.d.ts","sourceRoot":"","sources":["../../src/react/type-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAElF,eAAO,MAAM,UAAU,EAAE,eAgGxB,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,SAAS,IAAI,IAAI,OAAO,CAC1C,MAAM,CAAC,EACP,eAAe,GAAG,MAAM,OAAO,iBAAiB,CACjD,CAAC;AACF,KAAK,UAAU,CAAC,CAAC,SAAS,IAAI,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,IAAI,CAAC;AACxF,KAAK,eAAe,GAAG;KACpB,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAEF,QAAA,MAAM,WAAW,sLAaP,CAAC;AACX,KAAK,eAAe,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc,2LAAuB,CAAC;AAEnD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,MAAM,CAAC,EACpE,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,CAAC,GACL,oBAAoB,CAItB"}
|
package/package.json
CHANGED