@openpkg-ts/sdk 0.52.1 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -16
- package/dist/browser.d.ts +29 -64
- package/dist/browser.js +1 -9
- package/dist/index.d.ts +76 -125
- package/dist/index.js +165 -118
- package/dist/shared/{chunk-zrx9s0n4.js → chunk-7287tqkx.js} +1 -78
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -43,8 +43,6 @@ interface ExternalsConfig {
|
|
|
43
43
|
include?: string[];
|
|
44
44
|
/** Package patterns to never resolve */
|
|
45
45
|
exclude?: string[];
|
|
46
|
-
/** Max transitive depth for resolution (default: 1) */
|
|
47
|
-
depth?: number;
|
|
48
46
|
}
|
|
49
47
|
interface ExtractOptions {
|
|
50
48
|
entryFile: string;
|
|
@@ -53,8 +51,6 @@ interface ExtractOptions {
|
|
|
53
51
|
baseDir?: string;
|
|
54
52
|
content?: string;
|
|
55
53
|
maxTypeDepth?: number;
|
|
56
|
-
maxExternalTypeDepth?: number;
|
|
57
|
-
resolveExternalTypes?: boolean;
|
|
58
54
|
schemaExtraction?: "static" | "hybrid";
|
|
59
55
|
/** Include $schema URL in output */
|
|
60
56
|
includeSchema?: boolean;
|
|
@@ -117,15 +113,6 @@ interface ExtractResult {
|
|
|
117
113
|
/** Extraction method used: 'compiled' or 'direct-ts (runtime)' */
|
|
118
114
|
method?: string;
|
|
119
115
|
};
|
|
120
|
-
/** Degraded mode info when extracting from .d.ts files */
|
|
121
|
-
degradedMode?: {
|
|
122
|
-
reason: "dts-source";
|
|
123
|
-
stats: {
|
|
124
|
-
exportsWithoutDescription: number;
|
|
125
|
-
paramsWithoutDocs: number;
|
|
126
|
-
missingExamples: number;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
116
|
/** Export verification comparing discovered vs extracted */
|
|
130
117
|
verification?: ExportVerification;
|
|
131
118
|
}
|
|
@@ -231,41 +218,6 @@ declare function loadConfig(cwd: string): OpenpkgConfig | null;
|
|
|
231
218
|
* @returns Merged config
|
|
232
219
|
*/
|
|
233
220
|
declare function mergeConfig(fileConfig: OpenpkgConfig | null, cliOptions: Partial<OpenpkgConfig>): OpenpkgConfig;
|
|
234
|
-
import { OpenPkg as OpenPkg2, SpecExport } from "@openpkg-ts/spec";
|
|
235
|
-
interface DiagnosticItem {
|
|
236
|
-
exportId: string;
|
|
237
|
-
exportName: string;
|
|
238
|
-
issue: string;
|
|
239
|
-
/** Member name if issue is on a member */
|
|
240
|
-
member?: string;
|
|
241
|
-
/** Parameter name if issue is on a parameter */
|
|
242
|
-
param?: string;
|
|
243
|
-
}
|
|
244
|
-
interface SpecDiagnostics {
|
|
245
|
-
/** Exports/members without descriptions */
|
|
246
|
-
missingDescriptions: DiagnosticItem[];
|
|
247
|
-
/** Exports marked @deprecated but no reason provided */
|
|
248
|
-
deprecatedNoReason: DiagnosticItem[];
|
|
249
|
-
/** Function params without descriptions in JSDoc */
|
|
250
|
-
missingParamDocs: DiagnosticItem[];
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Check if has @deprecated tag.
|
|
254
|
-
*/
|
|
255
|
-
declare function hasDeprecatedTag(exp: SpecExport): boolean;
|
|
256
|
-
/**
|
|
257
|
-
* Get deprecation message from @deprecated tag.
|
|
258
|
-
* Returns undefined if no reason provided.
|
|
259
|
-
*/
|
|
260
|
-
declare function getDeprecationMessage(exp: SpecExport): string | undefined;
|
|
261
|
-
/**
|
|
262
|
-
* Find params without descriptions in JSDoc.
|
|
263
|
-
*/
|
|
264
|
-
declare function findMissingParamDocs(exp: SpecExport): string[];
|
|
265
|
-
/**
|
|
266
|
-
* Analyze a spec for quality issues.
|
|
267
|
-
*/
|
|
268
|
-
declare function analyzeSpec(spec: OpenPkg2): SpecDiagnostics;
|
|
269
221
|
import { SpecMember } from "@openpkg-ts/spec";
|
|
270
222
|
/**
|
|
271
223
|
* Extract badge strings from a member's visibility and flags.
|
|
@@ -276,8 +228,8 @@ declare function getMemberBadges(member: SpecMember): string[];
|
|
|
276
228
|
* Format badges array into a display string (space-separated).
|
|
277
229
|
*/
|
|
278
230
|
declare function formatBadges(badges: string[]): string;
|
|
279
|
-
import { OpenPkg as
|
|
280
|
-
import { OpenPkg as
|
|
231
|
+
import { OpenPkg as OpenPkg7, SpecExport as SpecExport2, SpecExportKind as SpecExportKind4, SpecType } from "@openpkg-ts/spec";
|
|
232
|
+
import { OpenPkg as OpenPkg2 } from "@openpkg-ts/spec";
|
|
281
233
|
interface HTMLOptions {
|
|
282
234
|
/** Page title override */
|
|
283
235
|
title?: string;
|
|
@@ -318,8 +270,8 @@ interface HTMLOptions {
|
|
|
318
270
|
* const fragment = docs.toHTML({ export: 'greet', fullDocument: false })
|
|
319
271
|
* ```
|
|
320
272
|
*/
|
|
321
|
-
declare function toHTML2(spec:
|
|
322
|
-
import { OpenPkg as
|
|
273
|
+
declare function toHTML2(spec: OpenPkg2, options?: HTMLOptions): string;
|
|
274
|
+
import { OpenPkg as OpenPkg3, SpecExportKind, SpecInlineTag } from "@openpkg-ts/spec";
|
|
323
275
|
interface JSONOptions {
|
|
324
276
|
/** Include raw spec data alongside simplified data */
|
|
325
277
|
includeRaw?: boolean;
|
|
@@ -414,7 +366,7 @@ interface SimplifiedSpec {
|
|
|
414
366
|
* // { id, name, kind, signature, parameters, returns, ... }
|
|
415
367
|
* ```
|
|
416
368
|
*/
|
|
417
|
-
declare function toJSON2(spec:
|
|
369
|
+
declare function toJSON2(spec: OpenPkg3, options?: JSONOptions): SimplifiedSpec | SimplifiedExport;
|
|
418
370
|
/**
|
|
419
371
|
* Serialize to JSON string with formatting.
|
|
420
372
|
*
|
|
@@ -422,10 +374,10 @@ declare function toJSON2(spec: OpenPkg4, options?: JSONOptions): SimplifiedSpec
|
|
|
422
374
|
* @param options - JSON options plus pretty formatting option
|
|
423
375
|
* @returns JSON string
|
|
424
376
|
*/
|
|
425
|
-
declare function toJSONString(spec:
|
|
377
|
+
declare function toJSONString(spec: OpenPkg3, options?: JSONOptions & {
|
|
426
378
|
pretty?: boolean;
|
|
427
379
|
}): string;
|
|
428
|
-
import { OpenPkg as
|
|
380
|
+
import { OpenPkg as OpenPkg4, SpecExport } from "@openpkg-ts/spec";
|
|
429
381
|
interface MarkdownOptions {
|
|
430
382
|
/** Include frontmatter in output */
|
|
431
383
|
frontmatter?: boolean;
|
|
@@ -471,7 +423,7 @@ interface ExportMarkdownOptions extends MarkdownOptions {
|
|
|
471
423
|
* })
|
|
472
424
|
* ```
|
|
473
425
|
*/
|
|
474
|
-
declare function exportToMarkdown(exp:
|
|
426
|
+
declare function exportToMarkdown(exp: SpecExport, options?: MarkdownOptions): string;
|
|
475
427
|
/**
|
|
476
428
|
* Render entire spec to MDX.
|
|
477
429
|
*
|
|
@@ -494,8 +446,8 @@ declare function exportToMarkdown(exp: SpecExport2, options?: MarkdownOptions):
|
|
|
494
446
|
* // Single * const fnMdx = docs.toMarkdown({ export: 'greet' })
|
|
495
447
|
* ```
|
|
496
448
|
*/
|
|
497
|
-
declare function toMarkdown2(spec:
|
|
498
|
-
import { OpenPkg as
|
|
449
|
+
declare function toMarkdown2(spec: OpenPkg4, options?: ExportMarkdownOptions): string;
|
|
450
|
+
import { OpenPkg as OpenPkg5, SpecExportKind as SpecExportKind2 } from "@openpkg-ts/spec";
|
|
499
451
|
type NavFormat = "fumadocs" | "docusaurus" | "generic";
|
|
500
452
|
type GroupBy = "kind" | "module" | "tag" | "none";
|
|
501
453
|
interface NavOptions {
|
|
@@ -570,7 +522,7 @@ type DocusaurusSidebar = DocusaurusSidebarItem[];
|
|
|
570
522
|
* const sidebar = docs.toNavigation({ format: 'docusaurus' })
|
|
571
523
|
* ```
|
|
572
524
|
*/
|
|
573
|
-
declare function toNavigation2(spec:
|
|
525
|
+
declare function toNavigation2(spec: OpenPkg5, options?: NavOptions): GenericNav | FumadocsMeta | DocusaurusSidebar;
|
|
574
526
|
/**
|
|
575
527
|
* Generate Fumadocs meta.json file content.
|
|
576
528
|
*
|
|
@@ -586,7 +538,7 @@ declare function toNavigation2(spec: OpenPkg6, options?: NavOptions): GenericNav
|
|
|
586
538
|
* fs.writeFileSync('docs/api/meta.json', meta)
|
|
587
539
|
* ```
|
|
588
540
|
*/
|
|
589
|
-
declare function toFumadocsMetaJSON(spec:
|
|
541
|
+
declare function toFumadocsMetaJSON(spec: OpenPkg5, options?: Omit<NavOptions, "format">): string;
|
|
590
542
|
/**
|
|
591
543
|
* Generate Docusaurus sidebar config.
|
|
592
544
|
*
|
|
@@ -602,8 +554,8 @@ declare function toFumadocsMetaJSON(spec: OpenPkg6, options?: Omit<NavOptions, "
|
|
|
602
554
|
* fs.writeFileSync('sidebars.js', sidebar)
|
|
603
555
|
* ```
|
|
604
556
|
*/
|
|
605
|
-
declare function toDocusaurusSidebarJS(spec:
|
|
606
|
-
import { OpenPkg as
|
|
557
|
+
declare function toDocusaurusSidebarJS(spec: OpenPkg5, options?: Omit<NavOptions, "format">): string;
|
|
558
|
+
import { OpenPkg as OpenPkg6, SpecExportKind as SpecExportKind3 } from "@openpkg-ts/spec";
|
|
607
559
|
interface SearchOptions {
|
|
608
560
|
/** Base URL for search result links */
|
|
609
561
|
baseUrl?: string;
|
|
@@ -696,7 +648,7 @@ interface SearchIndex {
|
|
|
696
648
|
* // { records: [...], version: '1.0.0', packageName: 'my-lib' }
|
|
697
649
|
* ```
|
|
698
650
|
*/
|
|
699
|
-
declare function toSearchIndex2(spec:
|
|
651
|
+
declare function toSearchIndex2(spec: OpenPkg6, options?: SearchOptions): SearchIndex;
|
|
700
652
|
/**
|
|
701
653
|
* Generate Pagefind-compatible records.
|
|
702
654
|
*
|
|
@@ -712,7 +664,7 @@ declare function toSearchIndex2(spec: OpenPkg7, options?: SearchOptions): Search
|
|
|
712
664
|
* })
|
|
713
665
|
* ```
|
|
714
666
|
*/
|
|
715
|
-
declare function toPagefindRecords2(spec:
|
|
667
|
+
declare function toPagefindRecords2(spec: OpenPkg6, options?: SearchOptions): PagefindRecord[];
|
|
716
668
|
/**
|
|
717
669
|
* Generate Algolia-compatible records.
|
|
718
670
|
*
|
|
@@ -726,7 +678,7 @@ declare function toPagefindRecords2(spec: OpenPkg7, options?: SearchOptions): Pa
|
|
|
726
678
|
* // Upload to Algolia index
|
|
727
679
|
* ```
|
|
728
680
|
*/
|
|
729
|
-
declare function toAlgoliaRecords2(spec:
|
|
681
|
+
declare function toAlgoliaRecords2(spec: OpenPkg6, options?: SearchOptions): AlgoliaRecord[];
|
|
730
682
|
/**
|
|
731
683
|
* Serialize search index to JSON string.
|
|
732
684
|
*
|
|
@@ -740,36 +692,36 @@ declare function toAlgoliaRecords2(spec: OpenPkg7, options?: SearchOptions): Alg
|
|
|
740
692
|
* fs.writeFileSync('search-index.json', json)
|
|
741
693
|
* ```
|
|
742
694
|
*/
|
|
743
|
-
declare function toSearchIndexJSON(spec:
|
|
695
|
+
declare function toSearchIndexJSON(spec: OpenPkg6, options?: SearchOptions & {
|
|
744
696
|
pretty?: boolean;
|
|
745
697
|
}): string;
|
|
746
698
|
interface LoadOptions {
|
|
747
699
|
/** Path to openpkg.json file or the spec object directly */
|
|
748
|
-
input: string |
|
|
700
|
+
input: string | OpenPkg7;
|
|
749
701
|
}
|
|
750
702
|
interface DocsInstance {
|
|
751
703
|
/** The parsed OpenPkg spec */
|
|
752
|
-
spec:
|
|
704
|
+
spec: OpenPkg7;
|
|
753
705
|
/** Get an by its ID */
|
|
754
|
-
getExport(id: string):
|
|
706
|
+
getExport(id: string): SpecExport2 | undefined;
|
|
755
707
|
/** Get a type definition by its ID */
|
|
756
708
|
getType(id: string): SpecType | undefined;
|
|
757
709
|
/** Get all exports of a specific kind */
|
|
758
|
-
getExportsByKind(kind: SpecExportKind4):
|
|
710
|
+
getExportsByKind(kind: SpecExportKind4): SpecExport2[];
|
|
759
711
|
/** Get all exports */
|
|
760
|
-
getAllExports():
|
|
712
|
+
getAllExports(): SpecExport2[];
|
|
761
713
|
/** Get all type definitions */
|
|
762
714
|
getAllTypes(): SpecType[];
|
|
763
715
|
/** Get exports by JSDoc tag (e.g., '@beta', '@internal') */
|
|
764
|
-
getExportsByTag(tagName: string):
|
|
716
|
+
getExportsByTag(tagName: string): SpecExport2[];
|
|
765
717
|
/** Search exports by name or description */
|
|
766
|
-
search(query: string):
|
|
718
|
+
search(query: string): SpecExport2[];
|
|
767
719
|
/** Get exports belonging to a specific module/namespace */
|
|
768
|
-
getModule(moduleName: string):
|
|
720
|
+
getModule(moduleName: string): SpecExport2[];
|
|
769
721
|
/** Get deprecated exports */
|
|
770
|
-
getDeprecated():
|
|
722
|
+
getDeprecated(): SpecExport2[];
|
|
771
723
|
/** Get exports grouped by kind */
|
|
772
|
-
groupByKind(): Record<SpecExportKind4,
|
|
724
|
+
groupByKind(): Record<SpecExportKind4, SpecExport2[]>;
|
|
773
725
|
/** Render spec or single to an MDX string */
|
|
774
726
|
toMarkdown(options?: ExportMarkdownOptions): string;
|
|
775
727
|
/** Render spec or single to an HTML string */
|
|
@@ -797,7 +749,7 @@ interface DocsInstance {
|
|
|
797
749
|
* const docs = loadSpec(spec)
|
|
798
750
|
* ```
|
|
799
751
|
*/
|
|
800
|
-
declare function loadSpec(spec:
|
|
752
|
+
declare function loadSpec(spec: OpenPkg7): DocsInstance;
|
|
801
753
|
/**
|
|
802
754
|
* Creates a docs instance for querying and rendering API documentation.
|
|
803
755
|
*
|
|
@@ -822,8 +774,8 @@ declare function loadSpec(spec: OpenPkg8): DocsInstance;
|
|
|
822
774
|
* docs.search('hook')
|
|
823
775
|
* ```
|
|
824
776
|
*/
|
|
825
|
-
declare function createDocs(input: string |
|
|
826
|
-
import { OpenPkg as
|
|
777
|
+
declare function createDocs(input: string | OpenPkg7): DocsInstance;
|
|
778
|
+
import { OpenPkg as OpenPkg8, SpecExport as SpecExport3, SpecMember as SpecMember2, SpecSchema, SpecSignature, SpecType as SpecType2, SpecTypeParameter } from "@openpkg-ts/spec";
|
|
827
779
|
interface FormatSchemaOptions {
|
|
828
780
|
/** Include package attribution for external types */
|
|
829
781
|
includePackage?: boolean;
|
|
@@ -908,7 +860,7 @@ declare function formatReturnType(sig?: SpecSignature): string;
|
|
|
908
860
|
* // 'class Logger extends EventEmitter'
|
|
909
861
|
* ```
|
|
910
862
|
*/
|
|
911
|
-
declare function buildSignatureString(exp:
|
|
863
|
+
declare function buildSignatureString(exp: SpecExport3, sigIndex?: number): string;
|
|
912
864
|
/**
|
|
913
865
|
* Resolve a type reference to its definition.
|
|
914
866
|
*
|
|
@@ -922,7 +874,7 @@ declare function buildSignatureString(exp: SpecExport4, sigIndex?: number): stri
|
|
|
922
874
|
* // { id: 'User', name: 'User', kind: 'interface', ... }
|
|
923
875
|
* ```
|
|
924
876
|
*/
|
|
925
|
-
declare function resolveTypeRef(ref: string, spec:
|
|
877
|
+
declare function resolveTypeRef(ref: string, spec: OpenPkg8): SpecType2 | undefined;
|
|
926
878
|
/**
|
|
927
879
|
* Check if a member is a method (has signatures).
|
|
928
880
|
*
|
|
@@ -1037,8 +989,8 @@ declare function formatConditionalType(condType: SpecConditionalType): string;
|
|
|
1037
989
|
* ```
|
|
1038
990
|
*/
|
|
1039
991
|
declare function formatMappedType(mappedType: SpecMappedType): string;
|
|
1040
|
-
import { OpenPkg as
|
|
1041
|
-
type Predicate = (exp:
|
|
992
|
+
import { OpenPkg as OpenPkg9, SpecExport as SpecExport4, SpecExportKind as SpecExportKind6 } from "@openpkg-ts/spec";
|
|
993
|
+
type Predicate = (exp: SpecExport4) => boolean;
|
|
1042
994
|
/**
|
|
1043
995
|
* Chainable query builder for filtering OpenPkg exports.
|
|
1044
996
|
* Filters are lazy - predicates only run on execution methods (find, first, count, etc).
|
|
@@ -1046,7 +998,7 @@ type Predicate = (exp: SpecExport5) => boolean;
|
|
|
1046
998
|
declare class QueryBuilder {
|
|
1047
999
|
private spec;
|
|
1048
1000
|
private predicates;
|
|
1049
|
-
constructor(spec:
|
|
1001
|
+
constructor(spec: OpenPkg9);
|
|
1050
1002
|
/**
|
|
1051
1003
|
* Filter by kind(s)
|
|
1052
1004
|
*/
|
|
@@ -1084,11 +1036,11 @@ declare class QueryBuilder {
|
|
|
1084
1036
|
/**
|
|
1085
1037
|
* Execute query and return matching exports
|
|
1086
1038
|
*/
|
|
1087
|
-
find():
|
|
1039
|
+
find(): SpecExport4[];
|
|
1088
1040
|
/**
|
|
1089
1041
|
* Execute query and return first match (or undefined)
|
|
1090
1042
|
*/
|
|
1091
|
-
first():
|
|
1043
|
+
first(): SpecExport4 | undefined;
|
|
1092
1044
|
/**
|
|
1093
1045
|
* Execute query and return count of matches
|
|
1094
1046
|
*/
|
|
@@ -1100,12 +1052,12 @@ declare class QueryBuilder {
|
|
|
1100
1052
|
/**
|
|
1101
1053
|
* Execute query and return a new filtered OpenPkg spec
|
|
1102
1054
|
*/
|
|
1103
|
-
toSpec():
|
|
1055
|
+
toSpec(): OpenPkg9;
|
|
1104
1056
|
}
|
|
1105
1057
|
/**
|
|
1106
1058
|
* Create a query builder for the given spec
|
|
1107
1059
|
*/
|
|
1108
|
-
declare function query(spec:
|
|
1060
|
+
declare function query(spec: OpenPkg9): QueryBuilder;
|
|
1109
1061
|
import { EntryPointDetectionMethod as EntryPointDetectionMethod2 } from "@openpkg-ts/spec";
|
|
1110
1062
|
type PackageRecord = {
|
|
1111
1063
|
name: string;
|
|
@@ -1149,10 +1101,6 @@ type ResolveEmpty = {
|
|
|
1149
1101
|
kind: "empty";
|
|
1150
1102
|
reason: string;
|
|
1151
1103
|
};
|
|
1152
|
-
type ResolveRemote = {
|
|
1153
|
-
kind: "remote";
|
|
1154
|
-
input: string;
|
|
1155
|
-
};
|
|
1156
1104
|
type ResolveExplicit = {
|
|
1157
1105
|
kind: "explicit";
|
|
1158
1106
|
entryFile: string;
|
|
@@ -1162,9 +1110,14 @@ type ResolveUnavailable = {
|
|
|
1162
1110
|
kind: "unavailable";
|
|
1163
1111
|
reason: string;
|
|
1164
1112
|
};
|
|
1165
|
-
type ResolveTargetResult = ResolveOk | ResolveAmbiguous | ResolveNeedsBuild | ResolveEmpty |
|
|
1113
|
+
type ResolveTargetResult = (ResolveOk | ResolveAmbiguous | ResolveNeedsBuild | ResolveEmpty | ResolveExplicit | ResolveUnavailable) & {
|
|
1114
|
+
/** Present when this resolution owns a temp clone. Call after extraction. */
|
|
1115
|
+
cleanup?: () => void;
|
|
1116
|
+
};
|
|
1166
1117
|
declare function isRemoteInput(input: string): boolean;
|
|
1167
1118
|
declare function isEntryFilePath(input: string): boolean;
|
|
1119
|
+
/** Absolute, explicit relative, slash-containing, or entry-file paths — not bare intent words. */
|
|
1120
|
+
declare function isPathLikeInput(input: string): boolean;
|
|
1168
1121
|
declare function parseGithubRepo(input: string): {
|
|
1169
1122
|
owner: string;
|
|
1170
1123
|
repo: string;
|
|
@@ -1177,7 +1130,7 @@ declare function pickEntry(pkgDir: string): {
|
|
|
1177
1130
|
entryPointSource: EntryPointDetectionMethod2;
|
|
1178
1131
|
} | null;
|
|
1179
1132
|
declare function resolveTarget(options?: ResolveTargetOptions): Promise<ResolveTargetResult>;
|
|
1180
|
-
import { OpenPkg as
|
|
1133
|
+
import { OpenPkg as OpenPkg10, SpecExportKind as SpecExportKind7 } from "@openpkg-ts/spec";
|
|
1181
1134
|
type FilterCriteria = {
|
|
1182
1135
|
/** Filter by kinds */
|
|
1183
1136
|
kinds?: SpecExportKind7[];
|
|
@@ -1202,7 +1155,7 @@ type FilterCriteria = {
|
|
|
1202
1155
|
};
|
|
1203
1156
|
type FilterResult = {
|
|
1204
1157
|
/** New spec with only matched exports (immutable) */
|
|
1205
|
-
spec:
|
|
1158
|
+
spec: OpenPkg10;
|
|
1206
1159
|
/** Number of exports that matched */
|
|
1207
1160
|
matched: number;
|
|
1208
1161
|
/** Total number of exports in original spec */
|
|
@@ -1218,8 +1171,8 @@ type FilterResult = {
|
|
|
1218
1171
|
* @param criteria - Filter criteria (empty criteria matches all)
|
|
1219
1172
|
* @returns FilterResult with new spec, matched count, total count
|
|
1220
1173
|
*/
|
|
1221
|
-
declare function filterSpec(spec:
|
|
1222
|
-
import { SpecExport as
|
|
1174
|
+
declare function filterSpec(spec: OpenPkg10, criteria: FilterCriteria): FilterResult;
|
|
1175
|
+
import { SpecExport as SpecExport5, SpecType as SpecType3 } from "@openpkg-ts/spec";
|
|
1223
1176
|
interface GetExportOptions {
|
|
1224
1177
|
/** Entry point file path */
|
|
1225
1178
|
entryFile: string;
|
|
@@ -1234,7 +1187,7 @@ interface GetExportOptions {
|
|
|
1234
1187
|
}
|
|
1235
1188
|
interface GetExportResult {
|
|
1236
1189
|
/** The spec, or null if not found */
|
|
1237
|
-
export:
|
|
1190
|
+
export: SpecExport5 | null;
|
|
1238
1191
|
/** Related types referenced by the */
|
|
1239
1192
|
types: SpecType3[];
|
|
1240
1193
|
/** Errors encountered */
|
|
@@ -1299,9 +1252,7 @@ interface SerializerContext {
|
|
|
1299
1252
|
program: ts.Program;
|
|
1300
1253
|
sourceFile: ts.SourceFile;
|
|
1301
1254
|
maxTypeDepth: number;
|
|
1302
|
-
maxExternalTypeDepth: number;
|
|
1303
1255
|
currentDepth: number;
|
|
1304
|
-
resolveExternalTypes: boolean;
|
|
1305
1256
|
typeRegistry: TypeRegistry;
|
|
1306
1257
|
exportedIds: Set<string>;
|
|
1307
1258
|
/** Stack-style recursion guard for buildSchemaInternal (add before recurse, delete after) */
|
|
@@ -1679,7 +1630,7 @@ declare class CacheManager<
|
|
|
1679
1630
|
* @param options.only - Glob patterns to include (e.g., ["get*", "create*"])
|
|
1680
1631
|
* @param options.ignore - Glob patterns to exclude (e.g., ["*Internal", "_*"])
|
|
1681
1632
|
* @param options.onProgress - Callback fired for each export: (current, total, name) => void
|
|
1682
|
-
* @param options.isDtsSource - Set true when extracting from .d.ts (
|
|
1633
|
+
* @param options.isDtsSource - Set true when extracting from .d.ts (declaration-only generation metadata)
|
|
1683
1634
|
* @param options.externals - Config for resolving re-exports from external packages
|
|
1684
1635
|
*
|
|
1685
1636
|
* @returns Promise resolving to extraction result
|
|
@@ -1775,7 +1726,7 @@ declare const arktypeAdapter: SchemaAdapter;
|
|
|
1775
1726
|
declare const typeboxAdapter: SchemaAdapter;
|
|
1776
1727
|
declare const valibotAdapter: SchemaAdapter;
|
|
1777
1728
|
declare const zodAdapter: SchemaAdapter;
|
|
1778
|
-
import { OpenPkg as
|
|
1729
|
+
import { OpenPkg as OpenPkg11, SpecExport as SpecExport8, SpecType as SpecType6 } from "@openpkg-ts/spec";
|
|
1779
1730
|
interface AsStandardSchemaOptions {
|
|
1780
1731
|
keepExtensions?: boolean;
|
|
1781
1732
|
}
|
|
@@ -1783,7 +1734,7 @@ interface AsStandardSchemaOptions {
|
|
|
1783
1734
|
* Wrap an export, type, or named subject as a StandardJSONSchemaV1 producer.
|
|
1784
1735
|
* A string subject is resolved against the spec (exports first, then types).
|
|
1785
1736
|
*/
|
|
1786
|
-
declare function asStandardSchema(subject:
|
|
1737
|
+
declare function asStandardSchema(subject: SpecExport8 | SpecType6 | string, spec: OpenPkg11, options?: AsStandardSchemaOptions): StandardJSONSchemaV1;
|
|
1787
1738
|
import { SpecSchema as SpecSchema2 } from "@openpkg-ts/spec";
|
|
1788
1739
|
/** Object-shaped SpecSchema (excludes the string shorthand) — spreadable. */
|
|
1789
1740
|
type BuiltinSchema = Extract<SpecSchema2, object>;
|
|
@@ -1793,8 +1744,8 @@ type BuiltinSchema = Extract<SpecSchema2, object>;
|
|
|
1793
1744
|
* in a spec's types[]) and by adapters mapping refs for external consumers.
|
|
1794
1745
|
*/
|
|
1795
1746
|
declare const BUILTIN_TYPE_SCHEMAS: Record<string, BuiltinSchema>;
|
|
1796
|
-
import { OpenPkg as
|
|
1797
|
-
import { SpecExport as
|
|
1747
|
+
import { OpenPkg as OpenPkg12, SpecExport as SpecExport10, SpecType as SpecType8 } from "@openpkg-ts/spec";
|
|
1748
|
+
import { SpecExport as SpecExport9, SpecMember as SpecMember3, SpecSchema as SpecSchema3, SpecType as SpecType7 } from "@openpkg-ts/spec";
|
|
1798
1749
|
/**
|
|
1799
1750
|
* Options for schema normalization
|
|
1800
1751
|
*/
|
|
@@ -1815,7 +1766,7 @@ type JSONSchema = Record<string, unknown>;
|
|
|
1815
1766
|
* @returns JSON Schema 2020-12 compatible schema
|
|
1816
1767
|
*/
|
|
1817
1768
|
declare function normalizeSchema(schema: SpecSchema3, options?: NormalizeOptions): JSONSchema;
|
|
1818
|
-
declare function normalizeExport(exp:
|
|
1769
|
+
declare function normalizeExport(exp: SpecExport9, options?: NormalizeOptions): SpecExport9;
|
|
1819
1770
|
/**
|
|
1820
1771
|
* Normalize a SpecType, normalizing its schema and nested schemas.
|
|
1821
1772
|
*
|
|
@@ -1862,13 +1813,13 @@ interface JsonSchemaDocument extends Record<string, unknown> {
|
|
|
1862
1813
|
* Root a JSON Schema document at a single or type, bundling only its
|
|
1863
1814
|
* transitively-referenced types into `$defs`.
|
|
1864
1815
|
*/
|
|
1865
|
-
declare function exportToJsonSchema(subject:
|
|
1816
|
+
declare function exportToJsonSchema(subject: SpecExport10 | SpecType8, spec: OpenPkg12, options?: Omit<ToJsonSchemaOptions, "root">): JsonSchemaDocument;
|
|
1866
1817
|
/**
|
|
1867
1818
|
* Lift a whole spec (or, with `root`, a single named export/type) into a
|
|
1868
1819
|
* standalone JSON Schema 2020-12 document.
|
|
1869
1820
|
*/
|
|
1870
|
-
declare function toJsonSchema(spec:
|
|
1871
|
-
import { OpenPkg as
|
|
1821
|
+
declare function toJsonSchema(spec: OpenPkg12, options?: ToJsonSchemaOptions): JsonSchemaDocument;
|
|
1822
|
+
import { OpenPkg as OpenPkg13, SpecSchema as SpecSchema4 } from "@openpkg-ts/spec";
|
|
1872
1823
|
/** Strip TypeScript-specific extension keywords from a schema tree (deep). */
|
|
1873
1824
|
declare function stripTsExtensions(schema: JSONSchema): JSONSchema;
|
|
1874
1825
|
interface BundleOptions {
|
|
@@ -1894,8 +1845,8 @@ interface BundleResult {
|
|
|
1894
1845
|
* `x-ts-type` marker (type parameters), or a `#/$defs/<key>` ref whose target
|
|
1895
1846
|
* is collected (transitively, cycle-safe) into `defs`.
|
|
1896
1847
|
*/
|
|
1897
|
-
declare function bundleRefs(root: SpecSchema4, spec:
|
|
1898
|
-
import { OpenPkg as
|
|
1848
|
+
declare function bundleRefs(root: SpecSchema4, spec: OpenPkg13, options?: BundleOptions): BundleResult;
|
|
1849
|
+
import { OpenPkg as OpenPkg14, SpecExport as SpecExport11 } from "@openpkg-ts/spec";
|
|
1899
1850
|
type ToolSchemaProvider = "openai-strict" | "anthropic";
|
|
1900
1851
|
interface ToToolSchemaOptions {
|
|
1901
1852
|
provider: ToolSchemaProvider;
|
|
@@ -1915,25 +1866,25 @@ interface ToolSchemaResult {
|
|
|
1915
1866
|
* Build an AI tool-use parameter schema for a function export.
|
|
1916
1867
|
* Throws for non-function exports (class/variable support is out of scope in v1).
|
|
1917
1868
|
*/
|
|
1918
|
-
declare function toToolSchema(exp:
|
|
1919
|
-
import { SpecExport as
|
|
1869
|
+
declare function toToolSchema(exp: SpecExport11, spec: OpenPkg14, options: ToToolSchemaOptions): ToolSchemaResult;
|
|
1870
|
+
import { SpecExport as SpecExport12 } from "@openpkg-ts/spec";
|
|
1920
1871
|
import ts9 from "typescript";
|
|
1921
|
-
declare function serializeClass(node: ts9.ClassDeclaration, ctx: SerializerContext):
|
|
1922
|
-
import { SpecExport as
|
|
1872
|
+
declare function serializeClass(node: ts9.ClassDeclaration, ctx: SerializerContext): SpecExport12 | null;
|
|
1873
|
+
import { SpecExport as SpecExport13 } from "@openpkg-ts/spec";
|
|
1923
1874
|
import ts10 from "typescript";
|
|
1924
|
-
declare function serializeEnum(node: ts10.EnumDeclaration, ctx: SerializerContext):
|
|
1925
|
-
import { SpecExport as
|
|
1875
|
+
declare function serializeEnum(node: ts10.EnumDeclaration, ctx: SerializerContext): SpecExport13 | null;
|
|
1876
|
+
import { SpecExport as SpecExport14 } from "@openpkg-ts/spec";
|
|
1926
1877
|
import ts11 from "typescript";
|
|
1927
|
-
declare function serializeFunctionExport(node: ts11.FunctionDeclaration | ts11.ArrowFunction | ts11.FunctionExpression, ctx: SerializerContext, nameOverride?: string):
|
|
1928
|
-
import { SpecExport as
|
|
1878
|
+
declare function serializeFunctionExport(node: ts11.FunctionDeclaration | ts11.ArrowFunction | ts11.FunctionExpression, ctx: SerializerContext, nameOverride?: string): SpecExport14 | null;
|
|
1879
|
+
import { SpecExport as SpecExport15 } from "@openpkg-ts/spec";
|
|
1929
1880
|
import ts12 from "typescript";
|
|
1930
|
-
declare function serializeInterface(node: ts12.InterfaceDeclaration, ctx: SerializerContext):
|
|
1931
|
-
import { SpecExport as
|
|
1881
|
+
declare function serializeInterface(node: ts12.InterfaceDeclaration, ctx: SerializerContext): SpecExport15 | null;
|
|
1882
|
+
import { SpecExport as SpecExport16 } from "@openpkg-ts/spec";
|
|
1932
1883
|
import ts13 from "typescript";
|
|
1933
|
-
declare function serializeTypeAlias(node: ts13.TypeAliasDeclaration, ctx: SerializerContext):
|
|
1934
|
-
import { SpecExport as
|
|
1884
|
+
declare function serializeTypeAlias(node: ts13.TypeAliasDeclaration, ctx: SerializerContext): SpecExport16 | null;
|
|
1885
|
+
import { SpecExport as SpecExport17 } from "@openpkg-ts/spec";
|
|
1935
1886
|
import ts14 from "typescript";
|
|
1936
|
-
declare function serializeVariable(node: ts14.VariableDeclaration, statement: ts14.VariableStatement, ctx: SerializerContext):
|
|
1887
|
+
declare function serializeVariable(node: ts14.VariableDeclaration, statement: ts14.VariableStatement, ctx: SerializerContext): SpecExport17 | null;
|
|
1937
1888
|
import { SpecSignatureParameter } from "@openpkg-ts/spec";
|
|
1938
1889
|
import ts15 from "typescript";
|
|
1939
1890
|
declare function extractParameters(signature: ts15.Signature, ctx: SerializerContext): SpecSignatureParameter[];
|
|
@@ -2079,4 +2030,4 @@ declare function findDiscriminatorProperty(unionTypes: ts16.Type[], checker: ts1
|
|
|
2079
2030
|
import ts17 from "typescript";
|
|
2080
2031
|
declare function isExported(node: ts17.Node): boolean;
|
|
2081
2032
|
declare function getNodeName(node: ts17.Node): string | undefined;
|
|
2082
|
-
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, isMethod, isExported, isEntryFilePath, isBuiltinSymbol, isBuiltinGeneric, isAnonymous,
|
|
2033
|
+
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, ResolveUnavailable, 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, JEV_MODEL, JEV_CONFIDENCE, HTMLOptions, GroupBy, GetExportResult, GetExportOptions, GenericNav, FumadocsMetaItem, FumadocsMeta, FormatSchemaOptions, ForgottenExport, FilterResult, FilterCriteria, ExtractionWarningCode, ExtractionWarning, ExtractStandardSchemasOptions, ExtractResult, ExtractOptions, ExtractFromProjectOptions, ExternalsConfig, ExportVerification, ExportTracker, ExportMarkdownOptions, ExportItem, EvaluateResult, EvaluateRequest, EvaluateFn, DocusaurusSidebarItem, DocusaurusSidebar, DocsInstance, Diagnostic, CloneFn, CategorizedBreaking, CacheManagerOptions, CacheManager, CONFIG_FILENAME, BundleResult, BundleOptions, BuiltinSchema, BreakingSeverity, BUILTIN_TYPE_SCHEMAS, AsStandardSchemaOptions, AlgoliaRecord, ARRAY_PROTOTYPE_METHODS };
|