@openpkg-ts/sdk 0.54.4 → 0.54.5

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/index.d.ts CHANGED
@@ -1242,6 +1242,12 @@ interface SerializerContext {
1242
1242
  idOwner: Map<string, string>;
1243
1243
  /** Workspace package name → dir, used to package-scope colliding type ids. */
1244
1244
  workspacePackages: ReadonlyMap<string, string>;
1245
+ /** Structural schema-build steps taken this extract. */
1246
+ schemaOps: number;
1247
+ /** Cap on schema-build steps; past this, emit x-ts-type text. */
1248
+ maxSchemaOps: number;
1249
+ /** True once schemaOps exceeded maxSchemaOps. */
1250
+ budgetExceeded: boolean;
1245
1251
  }
1246
1252
  declare class TypeRegistry {
1247
1253
  private types;
@@ -1288,11 +1294,17 @@ declare function isTypeOnlyExport(symbol: ts3.Symbol): boolean;
1288
1294
  /**
1289
1295
  * Follows aliases back to the declaration that carries the type info.
1290
1296
  */
1291
- declare function resolveExportTarget(symbol: ts3.Symbol, checker: ts3.TypeChecker): {
1297
+ declare function resolveExportTarget(symbol: ts3.Symbol, checker: ts3.TypeChecker, program?: ts3.Program): {
1292
1298
  declaration?: ts3.Declaration;
1293
1299
  targetSymbol: ts3.Symbol;
1294
1300
  isTypeOnly: boolean;
1295
1301
  };
1302
+ /**
1303
+ * `getAliasedSymbol` does not follow named re-exports of bindings that arrived
1304
+ * via `*` (immer: `{ original } from "./internal"` where internal
1305
+ * is star-exports). Walk the module's table instead.
1306
+ */
1307
+ declare function resolveAliasSymbol(symbol: ts3.Symbol, checker: ts3.TypeChecker, seen?: Set<ts3.Symbol>, program?: ts3.Program): ts3.Symbol;
1296
1308
  import { SpecExample, SpecExportKind as SpecExportKind8, SpecInlineTag as SpecInlineTag2, SpecSource, SpecTag, SpecTypeParameter as SpecTypeParameter2 } from "@openpkg-ts/spec";
1297
1309
  import ts4 from "typescript";
1298
1310
  declare function getJSDocComment(node: ts4.Node, symbol?: ts4.Symbol, checker?: ts4.TypeChecker): {
@@ -1315,7 +1327,7 @@ type DeclarationWithTypeParams = ts4.FunctionDeclaration | ts4.ClassDeclaration
1315
1327
  * Extract type parameters from declarations like `<T extends Base, K = Default>`
1316
1328
  * Also captures variance annotations (in/out) and const modifier.
1317
1329
  */
1318
- declare function extractTypeParameters(node: DeclarationWithTypeParams, checker: ts4.TypeChecker): SpecTypeParameter2[] | undefined;
1330
+ declare function extractTypeParameters(node: DeclarationWithTypeParams, _checker: ts4.TypeChecker): SpecTypeParameter2[] | undefined;
1319
1331
  /**
1320
1332
  * Check if a symbol is marked as deprecated via @deprecated JSDoc tag.
1321
1333
  * Returns deprecation status and optional reason text.
@@ -1876,6 +1888,14 @@ declare function renderTypeText(type: ts16.Type, checker: ts16.TypeChecker, encl
1876
1888
  declare function writtenTypeText(typeNode: ts16.TypeNode | undefined): string | undefined;
1877
1889
  /** The annotation TypeNode on a declaration (property, alias, parameter), if any. */
1878
1890
  declare function declaredTypeNode(decl: ts16.Declaration | undefined): ts16.TypeNode | undefined;
1891
+ /** Return annotation on a call signature, if the author wrote one. */
1892
+ declare function typeNodeOfSignature(sig: ts16.Signature): ts16.TypeNode | undefined;
1893
+ /**
1894
+ * Build a schema from a written TypeNode when the checker type is `any`
1895
+ * (error types from arity mismatches, unresolved names, …). Recovers
1896
+ * `LiveMap<string, V>` / `LiveMap<string, V> | null` instead of silent `{}`.
1897
+ */
1898
+ declare function buildSchemaFromTypeNode(node: ts16.TypeNode, checker: ts16.TypeChecker, ctx?: SerializerContext): SpecSchema5;
1879
1899
  /**
1880
1900
  * Strip `undefined` from a union type when optionality is already expressed
1881
1901
  * elsewhere (`required: false`, `flags.optional`). Used for both schema shape
@@ -1902,6 +1922,16 @@ declare function decoratePropertySchema(schema: SpecSchema5, prop: ts16.Symbol,
1902
1922
  */
1903
1923
  declare function shouldEmitAliasTypeText(typeNode: ts16.TypeNode): boolean;
1904
1924
  declare const PRIMITIVES: Set<string>;
1925
+ /**
1926
+ * Mapped/conditional aliases that are not lib utilities (valibot DeepPickN,
1927
+ * ValidPaths, immer Draft). Instantiating them via getProperties /
1928
+ * getTypeOfSymbolAtLocation does not terminate — each instantiation is a new
1929
+ * ts.Type. Indexed-access aliases (Names) and lib utilities (Record/Pick/Omit)
1930
+ * still flatten.
1931
+ */
1932
+ declare function isDeferredMappedOrConditional(type: ts16.Type): boolean;
1933
+ /** True when instantiating this annotation would expand recursive mapped types. */
1934
+ declare function typeNodeDefersExpansion(node: ts16.TypeNode | undefined, checker: ts16.TypeChecker, program?: ts16.Program): boolean;
1905
1935
  declare const ARRAY_PROTOTYPE_METHODS: Set<string>;
1906
1936
  declare const STRING_PROTOTYPE_METHODS: Set<string>;
1907
1937
  declare const NUMBER_PROTOTYPE_METHODS: Set<string>;
@@ -1941,7 +1971,7 @@ declare function ensureNonEmptySchema(schema: SpecSchema5, type: ts16.Type, chec
1941
1971
  * Uses $ref for named types and typeArguments for generics.
1942
1972
  * Guarantees non-empty schema output via ensureNonEmptySchema wrapper.
1943
1973
  */
1944
- declare function buildSchema(type: ts16.Type, checker: ts16.TypeChecker, ctx?: SerializerContext): SpecSchema5;
1974
+ declare function buildSchema(type: ts16.Type, checker: ts16.TypeChecker, ctx?: SerializerContext, typeNode?: ts16.TypeNode): SpecSchema5;
1945
1975
  /**
1946
1976
  * Build schema for function types
1947
1977
  */
@@ -1986,4 +2016,4 @@ declare function findDiscriminatorProperty(unionTypes: ts16.Type[], checker: ts1
1986
2016
  import ts17 from "typescript";
1987
2017
  declare function isExported(node: ts17.Node): boolean;
1988
2018
  declare function getNodeName(node: ts17.Node): string | undefined;
1989
- export { zodAdapter, writtenTypeText, withDescription2 as withDescription, withDeprecated, validateSpec, valibotAdapter, typeboxAdapter, toToolSchema, toSearchIndexJSON, toSearchIndex2 as toSearchIndex, toPagefindRecords2 as toPagefindRecords, toNavigation2 as toNavigation, toMarkdown2 as toMarkdown, toJsonSchema, toJSONString, toJSON2 as toJSON, toHTML2 as toHTML, toFumadocsMetaJSON, toDocusaurusSidebarJS, toAlgoliaRecords2 as toAlgoliaRecords, stripUndefinedFromType, stripTsExtensions, sortByName, shouldEmitAliasTypeText, serializeVariable, serializeTypeAlias, serializeInterface, serializeFunctionExport, serializeEnum, serializeClass, scrubImportQualifiers, schemasAreEqual, schemaIsAny, resolveTypeRef, resolveTarget, resolveExportTarget, resolveCompiledPath, renderTypeText, registerReferencedTypes, registerAdapter, recommendSemverBump, query, pickEntry, parseGithubRepo, normalizeType, normalizeSchema, normalizeMembers, normalizeExport, mergeConfig, loadSpec, loadConfig, listExports, isTypeReference, isTypeOnlyExport, isSymbolDeprecated, isStandardJSONSchema, isSchemaType, isRemoteInput, isReadonlyPropertySymbol, isPureRefSchema, isProperty, isPrimitiveName, isPathLikeInput, isMethod, isExported, isEntryFilePath, isBuiltinSymbol, isBuiltinGeneric, isAnonymous, groupByVisibility, getValidationErrors, getTypeOrigin, getSourceLocation, getProperties, getParamDescription, getNonNullableType, getNodeName, getMethods, getMemberBadges, getJSDocComment, getExportKind, getExport2 as getExport, getAvailableVersions, toMarkdown2 as generateDocs, formatTypeParameters, formatSchema, formatReturnType, formatParameters, formatMappedType, formatConditionalType, formatBadges, findWorkspaceRoot, findDiscriminatorProperty, findAdapter, filterSpec, extractTypeParameters, extractStandardSchemasFromTs, extractStandardSchemasFromProject, extractStandardSchemas, extractSpec, extractSchemaType, extractParameters, extract, exportToMarkdown, exportToJsonSchema, ensureNonEmptySchema, diffSpec2 as diffSpecs, diffSpec, detectTsRuntime, deduplicateSchemas, decoratePropertySchema, declaredTypeNode, createProgram, createDocs, cloneRemote, categorizeBreakingChanges, catalogPackages, calculateNextVersion, bundleRefs, buildSignatureString, buildSchema, buildObjectSchema, buildFunctionSchema, assertSpec, asStandardSchema, arktypeAdapter, TypeRegistry, TypeReference2 as TypeReference, TsRuntime, ToolSchemaResult, ToolSchemaProvider, ToToolSchemaOptions, ToJsonSchemaOptions, StandardSchemaExtractionResult, StandardSchemaExtractionOutput, StandardJSONSchemaV1, StandardJSONSchemaTarget, StandardJSONSchemaOptions, SpecMappedType, SpecError, SpecDiff, SpecConditionalType, SkippedExportDetail, SimplifiedSpec, SimplifiedSignature, SimplifiedReturn, SimplifiedParameter, SimplifiedMember, SimplifiedExport, SimplifiedExample, SerializerContext, SemverRecommendation, SemverBump, SearchRecord, SearchOptions, SearchIndex, SchemaVersion, SchemaExtractionResult, SchemaAdapter, STRING_PROTOTYPE_METHODS, ResolveTargetResult, ResolveTargetOptions, ResolveOk, ResolveNeedsBuild, ResolveExplicit, ResolveEmpty, ResolveAmbiguous, QueryBuilder, ProjectExtractionOutput, ProjectExtractionInfo, ProgramResult, ProgramOptions, PagefindRecord, PackageRecord, PRIMITIVES, OpenpkgConfig, NormalizeOptions, NavOptions, NavItem, NavGroup, NavFormat, NUMBER_PROTOTYPE_METHODS, MemberChangeInfo, MarkdownOptions, LoadOptions, ListExportsResult, ListExportsOptions, LATEST_VERSION, JsonSchemaDocument, JSONSchema, JSONOptions, HTMLOptions, GroupBy, GetExportResult, GetExportOptions, GenericNav, FumadocsMetaItem, FumadocsMeta, FormatSchemaOptions, ForgottenExport, FilterResult, FilterCriteria, ExtractionWarningCode, ExtractionWarning, ExtractStandardSchemasOptions, ExtractResult, ExtractOptions, ExtractFromProjectOptions, ExternalsConfig, ExportVerification, ExportTracker, ExportMarkdownOptions, ExportItem, DocusaurusSidebarItem, DocusaurusSidebar, DocsInstance, Diagnostic, CloneFn, CategorizedBreaking, CacheManagerOptions, CacheManager, CONFIG_FILENAME, BundleResult, BundleOptions, BuiltinSchema, BreakingSeverity, BUILTIN_TYPE_SCHEMAS, AsStandardSchemaOptions, AlgoliaRecord, ARRAY_PROTOTYPE_METHODS };
2019
+ export { zodAdapter, writtenTypeText, withDescription2 as withDescription, withDeprecated, validateSpec, valibotAdapter, typeboxAdapter, typeNodeOfSignature, typeNodeDefersExpansion, toToolSchema, toSearchIndexJSON, toSearchIndex2 as toSearchIndex, toPagefindRecords2 as toPagefindRecords, toNavigation2 as toNavigation, toMarkdown2 as toMarkdown, toJsonSchema, toJSONString, toJSON2 as toJSON, toHTML2 as toHTML, toFumadocsMetaJSON, toDocusaurusSidebarJS, toAlgoliaRecords2 as toAlgoliaRecords, stripUndefinedFromType, stripTsExtensions, sortByName, shouldEmitAliasTypeText, serializeVariable, serializeTypeAlias, serializeInterface, serializeFunctionExport, serializeEnum, serializeClass, scrubImportQualifiers, schemasAreEqual, schemaIsAny, resolveTypeRef, resolveTarget, resolveExportTarget, resolveCompiledPath, resolveAliasSymbol, renderTypeText, registerReferencedTypes, registerAdapter, recommendSemverBump, query, pickEntry, parseGithubRepo, normalizeType, normalizeSchema, normalizeMembers, normalizeExport, mergeConfig, loadSpec, loadConfig, listExports, isTypeReference, isTypeOnlyExport, isSymbolDeprecated, isStandardJSONSchema, isSchemaType, isRemoteInput, isReadonlyPropertySymbol, isPureRefSchema, isProperty, isPrimitiveName, isPathLikeInput, isMethod, isExported, isEntryFilePath, isDeferredMappedOrConditional, isBuiltinSymbol, isBuiltinGeneric, isAnonymous, groupByVisibility, getValidationErrors, getTypeOrigin, getSourceLocation, getProperties, getParamDescription, getNonNullableType, getNodeName, getMethods, getMemberBadges, getJSDocComment, getExportKind, getExport2 as getExport, getAvailableVersions, toMarkdown2 as generateDocs, formatTypeParameters, formatSchema, formatReturnType, formatParameters, formatMappedType, formatConditionalType, formatBadges, findWorkspaceRoot, findDiscriminatorProperty, findAdapter, filterSpec, extractTypeParameters, extractStandardSchemasFromTs, extractStandardSchemasFromProject, extractStandardSchemas, extractSpec, extractSchemaType, extractParameters, extract, exportToMarkdown, exportToJsonSchema, ensureNonEmptySchema, diffSpec2 as diffSpecs, diffSpec, detectTsRuntime, deduplicateSchemas, decoratePropertySchema, declaredTypeNode, createProgram, createDocs, cloneRemote, categorizeBreakingChanges, catalogPackages, calculateNextVersion, bundleRefs, buildSignatureString, buildSchemaFromTypeNode, buildSchema, buildObjectSchema, buildFunctionSchema, assertSpec, asStandardSchema, arktypeAdapter, TypeRegistry, TypeReference2 as TypeReference, TsRuntime, ToolSchemaResult, ToolSchemaProvider, ToToolSchemaOptions, ToJsonSchemaOptions, StandardSchemaExtractionResult, StandardSchemaExtractionOutput, StandardJSONSchemaV1, StandardJSONSchemaTarget, StandardJSONSchemaOptions, SpecMappedType, SpecError, SpecDiff, SpecConditionalType, SkippedExportDetail, SimplifiedSpec, SimplifiedSignature, SimplifiedReturn, SimplifiedParameter, SimplifiedMember, SimplifiedExport, SimplifiedExample, SerializerContext, SemverRecommendation, SemverBump, SearchRecord, SearchOptions, SearchIndex, SchemaVersion, SchemaExtractionResult, SchemaAdapter, STRING_PROTOTYPE_METHODS, ResolveTargetResult, ResolveTargetOptions, ResolveOk, ResolveNeedsBuild, ResolveExplicit, ResolveEmpty, ResolveAmbiguous, QueryBuilder, ProjectExtractionOutput, ProjectExtractionInfo, ProgramResult, ProgramOptions, PagefindRecord, PackageRecord, PRIMITIVES, OpenpkgConfig, NormalizeOptions, NavOptions, NavItem, NavGroup, NavFormat, NUMBER_PROTOTYPE_METHODS, MemberChangeInfo, MarkdownOptions, LoadOptions, ListExportsResult, ListExportsOptions, LATEST_VERSION, JsonSchemaDocument, JSONSchema, JSONOptions, HTMLOptions, GroupBy, GetExportResult, GetExportOptions, GenericNav, FumadocsMetaItem, FumadocsMeta, FormatSchemaOptions, ForgottenExport, FilterResult, FilterCriteria, ExtractionWarningCode, ExtractionWarning, ExtractStandardSchemasOptions, ExtractResult, ExtractOptions, ExtractFromProjectOptions, ExternalsConfig, ExportVerification, ExportTracker, ExportMarkdownOptions, ExportItem, DocusaurusSidebarItem, DocusaurusSidebar, DocsInstance, Diagnostic, CloneFn, CategorizedBreaking, CacheManagerOptions, CacheManager, CONFIG_FILENAME, BundleResult, BundleOptions, BuiltinSchema, BreakingSeverity, BUILTIN_TYPE_SCHEMAS, AsStandardSchemaOptions, AlgoliaRecord, ARRAY_PROTOTYPE_METHODS };