@formspec/build 0.1.0-alpha.51 → 0.1.0-alpha.52

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/internals.js CHANGED
@@ -791,21 +791,21 @@ function wrapInConditional(field, layout, provenance) {
791
791
  }
792
792
 
793
793
  // src/analyzer/program.ts
794
- import * as ts6 from "typescript";
794
+ import * as ts7 from "typescript";
795
795
  import * as path from "path";
796
796
 
797
797
  // src/analyzer/class-analyzer.ts
798
- import * as ts5 from "typescript";
798
+ import * as ts6 from "typescript";
799
799
  import {
800
800
  analyzeMetadataForNodeWithChecker,
801
801
  parseCommentBlock
802
802
  } from "@formspec/analysis/internal";
803
803
 
804
804
  // src/analyzer/jsdoc-constraints.ts
805
- import * as ts4 from "typescript";
805
+ import * as ts5 from "typescript";
806
806
 
807
807
  // src/analyzer/tsdoc-parser.ts
808
- import * as ts3 from "typescript";
808
+ import * as ts4 from "typescript";
809
809
  import {
810
810
  checkSyntheticTagApplication,
811
811
  choosePreferredPayloadText,
@@ -813,6 +813,7 @@ import {
813
813
  getTagDefinition,
814
814
  hasTypeSemanticCapability,
815
815
  normalizeFormSpecTagName,
816
+ stripNullishUnion as stripNullishUnion2,
816
817
  parseConstraintTagValue,
817
818
  parseDefaultValueTagValue,
818
819
  parseTagSyntax,
@@ -945,6 +946,14 @@ function customTypeIdFromLookup(result) {
945
946
  return `${result.extensionId}/${result.registration.typeName}`;
946
947
  }
947
948
 
949
+ // src/analyzer/builtin-brands.ts
950
+ import * as ts3 from "typescript";
951
+ function isIntegerBrandedType(type) {
952
+ if (!type.isIntersection()) return false;
953
+ if (!type.types.some((member) => !!(member.flags & ts3.TypeFlags.Number))) return false;
954
+ return collectBrandIdentifiers(type).includes("__integerBrand");
955
+ }
956
+
948
957
  // src/analyzer/tsdoc-parser.ts
949
958
  function sharedTagValueOptions(options) {
950
959
  return {
@@ -952,7 +961,7 @@ function sharedTagValueOptions(options) {
952
961
  ...options?.fieldType !== void 0 ? { fieldType: options.fieldType } : {}
953
962
  };
954
963
  }
955
- var SYNTHETIC_TYPE_FORMAT_FLAGS = ts3.TypeFormatFlags.NoTruncation | ts3.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope;
964
+ var SYNTHETIC_TYPE_FORMAT_FLAGS = ts4.TypeFormatFlags.NoTruncation | ts4.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope;
956
965
  function getExtensionTypeNames(registry) {
957
966
  if (registry === void 0) {
958
967
  return /* @__PURE__ */ new Set();
@@ -966,23 +975,23 @@ function getExtensionTypeNames(registry) {
966
975
  function collectImportedNames(sourceFile) {
967
976
  const importedNames = /* @__PURE__ */ new Set();
968
977
  for (const statement of sourceFile.statements) {
969
- if (ts3.isImportDeclaration(statement) && statement.importClause !== void 0) {
978
+ if (ts4.isImportDeclaration(statement) && statement.importClause !== void 0) {
970
979
  const clause = statement.importClause;
971
980
  if (clause.name !== void 0) {
972
981
  importedNames.add(clause.name.text);
973
982
  }
974
983
  if (clause.namedBindings !== void 0) {
975
- if (ts3.isNamedImports(clause.namedBindings)) {
984
+ if (ts4.isNamedImports(clause.namedBindings)) {
976
985
  for (const specifier of clause.namedBindings.elements) {
977
986
  importedNames.add(specifier.name.text);
978
987
  }
979
- } else if (ts3.isNamespaceImport(clause.namedBindings)) {
988
+ } else if (ts4.isNamespaceImport(clause.namedBindings)) {
980
989
  importedNames.add(clause.namedBindings.name.text);
981
990
  }
982
991
  }
983
992
  continue;
984
993
  }
985
- if (ts3.isImportEqualsDeclaration(statement)) {
994
+ if (ts4.isImportEqualsDeclaration(statement)) {
986
995
  importedNames.add(statement.name.text);
987
996
  }
988
997
  }
@@ -990,13 +999,13 @@ function collectImportedNames(sourceFile) {
990
999
  }
991
1000
  function isNonReferenceIdentifier(node) {
992
1001
  const parent = node.parent;
993
- if ((ts3.isBindingElement(parent) || ts3.isClassDeclaration(parent) || ts3.isEnumDeclaration(parent) || ts3.isEnumMember(parent) || ts3.isFunctionDeclaration(parent) || ts3.isFunctionExpression(parent) || ts3.isImportClause(parent) || ts3.isImportEqualsDeclaration(parent) || ts3.isImportSpecifier(parent) || ts3.isInterfaceDeclaration(parent) || ts3.isMethodDeclaration(parent) || ts3.isMethodSignature(parent) || ts3.isModuleDeclaration(parent) || ts3.isNamespaceExport(parent) || ts3.isNamespaceImport(parent) || ts3.isParameter(parent) || ts3.isPropertyDeclaration(parent) || ts3.isPropertySignature(parent) || ts3.isSetAccessorDeclaration(parent) || ts3.isGetAccessorDeclaration(parent) || ts3.isTypeAliasDeclaration(parent) || ts3.isTypeParameterDeclaration(parent) || ts3.isVariableDeclaration(parent)) && parent.name === node) {
1002
+ if ((ts4.isBindingElement(parent) || ts4.isClassDeclaration(parent) || ts4.isEnumDeclaration(parent) || ts4.isEnumMember(parent) || ts4.isFunctionDeclaration(parent) || ts4.isFunctionExpression(parent) || ts4.isImportClause(parent) || ts4.isImportEqualsDeclaration(parent) || ts4.isImportSpecifier(parent) || ts4.isInterfaceDeclaration(parent) || ts4.isMethodDeclaration(parent) || ts4.isMethodSignature(parent) || ts4.isModuleDeclaration(parent) || ts4.isNamespaceExport(parent) || ts4.isNamespaceImport(parent) || ts4.isParameter(parent) || ts4.isPropertyDeclaration(parent) || ts4.isPropertySignature(parent) || ts4.isSetAccessorDeclaration(parent) || ts4.isGetAccessorDeclaration(parent) || ts4.isTypeAliasDeclaration(parent) || ts4.isTypeParameterDeclaration(parent) || ts4.isVariableDeclaration(parent)) && parent.name === node) {
994
1003
  return true;
995
1004
  }
996
- if ((ts3.isPropertyAssignment(parent) || ts3.isPropertyAccessExpression(parent)) && parent.name === node) {
1005
+ if ((ts4.isPropertyAssignment(parent) || ts4.isPropertyAccessExpression(parent)) && parent.name === node) {
997
1006
  return true;
998
1007
  }
999
- if (ts3.isQualifiedName(parent) && parent.right === node) {
1008
+ if (ts4.isQualifiedName(parent) && parent.right === node) {
1000
1009
  return true;
1001
1010
  }
1002
1011
  return false;
@@ -1010,11 +1019,11 @@ function statementReferencesImportedName(statement, importedNames) {
1010
1019
  if (referencesImportedName) {
1011
1020
  return;
1012
1021
  }
1013
- if (ts3.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
1022
+ if (ts4.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
1014
1023
  referencesImportedName = true;
1015
1024
  return;
1016
1025
  }
1017
- ts3.forEachChild(node, visit);
1026
+ ts4.forEachChild(node, visit);
1018
1027
  };
1019
1028
  visit(statement);
1020
1029
  return referencesImportedName;
@@ -1025,9 +1034,9 @@ function buildSupportingDeclarations(sourceFile, extensionTypeNames) {
1025
1034
  [...importedNames].filter((name) => !extensionTypeNames.has(name))
1026
1035
  );
1027
1036
  return sourceFile.statements.filter((statement) => {
1028
- if (ts3.isImportDeclaration(statement)) return false;
1029
- if (ts3.isImportEqualsDeclaration(statement)) return false;
1030
- if (ts3.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0)
1037
+ if (ts4.isImportDeclaration(statement)) return false;
1038
+ if (ts4.isImportEqualsDeclaration(statement)) return false;
1039
+ if (ts4.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0)
1031
1040
  return false;
1032
1041
  if (statementReferencesImportedName(statement, importedNamesToSkip)) {
1033
1042
  return false;
@@ -1125,7 +1134,7 @@ function stripHintNullishUnion(type) {
1125
1134
  return type;
1126
1135
  }
1127
1136
  const nonNullish = type.types.filter(
1128
- (member) => (member.flags & (ts3.TypeFlags.Null | ts3.TypeFlags.Undefined)) === 0
1137
+ (member) => (member.flags & (ts4.TypeFlags.Null | ts4.TypeFlags.Undefined)) === 0
1129
1138
  );
1130
1139
  if (nonNullish.length === 1 && nonNullish[0] !== void 0) {
1131
1140
  return nonNullish[0];
@@ -1141,10 +1150,10 @@ function isUserEmittableHintProperty(property, declaration) {
1141
1150
  }
1142
1151
  if ("name" in declaration && declaration.name !== void 0) {
1143
1152
  const name = declaration.name;
1144
- if (ts3.isComputedPropertyName(name) || ts3.isPrivateIdentifier(name)) {
1153
+ if (ts4.isComputedPropertyName(name) || ts4.isPrivateIdentifier(name)) {
1145
1154
  return false;
1146
1155
  }
1147
- if (!ts3.isIdentifier(name) && !ts3.isStringLiteral(name) && !ts3.isNumericLiteral(name)) {
1156
+ if (!ts4.isIdentifier(name) && !ts4.isStringLiteral(name) && !ts4.isNumericLiteral(name)) {
1148
1157
  return false;
1149
1158
  }
1150
1159
  }
@@ -1362,6 +1371,9 @@ function buildCompilerBackedConstraintDiagnostics(node, sourceFile, tagName, par
1362
1371
  }
1363
1372
  const hasBroadening = (() => {
1364
1373
  if (target === null) {
1374
+ if (isIntegerBrandedType(stripNullishUnion2(subjectType)) && definition.capabilities.includes("numeric-comparable")) {
1375
+ return true;
1376
+ }
1365
1377
  return hasBuiltinConstraintBroadening(tagName, options);
1366
1378
  }
1367
1379
  const registry = options?.extensionRegistry;
@@ -1514,12 +1526,12 @@ function parseTSDocTags(node, file = "", options) {
1514
1526
  const sourceText = sourceFile.getFullText();
1515
1527
  const extensionTypeNames = getExtensionTypeNames(options?.extensionRegistry);
1516
1528
  const supportingDeclarations = buildSupportingDeclarations(sourceFile, extensionTypeNames);
1517
- const commentRanges = ts3.getLeadingCommentRanges(sourceText, node.getFullStart());
1529
+ const commentRanges = ts4.getLeadingCommentRanges(sourceText, node.getFullStart());
1518
1530
  const rawTextFallbacks = collectRawTextFallbacks(node, file);
1519
1531
  const extensionTagNames = getExtensionTagNames(options);
1520
1532
  if (commentRanges) {
1521
1533
  for (const range of commentRanges) {
1522
- if (range.kind !== ts3.SyntaxKind.MultiLineCommentTrivia) {
1534
+ if (range.kind !== ts4.SyntaxKind.MultiLineCommentTrivia) {
1523
1535
  continue;
1524
1536
  }
1525
1537
  const commentText = sourceText.substring(range.pos, range.end);
@@ -1676,10 +1688,10 @@ function extractDisplayNameMetadata(node) {
1676
1688
  const memberDisplayNames = /* @__PURE__ */ new Map();
1677
1689
  const sourceFile = node.getSourceFile();
1678
1690
  const sourceText = sourceFile.getFullText();
1679
- const commentRanges = ts3.getLeadingCommentRanges(sourceText, node.getFullStart());
1691
+ const commentRanges = ts4.getLeadingCommentRanges(sourceText, node.getFullStart());
1680
1692
  if (commentRanges) {
1681
1693
  for (const range of commentRanges) {
1682
- if (range.kind !== ts3.SyntaxKind.MultiLineCommentTrivia) continue;
1694
+ if (range.kind !== ts4.SyntaxKind.MultiLineCommentTrivia) continue;
1683
1695
  const commentText = sourceText.substring(range.pos, range.end);
1684
1696
  if (!commentText.startsWith("/**")) continue;
1685
1697
  const unified = parseUnifiedComment(commentText);
@@ -1704,7 +1716,7 @@ function extractDisplayNameMetadata(node) {
1704
1716
  }
1705
1717
  function collectRawTextFallbacks(node, file) {
1706
1718
  const fallbacks = /* @__PURE__ */ new Map();
1707
- for (const tag of ts3.getJSDocTags(node)) {
1719
+ for (const tag of ts4.getJSDocTags(node)) {
1708
1720
  const tagName = normalizeConstraintTagName(tag.tagName.text);
1709
1721
  if (!TAGS_REQUIRING_RAW_TEXT.has(tagName)) continue;
1710
1722
  const commentText = getTagCommentText(tag)?.trim() ?? "";
@@ -1759,7 +1771,7 @@ function getTagCommentText(tag) {
1759
1771
  if (typeof tag.comment === "string") {
1760
1772
  return tag.comment;
1761
1773
  }
1762
- return ts3.getTextOfJSDocComment(tag.comment);
1774
+ return ts4.getTextOfJSDocComment(tag.comment);
1763
1775
  }
1764
1776
 
1765
1777
  // src/analyzer/jsdoc-constraints.ts
@@ -1777,18 +1789,18 @@ function extractJSDocAnnotationNodes(node, file = "", options) {
1777
1789
  function extractDefaultValueAnnotation(initializer, file = "") {
1778
1790
  if (!initializer) return null;
1779
1791
  let value;
1780
- if (ts4.isStringLiteral(initializer)) {
1792
+ if (ts5.isStringLiteral(initializer)) {
1781
1793
  value = initializer.text;
1782
- } else if (ts4.isNumericLiteral(initializer)) {
1794
+ } else if (ts5.isNumericLiteral(initializer)) {
1783
1795
  value = Number(initializer.text);
1784
- } else if (initializer.kind === ts4.SyntaxKind.TrueKeyword) {
1796
+ } else if (initializer.kind === ts5.SyntaxKind.TrueKeyword) {
1785
1797
  value = true;
1786
- } else if (initializer.kind === ts4.SyntaxKind.FalseKeyword) {
1798
+ } else if (initializer.kind === ts5.SyntaxKind.FalseKeyword) {
1787
1799
  value = false;
1788
- } else if (initializer.kind === ts4.SyntaxKind.NullKeyword) {
1800
+ } else if (initializer.kind === ts5.SyntaxKind.NullKeyword) {
1789
1801
  value = null;
1790
- } else if (ts4.isPrefixUnaryExpression(initializer)) {
1791
- if (initializer.operator === ts4.SyntaxKind.MinusToken && ts4.isNumericLiteral(initializer.operand)) {
1802
+ } else if (ts5.isPrefixUnaryExpression(initializer)) {
1803
+ if (initializer.operator === ts5.SyntaxKind.MinusToken && ts5.isNumericLiteral(initializer.operand)) {
1792
1804
  value = -Number(initializer.operand.text);
1793
1805
  }
1794
1806
  }
@@ -1810,38 +1822,28 @@ function extractDefaultValueAnnotation(initializer, file = "") {
1810
1822
 
1811
1823
  // src/analyzer/class-analyzer.ts
1812
1824
  function isObjectType(type) {
1813
- return !!(type.flags & ts5.TypeFlags.Object);
1825
+ return !!(type.flags & ts6.TypeFlags.Object);
1814
1826
  }
1815
1827
  function isIntersectionType(type) {
1816
- return !!(type.flags & ts5.TypeFlags.Intersection);
1817
- }
1818
- function isIntegerBrandedType(type) {
1819
- if (!type.isIntersection()) {
1820
- return false;
1821
- }
1822
- const hasNumberBase = type.types.some((member) => !!(member.flags & ts5.TypeFlags.Number));
1823
- if (!hasNumberBase) {
1824
- return false;
1825
- }
1826
- return collectBrandIdentifiers(type).includes("__integerBrand");
1828
+ return !!(type.flags & ts6.TypeFlags.Intersection);
1827
1829
  }
1828
1830
  function isResolvableObjectLikeAliasTypeNode(typeNode) {
1829
- if (ts5.isParenthesizedTypeNode(typeNode)) {
1831
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
1830
1832
  return isResolvableObjectLikeAliasTypeNode(typeNode.type);
1831
1833
  }
1832
- if (ts5.isTypeLiteralNode(typeNode) || ts5.isTypeReferenceNode(typeNode)) {
1834
+ if (ts6.isTypeLiteralNode(typeNode) || ts6.isTypeReferenceNode(typeNode)) {
1833
1835
  return true;
1834
1836
  }
1835
- return ts5.isIntersectionTypeNode(typeNode) && typeNode.types.length > 0 && typeNode.types.every((member) => isResolvableObjectLikeAliasTypeNode(member));
1837
+ return ts6.isIntersectionTypeNode(typeNode) && typeNode.types.length > 0 && typeNode.types.every((member) => isResolvableObjectLikeAliasTypeNode(member));
1836
1838
  }
1837
1839
  function isSemanticallyPlainObjectLikeType(type, checker) {
1838
1840
  if (isIntersectionType(type)) {
1839
1841
  return type.types.length > 0 && type.types.every((member) => isSemanticallyPlainObjectLikeType(member, checker));
1840
1842
  }
1841
- return isObjectType(type) && checker.getSignaturesOfType(type, ts5.SignatureKind.Call).length === 0 && checker.getSignaturesOfType(type, ts5.SignatureKind.Construct).length === 0 && !checker.isArrayType(type) && !checker.isTupleType(type);
1843
+ return isObjectType(type) && checker.getSignaturesOfType(type, ts6.SignatureKind.Call).length === 0 && checker.getSignaturesOfType(type, ts6.SignatureKind.Construct).length === 0 && !checker.isArrayType(type) && !checker.isTupleType(type);
1842
1844
  }
1843
1845
  function isTypeReference(type) {
1844
- return !!(type.flags & ts5.TypeFlags.Object) && !!(type.objectFlags & ts5.ObjectFlags.Reference);
1846
+ return !!(type.flags & ts6.TypeFlags.Object) && !!(type.objectFlags & ts6.ObjectFlags.Reference);
1845
1847
  }
1846
1848
  var RESOLVING_TYPE_PLACEHOLDER = {
1847
1849
  kind: "object",
@@ -1906,7 +1908,7 @@ function resolveNodeMetadata(metadataPolicy, declarationKind, logicalName, node,
1906
1908
  function analyzeDeclarationRootInfo(declaration, checker, file = "", extensionRegistry, metadataPolicy) {
1907
1909
  const normalizedMetadataPolicy = createAnalyzerMetadataPolicy(metadataPolicy);
1908
1910
  const declarationType = checker.getTypeAtLocation(declaration);
1909
- const logicalName = ts5.isClassDeclaration(declaration) ? declaration.name?.text ?? "AnonymousClass" : declaration.name.text;
1911
+ const logicalName = ts6.isClassDeclaration(declaration) ? declaration.name?.text ?? "AnonymousClass" : declaration.name.text;
1910
1912
  const docResult = extractJSDocParseResult(
1911
1913
  declaration,
1912
1914
  file,
@@ -1954,7 +1956,7 @@ function analyzeClassToIR(classDecl, checker, file = "", extensionRegistry, meta
1954
1956
  const instanceMethods = [];
1955
1957
  const staticMethods = [];
1956
1958
  for (const member of classDecl.members) {
1957
- if (ts5.isPropertyDeclaration(member)) {
1959
+ if (ts6.isPropertyDeclaration(member)) {
1958
1960
  const fieldNode = analyzeFieldToIR(
1959
1961
  member,
1960
1962
  checker,
@@ -1970,10 +1972,10 @@ function analyzeClassToIR(classDecl, checker, file = "", extensionRegistry, meta
1970
1972
  fields.push(fieldNode);
1971
1973
  fieldLayouts.push({});
1972
1974
  }
1973
- } else if (ts5.isMethodDeclaration(member)) {
1975
+ } else if (ts6.isMethodDeclaration(member)) {
1974
1976
  const methodInfo = analyzeMethod(member, checker);
1975
1977
  if (methodInfo) {
1976
- const isStatic = member.modifiers?.some((m) => m.kind === ts5.SyntaxKind.StaticKeyword);
1978
+ const isStatic = member.modifiers?.some((m) => m.kind === ts6.SyntaxKind.StaticKeyword);
1977
1979
  if (isStatic) {
1978
1980
  staticMethods.push(methodInfo);
1979
1981
  } else {
@@ -2036,7 +2038,7 @@ function analyzeInterfaceToIR(interfaceDecl, checker, file = "", extensionRegist
2036
2038
  diagnostics.push(...interfaceDoc.diagnostics);
2037
2039
  const visiting = /* @__PURE__ */ new Set();
2038
2040
  for (const member of interfaceDecl.members) {
2039
- if (ts5.isPropertySignature(member)) {
2041
+ if (ts6.isPropertySignature(member)) {
2040
2042
  const fieldNode = analyzeInterfacePropertyToIR(
2041
2043
  member,
2042
2044
  checker,
@@ -2094,7 +2096,7 @@ function analyzeTypeAliasToIR(typeAlias, checker, file = "", extensionRegistry,
2094
2096
  if (members === null) {
2095
2097
  const sourceFile = typeAlias.getSourceFile();
2096
2098
  const { line } = sourceFile.getLineAndCharacterOfPosition(typeAlias.getStart());
2097
- const kindDesc = ts5.SyntaxKind[typeAlias.type.kind] ?? "unknown";
2099
+ const kindDesc = ts6.SyntaxKind[typeAlias.type.kind] ?? "unknown";
2098
2100
  return {
2099
2101
  ok: false,
2100
2102
  kind: "not-object-like",
@@ -2129,7 +2131,7 @@ function analyzeTypeAliasToIR(typeAlias, checker, file = "", extensionRegistry,
2129
2131
  diagnostics.push(...typeAliasDoc.diagnostics);
2130
2132
  const visiting = /* @__PURE__ */ new Set();
2131
2133
  for (const member of members) {
2132
- if (ts5.isPropertySignature(member)) {
2134
+ if (ts6.isPropertySignature(member)) {
2133
2135
  const fieldNode = analyzeInterfacePropertyToIR(
2134
2136
  member,
2135
2137
  checker,
@@ -2196,13 +2198,13 @@ function makeAnalysisDiagnostic(code, message, primaryLocation, relatedLocations
2196
2198
  function getLeadingParsedTags(node) {
2197
2199
  const sourceFile = node.getSourceFile();
2198
2200
  const sourceText = sourceFile.getFullText();
2199
- const commentRanges = ts5.getLeadingCommentRanges(sourceText, node.getFullStart());
2201
+ const commentRanges = ts6.getLeadingCommentRanges(sourceText, node.getFullStart());
2200
2202
  if (commentRanges === void 0) {
2201
2203
  return [];
2202
2204
  }
2203
2205
  const parsedTags = [];
2204
2206
  for (const range of commentRanges) {
2205
- if (range.kind !== ts5.SyntaxKind.MultiLineCommentTrivia) {
2207
+ if (range.kind !== ts6.SyntaxKind.MultiLineCommentTrivia) {
2206
2208
  continue;
2207
2209
  }
2208
2210
  const commentText = sourceText.slice(range.pos, range.end);
@@ -2220,19 +2222,19 @@ function resolveDiscriminatorProperty(node, checker, fieldName) {
2220
2222
  return null;
2221
2223
  }
2222
2224
  const declaration = propertySymbol.valueDeclaration ?? propertySymbol.declarations?.find(
2223
- (candidate) => ts5.isPropertyDeclaration(candidate) || ts5.isPropertySignature(candidate)
2225
+ (candidate) => ts6.isPropertyDeclaration(candidate) || ts6.isPropertySignature(candidate)
2224
2226
  ) ?? propertySymbol.declarations?.[0];
2225
2227
  return {
2226
2228
  declaration,
2227
2229
  type: checker.getTypeOfSymbolAtLocation(propertySymbol, declaration ?? node),
2228
- optional: !!(propertySymbol.flags & ts5.SymbolFlags.Optional) || declaration !== void 0 && "questionToken" in declaration && declaration.questionToken !== void 0
2230
+ optional: !!(propertySymbol.flags & ts6.SymbolFlags.Optional) || declaration !== void 0 && "questionToken" in declaration && declaration.questionToken !== void 0
2229
2231
  };
2230
2232
  }
2231
2233
  function isLocalTypeParameterName(node, typeParameterName) {
2232
2234
  return node.typeParameters?.some((typeParameter) => typeParameter.name.text === typeParameterName) ?? false;
2233
2235
  }
2234
2236
  function isNullishSemanticType(type) {
2235
- if (type.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined | ts5.TypeFlags.Void | ts5.TypeFlags.Unknown | ts5.TypeFlags.Any)) {
2237
+ if (type.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined | ts6.TypeFlags.Void | ts6.TypeFlags.Unknown | ts6.TypeFlags.Any)) {
2236
2238
  return true;
2237
2239
  }
2238
2240
  return type.isUnion() && type.types.some((member) => isNullishSemanticType(member));
@@ -2242,7 +2244,7 @@ function isStringLikeSemanticType(type, checker, seen = /* @__PURE__ */ new Set(
2242
2244
  return false;
2243
2245
  }
2244
2246
  seen.add(type);
2245
- if (type.flags & ts5.TypeFlags.StringLike) {
2247
+ if (type.flags & ts6.TypeFlags.StringLike) {
2246
2248
  return true;
2247
2249
  }
2248
2250
  if (type.isUnion()) {
@@ -2255,13 +2257,13 @@ function isStringLikeSemanticType(type, checker, seen = /* @__PURE__ */ new Set(
2255
2257
  return false;
2256
2258
  }
2257
2259
  function getObjectLikeTypeAliasMembers(typeNode) {
2258
- if (ts5.isParenthesizedTypeNode(typeNode)) {
2260
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
2259
2261
  return getObjectLikeTypeAliasMembers(typeNode.type);
2260
2262
  }
2261
- if (ts5.isTypeLiteralNode(typeNode)) {
2263
+ if (ts6.isTypeLiteralNode(typeNode)) {
2262
2264
  return [...typeNode.members];
2263
2265
  }
2264
- if (ts5.isIntersectionTypeNode(typeNode)) {
2266
+ if (ts6.isIntersectionTypeNode(typeNode)) {
2265
2267
  const members = [];
2266
2268
  for (const intersectionMember of typeNode.types) {
2267
2269
  const resolvedMembers = getObjectLikeTypeAliasMembers(intersectionMember);
@@ -2424,7 +2426,7 @@ function resolveLiteralDiscriminatorPropertyValue(boundType, propertyName, check
2424
2426
  }
2425
2427
  if (propertyType.isUnion()) {
2426
2428
  const nonNullMembers = propertyType.types.filter(
2427
- (member) => !(member.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
2429
+ (member) => !(member.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
2428
2430
  );
2429
2431
  if (nonNullMembers.length > 0 && nonNullMembers.every((member) => member.isStringLiteral())) {
2430
2432
  diagnostics.push(
@@ -2473,13 +2475,13 @@ function resolveNamedDiscriminatorDeclaration(type, checker, seen = /* @__PURE__
2473
2475
  seen.add(type);
2474
2476
  const symbol = type.aliasSymbol ?? type.getSymbol();
2475
2477
  if (symbol !== void 0) {
2476
- const aliased = symbol.flags & ts5.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : void 0;
2478
+ const aliased = symbol.flags & ts6.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : void 0;
2477
2479
  const targetSymbol = aliased ?? symbol;
2478
2480
  const declaration = targetSymbol.declarations?.find(
2479
- (candidate) => ts5.isClassDeclaration(candidate) || ts5.isInterfaceDeclaration(candidate) || ts5.isTypeAliasDeclaration(candidate) || ts5.isEnumDeclaration(candidate)
2481
+ (candidate) => ts6.isClassDeclaration(candidate) || ts6.isInterfaceDeclaration(candidate) || ts6.isTypeAliasDeclaration(candidate) || ts6.isEnumDeclaration(candidate)
2480
2482
  );
2481
2483
  if (declaration !== void 0) {
2482
- if (ts5.isTypeAliasDeclaration(declaration) && ts5.isTypeReferenceNode(declaration.type) && checker.getTypeFromTypeNode(declaration.type) !== type) {
2484
+ if (ts6.isTypeAliasDeclaration(declaration) && ts6.isTypeReferenceNode(declaration.type) && checker.getTypeFromTypeNode(declaration.type) !== type) {
2483
2485
  return resolveNamedDiscriminatorDeclaration(
2484
2486
  checker.getTypeFromTypeNode(declaration.type),
2485
2487
  checker,
@@ -2507,7 +2509,7 @@ function resolveDiscriminatorValue(boundType, fieldName, checker, provenance, di
2507
2509
  }
2508
2510
  if (boundType.isUnion()) {
2509
2511
  const nonNullMembers = boundType.types.filter(
2510
- (member) => !(member.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
2512
+ (member) => !(member.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
2511
2513
  );
2512
2514
  if (nonNullMembers.every((member) => member.isStringLiteral())) {
2513
2515
  diagnostics.push(
@@ -2552,7 +2554,7 @@ function resolveDiscriminatorValue(boundType, fieldName, checker, provenance, di
2552
2554
  return null;
2553
2555
  }
2554
2556
  function getDeclarationName(node) {
2555
- if (ts5.isClassDeclaration(node) || ts5.isInterfaceDeclaration(node) || ts5.isTypeAliasDeclaration(node) || ts5.isEnumDeclaration(node)) {
2557
+ if (ts6.isClassDeclaration(node) || ts6.isInterfaceDeclaration(node) || ts6.isTypeAliasDeclaration(node) || ts6.isEnumDeclaration(node)) {
2556
2558
  return node.name?.text ?? "anonymous";
2557
2559
  }
2558
2560
  return "anonymous";
@@ -2607,11 +2609,11 @@ function extractReferenceTypeArguments(type, checker, file, typeRegistry, visiti
2607
2609
  if (sourceTypeNode === void 0) {
2608
2610
  return [];
2609
2611
  }
2610
- const unwrapParentheses = (typeNode) => ts5.isParenthesizedTypeNode(typeNode) ? unwrapParentheses(typeNode.type) : typeNode;
2612
+ const unwrapParentheses = (typeNode) => ts6.isParenthesizedTypeNode(typeNode) ? unwrapParentheses(typeNode.type) : typeNode;
2611
2613
  const directTypeNode = unwrapParentheses(sourceTypeNode);
2612
- const referenceTypeNode = ts5.isTypeReferenceNode(directTypeNode) ? directTypeNode : (() => {
2614
+ const referenceTypeNode = ts6.isTypeReferenceNode(directTypeNode) ? directTypeNode : (() => {
2613
2615
  const resolvedTypeNode = resolveAliasedTypeNode(directTypeNode, checker);
2614
- return ts5.isTypeReferenceNode(resolvedTypeNode) ? resolvedTypeNode : null;
2616
+ return ts6.isTypeReferenceNode(resolvedTypeNode) ? resolvedTypeNode : null;
2615
2617
  })();
2616
2618
  if (referenceTypeNode?.typeArguments === void 0) {
2617
2619
  return [];
@@ -2666,7 +2668,7 @@ function applyDiscriminatorToObjectProperties(properties, node, subjectType, che
2666
2668
  );
2667
2669
  }
2668
2670
  function analyzeFieldToIR(prop, checker, file, typeRegistry, visiting, diagnostics, hostType, metadataPolicy, extensionRegistry) {
2669
- if (!ts5.isIdentifier(prop.name)) {
2671
+ if (!ts6.isIdentifier(prop.name)) {
2670
2672
  return null;
2671
2673
  }
2672
2674
  const name = prop.name.text;
@@ -2793,7 +2795,7 @@ function findDuplicateObjectLikeTypeAliasPropertyNames(members) {
2793
2795
  const seen = /* @__PURE__ */ new Set();
2794
2796
  const duplicates = /* @__PURE__ */ new Set();
2795
2797
  for (const member of members) {
2796
- if (!ts5.isPropertySignature(member)) {
2798
+ if (!ts6.isPropertySignature(member)) {
2797
2799
  continue;
2798
2800
  }
2799
2801
  const name = getAnalyzableObjectLikePropertyName(member.name);
@@ -2809,7 +2811,7 @@ function findDuplicateObjectLikeTypeAliasPropertyNames(members) {
2809
2811
  return [...duplicates].sort();
2810
2812
  }
2811
2813
  function getAnalyzableObjectLikePropertyName(name) {
2812
- if (ts5.isIdentifier(name) || ts5.isStringLiteral(name) || ts5.isNumericLiteral(name)) {
2814
+ if (ts6.isIdentifier(name) || ts6.isStringLiteral(name) || ts6.isNumericLiteral(name)) {
2813
2815
  return name.text;
2814
2816
  }
2815
2817
  return null;
@@ -2907,25 +2909,25 @@ function resolveTypeNode(type, checker, file, typeRegistry, visiting, sourceNode
2907
2909
  if (isIntegerBrandedType(type)) {
2908
2910
  return { kind: "primitive", primitiveKind: "integer" };
2909
2911
  }
2910
- if (type.flags & ts5.TypeFlags.String) {
2912
+ if (type.flags & ts6.TypeFlags.String) {
2911
2913
  return { kind: "primitive", primitiveKind: "string" };
2912
2914
  }
2913
- if (type.flags & ts5.TypeFlags.Number) {
2915
+ if (type.flags & ts6.TypeFlags.Number) {
2914
2916
  return { kind: "primitive", primitiveKind: "number" };
2915
2917
  }
2916
- if (type.flags & (ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral)) {
2918
+ if (type.flags & (ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral)) {
2917
2919
  return { kind: "primitive", primitiveKind: "bigint" };
2918
2920
  }
2919
- if (type.flags & ts5.TypeFlags.Boolean) {
2921
+ if (type.flags & ts6.TypeFlags.Boolean) {
2920
2922
  return { kind: "primitive", primitiveKind: "boolean" };
2921
2923
  }
2922
- if (type.flags & ts5.TypeFlags.Null) {
2924
+ if (type.flags & ts6.TypeFlags.Null) {
2923
2925
  return { kind: "primitive", primitiveKind: "null" };
2924
2926
  }
2925
- if (type.flags & ts5.TypeFlags.Undefined) {
2927
+ if (type.flags & ts6.TypeFlags.Undefined) {
2926
2928
  return { kind: "primitive", primitiveKind: "null" };
2927
2929
  }
2928
- if (type.flags & ts5.TypeFlags.Void) {
2930
+ if (type.flags & ts6.TypeFlags.Void) {
2929
2931
  return { kind: "primitive", primitiveKind: "null" };
2930
2932
  }
2931
2933
  if (type.isStringLiteral()) {
@@ -3012,10 +3014,10 @@ function resolveTypeNode(type, checker, file, typeRegistry, visiting, sourceNode
3012
3014
  return { kind: "primitive", primitiveKind: "string" };
3013
3015
  }
3014
3016
  function tryResolveNamedPrimitiveAlias(type, checker, file, typeRegistry, visiting, sourceNode, metadataPolicy = createAnalyzerMetadataPolicy(void 0), extensionRegistry, diagnostics) {
3015
- if (!(type.flags & (ts5.TypeFlags.String | ts5.TypeFlags.Number | ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral | ts5.TypeFlags.Boolean | ts5.TypeFlags.Null)) && !isIntegerBrandedType(type)) {
3017
+ if (!(type.flags & (ts6.TypeFlags.String | ts6.TypeFlags.Number | ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral | ts6.TypeFlags.Boolean | ts6.TypeFlags.Null)) && !isIntegerBrandedType(type)) {
3016
3018
  return null;
3017
3019
  }
3018
- const aliasDecl = type.aliasSymbol?.declarations?.find(ts5.isTypeAliasDeclaration) ?? getReferencedTypeAliasDeclaration(sourceNode, checker);
3020
+ const aliasDecl = type.aliasSymbol?.declarations?.find(ts6.isTypeAliasDeclaration) ?? getReferencedTypeAliasDeclaration(sourceNode, checker);
3019
3021
  if (!aliasDecl) {
3020
3022
  return null;
3021
3023
  }
@@ -3065,14 +3067,14 @@ function tryResolveNamedPrimitiveAlias(type, checker, file, typeRegistry, visiti
3065
3067
  return { kind: "reference", name: aliasName, typeArguments: [] };
3066
3068
  }
3067
3069
  function getReferencedTypeAliasDeclaration(sourceNode, checker) {
3068
- const typeNode = sourceNode && (ts5.isPropertyDeclaration(sourceNode) || ts5.isPropertySignature(sourceNode) || ts5.isParameter(sourceNode)) ? sourceNode.type : void 0;
3069
- if (!typeNode || !ts5.isTypeReferenceNode(typeNode)) {
3070
+ const typeNode = sourceNode && (ts6.isPropertyDeclaration(sourceNode) || ts6.isPropertySignature(sourceNode) || ts6.isParameter(sourceNode)) ? sourceNode.type : void 0;
3071
+ if (!typeNode || !ts6.isTypeReferenceNode(typeNode)) {
3070
3072
  return void 0;
3071
3073
  }
3072
3074
  return getTypeAliasDeclarationFromTypeReference(typeNode, checker);
3073
3075
  }
3074
3076
  function shouldEmitPrimitiveAliasDefinition(typeNode, checker) {
3075
- if (!ts5.isTypeReferenceNode(typeNode)) {
3077
+ if (!ts6.isTypeReferenceNode(typeNode)) {
3076
3078
  return false;
3077
3079
  }
3078
3080
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
@@ -3080,10 +3082,10 @@ function shouldEmitPrimitiveAliasDefinition(typeNode, checker) {
3080
3082
  return false;
3081
3083
  }
3082
3084
  const resolved = checker.getTypeFromTypeNode(aliasDecl.type);
3083
- return !!(resolved.flags & (ts5.TypeFlags.String | ts5.TypeFlags.Number | ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral | ts5.TypeFlags.Boolean | ts5.TypeFlags.Null));
3085
+ return !!(resolved.flags & (ts6.TypeFlags.String | ts6.TypeFlags.Number | ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral | ts6.TypeFlags.Boolean | ts6.TypeFlags.Null));
3084
3086
  }
3085
3087
  function resolveAliasedPrimitiveTarget(type, checker, file, typeRegistry, visiting, metadataPolicy = createAnalyzerMetadataPolicy(void 0), extensionRegistry, diagnostics, visitedAliases = /* @__PURE__ */ new Set()) {
3086
- const nestedAliasDecl = type.aliasSymbol?.declarations?.find(ts5.isTypeAliasDeclaration);
3088
+ const nestedAliasDecl = type.aliasSymbol?.declarations?.find(ts6.isTypeAliasDeclaration);
3087
3089
  if (nestedAliasDecl !== void 0 && !visitedAliases.has(nestedAliasDecl)) {
3088
3090
  visitedAliases.add(nestedAliasDecl);
3089
3091
  return resolveAliasedPrimitiveTarget(
@@ -3101,19 +3103,19 @@ function resolveAliasedPrimitiveTarget(type, checker, file, typeRegistry, visiti
3101
3103
  if (isIntegerBrandedType(type)) {
3102
3104
  return { kind: "primitive", primitiveKind: "integer" };
3103
3105
  }
3104
- if (type.flags & ts5.TypeFlags.String) {
3106
+ if (type.flags & ts6.TypeFlags.String) {
3105
3107
  return { kind: "primitive", primitiveKind: "string" };
3106
3108
  }
3107
- if (type.flags & ts5.TypeFlags.Number) {
3109
+ if (type.flags & ts6.TypeFlags.Number) {
3108
3110
  return { kind: "primitive", primitiveKind: "number" };
3109
3111
  }
3110
- if (type.flags & (ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral)) {
3112
+ if (type.flags & (ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral)) {
3111
3113
  return { kind: "primitive", primitiveKind: "bigint" };
3112
3114
  }
3113
- if (type.flags & ts5.TypeFlags.Boolean) {
3115
+ if (type.flags & ts6.TypeFlags.Boolean) {
3114
3116
  return { kind: "primitive", primitiveKind: "boolean" };
3115
3117
  }
3116
- if (type.flags & ts5.TypeFlags.Null) {
3118
+ if (type.flags & ts6.TypeFlags.Null) {
3117
3119
  return { kind: "primitive", primitiveKind: "null" };
3118
3120
  }
3119
3121
  return resolveTypeNode(
@@ -3140,13 +3142,13 @@ function resolveUnionType(type, checker, file, typeRegistry, visiting, sourceNod
3140
3142
  (memberTypeNode) => !isNullishTypeNode(resolveAliasedTypeNode(memberTypeNode, checker))
3141
3143
  );
3142
3144
  const nonNullTypes = allTypes.filter(
3143
- (memberType) => !(memberType.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
3145
+ (memberType) => !(memberType.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
3144
3146
  );
3145
3147
  const nonNullMembers = nonNullTypes.map((memberType, index) => ({
3146
3148
  memberType,
3147
3149
  sourceNode: nonNullSourceNodes.length === nonNullTypes.length ? nonNullSourceNodes[index] : void 0
3148
3150
  }));
3149
- const hasNull = allTypes.some((t) => t.flags & ts5.TypeFlags.Null);
3151
+ const hasNull = allTypes.some((t) => t.flags & ts6.TypeFlags.Null);
3150
3152
  const memberDisplayNames = /* @__PURE__ */ new Map();
3151
3153
  if (namedDecl) {
3152
3154
  for (const [value, label] of extractDisplayNameMetadata(namedDecl).memberDisplayNames) {
@@ -3189,7 +3191,7 @@ function resolveUnionType(type, checker, file, typeRegistry, visiting, sourceNod
3189
3191
  const displayName = memberDisplayNames.get(String(value));
3190
3192
  return displayName !== void 0 ? { value, displayName } : { value };
3191
3193
  });
3192
- const isBooleanUnion2 = nonNullTypes.length === 2 && nonNullTypes.every((t) => t.flags & ts5.TypeFlags.BooleanLiteral);
3194
+ const isBooleanUnion2 = nonNullTypes.length === 2 && nonNullTypes.every((t) => t.flags & ts6.TypeFlags.BooleanLiteral);
3193
3195
  if (isBooleanUnion2) {
3194
3196
  const boolNode = { kind: "primitive", primitiveKind: "boolean" };
3195
3197
  const result = hasNull ? {
@@ -3281,7 +3283,7 @@ function tryResolveRecordType(type, checker, file, typeRegistry, visiting, metad
3281
3283
  if (type.getProperties().length > 0) {
3282
3284
  return null;
3283
3285
  }
3284
- const indexInfo = checker.getIndexInfoOfType(type, ts5.IndexKind.String);
3286
+ const indexInfo = checker.getIndexInfoOfType(type, ts6.IndexKind.String);
3285
3287
  if (!indexInfo) {
3286
3288
  return null;
3287
3289
  }
@@ -3329,10 +3331,10 @@ function shouldEmitResolvedObjectProperty(property, declaration) {
3329
3331
  }
3330
3332
  if (declaration !== void 0 && "name" in declaration && declaration.name !== void 0) {
3331
3333
  const name = declaration.name;
3332
- if (ts5.isComputedPropertyName(name) || ts5.isPrivateIdentifier(name)) {
3334
+ if (ts6.isComputedPropertyName(name) || ts6.isPrivateIdentifier(name)) {
3333
3335
  return false;
3334
3336
  }
3335
- if (!ts5.isIdentifier(name) && !ts5.isStringLiteral(name) && !ts5.isNumericLiteral(name)) {
3337
+ if (!ts6.isIdentifier(name) && !ts6.isStringLiteral(name) && !ts6.isNumericLiteral(name)) {
3336
3338
  return false;
3337
3339
  }
3338
3340
  }
@@ -3458,7 +3460,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3458
3460
  if (!declaration) continue;
3459
3461
  if (!shouldEmitResolvedObjectProperty(prop, declaration)) continue;
3460
3462
  const propType = checker.getTypeOfSymbolAtLocation(prop, declaration);
3461
- const optional = !!(prop.flags & ts5.SymbolFlags.Optional);
3463
+ const optional = !!(prop.flags & ts6.SymbolFlags.Optional);
3462
3464
  const propTypeNode = resolveTypeNode(
3463
3465
  propType,
3464
3466
  checker,
@@ -3471,7 +3473,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3471
3473
  collectedDiagnostics
3472
3474
  );
3473
3475
  const fieldNodeInfo = fieldInfoMap?.get(prop.name);
3474
- const inlineFieldNodeInfo = fieldNodeInfo === void 0 ? ts5.isPropertySignature(declaration) ? analyzeInterfacePropertyToIR(
3476
+ const inlineFieldNodeInfo = fieldNodeInfo === void 0 ? ts6.isPropertySignature(declaration) ? analyzeInterfacePropertyToIR(
3475
3477
  declaration,
3476
3478
  checker,
3477
3479
  file,
@@ -3481,7 +3483,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3481
3483
  type,
3482
3484
  metadataPolicy,
3483
3485
  extensionRegistry
3484
- ) : ts5.isPropertyDeclaration(declaration) ? analyzeFieldToIR(
3486
+ ) : ts6.isPropertyDeclaration(declaration) ? analyzeFieldToIR(
3485
3487
  declaration,
3486
3488
  checker,
3487
3489
  file,
@@ -3509,7 +3511,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3509
3511
  visiting.delete(type);
3510
3512
  const objectNode = {
3511
3513
  kind: "object",
3512
- properties: namedDecl !== void 0 && (ts5.isClassDeclaration(namedDecl) || ts5.isInterfaceDeclaration(namedDecl) || ts5.isTypeAliasDeclaration(namedDecl)) ? applyDiscriminatorToObjectProperties(
3514
+ properties: namedDecl !== void 0 && (ts6.isClassDeclaration(namedDecl) || ts6.isInterfaceDeclaration(namedDecl) || ts6.isTypeAliasDeclaration(namedDecl)) ? applyDiscriminatorToObjectProperties(
3513
3515
  properties,
3514
3516
  namedDecl,
3515
3517
  type,
@@ -3557,12 +3559,12 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3557
3559
  for (const symbol of symbols) {
3558
3560
  const declarations = symbol.declarations;
3559
3561
  if (!declarations) continue;
3560
- const classDecl = declarations.find(ts5.isClassDeclaration);
3562
+ const classDecl = declarations.find(ts6.isClassDeclaration);
3561
3563
  if (classDecl) {
3562
3564
  const map = /* @__PURE__ */ new Map();
3563
3565
  const hostType = checker.getTypeAtLocation(classDecl);
3564
3566
  for (const member of classDecl.members) {
3565
- if (ts5.isPropertyDeclaration(member) && ts5.isIdentifier(member.name)) {
3567
+ if (ts6.isPropertyDeclaration(member) && ts6.isIdentifier(member.name)) {
3566
3568
  const fieldNode = analyzeFieldToIR(
3567
3569
  member,
3568
3570
  checker,
@@ -3586,7 +3588,7 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3586
3588
  }
3587
3589
  return map;
3588
3590
  }
3589
- const interfaceDecl = declarations.find(ts5.isInterfaceDeclaration);
3591
+ const interfaceDecl = declarations.find(ts6.isInterfaceDeclaration);
3590
3592
  if (interfaceDecl) {
3591
3593
  return buildFieldNodeInfoMap(
3592
3594
  interfaceDecl.members,
@@ -3600,7 +3602,7 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3600
3602
  extensionRegistry
3601
3603
  );
3602
3604
  }
3603
- const typeAliasDecl = declarations.find(ts5.isTypeAliasDeclaration);
3605
+ const typeAliasDecl = declarations.find(ts6.isTypeAliasDeclaration);
3604
3606
  const typeAliasMembers = typeAliasDecl === void 0 ? null : getObjectLikeTypeAliasMembers(typeAliasDecl.type);
3605
3607
  if (typeAliasDecl && typeAliasMembers !== null) {
3606
3608
  return buildFieldNodeInfoMap(
@@ -3624,10 +3626,10 @@ function extractArrayElementTypeNode(sourceNode, checker) {
3624
3626
  return void 0;
3625
3627
  }
3626
3628
  const resolvedTypeNode = resolveAliasedTypeNode(typeNode, checker);
3627
- if (ts5.isArrayTypeNode(resolvedTypeNode)) {
3629
+ if (ts6.isArrayTypeNode(resolvedTypeNode)) {
3628
3630
  return resolvedTypeNode.elementType;
3629
3631
  }
3630
- if (ts5.isTypeReferenceNode(resolvedTypeNode) && ts5.isIdentifier(resolvedTypeNode.typeName) && resolvedTypeNode.typeName.text === "Array" && resolvedTypeNode.typeArguments?.[0]) {
3632
+ if (ts6.isTypeReferenceNode(resolvedTypeNode) && ts6.isIdentifier(resolvedTypeNode.typeName) && resolvedTypeNode.typeName.text === "Array" && resolvedTypeNode.typeArguments?.[0]) {
3631
3633
  return resolvedTypeNode.typeArguments[0];
3632
3634
  }
3633
3635
  return void 0;
@@ -3638,13 +3640,13 @@ function extractUnionMemberTypeNodes(sourceNode, checker) {
3638
3640
  return [];
3639
3641
  }
3640
3642
  const resolvedTypeNode = resolveAliasedTypeNode(typeNode, checker);
3641
- return ts5.isUnionTypeNode(resolvedTypeNode) ? [...resolvedTypeNode.types] : [];
3643
+ return ts6.isUnionTypeNode(resolvedTypeNode) ? [...resolvedTypeNode.types] : [];
3642
3644
  }
3643
3645
  function resolveAliasedTypeNode(typeNode, checker, visited = /* @__PURE__ */ new Set()) {
3644
- if (ts5.isParenthesizedTypeNode(typeNode)) {
3646
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
3645
3647
  return resolveAliasedTypeNode(typeNode.type, checker, visited);
3646
3648
  }
3647
- if (!ts5.isTypeReferenceNode(typeNode) || !ts5.isIdentifier(typeNode.typeName)) {
3649
+ if (!ts6.isTypeReferenceNode(typeNode) || !ts6.isIdentifier(typeNode.typeName)) {
3648
3650
  return typeNode;
3649
3651
  }
3650
3652
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
@@ -3655,15 +3657,15 @@ function resolveAliasedTypeNode(typeNode, checker, visited = /* @__PURE__ */ new
3655
3657
  return resolveAliasedTypeNode(aliasDecl.type, checker, visited);
3656
3658
  }
3657
3659
  function isNullishTypeNode(typeNode) {
3658
- if (typeNode.kind === ts5.SyntaxKind.NullKeyword || typeNode.kind === ts5.SyntaxKind.UndefinedKeyword) {
3660
+ if (typeNode.kind === ts6.SyntaxKind.NullKeyword || typeNode.kind === ts6.SyntaxKind.UndefinedKeyword) {
3659
3661
  return true;
3660
3662
  }
3661
- return ts5.isLiteralTypeNode(typeNode) && (typeNode.literal.kind === ts5.SyntaxKind.NullKeyword || typeNode.literal.kind === ts5.SyntaxKind.UndefinedKeyword);
3663
+ return ts6.isLiteralTypeNode(typeNode) && (typeNode.literal.kind === ts6.SyntaxKind.NullKeyword || typeNode.literal.kind === ts6.SyntaxKind.UndefinedKeyword);
3662
3664
  }
3663
3665
  function buildFieldNodeInfoMap(members, checker, file, typeRegistry, visiting, metadataPolicy, hostType, diagnostics, extensionRegistry) {
3664
3666
  const map = /* @__PURE__ */ new Map();
3665
3667
  for (const member of members) {
3666
- if (ts5.isPropertySignature(member)) {
3668
+ if (ts6.isPropertySignature(member)) {
3667
3669
  const fieldNode = analyzeInterfacePropertyToIR(
3668
3670
  member,
3669
3671
  checker,
@@ -3689,7 +3691,7 @@ function buildFieldNodeInfoMap(members, checker, file, typeRegistry, visiting, m
3689
3691
  }
3690
3692
  var MAX_ALIAS_CHAIN_DEPTH = 8;
3691
3693
  function extractTypeAliasConstraintNodes(typeNode, checker, file, extensionRegistry, depth = 0) {
3692
- if (!ts5.isTypeReferenceNode(typeNode)) return [];
3694
+ if (!ts6.isTypeReferenceNode(typeNode)) return [];
3693
3695
  if (depth >= MAX_ALIAS_CHAIN_DEPTH) {
3694
3696
  const aliasName = typeNode.typeName.getText();
3695
3697
  throw new Error(
@@ -3698,7 +3700,7 @@ function extractTypeAliasConstraintNodes(typeNode, checker, file, extensionRegis
3698
3700
  }
3699
3701
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
3700
3702
  if (!aliasDecl) return [];
3701
- if (ts5.isTypeLiteralNode(aliasDecl.type)) return [];
3703
+ if (ts6.isTypeLiteralNode(aliasDecl.type)) return [];
3702
3704
  const aliasFieldType = resolveTypeNode(
3703
3705
  checker.getTypeAtLocation(aliasDecl.type),
3704
3706
  checker,
@@ -3742,14 +3744,14 @@ function getNamedTypeName(type) {
3742
3744
  const symbol = type.getSymbol();
3743
3745
  if (symbol?.declarations) {
3744
3746
  const decl = symbol.declarations[0];
3745
- if (decl && (ts5.isClassDeclaration(decl) || ts5.isInterfaceDeclaration(decl) || ts5.isTypeAliasDeclaration(decl))) {
3746
- const name = ts5.isClassDeclaration(decl) ? decl.name?.text : decl.name.text;
3747
+ if (decl && (ts6.isClassDeclaration(decl) || ts6.isInterfaceDeclaration(decl) || ts6.isTypeAliasDeclaration(decl))) {
3748
+ const name = ts6.isClassDeclaration(decl) ? decl.name?.text : decl.name.text;
3747
3749
  if (name) return name;
3748
3750
  }
3749
3751
  }
3750
3752
  const aliasSymbol = type.aliasSymbol;
3751
3753
  if (aliasSymbol?.declarations) {
3752
- const aliasDecl = aliasSymbol.declarations.find(ts5.isTypeAliasDeclaration);
3754
+ const aliasDecl = aliasSymbol.declarations.find(ts6.isTypeAliasDeclaration);
3753
3755
  if (aliasDecl) {
3754
3756
  return aliasDecl.name.text;
3755
3757
  }
@@ -3760,24 +3762,24 @@ function getNamedTypeDeclaration(type) {
3760
3762
  const symbol = type.getSymbol();
3761
3763
  if (symbol?.declarations) {
3762
3764
  const decl = symbol.declarations[0];
3763
- if (decl && (ts5.isClassDeclaration(decl) || ts5.isInterfaceDeclaration(decl) || ts5.isTypeAliasDeclaration(decl))) {
3765
+ if (decl && (ts6.isClassDeclaration(decl) || ts6.isInterfaceDeclaration(decl) || ts6.isTypeAliasDeclaration(decl))) {
3764
3766
  return decl;
3765
3767
  }
3766
3768
  }
3767
3769
  const aliasSymbol = type.aliasSymbol;
3768
3770
  if (aliasSymbol?.declarations) {
3769
- return aliasSymbol.declarations.find(ts5.isTypeAliasDeclaration);
3771
+ return aliasSymbol.declarations.find(ts6.isTypeAliasDeclaration);
3770
3772
  }
3771
3773
  return void 0;
3772
3774
  }
3773
3775
  function analyzeMethod(method, checker) {
3774
- if (!ts5.isIdentifier(method.name)) {
3776
+ if (!ts6.isIdentifier(method.name)) {
3775
3777
  return null;
3776
3778
  }
3777
3779
  const name = method.name.text;
3778
3780
  const parameters = [];
3779
3781
  for (const param of method.parameters) {
3780
- if (ts5.isIdentifier(param.name)) {
3782
+ if (ts6.isIdentifier(param.name)) {
3781
3783
  const paramInfo = analyzeParameter(param, checker);
3782
3784
  parameters.push(paramInfo);
3783
3785
  }
@@ -3788,7 +3790,7 @@ function analyzeMethod(method, checker) {
3788
3790
  return { name, parameters, returnTypeNode, returnType };
3789
3791
  }
3790
3792
  function analyzeParameter(param, checker) {
3791
- const name = ts5.isIdentifier(param.name) ? param.name.text : "param";
3793
+ const name = ts6.isIdentifier(param.name) ? param.name.text : "param";
3792
3794
  const typeNode = param.type;
3793
3795
  const type = checker.getTypeAtLocation(param);
3794
3796
  const formSpecExportName = detectFormSpecReference(typeNode);
@@ -3797,15 +3799,15 @@ function analyzeParameter(param, checker) {
3797
3799
  }
3798
3800
  function detectFormSpecReference(typeNode) {
3799
3801
  if (!typeNode) return null;
3800
- if (!ts5.isTypeReferenceNode(typeNode)) return null;
3801
- const typeName = ts5.isIdentifier(typeNode.typeName) ? typeNode.typeName.text : ts5.isQualifiedName(typeNode.typeName) ? typeNode.typeName.right.text : null;
3802
+ if (!ts6.isTypeReferenceNode(typeNode)) return null;
3803
+ const typeName = ts6.isIdentifier(typeNode.typeName) ? typeNode.typeName.text : ts6.isQualifiedName(typeNode.typeName) ? typeNode.typeName.right.text : null;
3802
3804
  if (typeName !== "InferSchema" && typeName !== "InferFormSchema") return null;
3803
3805
  const typeArg = typeNode.typeArguments?.[0];
3804
- if (!typeArg || !ts5.isTypeQueryNode(typeArg)) return null;
3805
- if (ts5.isIdentifier(typeArg.exprName)) {
3806
+ if (!typeArg || !ts6.isTypeQueryNode(typeArg)) return null;
3807
+ if (ts6.isIdentifier(typeArg.exprName)) {
3806
3808
  return typeArg.exprName.text;
3807
3809
  }
3808
- if (ts5.isQualifiedName(typeArg.exprName)) {
3810
+ if (ts6.isQualifiedName(typeArg.exprName)) {
3809
3811
  return typeArg.exprName.right.text;
3810
3812
  }
3811
3813
  return null;
@@ -3827,23 +3829,23 @@ function createProgramContextFromProgram(program, filePath) {
3827
3829
  function createProgramContext(filePath, additionalFiles) {
3828
3830
  const absolutePath = path.resolve(filePath);
3829
3831
  const fileDir = path.dirname(absolutePath);
3830
- const configPath = ts6.findConfigFile(fileDir, ts6.sys.fileExists.bind(ts6.sys), "tsconfig.json");
3832
+ const configPath = ts7.findConfigFile(fileDir, ts7.sys.fileExists.bind(ts7.sys), "tsconfig.json");
3831
3833
  let compilerOptions;
3832
3834
  let fileNames;
3833
3835
  if (configPath) {
3834
- const configFile = ts6.readConfigFile(configPath, ts6.sys.readFile.bind(ts6.sys));
3836
+ const configFile = ts7.readConfigFile(configPath, ts7.sys.readFile.bind(ts7.sys));
3835
3837
  if (configFile.error) {
3836
3838
  throw new Error(
3837
- `Error reading tsconfig.json: ${ts6.flattenDiagnosticMessageText(configFile.error.messageText, "\n")}`
3839
+ `Error reading tsconfig.json: ${ts7.flattenDiagnosticMessageText(configFile.error.messageText, "\n")}`
3838
3840
  );
3839
3841
  }
3840
- const parsed = ts6.parseJsonConfigFileContent(
3842
+ const parsed = ts7.parseJsonConfigFileContent(
3841
3843
  configFile.config,
3842
- ts6.sys,
3844
+ ts7.sys,
3843
3845
  path.dirname(configPath)
3844
3846
  );
3845
3847
  if (parsed.errors.length > 0) {
3846
- const errorMessages = parsed.errors.map((e) => ts6.flattenDiagnosticMessageText(e.messageText, "\n")).join("\n");
3848
+ const errorMessages = parsed.errors.map((e) => ts7.flattenDiagnosticMessageText(e.messageText, "\n")).join("\n");
3847
3849
  throw new Error(`Error parsing tsconfig.json: ${errorMessages}`);
3848
3850
  }
3849
3851
  compilerOptions = parsed.options;
@@ -3851,9 +3853,9 @@ function createProgramContext(filePath, additionalFiles) {
3851
3853
  fileNames = [.../* @__PURE__ */ new Set([...parsed.fileNames, absolutePath, ...normalizedAdditional])];
3852
3854
  } else {
3853
3855
  compilerOptions = {
3854
- target: ts6.ScriptTarget.ES2022,
3855
- module: ts6.ModuleKind.NodeNext,
3856
- moduleResolution: ts6.ModuleResolutionKind.NodeNext,
3856
+ target: ts7.ScriptTarget.ES2022,
3857
+ module: ts7.ModuleKind.NodeNext,
3858
+ moduleResolution: ts7.ModuleResolutionKind.NodeNext,
3857
3859
  strict: true,
3858
3860
  skipLibCheck: true,
3859
3861
  declaration: true
@@ -3861,7 +3863,7 @@ function createProgramContext(filePath, additionalFiles) {
3861
3863
  const normalizedAdditional = (additionalFiles ?? []).map((f) => path.resolve(f));
3862
3864
  fileNames = [.../* @__PURE__ */ new Set([absolutePath, ...normalizedAdditional])];
3863
3865
  }
3864
- const program = ts6.createProgram(fileNames, compilerOptions);
3866
+ const program = ts7.createProgram(fileNames, compilerOptions);
3865
3867
  const sourceFile = program.getSourceFile(absolutePath);
3866
3868
  if (!sourceFile) {
3867
3869
  throw new Error(`Could not find source file: ${absolutePath}`);
@@ -3880,19 +3882,19 @@ function findNodeByName(sourceFile, name, predicate, getName) {
3880
3882
  result = node;
3881
3883
  return;
3882
3884
  }
3883
- ts6.forEachChild(node, visit);
3885
+ ts7.forEachChild(node, visit);
3884
3886
  }
3885
3887
  visit(sourceFile);
3886
3888
  return result;
3887
3889
  }
3888
3890
  function findClassByName(sourceFile, className) {
3889
- return findNodeByName(sourceFile, className, ts6.isClassDeclaration, (n) => n.name?.text);
3891
+ return findNodeByName(sourceFile, className, ts7.isClassDeclaration, (n) => n.name?.text);
3890
3892
  }
3891
3893
  function findInterfaceByName(sourceFile, interfaceName) {
3892
- return findNodeByName(sourceFile, interfaceName, ts6.isInterfaceDeclaration, (n) => n.name.text);
3894
+ return findNodeByName(sourceFile, interfaceName, ts7.isInterfaceDeclaration, (n) => n.name.text);
3893
3895
  }
3894
3896
  function findTypeAliasByName(sourceFile, aliasName) {
3895
- return findNodeByName(sourceFile, aliasName, ts6.isTypeAliasDeclaration, (n) => n.name.text);
3897
+ return findNodeByName(sourceFile, aliasName, ts7.isTypeAliasDeclaration, (n) => n.name.text);
3896
3898
  }
3897
3899
  function getResolvedObjectRootType(rootType, typeRegistry) {
3898
3900
  if (rootType.kind === "object") {
@@ -3932,22 +3934,22 @@ function createResolvedObjectAliasAnalysis(name, rootType, typeRegistry, rootInf
3932
3934
  };
3933
3935
  }
3934
3936
  function containsTypeReferenceInObjectLikeAlias(typeNode) {
3935
- if (ts6.isParenthesizedTypeNode(typeNode)) {
3937
+ if (ts7.isParenthesizedTypeNode(typeNode)) {
3936
3938
  return containsTypeReferenceInObjectLikeAlias(typeNode.type);
3937
3939
  }
3938
- if (ts6.isTypeReferenceNode(typeNode)) {
3940
+ if (ts7.isTypeReferenceNode(typeNode)) {
3939
3941
  return true;
3940
3942
  }
3941
- return ts6.isIntersectionTypeNode(typeNode) && typeNode.types.some((member) => containsTypeReferenceInObjectLikeAlias(member));
3943
+ return ts7.isIntersectionTypeNode(typeNode) && typeNode.types.some((member) => containsTypeReferenceInObjectLikeAlias(member));
3942
3944
  }
3943
3945
  function collectFallbackAliasMemberPropertyNames(typeNode, checker) {
3944
- if (ts6.isParenthesizedTypeNode(typeNode)) {
3946
+ if (ts7.isParenthesizedTypeNode(typeNode)) {
3945
3947
  return collectFallbackAliasMemberPropertyNames(typeNode.type, checker);
3946
3948
  }
3947
- if (ts6.isTypeLiteralNode(typeNode)) {
3949
+ if (ts7.isTypeLiteralNode(typeNode)) {
3948
3950
  const propertyNames = [];
3949
3951
  for (const member of typeNode.members) {
3950
- if (!ts6.isPropertySignature(member)) {
3952
+ if (!ts7.isPropertySignature(member)) {
3951
3953
  continue;
3952
3954
  }
3953
3955
  const propertyName = getAnalyzableObjectLikePropertyName(member.name);
@@ -3957,13 +3959,13 @@ function collectFallbackAliasMemberPropertyNames(typeNode, checker) {
3957
3959
  }
3958
3960
  return propertyNames;
3959
3961
  }
3960
- if (ts6.isTypeReferenceNode(typeNode)) {
3962
+ if (ts7.isTypeReferenceNode(typeNode)) {
3961
3963
  return checker.getTypeFromTypeNode(typeNode).getProperties().map((property) => property.getName());
3962
3964
  }
3963
3965
  return null;
3964
3966
  }
3965
3967
  function findFallbackAliasDuplicatePropertyNames(typeNode, checker) {
3966
- if (!ts6.isIntersectionTypeNode(typeNode)) {
3968
+ if (!ts7.isIntersectionTypeNode(typeNode)) {
3967
3969
  return [];
3968
3970
  }
3969
3971
  const seen = /* @__PURE__ */ new Set();
@@ -4153,7 +4155,7 @@ function makeFileProvenance(filePath) {
4153
4155
  }
4154
4156
 
4155
4157
  // src/generators/class-schema.ts
4156
- import * as ts8 from "typescript";
4158
+ import * as ts9 from "typescript";
4157
4159
 
4158
4160
  // src/metadata/collision-guards.ts
4159
4161
  function assertUniqueSerializedNames(entries, scope) {
@@ -5153,7 +5155,7 @@ function createExtensionRegistry(extensions) {
5153
5155
  }
5154
5156
 
5155
5157
  // src/extensions/symbol-registry.ts
5156
- import * as ts7 from "typescript";
5158
+ import * as ts8 from "typescript";
5157
5159
  import * as path2 from "path";
5158
5160
 
5159
5161
  // src/ui-schema/schema.ts