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

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.
@@ -847,18 +847,18 @@ function wrapInConditional(field, layout, provenance) {
847
847
  }
848
848
 
849
849
  // src/analyzer/program.ts
850
- var ts6 = __toESM(require("typescript"), 1);
850
+ var ts7 = __toESM(require("typescript"), 1);
851
851
  var path = __toESM(require("path"), 1);
852
852
 
853
853
  // src/analyzer/class-analyzer.ts
854
- var ts5 = __toESM(require("typescript"), 1);
854
+ var ts6 = __toESM(require("typescript"), 1);
855
855
  var import_internal3 = require("@formspec/analysis/internal");
856
856
 
857
857
  // src/analyzer/jsdoc-constraints.ts
858
- var ts4 = __toESM(require("typescript"), 1);
858
+ var ts5 = __toESM(require("typescript"), 1);
859
859
 
860
860
  // src/analyzer/tsdoc-parser.ts
861
- var ts3 = __toESM(require("typescript"), 1);
861
+ var ts4 = __toESM(require("typescript"), 1);
862
862
  var import_internal2 = require("@formspec/analysis/internal");
863
863
  var import_internals3 = require("@formspec/core/internals");
864
864
  var import_internals4 = require("@formspec/core/internals");
@@ -980,6 +980,14 @@ function customTypeIdFromLookup(result) {
980
980
  return `${result.extensionId}/${result.registration.typeName}`;
981
981
  }
982
982
 
983
+ // src/analyzer/builtin-brands.ts
984
+ var ts3 = __toESM(require("typescript"), 1);
985
+ function isIntegerBrandedType(type) {
986
+ if (!type.isIntersection()) return false;
987
+ if (!type.types.some((member) => !!(member.flags & ts3.TypeFlags.Number))) return false;
988
+ return collectBrandIdentifiers(type).includes("__integerBrand");
989
+ }
990
+
983
991
  // src/analyzer/tsdoc-parser.ts
984
992
  function sharedTagValueOptions(options) {
985
993
  return {
@@ -987,7 +995,7 @@ function sharedTagValueOptions(options) {
987
995
  ...options?.fieldType !== void 0 ? { fieldType: options.fieldType } : {}
988
996
  };
989
997
  }
990
- var SYNTHETIC_TYPE_FORMAT_FLAGS = ts3.TypeFormatFlags.NoTruncation | ts3.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope;
998
+ var SYNTHETIC_TYPE_FORMAT_FLAGS = ts4.TypeFormatFlags.NoTruncation | ts4.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope;
991
999
  function getExtensionTypeNames(registry) {
992
1000
  if (registry === void 0) {
993
1001
  return /* @__PURE__ */ new Set();
@@ -1001,23 +1009,23 @@ function getExtensionTypeNames(registry) {
1001
1009
  function collectImportedNames(sourceFile) {
1002
1010
  const importedNames = /* @__PURE__ */ new Set();
1003
1011
  for (const statement of sourceFile.statements) {
1004
- if (ts3.isImportDeclaration(statement) && statement.importClause !== void 0) {
1012
+ if (ts4.isImportDeclaration(statement) && statement.importClause !== void 0) {
1005
1013
  const clause = statement.importClause;
1006
1014
  if (clause.name !== void 0) {
1007
1015
  importedNames.add(clause.name.text);
1008
1016
  }
1009
1017
  if (clause.namedBindings !== void 0) {
1010
- if (ts3.isNamedImports(clause.namedBindings)) {
1018
+ if (ts4.isNamedImports(clause.namedBindings)) {
1011
1019
  for (const specifier of clause.namedBindings.elements) {
1012
1020
  importedNames.add(specifier.name.text);
1013
1021
  }
1014
- } else if (ts3.isNamespaceImport(clause.namedBindings)) {
1022
+ } else if (ts4.isNamespaceImport(clause.namedBindings)) {
1015
1023
  importedNames.add(clause.namedBindings.name.text);
1016
1024
  }
1017
1025
  }
1018
1026
  continue;
1019
1027
  }
1020
- if (ts3.isImportEqualsDeclaration(statement)) {
1028
+ if (ts4.isImportEqualsDeclaration(statement)) {
1021
1029
  importedNames.add(statement.name.text);
1022
1030
  }
1023
1031
  }
@@ -1025,50 +1033,96 @@ function collectImportedNames(sourceFile) {
1025
1033
  }
1026
1034
  function isNonReferenceIdentifier(node) {
1027
1035
  const parent = node.parent;
1028
- 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) {
1036
+ 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) {
1029
1037
  return true;
1030
1038
  }
1031
- if ((ts3.isPropertyAssignment(parent) || ts3.isPropertyAccessExpression(parent)) && parent.name === node) {
1039
+ if ((ts4.isPropertyAssignment(parent) || ts4.isPropertyAccessExpression(parent)) && parent.name === node) {
1032
1040
  return true;
1033
1041
  }
1034
- if (ts3.isQualifiedName(parent) && parent.right === node) {
1042
+ if (ts4.isQualifiedName(parent) && parent.right === node) {
1035
1043
  return true;
1036
1044
  }
1037
1045
  return false;
1038
1046
  }
1039
- function statementReferencesImportedName(statement, importedNames) {
1047
+ function astReferencesImportedName(root, importedNames) {
1040
1048
  if (importedNames.size === 0) {
1041
1049
  return false;
1042
1050
  }
1043
- let referencesImportedName = false;
1051
+ let found = false;
1044
1052
  const visit = (node) => {
1045
- if (referencesImportedName) {
1046
- return;
1047
- }
1048
- if (ts3.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
1049
- referencesImportedName = true;
1053
+ if (found) return;
1054
+ if (ts4.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
1055
+ found = true;
1050
1056
  return;
1051
1057
  }
1052
- ts3.forEachChild(node, visit);
1058
+ ts4.forEachChild(node, visit);
1053
1059
  };
1054
- visit(statement);
1055
- return referencesImportedName;
1060
+ visit(root);
1061
+ return found;
1062
+ }
1063
+ function getObjectMembers(statement) {
1064
+ if (ts4.isInterfaceDeclaration(statement)) {
1065
+ return statement.members;
1066
+ }
1067
+ if (ts4.isTypeLiteralNode(statement.type)) {
1068
+ return statement.type.members;
1069
+ }
1070
+ return void 0;
1071
+ }
1072
+ function rewriteImportedMemberTypes(statement, sourceFile, importedNames) {
1073
+ const members = getObjectMembers(statement);
1074
+ if (members === void 0) {
1075
+ return null;
1076
+ }
1077
+ const replacements = [];
1078
+ for (const member of members) {
1079
+ if (!ts4.isPropertySignature(member)) {
1080
+ if (astReferencesImportedName(member, importedNames)) {
1081
+ return null;
1082
+ }
1083
+ continue;
1084
+ }
1085
+ const typeAnnotation = member.type;
1086
+ if (typeAnnotation === void 0) continue;
1087
+ if (astReferencesImportedName(typeAnnotation, importedNames)) {
1088
+ replacements.push({
1089
+ start: typeAnnotation.getStart(sourceFile),
1090
+ end: typeAnnotation.getEnd()
1091
+ });
1092
+ }
1093
+ }
1094
+ if (replacements.length === 0) {
1095
+ return statement.getText(sourceFile);
1096
+ }
1097
+ const stmtStart = statement.getStart(sourceFile);
1098
+ let result = statement.getText(sourceFile);
1099
+ for (const { start, end } of [...replacements].reverse()) {
1100
+ result = result.slice(0, start - stmtStart) + "unknown" + result.slice(end - stmtStart);
1101
+ }
1102
+ return result;
1056
1103
  }
1057
1104
  function buildSupportingDeclarations(sourceFile, extensionTypeNames) {
1058
1105
  const importedNames = collectImportedNames(sourceFile);
1059
1106
  const importedNamesToSkip = new Set(
1060
1107
  [...importedNames].filter((name) => !extensionTypeNames.has(name))
1061
1108
  );
1062
- return sourceFile.statements.filter((statement) => {
1063
- if (ts3.isImportDeclaration(statement)) return false;
1064
- if (ts3.isImportEqualsDeclaration(statement)) return false;
1065
- if (ts3.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0)
1066
- return false;
1067
- if (statementReferencesImportedName(statement, importedNamesToSkip)) {
1068
- return false;
1109
+ const result = [];
1110
+ for (const statement of sourceFile.statements) {
1111
+ if (ts4.isImportDeclaration(statement)) continue;
1112
+ if (ts4.isImportEqualsDeclaration(statement)) continue;
1113
+ if (ts4.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0) continue;
1114
+ if (!astReferencesImportedName(statement, importedNamesToSkip)) {
1115
+ result.push(statement.getText(sourceFile));
1116
+ continue;
1069
1117
  }
1070
- return true;
1071
- }).map((statement) => statement.getText(sourceFile));
1118
+ if (ts4.isInterfaceDeclaration(statement) || ts4.isTypeAliasDeclaration(statement)) {
1119
+ const rewritten = rewriteImportedMemberTypes(statement, sourceFile, importedNamesToSkip);
1120
+ if (rewritten !== null) {
1121
+ result.push(rewritten);
1122
+ }
1123
+ }
1124
+ }
1125
+ return result;
1072
1126
  }
1073
1127
  function pushUniqueCompilerDiagnostics(target, additions) {
1074
1128
  for (const diagnostic of additions) {
@@ -1160,7 +1214,7 @@ function stripHintNullishUnion(type) {
1160
1214
  return type;
1161
1215
  }
1162
1216
  const nonNullish = type.types.filter(
1163
- (member) => (member.flags & (ts3.TypeFlags.Null | ts3.TypeFlags.Undefined)) === 0
1217
+ (member) => (member.flags & (ts4.TypeFlags.Null | ts4.TypeFlags.Undefined)) === 0
1164
1218
  );
1165
1219
  if (nonNullish.length === 1 && nonNullish[0] !== void 0) {
1166
1220
  return nonNullish[0];
@@ -1176,10 +1230,10 @@ function isUserEmittableHintProperty(property, declaration) {
1176
1230
  }
1177
1231
  if ("name" in declaration && declaration.name !== void 0) {
1178
1232
  const name = declaration.name;
1179
- if (ts3.isComputedPropertyName(name) || ts3.isPrivateIdentifier(name)) {
1233
+ if (ts4.isComputedPropertyName(name) || ts4.isPrivateIdentifier(name)) {
1180
1234
  return false;
1181
1235
  }
1182
- if (!ts3.isIdentifier(name) && !ts3.isStringLiteral(name) && !ts3.isNumericLiteral(name)) {
1236
+ if (!ts4.isIdentifier(name) && !ts4.isStringLiteral(name) && !ts4.isNumericLiteral(name)) {
1183
1237
  return false;
1184
1238
  }
1185
1239
  }
@@ -1397,6 +1451,9 @@ function buildCompilerBackedConstraintDiagnostics(node, sourceFile, tagName, par
1397
1451
  }
1398
1452
  const hasBroadening = (() => {
1399
1453
  if (target === null) {
1454
+ if (isIntegerBrandedType((0, import_internal2.stripNullishUnion)(subjectType)) && definition.capabilities.includes("numeric-comparable")) {
1455
+ return true;
1456
+ }
1400
1457
  return hasBuiltinConstraintBroadening(tagName, options);
1401
1458
  }
1402
1459
  const registry = options?.extensionRegistry;
@@ -1549,12 +1606,12 @@ function parseTSDocTags(node, file = "", options) {
1549
1606
  const sourceText = sourceFile.getFullText();
1550
1607
  const extensionTypeNames = getExtensionTypeNames(options?.extensionRegistry);
1551
1608
  const supportingDeclarations = buildSupportingDeclarations(sourceFile, extensionTypeNames);
1552
- const commentRanges = ts3.getLeadingCommentRanges(sourceText, node.getFullStart());
1609
+ const commentRanges = ts4.getLeadingCommentRanges(sourceText, node.getFullStart());
1553
1610
  const rawTextFallbacks = collectRawTextFallbacks(node, file);
1554
1611
  const extensionTagNames = getExtensionTagNames(options);
1555
1612
  if (commentRanges) {
1556
1613
  for (const range of commentRanges) {
1557
- if (range.kind !== ts3.SyntaxKind.MultiLineCommentTrivia) {
1614
+ if (range.kind !== ts4.SyntaxKind.MultiLineCommentTrivia) {
1558
1615
  continue;
1559
1616
  }
1560
1617
  const commentText = sourceText.substring(range.pos, range.end);
@@ -1711,10 +1768,10 @@ function extractDisplayNameMetadata(node) {
1711
1768
  const memberDisplayNames = /* @__PURE__ */ new Map();
1712
1769
  const sourceFile = node.getSourceFile();
1713
1770
  const sourceText = sourceFile.getFullText();
1714
- const commentRanges = ts3.getLeadingCommentRanges(sourceText, node.getFullStart());
1771
+ const commentRanges = ts4.getLeadingCommentRanges(sourceText, node.getFullStart());
1715
1772
  if (commentRanges) {
1716
1773
  for (const range of commentRanges) {
1717
- if (range.kind !== ts3.SyntaxKind.MultiLineCommentTrivia) continue;
1774
+ if (range.kind !== ts4.SyntaxKind.MultiLineCommentTrivia) continue;
1718
1775
  const commentText = sourceText.substring(range.pos, range.end);
1719
1776
  if (!commentText.startsWith("/**")) continue;
1720
1777
  const unified = (0, import_internal2.parseUnifiedComment)(commentText);
@@ -1739,7 +1796,7 @@ function extractDisplayNameMetadata(node) {
1739
1796
  }
1740
1797
  function collectRawTextFallbacks(node, file) {
1741
1798
  const fallbacks = /* @__PURE__ */ new Map();
1742
- for (const tag of ts3.getJSDocTags(node)) {
1799
+ for (const tag of ts4.getJSDocTags(node)) {
1743
1800
  const tagName = (0, import_internals3.normalizeConstraintTagName)(tag.tagName.text);
1744
1801
  if (!import_internal2.TAGS_REQUIRING_RAW_TEXT.has(tagName)) continue;
1745
1802
  const commentText = getTagCommentText(tag)?.trim() ?? "";
@@ -1794,7 +1851,7 @@ function getTagCommentText(tag) {
1794
1851
  if (typeof tag.comment === "string") {
1795
1852
  return tag.comment;
1796
1853
  }
1797
- return ts3.getTextOfJSDocComment(tag.comment);
1854
+ return ts4.getTextOfJSDocComment(tag.comment);
1798
1855
  }
1799
1856
 
1800
1857
  // src/analyzer/jsdoc-constraints.ts
@@ -1812,18 +1869,18 @@ function extractJSDocAnnotationNodes(node, file = "", options) {
1812
1869
  function extractDefaultValueAnnotation(initializer, file = "") {
1813
1870
  if (!initializer) return null;
1814
1871
  let value;
1815
- if (ts4.isStringLiteral(initializer)) {
1872
+ if (ts5.isStringLiteral(initializer)) {
1816
1873
  value = initializer.text;
1817
- } else if (ts4.isNumericLiteral(initializer)) {
1874
+ } else if (ts5.isNumericLiteral(initializer)) {
1818
1875
  value = Number(initializer.text);
1819
- } else if (initializer.kind === ts4.SyntaxKind.TrueKeyword) {
1876
+ } else if (initializer.kind === ts5.SyntaxKind.TrueKeyword) {
1820
1877
  value = true;
1821
- } else if (initializer.kind === ts4.SyntaxKind.FalseKeyword) {
1878
+ } else if (initializer.kind === ts5.SyntaxKind.FalseKeyword) {
1822
1879
  value = false;
1823
- } else if (initializer.kind === ts4.SyntaxKind.NullKeyword) {
1880
+ } else if (initializer.kind === ts5.SyntaxKind.NullKeyword) {
1824
1881
  value = null;
1825
- } else if (ts4.isPrefixUnaryExpression(initializer)) {
1826
- if (initializer.operator === ts4.SyntaxKind.MinusToken && ts4.isNumericLiteral(initializer.operand)) {
1882
+ } else if (ts5.isPrefixUnaryExpression(initializer)) {
1883
+ if (initializer.operator === ts5.SyntaxKind.MinusToken && ts5.isNumericLiteral(initializer.operand)) {
1827
1884
  value = -Number(initializer.operand.text);
1828
1885
  }
1829
1886
  }
@@ -1845,38 +1902,28 @@ function extractDefaultValueAnnotation(initializer, file = "") {
1845
1902
 
1846
1903
  // src/analyzer/class-analyzer.ts
1847
1904
  function isObjectType(type) {
1848
- return !!(type.flags & ts5.TypeFlags.Object);
1905
+ return !!(type.flags & ts6.TypeFlags.Object);
1849
1906
  }
1850
1907
  function isIntersectionType(type) {
1851
- return !!(type.flags & ts5.TypeFlags.Intersection);
1852
- }
1853
- function isIntegerBrandedType(type) {
1854
- if (!type.isIntersection()) {
1855
- return false;
1856
- }
1857
- const hasNumberBase = type.types.some((member) => !!(member.flags & ts5.TypeFlags.Number));
1858
- if (!hasNumberBase) {
1859
- return false;
1860
- }
1861
- return collectBrandIdentifiers(type).includes("__integerBrand");
1908
+ return !!(type.flags & ts6.TypeFlags.Intersection);
1862
1909
  }
1863
1910
  function isResolvableObjectLikeAliasTypeNode(typeNode) {
1864
- if (ts5.isParenthesizedTypeNode(typeNode)) {
1911
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
1865
1912
  return isResolvableObjectLikeAliasTypeNode(typeNode.type);
1866
1913
  }
1867
- if (ts5.isTypeLiteralNode(typeNode) || ts5.isTypeReferenceNode(typeNode)) {
1914
+ if (ts6.isTypeLiteralNode(typeNode) || ts6.isTypeReferenceNode(typeNode)) {
1868
1915
  return true;
1869
1916
  }
1870
- return ts5.isIntersectionTypeNode(typeNode) && typeNode.types.length > 0 && typeNode.types.every((member) => isResolvableObjectLikeAliasTypeNode(member));
1917
+ return ts6.isIntersectionTypeNode(typeNode) && typeNode.types.length > 0 && typeNode.types.every((member) => isResolvableObjectLikeAliasTypeNode(member));
1871
1918
  }
1872
1919
  function isSemanticallyPlainObjectLikeType(type, checker) {
1873
1920
  if (isIntersectionType(type)) {
1874
1921
  return type.types.length > 0 && type.types.every((member) => isSemanticallyPlainObjectLikeType(member, checker));
1875
1922
  }
1876
- 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);
1923
+ 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);
1877
1924
  }
1878
1925
  function isTypeReference(type) {
1879
- return !!(type.flags & ts5.TypeFlags.Object) && !!(type.objectFlags & ts5.ObjectFlags.Reference);
1926
+ return !!(type.flags & ts6.TypeFlags.Object) && !!(type.objectFlags & ts6.ObjectFlags.Reference);
1880
1927
  }
1881
1928
  var RESOLVING_TYPE_PLACEHOLDER = {
1882
1929
  kind: "object",
@@ -1941,7 +1988,7 @@ function resolveNodeMetadata(metadataPolicy, declarationKind, logicalName, node,
1941
1988
  function analyzeDeclarationRootInfo(declaration, checker, file = "", extensionRegistry, metadataPolicy) {
1942
1989
  const normalizedMetadataPolicy = createAnalyzerMetadataPolicy(metadataPolicy);
1943
1990
  const declarationType = checker.getTypeAtLocation(declaration);
1944
- const logicalName = ts5.isClassDeclaration(declaration) ? declaration.name?.text ?? "AnonymousClass" : declaration.name.text;
1991
+ const logicalName = ts6.isClassDeclaration(declaration) ? declaration.name?.text ?? "AnonymousClass" : declaration.name.text;
1945
1992
  const docResult = extractJSDocParseResult(
1946
1993
  declaration,
1947
1994
  file,
@@ -1989,7 +2036,7 @@ function analyzeClassToIR(classDecl, checker, file = "", extensionRegistry, meta
1989
2036
  const instanceMethods = [];
1990
2037
  const staticMethods = [];
1991
2038
  for (const member of classDecl.members) {
1992
- if (ts5.isPropertyDeclaration(member)) {
2039
+ if (ts6.isPropertyDeclaration(member)) {
1993
2040
  const fieldNode = analyzeFieldToIR(
1994
2041
  member,
1995
2042
  checker,
@@ -2005,10 +2052,10 @@ function analyzeClassToIR(classDecl, checker, file = "", extensionRegistry, meta
2005
2052
  fields.push(fieldNode);
2006
2053
  fieldLayouts.push({});
2007
2054
  }
2008
- } else if (ts5.isMethodDeclaration(member)) {
2055
+ } else if (ts6.isMethodDeclaration(member)) {
2009
2056
  const methodInfo = analyzeMethod(member, checker);
2010
2057
  if (methodInfo) {
2011
- const isStatic = member.modifiers?.some((m) => m.kind === ts5.SyntaxKind.StaticKeyword);
2058
+ const isStatic = member.modifiers?.some((m) => m.kind === ts6.SyntaxKind.StaticKeyword);
2012
2059
  if (isStatic) {
2013
2060
  staticMethods.push(methodInfo);
2014
2061
  } else {
@@ -2071,7 +2118,7 @@ function analyzeInterfaceToIR(interfaceDecl, checker, file = "", extensionRegist
2071
2118
  diagnostics.push(...interfaceDoc.diagnostics);
2072
2119
  const visiting = /* @__PURE__ */ new Set();
2073
2120
  for (const member of interfaceDecl.members) {
2074
- if (ts5.isPropertySignature(member)) {
2121
+ if (ts6.isPropertySignature(member)) {
2075
2122
  const fieldNode = analyzeInterfacePropertyToIR(
2076
2123
  member,
2077
2124
  checker,
@@ -2129,7 +2176,7 @@ function analyzeTypeAliasToIR(typeAlias, checker, file = "", extensionRegistry,
2129
2176
  if (members === null) {
2130
2177
  const sourceFile = typeAlias.getSourceFile();
2131
2178
  const { line } = sourceFile.getLineAndCharacterOfPosition(typeAlias.getStart());
2132
- const kindDesc = ts5.SyntaxKind[typeAlias.type.kind] ?? "unknown";
2179
+ const kindDesc = ts6.SyntaxKind[typeAlias.type.kind] ?? "unknown";
2133
2180
  return {
2134
2181
  ok: false,
2135
2182
  kind: "not-object-like",
@@ -2164,7 +2211,7 @@ function analyzeTypeAliasToIR(typeAlias, checker, file = "", extensionRegistry,
2164
2211
  diagnostics.push(...typeAliasDoc.diagnostics);
2165
2212
  const visiting = /* @__PURE__ */ new Set();
2166
2213
  for (const member of members) {
2167
- if (ts5.isPropertySignature(member)) {
2214
+ if (ts6.isPropertySignature(member)) {
2168
2215
  const fieldNode = analyzeInterfacePropertyToIR(
2169
2216
  member,
2170
2217
  checker,
@@ -2231,13 +2278,13 @@ function makeAnalysisDiagnostic(code, message, primaryLocation, relatedLocations
2231
2278
  function getLeadingParsedTags(node) {
2232
2279
  const sourceFile = node.getSourceFile();
2233
2280
  const sourceText = sourceFile.getFullText();
2234
- const commentRanges = ts5.getLeadingCommentRanges(sourceText, node.getFullStart());
2281
+ const commentRanges = ts6.getLeadingCommentRanges(sourceText, node.getFullStart());
2235
2282
  if (commentRanges === void 0) {
2236
2283
  return [];
2237
2284
  }
2238
2285
  const parsedTags = [];
2239
2286
  for (const range of commentRanges) {
2240
- if (range.kind !== ts5.SyntaxKind.MultiLineCommentTrivia) {
2287
+ if (range.kind !== ts6.SyntaxKind.MultiLineCommentTrivia) {
2241
2288
  continue;
2242
2289
  }
2243
2290
  const commentText = sourceText.slice(range.pos, range.end);
@@ -2255,19 +2302,19 @@ function resolveDiscriminatorProperty(node, checker, fieldName) {
2255
2302
  return null;
2256
2303
  }
2257
2304
  const declaration = propertySymbol.valueDeclaration ?? propertySymbol.declarations?.find(
2258
- (candidate) => ts5.isPropertyDeclaration(candidate) || ts5.isPropertySignature(candidate)
2305
+ (candidate) => ts6.isPropertyDeclaration(candidate) || ts6.isPropertySignature(candidate)
2259
2306
  ) ?? propertySymbol.declarations?.[0];
2260
2307
  return {
2261
2308
  declaration,
2262
2309
  type: checker.getTypeOfSymbolAtLocation(propertySymbol, declaration ?? node),
2263
- optional: !!(propertySymbol.flags & ts5.SymbolFlags.Optional) || declaration !== void 0 && "questionToken" in declaration && declaration.questionToken !== void 0
2310
+ optional: !!(propertySymbol.flags & ts6.SymbolFlags.Optional) || declaration !== void 0 && "questionToken" in declaration && declaration.questionToken !== void 0
2264
2311
  };
2265
2312
  }
2266
2313
  function isLocalTypeParameterName(node, typeParameterName) {
2267
2314
  return node.typeParameters?.some((typeParameter) => typeParameter.name.text === typeParameterName) ?? false;
2268
2315
  }
2269
2316
  function isNullishSemanticType(type) {
2270
- if (type.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined | ts5.TypeFlags.Void | ts5.TypeFlags.Unknown | ts5.TypeFlags.Any)) {
2317
+ if (type.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined | ts6.TypeFlags.Void | ts6.TypeFlags.Unknown | ts6.TypeFlags.Any)) {
2271
2318
  return true;
2272
2319
  }
2273
2320
  return type.isUnion() && type.types.some((member) => isNullishSemanticType(member));
@@ -2277,7 +2324,7 @@ function isStringLikeSemanticType(type, checker, seen = /* @__PURE__ */ new Set(
2277
2324
  return false;
2278
2325
  }
2279
2326
  seen.add(type);
2280
- if (type.flags & ts5.TypeFlags.StringLike) {
2327
+ if (type.flags & ts6.TypeFlags.StringLike) {
2281
2328
  return true;
2282
2329
  }
2283
2330
  if (type.isUnion()) {
@@ -2290,13 +2337,13 @@ function isStringLikeSemanticType(type, checker, seen = /* @__PURE__ */ new Set(
2290
2337
  return false;
2291
2338
  }
2292
2339
  function getObjectLikeTypeAliasMembers(typeNode) {
2293
- if (ts5.isParenthesizedTypeNode(typeNode)) {
2340
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
2294
2341
  return getObjectLikeTypeAliasMembers(typeNode.type);
2295
2342
  }
2296
- if (ts5.isTypeLiteralNode(typeNode)) {
2343
+ if (ts6.isTypeLiteralNode(typeNode)) {
2297
2344
  return [...typeNode.members];
2298
2345
  }
2299
- if (ts5.isIntersectionTypeNode(typeNode)) {
2346
+ if (ts6.isIntersectionTypeNode(typeNode)) {
2300
2347
  const members = [];
2301
2348
  for (const intersectionMember of typeNode.types) {
2302
2349
  const resolvedMembers = getObjectLikeTypeAliasMembers(intersectionMember);
@@ -2459,7 +2506,7 @@ function resolveLiteralDiscriminatorPropertyValue(boundType, propertyName, check
2459
2506
  }
2460
2507
  if (propertyType.isUnion()) {
2461
2508
  const nonNullMembers = propertyType.types.filter(
2462
- (member) => !(member.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
2509
+ (member) => !(member.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
2463
2510
  );
2464
2511
  if (nonNullMembers.length > 0 && nonNullMembers.every((member) => member.isStringLiteral())) {
2465
2512
  diagnostics.push(
@@ -2508,13 +2555,13 @@ function resolveNamedDiscriminatorDeclaration(type, checker, seen = /* @__PURE__
2508
2555
  seen.add(type);
2509
2556
  const symbol = type.aliasSymbol ?? type.getSymbol();
2510
2557
  if (symbol !== void 0) {
2511
- const aliased = symbol.flags & ts5.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : void 0;
2558
+ const aliased = symbol.flags & ts6.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : void 0;
2512
2559
  const targetSymbol = aliased ?? symbol;
2513
2560
  const declaration = targetSymbol.declarations?.find(
2514
- (candidate) => ts5.isClassDeclaration(candidate) || ts5.isInterfaceDeclaration(candidate) || ts5.isTypeAliasDeclaration(candidate) || ts5.isEnumDeclaration(candidate)
2561
+ (candidate) => ts6.isClassDeclaration(candidate) || ts6.isInterfaceDeclaration(candidate) || ts6.isTypeAliasDeclaration(candidate) || ts6.isEnumDeclaration(candidate)
2515
2562
  );
2516
2563
  if (declaration !== void 0) {
2517
- if (ts5.isTypeAliasDeclaration(declaration) && ts5.isTypeReferenceNode(declaration.type) && checker.getTypeFromTypeNode(declaration.type) !== type) {
2564
+ if (ts6.isTypeAliasDeclaration(declaration) && ts6.isTypeReferenceNode(declaration.type) && checker.getTypeFromTypeNode(declaration.type) !== type) {
2518
2565
  return resolveNamedDiscriminatorDeclaration(
2519
2566
  checker.getTypeFromTypeNode(declaration.type),
2520
2567
  checker,
@@ -2542,7 +2589,7 @@ function resolveDiscriminatorValue(boundType, fieldName, checker, provenance, di
2542
2589
  }
2543
2590
  if (boundType.isUnion()) {
2544
2591
  const nonNullMembers = boundType.types.filter(
2545
- (member) => !(member.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
2592
+ (member) => !(member.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
2546
2593
  );
2547
2594
  if (nonNullMembers.every((member) => member.isStringLiteral())) {
2548
2595
  diagnostics.push(
@@ -2587,7 +2634,7 @@ function resolveDiscriminatorValue(boundType, fieldName, checker, provenance, di
2587
2634
  return null;
2588
2635
  }
2589
2636
  function getDeclarationName(node) {
2590
- if (ts5.isClassDeclaration(node) || ts5.isInterfaceDeclaration(node) || ts5.isTypeAliasDeclaration(node) || ts5.isEnumDeclaration(node)) {
2637
+ if (ts6.isClassDeclaration(node) || ts6.isInterfaceDeclaration(node) || ts6.isTypeAliasDeclaration(node) || ts6.isEnumDeclaration(node)) {
2591
2638
  return node.name?.text ?? "anonymous";
2592
2639
  }
2593
2640
  return "anonymous";
@@ -2642,11 +2689,11 @@ function extractReferenceTypeArguments(type, checker, file, typeRegistry, visiti
2642
2689
  if (sourceTypeNode === void 0) {
2643
2690
  return [];
2644
2691
  }
2645
- const unwrapParentheses = (typeNode) => ts5.isParenthesizedTypeNode(typeNode) ? unwrapParentheses(typeNode.type) : typeNode;
2692
+ const unwrapParentheses = (typeNode) => ts6.isParenthesizedTypeNode(typeNode) ? unwrapParentheses(typeNode.type) : typeNode;
2646
2693
  const directTypeNode = unwrapParentheses(sourceTypeNode);
2647
- const referenceTypeNode = ts5.isTypeReferenceNode(directTypeNode) ? directTypeNode : (() => {
2694
+ const referenceTypeNode = ts6.isTypeReferenceNode(directTypeNode) ? directTypeNode : (() => {
2648
2695
  const resolvedTypeNode = resolveAliasedTypeNode(directTypeNode, checker);
2649
- return ts5.isTypeReferenceNode(resolvedTypeNode) ? resolvedTypeNode : null;
2696
+ return ts6.isTypeReferenceNode(resolvedTypeNode) ? resolvedTypeNode : null;
2650
2697
  })();
2651
2698
  if (referenceTypeNode?.typeArguments === void 0) {
2652
2699
  return [];
@@ -2701,7 +2748,7 @@ function applyDiscriminatorToObjectProperties(properties, node, subjectType, che
2701
2748
  );
2702
2749
  }
2703
2750
  function analyzeFieldToIR(prop, checker, file, typeRegistry, visiting, diagnostics, hostType, metadataPolicy, extensionRegistry) {
2704
- if (!ts5.isIdentifier(prop.name)) {
2751
+ if (!ts6.isIdentifier(prop.name)) {
2705
2752
  return null;
2706
2753
  }
2707
2754
  const name = prop.name.text;
@@ -2828,7 +2875,7 @@ function findDuplicateObjectLikeTypeAliasPropertyNames(members) {
2828
2875
  const seen = /* @__PURE__ */ new Set();
2829
2876
  const duplicates = /* @__PURE__ */ new Set();
2830
2877
  for (const member of members) {
2831
- if (!ts5.isPropertySignature(member)) {
2878
+ if (!ts6.isPropertySignature(member)) {
2832
2879
  continue;
2833
2880
  }
2834
2881
  const name = getAnalyzableObjectLikePropertyName(member.name);
@@ -2844,7 +2891,7 @@ function findDuplicateObjectLikeTypeAliasPropertyNames(members) {
2844
2891
  return [...duplicates].sort();
2845
2892
  }
2846
2893
  function getAnalyzableObjectLikePropertyName(name) {
2847
- if (ts5.isIdentifier(name) || ts5.isStringLiteral(name) || ts5.isNumericLiteral(name)) {
2894
+ if (ts6.isIdentifier(name) || ts6.isStringLiteral(name) || ts6.isNumericLiteral(name)) {
2848
2895
  return name.text;
2849
2896
  }
2850
2897
  return null;
@@ -2942,25 +2989,25 @@ function resolveTypeNode(type, checker, file, typeRegistry, visiting, sourceNode
2942
2989
  if (isIntegerBrandedType(type)) {
2943
2990
  return { kind: "primitive", primitiveKind: "integer" };
2944
2991
  }
2945
- if (type.flags & ts5.TypeFlags.String) {
2992
+ if (type.flags & ts6.TypeFlags.String) {
2946
2993
  return { kind: "primitive", primitiveKind: "string" };
2947
2994
  }
2948
- if (type.flags & ts5.TypeFlags.Number) {
2995
+ if (type.flags & ts6.TypeFlags.Number) {
2949
2996
  return { kind: "primitive", primitiveKind: "number" };
2950
2997
  }
2951
- if (type.flags & (ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral)) {
2998
+ if (type.flags & (ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral)) {
2952
2999
  return { kind: "primitive", primitiveKind: "bigint" };
2953
3000
  }
2954
- if (type.flags & ts5.TypeFlags.Boolean) {
3001
+ if (type.flags & ts6.TypeFlags.Boolean) {
2955
3002
  return { kind: "primitive", primitiveKind: "boolean" };
2956
3003
  }
2957
- if (type.flags & ts5.TypeFlags.Null) {
3004
+ if (type.flags & ts6.TypeFlags.Null) {
2958
3005
  return { kind: "primitive", primitiveKind: "null" };
2959
3006
  }
2960
- if (type.flags & ts5.TypeFlags.Undefined) {
3007
+ if (type.flags & ts6.TypeFlags.Undefined) {
2961
3008
  return { kind: "primitive", primitiveKind: "null" };
2962
3009
  }
2963
- if (type.flags & ts5.TypeFlags.Void) {
3010
+ if (type.flags & ts6.TypeFlags.Void) {
2964
3011
  return { kind: "primitive", primitiveKind: "null" };
2965
3012
  }
2966
3013
  if (type.isStringLiteral()) {
@@ -3047,10 +3094,10 @@ function resolveTypeNode(type, checker, file, typeRegistry, visiting, sourceNode
3047
3094
  return { kind: "primitive", primitiveKind: "string" };
3048
3095
  }
3049
3096
  function tryResolveNamedPrimitiveAlias(type, checker, file, typeRegistry, visiting, sourceNode, metadataPolicy = createAnalyzerMetadataPolicy(void 0), extensionRegistry, diagnostics) {
3050
- if (!(type.flags & (ts5.TypeFlags.String | ts5.TypeFlags.Number | ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral | ts5.TypeFlags.Boolean | ts5.TypeFlags.Null)) && !isIntegerBrandedType(type)) {
3097
+ if (!(type.flags & (ts6.TypeFlags.String | ts6.TypeFlags.Number | ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral | ts6.TypeFlags.Boolean | ts6.TypeFlags.Null)) && !isIntegerBrandedType(type)) {
3051
3098
  return null;
3052
3099
  }
3053
- const aliasDecl = type.aliasSymbol?.declarations?.find(ts5.isTypeAliasDeclaration) ?? getReferencedTypeAliasDeclaration(sourceNode, checker);
3100
+ const aliasDecl = type.aliasSymbol?.declarations?.find(ts6.isTypeAliasDeclaration) ?? getReferencedTypeAliasDeclaration(sourceNode, checker);
3054
3101
  if (!aliasDecl) {
3055
3102
  return null;
3056
3103
  }
@@ -3100,14 +3147,14 @@ function tryResolveNamedPrimitiveAlias(type, checker, file, typeRegistry, visiti
3100
3147
  return { kind: "reference", name: aliasName, typeArguments: [] };
3101
3148
  }
3102
3149
  function getReferencedTypeAliasDeclaration(sourceNode, checker) {
3103
- const typeNode = sourceNode && (ts5.isPropertyDeclaration(sourceNode) || ts5.isPropertySignature(sourceNode) || ts5.isParameter(sourceNode)) ? sourceNode.type : void 0;
3104
- if (!typeNode || !ts5.isTypeReferenceNode(typeNode)) {
3150
+ const typeNode = sourceNode && (ts6.isPropertyDeclaration(sourceNode) || ts6.isPropertySignature(sourceNode) || ts6.isParameter(sourceNode)) ? sourceNode.type : void 0;
3151
+ if (!typeNode || !ts6.isTypeReferenceNode(typeNode)) {
3105
3152
  return void 0;
3106
3153
  }
3107
3154
  return getTypeAliasDeclarationFromTypeReference(typeNode, checker);
3108
3155
  }
3109
3156
  function shouldEmitPrimitiveAliasDefinition(typeNode, checker) {
3110
- if (!ts5.isTypeReferenceNode(typeNode)) {
3157
+ if (!ts6.isTypeReferenceNode(typeNode)) {
3111
3158
  return false;
3112
3159
  }
3113
3160
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
@@ -3115,10 +3162,10 @@ function shouldEmitPrimitiveAliasDefinition(typeNode, checker) {
3115
3162
  return false;
3116
3163
  }
3117
3164
  const resolved = checker.getTypeFromTypeNode(aliasDecl.type);
3118
- return !!(resolved.flags & (ts5.TypeFlags.String | ts5.TypeFlags.Number | ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral | ts5.TypeFlags.Boolean | ts5.TypeFlags.Null));
3165
+ return !!(resolved.flags & (ts6.TypeFlags.String | ts6.TypeFlags.Number | ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral | ts6.TypeFlags.Boolean | ts6.TypeFlags.Null));
3119
3166
  }
3120
3167
  function resolveAliasedPrimitiveTarget(type, checker, file, typeRegistry, visiting, metadataPolicy = createAnalyzerMetadataPolicy(void 0), extensionRegistry, diagnostics, visitedAliases = /* @__PURE__ */ new Set()) {
3121
- const nestedAliasDecl = type.aliasSymbol?.declarations?.find(ts5.isTypeAliasDeclaration);
3168
+ const nestedAliasDecl = type.aliasSymbol?.declarations?.find(ts6.isTypeAliasDeclaration);
3122
3169
  if (nestedAliasDecl !== void 0 && !visitedAliases.has(nestedAliasDecl)) {
3123
3170
  visitedAliases.add(nestedAliasDecl);
3124
3171
  return resolveAliasedPrimitiveTarget(
@@ -3136,19 +3183,19 @@ function resolveAliasedPrimitiveTarget(type, checker, file, typeRegistry, visiti
3136
3183
  if (isIntegerBrandedType(type)) {
3137
3184
  return { kind: "primitive", primitiveKind: "integer" };
3138
3185
  }
3139
- if (type.flags & ts5.TypeFlags.String) {
3186
+ if (type.flags & ts6.TypeFlags.String) {
3140
3187
  return { kind: "primitive", primitiveKind: "string" };
3141
3188
  }
3142
- if (type.flags & ts5.TypeFlags.Number) {
3189
+ if (type.flags & ts6.TypeFlags.Number) {
3143
3190
  return { kind: "primitive", primitiveKind: "number" };
3144
3191
  }
3145
- if (type.flags & (ts5.TypeFlags.BigInt | ts5.TypeFlags.BigIntLiteral)) {
3192
+ if (type.flags & (ts6.TypeFlags.BigInt | ts6.TypeFlags.BigIntLiteral)) {
3146
3193
  return { kind: "primitive", primitiveKind: "bigint" };
3147
3194
  }
3148
- if (type.flags & ts5.TypeFlags.Boolean) {
3195
+ if (type.flags & ts6.TypeFlags.Boolean) {
3149
3196
  return { kind: "primitive", primitiveKind: "boolean" };
3150
3197
  }
3151
- if (type.flags & ts5.TypeFlags.Null) {
3198
+ if (type.flags & ts6.TypeFlags.Null) {
3152
3199
  return { kind: "primitive", primitiveKind: "null" };
3153
3200
  }
3154
3201
  return resolveTypeNode(
@@ -3175,13 +3222,13 @@ function resolveUnionType(type, checker, file, typeRegistry, visiting, sourceNod
3175
3222
  (memberTypeNode) => !isNullishTypeNode(resolveAliasedTypeNode(memberTypeNode, checker))
3176
3223
  );
3177
3224
  const nonNullTypes = allTypes.filter(
3178
- (memberType) => !(memberType.flags & (ts5.TypeFlags.Null | ts5.TypeFlags.Undefined))
3225
+ (memberType) => !(memberType.flags & (ts6.TypeFlags.Null | ts6.TypeFlags.Undefined))
3179
3226
  );
3180
3227
  const nonNullMembers = nonNullTypes.map((memberType, index) => ({
3181
3228
  memberType,
3182
3229
  sourceNode: nonNullSourceNodes.length === nonNullTypes.length ? nonNullSourceNodes[index] : void 0
3183
3230
  }));
3184
- const hasNull = allTypes.some((t) => t.flags & ts5.TypeFlags.Null);
3231
+ const hasNull = allTypes.some((t) => t.flags & ts6.TypeFlags.Null);
3185
3232
  const memberDisplayNames = /* @__PURE__ */ new Map();
3186
3233
  if (namedDecl) {
3187
3234
  for (const [value, label] of extractDisplayNameMetadata(namedDecl).memberDisplayNames) {
@@ -3224,7 +3271,7 @@ function resolveUnionType(type, checker, file, typeRegistry, visiting, sourceNod
3224
3271
  const displayName = memberDisplayNames.get(String(value));
3225
3272
  return displayName !== void 0 ? { value, displayName } : { value };
3226
3273
  });
3227
- const isBooleanUnion2 = nonNullTypes.length === 2 && nonNullTypes.every((t) => t.flags & ts5.TypeFlags.BooleanLiteral);
3274
+ const isBooleanUnion2 = nonNullTypes.length === 2 && nonNullTypes.every((t) => t.flags & ts6.TypeFlags.BooleanLiteral);
3228
3275
  if (isBooleanUnion2) {
3229
3276
  const boolNode = { kind: "primitive", primitiveKind: "boolean" };
3230
3277
  const result = hasNull ? {
@@ -3316,7 +3363,7 @@ function tryResolveRecordType(type, checker, file, typeRegistry, visiting, metad
3316
3363
  if (type.getProperties().length > 0) {
3317
3364
  return null;
3318
3365
  }
3319
- const indexInfo = checker.getIndexInfoOfType(type, ts5.IndexKind.String);
3366
+ const indexInfo = checker.getIndexInfoOfType(type, ts6.IndexKind.String);
3320
3367
  if (!indexInfo) {
3321
3368
  return null;
3322
3369
  }
@@ -3364,10 +3411,10 @@ function shouldEmitResolvedObjectProperty(property, declaration) {
3364
3411
  }
3365
3412
  if (declaration !== void 0 && "name" in declaration && declaration.name !== void 0) {
3366
3413
  const name = declaration.name;
3367
- if (ts5.isComputedPropertyName(name) || ts5.isPrivateIdentifier(name)) {
3414
+ if (ts6.isComputedPropertyName(name) || ts6.isPrivateIdentifier(name)) {
3368
3415
  return false;
3369
3416
  }
3370
- if (!ts5.isIdentifier(name) && !ts5.isStringLiteral(name) && !ts5.isNumericLiteral(name)) {
3417
+ if (!ts6.isIdentifier(name) && !ts6.isStringLiteral(name) && !ts6.isNumericLiteral(name)) {
3371
3418
  return false;
3372
3419
  }
3373
3420
  }
@@ -3493,7 +3540,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3493
3540
  if (!declaration) continue;
3494
3541
  if (!shouldEmitResolvedObjectProperty(prop, declaration)) continue;
3495
3542
  const propType = checker.getTypeOfSymbolAtLocation(prop, declaration);
3496
- const optional = !!(prop.flags & ts5.SymbolFlags.Optional);
3543
+ const optional = !!(prop.flags & ts6.SymbolFlags.Optional);
3497
3544
  const propTypeNode = resolveTypeNode(
3498
3545
  propType,
3499
3546
  checker,
@@ -3506,7 +3553,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3506
3553
  collectedDiagnostics
3507
3554
  );
3508
3555
  const fieldNodeInfo = fieldInfoMap?.get(prop.name);
3509
- const inlineFieldNodeInfo = fieldNodeInfo === void 0 ? ts5.isPropertySignature(declaration) ? analyzeInterfacePropertyToIR(
3556
+ const inlineFieldNodeInfo = fieldNodeInfo === void 0 ? ts6.isPropertySignature(declaration) ? analyzeInterfacePropertyToIR(
3510
3557
  declaration,
3511
3558
  checker,
3512
3559
  file,
@@ -3516,7 +3563,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3516
3563
  type,
3517
3564
  metadataPolicy,
3518
3565
  extensionRegistry
3519
- ) : ts5.isPropertyDeclaration(declaration) ? analyzeFieldToIR(
3566
+ ) : ts6.isPropertyDeclaration(declaration) ? analyzeFieldToIR(
3520
3567
  declaration,
3521
3568
  checker,
3522
3569
  file,
@@ -3544,7 +3591,7 @@ function resolveObjectType(type, checker, file, typeRegistry, visiting, sourceNo
3544
3591
  visiting.delete(type);
3545
3592
  const objectNode = {
3546
3593
  kind: "object",
3547
- properties: namedDecl !== void 0 && (ts5.isClassDeclaration(namedDecl) || ts5.isInterfaceDeclaration(namedDecl) || ts5.isTypeAliasDeclaration(namedDecl)) ? applyDiscriminatorToObjectProperties(
3594
+ properties: namedDecl !== void 0 && (ts6.isClassDeclaration(namedDecl) || ts6.isInterfaceDeclaration(namedDecl) || ts6.isTypeAliasDeclaration(namedDecl)) ? applyDiscriminatorToObjectProperties(
3548
3595
  properties,
3549
3596
  namedDecl,
3550
3597
  type,
@@ -3592,12 +3639,12 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3592
3639
  for (const symbol of symbols) {
3593
3640
  const declarations = symbol.declarations;
3594
3641
  if (!declarations) continue;
3595
- const classDecl = declarations.find(ts5.isClassDeclaration);
3642
+ const classDecl = declarations.find(ts6.isClassDeclaration);
3596
3643
  if (classDecl) {
3597
3644
  const map = /* @__PURE__ */ new Map();
3598
3645
  const hostType = checker.getTypeAtLocation(classDecl);
3599
3646
  for (const member of classDecl.members) {
3600
- if (ts5.isPropertyDeclaration(member) && ts5.isIdentifier(member.name)) {
3647
+ if (ts6.isPropertyDeclaration(member) && ts6.isIdentifier(member.name)) {
3601
3648
  const fieldNode = analyzeFieldToIR(
3602
3649
  member,
3603
3650
  checker,
@@ -3621,7 +3668,7 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3621
3668
  }
3622
3669
  return map;
3623
3670
  }
3624
- const interfaceDecl = declarations.find(ts5.isInterfaceDeclaration);
3671
+ const interfaceDecl = declarations.find(ts6.isInterfaceDeclaration);
3625
3672
  if (interfaceDecl) {
3626
3673
  return buildFieldNodeInfoMap(
3627
3674
  interfaceDecl.members,
@@ -3635,7 +3682,7 @@ function getNamedTypeFieldNodeInfoMap(type, checker, file, typeRegistry, visitin
3635
3682
  extensionRegistry
3636
3683
  );
3637
3684
  }
3638
- const typeAliasDecl = declarations.find(ts5.isTypeAliasDeclaration);
3685
+ const typeAliasDecl = declarations.find(ts6.isTypeAliasDeclaration);
3639
3686
  const typeAliasMembers = typeAliasDecl === void 0 ? null : getObjectLikeTypeAliasMembers(typeAliasDecl.type);
3640
3687
  if (typeAliasDecl && typeAliasMembers !== null) {
3641
3688
  return buildFieldNodeInfoMap(
@@ -3659,10 +3706,10 @@ function extractArrayElementTypeNode(sourceNode, checker) {
3659
3706
  return void 0;
3660
3707
  }
3661
3708
  const resolvedTypeNode = resolveAliasedTypeNode(typeNode, checker);
3662
- if (ts5.isArrayTypeNode(resolvedTypeNode)) {
3709
+ if (ts6.isArrayTypeNode(resolvedTypeNode)) {
3663
3710
  return resolvedTypeNode.elementType;
3664
3711
  }
3665
- if (ts5.isTypeReferenceNode(resolvedTypeNode) && ts5.isIdentifier(resolvedTypeNode.typeName) && resolvedTypeNode.typeName.text === "Array" && resolvedTypeNode.typeArguments?.[0]) {
3712
+ if (ts6.isTypeReferenceNode(resolvedTypeNode) && ts6.isIdentifier(resolvedTypeNode.typeName) && resolvedTypeNode.typeName.text === "Array" && resolvedTypeNode.typeArguments?.[0]) {
3666
3713
  return resolvedTypeNode.typeArguments[0];
3667
3714
  }
3668
3715
  return void 0;
@@ -3673,13 +3720,13 @@ function extractUnionMemberTypeNodes(sourceNode, checker) {
3673
3720
  return [];
3674
3721
  }
3675
3722
  const resolvedTypeNode = resolveAliasedTypeNode(typeNode, checker);
3676
- return ts5.isUnionTypeNode(resolvedTypeNode) ? [...resolvedTypeNode.types] : [];
3723
+ return ts6.isUnionTypeNode(resolvedTypeNode) ? [...resolvedTypeNode.types] : [];
3677
3724
  }
3678
3725
  function resolveAliasedTypeNode(typeNode, checker, visited = /* @__PURE__ */ new Set()) {
3679
- if (ts5.isParenthesizedTypeNode(typeNode)) {
3726
+ if (ts6.isParenthesizedTypeNode(typeNode)) {
3680
3727
  return resolveAliasedTypeNode(typeNode.type, checker, visited);
3681
3728
  }
3682
- if (!ts5.isTypeReferenceNode(typeNode) || !ts5.isIdentifier(typeNode.typeName)) {
3729
+ if (!ts6.isTypeReferenceNode(typeNode) || !ts6.isIdentifier(typeNode.typeName)) {
3683
3730
  return typeNode;
3684
3731
  }
3685
3732
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
@@ -3690,15 +3737,15 @@ function resolveAliasedTypeNode(typeNode, checker, visited = /* @__PURE__ */ new
3690
3737
  return resolveAliasedTypeNode(aliasDecl.type, checker, visited);
3691
3738
  }
3692
3739
  function isNullishTypeNode(typeNode) {
3693
- if (typeNode.kind === ts5.SyntaxKind.NullKeyword || typeNode.kind === ts5.SyntaxKind.UndefinedKeyword) {
3740
+ if (typeNode.kind === ts6.SyntaxKind.NullKeyword || typeNode.kind === ts6.SyntaxKind.UndefinedKeyword) {
3694
3741
  return true;
3695
3742
  }
3696
- return ts5.isLiteralTypeNode(typeNode) && (typeNode.literal.kind === ts5.SyntaxKind.NullKeyword || typeNode.literal.kind === ts5.SyntaxKind.UndefinedKeyword);
3743
+ return ts6.isLiteralTypeNode(typeNode) && (typeNode.literal.kind === ts6.SyntaxKind.NullKeyword || typeNode.literal.kind === ts6.SyntaxKind.UndefinedKeyword);
3697
3744
  }
3698
3745
  function buildFieldNodeInfoMap(members, checker, file, typeRegistry, visiting, metadataPolicy, hostType, diagnostics, extensionRegistry) {
3699
3746
  const map = /* @__PURE__ */ new Map();
3700
3747
  for (const member of members) {
3701
- if (ts5.isPropertySignature(member)) {
3748
+ if (ts6.isPropertySignature(member)) {
3702
3749
  const fieldNode = analyzeInterfacePropertyToIR(
3703
3750
  member,
3704
3751
  checker,
@@ -3724,7 +3771,7 @@ function buildFieldNodeInfoMap(members, checker, file, typeRegistry, visiting, m
3724
3771
  }
3725
3772
  var MAX_ALIAS_CHAIN_DEPTH = 8;
3726
3773
  function extractTypeAliasConstraintNodes(typeNode, checker, file, extensionRegistry, depth = 0) {
3727
- if (!ts5.isTypeReferenceNode(typeNode)) return [];
3774
+ if (!ts6.isTypeReferenceNode(typeNode)) return [];
3728
3775
  if (depth >= MAX_ALIAS_CHAIN_DEPTH) {
3729
3776
  const aliasName = typeNode.typeName.getText();
3730
3777
  throw new Error(
@@ -3733,7 +3780,7 @@ function extractTypeAliasConstraintNodes(typeNode, checker, file, extensionRegis
3733
3780
  }
3734
3781
  const aliasDecl = getTypeAliasDeclarationFromTypeReference(typeNode, checker);
3735
3782
  if (!aliasDecl) return [];
3736
- if (ts5.isTypeLiteralNode(aliasDecl.type)) return [];
3783
+ if (ts6.isTypeLiteralNode(aliasDecl.type)) return [];
3737
3784
  const aliasFieldType = resolveTypeNode(
3738
3785
  checker.getTypeAtLocation(aliasDecl.type),
3739
3786
  checker,
@@ -3777,14 +3824,14 @@ function getNamedTypeName(type) {
3777
3824
  const symbol = type.getSymbol();
3778
3825
  if (symbol?.declarations) {
3779
3826
  const decl = symbol.declarations[0];
3780
- if (decl && (ts5.isClassDeclaration(decl) || ts5.isInterfaceDeclaration(decl) || ts5.isTypeAliasDeclaration(decl))) {
3781
- const name = ts5.isClassDeclaration(decl) ? decl.name?.text : decl.name.text;
3827
+ if (decl && (ts6.isClassDeclaration(decl) || ts6.isInterfaceDeclaration(decl) || ts6.isTypeAliasDeclaration(decl))) {
3828
+ const name = ts6.isClassDeclaration(decl) ? decl.name?.text : decl.name.text;
3782
3829
  if (name) return name;
3783
3830
  }
3784
3831
  }
3785
3832
  const aliasSymbol = type.aliasSymbol;
3786
3833
  if (aliasSymbol?.declarations) {
3787
- const aliasDecl = aliasSymbol.declarations.find(ts5.isTypeAliasDeclaration);
3834
+ const aliasDecl = aliasSymbol.declarations.find(ts6.isTypeAliasDeclaration);
3788
3835
  if (aliasDecl) {
3789
3836
  return aliasDecl.name.text;
3790
3837
  }
@@ -3795,24 +3842,24 @@ function getNamedTypeDeclaration(type) {
3795
3842
  const symbol = type.getSymbol();
3796
3843
  if (symbol?.declarations) {
3797
3844
  const decl = symbol.declarations[0];
3798
- if (decl && (ts5.isClassDeclaration(decl) || ts5.isInterfaceDeclaration(decl) || ts5.isTypeAliasDeclaration(decl))) {
3845
+ if (decl && (ts6.isClassDeclaration(decl) || ts6.isInterfaceDeclaration(decl) || ts6.isTypeAliasDeclaration(decl))) {
3799
3846
  return decl;
3800
3847
  }
3801
3848
  }
3802
3849
  const aliasSymbol = type.aliasSymbol;
3803
3850
  if (aliasSymbol?.declarations) {
3804
- return aliasSymbol.declarations.find(ts5.isTypeAliasDeclaration);
3851
+ return aliasSymbol.declarations.find(ts6.isTypeAliasDeclaration);
3805
3852
  }
3806
3853
  return void 0;
3807
3854
  }
3808
3855
  function analyzeMethod(method, checker) {
3809
- if (!ts5.isIdentifier(method.name)) {
3856
+ if (!ts6.isIdentifier(method.name)) {
3810
3857
  return null;
3811
3858
  }
3812
3859
  const name = method.name.text;
3813
3860
  const parameters = [];
3814
3861
  for (const param of method.parameters) {
3815
- if (ts5.isIdentifier(param.name)) {
3862
+ if (ts6.isIdentifier(param.name)) {
3816
3863
  const paramInfo = analyzeParameter(param, checker);
3817
3864
  parameters.push(paramInfo);
3818
3865
  }
@@ -3823,7 +3870,7 @@ function analyzeMethod(method, checker) {
3823
3870
  return { name, parameters, returnTypeNode, returnType };
3824
3871
  }
3825
3872
  function analyzeParameter(param, checker) {
3826
- const name = ts5.isIdentifier(param.name) ? param.name.text : "param";
3873
+ const name = ts6.isIdentifier(param.name) ? param.name.text : "param";
3827
3874
  const typeNode = param.type;
3828
3875
  const type = checker.getTypeAtLocation(param);
3829
3876
  const formSpecExportName = detectFormSpecReference(typeNode);
@@ -3832,15 +3879,15 @@ function analyzeParameter(param, checker) {
3832
3879
  }
3833
3880
  function detectFormSpecReference(typeNode) {
3834
3881
  if (!typeNode) return null;
3835
- if (!ts5.isTypeReferenceNode(typeNode)) return null;
3836
- const typeName = ts5.isIdentifier(typeNode.typeName) ? typeNode.typeName.text : ts5.isQualifiedName(typeNode.typeName) ? typeNode.typeName.right.text : null;
3882
+ if (!ts6.isTypeReferenceNode(typeNode)) return null;
3883
+ const typeName = ts6.isIdentifier(typeNode.typeName) ? typeNode.typeName.text : ts6.isQualifiedName(typeNode.typeName) ? typeNode.typeName.right.text : null;
3837
3884
  if (typeName !== "InferSchema" && typeName !== "InferFormSchema") return null;
3838
3885
  const typeArg = typeNode.typeArguments?.[0];
3839
- if (!typeArg || !ts5.isTypeQueryNode(typeArg)) return null;
3840
- if (ts5.isIdentifier(typeArg.exprName)) {
3886
+ if (!typeArg || !ts6.isTypeQueryNode(typeArg)) return null;
3887
+ if (ts6.isIdentifier(typeArg.exprName)) {
3841
3888
  return typeArg.exprName.text;
3842
3889
  }
3843
- if (ts5.isQualifiedName(typeArg.exprName)) {
3890
+ if (ts6.isQualifiedName(typeArg.exprName)) {
3844
3891
  return typeArg.exprName.right.text;
3845
3892
  }
3846
3893
  return null;
@@ -3862,23 +3909,23 @@ function createProgramContextFromProgram(program, filePath) {
3862
3909
  function createProgramContext(filePath, additionalFiles) {
3863
3910
  const absolutePath = path.resolve(filePath);
3864
3911
  const fileDir = path.dirname(absolutePath);
3865
- const configPath = ts6.findConfigFile(fileDir, ts6.sys.fileExists.bind(ts6.sys), "tsconfig.json");
3912
+ const configPath = ts7.findConfigFile(fileDir, ts7.sys.fileExists.bind(ts7.sys), "tsconfig.json");
3866
3913
  let compilerOptions;
3867
3914
  let fileNames;
3868
3915
  if (configPath) {
3869
- const configFile = ts6.readConfigFile(configPath, ts6.sys.readFile.bind(ts6.sys));
3916
+ const configFile = ts7.readConfigFile(configPath, ts7.sys.readFile.bind(ts7.sys));
3870
3917
  if (configFile.error) {
3871
3918
  throw new Error(
3872
- `Error reading tsconfig.json: ${ts6.flattenDiagnosticMessageText(configFile.error.messageText, "\n")}`
3919
+ `Error reading tsconfig.json: ${ts7.flattenDiagnosticMessageText(configFile.error.messageText, "\n")}`
3873
3920
  );
3874
3921
  }
3875
- const parsed = ts6.parseJsonConfigFileContent(
3922
+ const parsed = ts7.parseJsonConfigFileContent(
3876
3923
  configFile.config,
3877
- ts6.sys,
3924
+ ts7.sys,
3878
3925
  path.dirname(configPath)
3879
3926
  );
3880
3927
  if (parsed.errors.length > 0) {
3881
- const errorMessages = parsed.errors.map((e) => ts6.flattenDiagnosticMessageText(e.messageText, "\n")).join("\n");
3928
+ const errorMessages = parsed.errors.map((e) => ts7.flattenDiagnosticMessageText(e.messageText, "\n")).join("\n");
3882
3929
  throw new Error(`Error parsing tsconfig.json: ${errorMessages}`);
3883
3930
  }
3884
3931
  compilerOptions = parsed.options;
@@ -3886,9 +3933,9 @@ function createProgramContext(filePath, additionalFiles) {
3886
3933
  fileNames = [.../* @__PURE__ */ new Set([...parsed.fileNames, absolutePath, ...normalizedAdditional])];
3887
3934
  } else {
3888
3935
  compilerOptions = {
3889
- target: ts6.ScriptTarget.ES2022,
3890
- module: ts6.ModuleKind.NodeNext,
3891
- moduleResolution: ts6.ModuleResolutionKind.NodeNext,
3936
+ target: ts7.ScriptTarget.ES2022,
3937
+ module: ts7.ModuleKind.NodeNext,
3938
+ moduleResolution: ts7.ModuleResolutionKind.NodeNext,
3892
3939
  strict: true,
3893
3940
  skipLibCheck: true,
3894
3941
  declaration: true
@@ -3896,7 +3943,7 @@ function createProgramContext(filePath, additionalFiles) {
3896
3943
  const normalizedAdditional = (additionalFiles ?? []).map((f) => path.resolve(f));
3897
3944
  fileNames = [.../* @__PURE__ */ new Set([absolutePath, ...normalizedAdditional])];
3898
3945
  }
3899
- const program = ts6.createProgram(fileNames, compilerOptions);
3946
+ const program = ts7.createProgram(fileNames, compilerOptions);
3900
3947
  const sourceFile = program.getSourceFile(absolutePath);
3901
3948
  if (!sourceFile) {
3902
3949
  throw new Error(`Could not find source file: ${absolutePath}`);
@@ -3915,19 +3962,19 @@ function findNodeByName(sourceFile, name, predicate, getName) {
3915
3962
  result = node;
3916
3963
  return;
3917
3964
  }
3918
- ts6.forEachChild(node, visit);
3965
+ ts7.forEachChild(node, visit);
3919
3966
  }
3920
3967
  visit(sourceFile);
3921
3968
  return result;
3922
3969
  }
3923
3970
  function findClassByName(sourceFile, className) {
3924
- return findNodeByName(sourceFile, className, ts6.isClassDeclaration, (n) => n.name?.text);
3971
+ return findNodeByName(sourceFile, className, ts7.isClassDeclaration, (n) => n.name?.text);
3925
3972
  }
3926
3973
  function findInterfaceByName(sourceFile, interfaceName) {
3927
- return findNodeByName(sourceFile, interfaceName, ts6.isInterfaceDeclaration, (n) => n.name.text);
3974
+ return findNodeByName(sourceFile, interfaceName, ts7.isInterfaceDeclaration, (n) => n.name.text);
3928
3975
  }
3929
3976
  function findTypeAliasByName(sourceFile, aliasName) {
3930
- return findNodeByName(sourceFile, aliasName, ts6.isTypeAliasDeclaration, (n) => n.name.text);
3977
+ return findNodeByName(sourceFile, aliasName, ts7.isTypeAliasDeclaration, (n) => n.name.text);
3931
3978
  }
3932
3979
  function getResolvedObjectRootType(rootType, typeRegistry) {
3933
3980
  if (rootType.kind === "object") {
@@ -3967,22 +4014,22 @@ function createResolvedObjectAliasAnalysis(name, rootType, typeRegistry, rootInf
3967
4014
  };
3968
4015
  }
3969
4016
  function containsTypeReferenceInObjectLikeAlias(typeNode) {
3970
- if (ts6.isParenthesizedTypeNode(typeNode)) {
4017
+ if (ts7.isParenthesizedTypeNode(typeNode)) {
3971
4018
  return containsTypeReferenceInObjectLikeAlias(typeNode.type);
3972
4019
  }
3973
- if (ts6.isTypeReferenceNode(typeNode)) {
4020
+ if (ts7.isTypeReferenceNode(typeNode)) {
3974
4021
  return true;
3975
4022
  }
3976
- return ts6.isIntersectionTypeNode(typeNode) && typeNode.types.some((member) => containsTypeReferenceInObjectLikeAlias(member));
4023
+ return ts7.isIntersectionTypeNode(typeNode) && typeNode.types.some((member) => containsTypeReferenceInObjectLikeAlias(member));
3977
4024
  }
3978
4025
  function collectFallbackAliasMemberPropertyNames(typeNode, checker) {
3979
- if (ts6.isParenthesizedTypeNode(typeNode)) {
4026
+ if (ts7.isParenthesizedTypeNode(typeNode)) {
3980
4027
  return collectFallbackAliasMemberPropertyNames(typeNode.type, checker);
3981
4028
  }
3982
- if (ts6.isTypeLiteralNode(typeNode)) {
4029
+ if (ts7.isTypeLiteralNode(typeNode)) {
3983
4030
  const propertyNames = [];
3984
4031
  for (const member of typeNode.members) {
3985
- if (!ts6.isPropertySignature(member)) {
4032
+ if (!ts7.isPropertySignature(member)) {
3986
4033
  continue;
3987
4034
  }
3988
4035
  const propertyName = getAnalyzableObjectLikePropertyName(member.name);
@@ -3992,13 +4039,13 @@ function collectFallbackAliasMemberPropertyNames(typeNode, checker) {
3992
4039
  }
3993
4040
  return propertyNames;
3994
4041
  }
3995
- if (ts6.isTypeReferenceNode(typeNode)) {
4042
+ if (ts7.isTypeReferenceNode(typeNode)) {
3996
4043
  return checker.getTypeFromTypeNode(typeNode).getProperties().map((property) => property.getName());
3997
4044
  }
3998
4045
  return null;
3999
4046
  }
4000
4047
  function findFallbackAliasDuplicatePropertyNames(typeNode, checker) {
4001
- if (!ts6.isIntersectionTypeNode(typeNode)) {
4048
+ if (!ts7.isIntersectionTypeNode(typeNode)) {
4002
4049
  return [];
4003
4050
  }
4004
4051
  const seen = /* @__PURE__ */ new Set();
@@ -4188,7 +4235,7 @@ function makeFileProvenance(filePath) {
4188
4235
  }
4189
4236
 
4190
4237
  // src/generators/class-schema.ts
4191
- var ts8 = __toESM(require("typescript"), 1);
4238
+ var ts9 = __toESM(require("typescript"), 1);
4192
4239
 
4193
4240
  // src/metadata/collision-guards.ts
4194
4241
  function assertUniqueSerializedNames(entries, scope) {
@@ -5182,7 +5229,7 @@ function createExtensionRegistry(extensions) {
5182
5229
  }
5183
5230
 
5184
5231
  // src/extensions/symbol-registry.ts
5185
- var ts7 = __toESM(require("typescript"), 1);
5232
+ var ts8 = __toESM(require("typescript"), 1);
5186
5233
  var path2 = __toESM(require("path"), 1);
5187
5234
 
5188
5235
  // src/ui-schema/schema.ts