@dtsx/dtsx 0.0.0-stage → 0.11.38
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/LICENSE.md +21 -0
- package/README.md +442 -2
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +12 -0
- package/dist/chunk-082w7zvy.js +4 -0
- package/dist/chunk-0k0fhq13.js +19 -0
- package/dist/chunk-0rmbc5zp.js +3 -0
- package/dist/chunk-0yg5mcrf.js +3 -0
- package/dist/chunk-0zfzhn19.js +31 -0
- package/dist/chunk-189nn4fc.js +3 -0
- package/dist/chunk-1j6092xz.js +7 -0
- package/dist/chunk-1qtghb2x.js +3 -0
- package/dist/chunk-2436cnmb.js +3 -0
- package/dist/chunk-2qd3axyx.js +5 -0
- package/dist/chunk-32qexm3w.js +3 -0
- package/dist/chunk-3fbt79hx.js +3 -0
- package/dist/chunk-3t57mzvf.js +3 -0
- package/dist/chunk-42j9cfte.js +3 -0
- package/dist/chunk-4fygcxtb.js +4 -0
- package/dist/chunk-50h54rax.js +177 -0
- package/dist/chunk-5hyv43ps.js +12 -0
- package/dist/chunk-6yvk3q1e.js +3 -0
- package/dist/chunk-73dzve1s.js +3 -0
- package/dist/chunk-7tremqhs.js +14 -0
- package/dist/chunk-83qnrx0m.js +7 -0
- package/dist/chunk-88gwzbew.js +4 -0
- package/dist/chunk-8d3sdkv4.js +24 -0
- package/dist/chunk-8tzd98q8.js +22 -0
- package/dist/chunk-96atbsd3.js +3 -0
- package/dist/chunk-9gts9ymh.js +3 -0
- package/dist/chunk-9menejdz.js +3 -0
- package/dist/chunk-a7nvyxpg.js +6 -0
- package/dist/chunk-ag1b6d30.js +3 -0
- package/dist/chunk-asws39qs.js +31 -0
- package/dist/chunk-bnry23ve.js +4 -0
- package/dist/chunk-bxc2herz.js +9 -0
- package/dist/chunk-cpmqa8kd.js +4 -0
- package/dist/chunk-cv29b4zb.js +7 -0
- package/dist/chunk-cyr45de1.js +8 -0
- package/dist/chunk-d0bazr3p.js +3 -0
- package/dist/chunk-danfamyx.js +3 -0
- package/dist/chunk-davy89dj.js +8 -0
- package/dist/chunk-e29rp5xj.js +7 -0
- package/dist/chunk-eba562w8.js +9 -0
- package/dist/chunk-ebjafajx.js +62 -0
- package/dist/chunk-ft2zk7jx.js +3 -0
- package/dist/chunk-g2120ysy.js +3 -0
- package/dist/chunk-ghfd34r7.js +3 -0
- package/dist/chunk-gspsxc9d.js +34 -0
- package/dist/chunk-h3n6256r.js +3 -0
- package/dist/chunk-hnqm1zb3.js +5 -0
- package/dist/chunk-htgy94y3.js +2 -0
- package/dist/chunk-hv8bx8xx.js +102 -0
- package/dist/chunk-hzn9kmq7.js +3 -0
- package/dist/chunk-ja7bp731.js +3 -0
- package/dist/chunk-jcckwgb9.js +3 -0
- package/dist/chunk-kfk554fj.js +3 -0
- package/dist/chunk-kkshxyex.js +18 -0
- package/dist/chunk-kpbz61yy.js +4 -0
- package/dist/chunk-mkakbjvs.js +3 -0
- package/dist/chunk-mwyjxjqa.js +3 -0
- package/dist/chunk-p023fhce.js +8 -0
- package/dist/chunk-p9vfxn8g.js +3 -0
- package/dist/chunk-pga5m4wm.js +3 -0
- package/dist/chunk-pjqzkgzk.js +6 -0
- package/dist/chunk-qzjzw9p2.js +3 -0
- package/dist/chunk-rbx6q1r0.js +18 -0
- package/dist/chunk-rkstz4w1.js +6 -0
- package/dist/chunk-rz060wxt.js +6 -0
- package/dist/chunk-sd8bywh9.js +21 -0
- package/dist/chunk-sv8h007a.js +3 -0
- package/dist/chunk-t4va49p3.js +10 -0
- package/dist/chunk-tka2m4af.js +7 -0
- package/dist/chunk-v6fwy63g.js +3 -0
- package/dist/chunk-v93389xm.js +3 -0
- package/dist/chunk-vf3ybe5r.js +3 -0
- package/dist/chunk-vkahj2ab.js +10 -0
- package/dist/chunk-wnqg6hem.js +27 -0
- package/dist/chunk-xa6rsd4b.js +29 -0
- package/dist/chunk-xfjfhe9d.js +3 -0
- package/dist/chunk-xwpn40p0.js +6 -0
- package/dist/chunk-y1g6v96c.js +10 -0
- package/dist/chunk-y5k0szq6.js +3 -0
- package/dist/chunk-yay68832.js +3 -0
- package/dist/chunk-yrv6z221.js +3 -0
- package/dist/chunk-yx1jy7fx.js +37 -0
- package/dist/chunk-zgcdx773.js +4 -0
- package/dist/chunk-zk3w5sqv.js +4 -0
- package/dist/chunk-zq93f8ca.js +5 -0
- package/dist/src/augmentation-graph.d.ts +11 -0
- package/dist/src/augmentation-graph.js +2 -0
- package/dist/src/binding-patterns.d.ts +18 -0
- package/dist/src/binding-patterns.js +2 -0
- package/dist/src/branded-types.d.ts +159 -0
- package/dist/src/branded-types.js +2 -0
- package/dist/src/bundle-linker.d.ts +38 -0
- package/dist/src/bundle-linker.js +2 -0
- package/dist/src/bundler.d.ts +55 -0
- package/dist/src/bundler.js +2 -0
- package/dist/src/cache.d.ts +53 -0
- package/dist/src/cache.js +2 -0
- package/dist/src/call-signatures.d.ts +1 -0
- package/dist/src/call-signatures.js +2 -0
- package/dist/src/checker.d.ts +107 -0
- package/dist/src/circular.d.ts +82 -0
- package/dist/src/circular.js +2 -0
- package/dist/src/compat.d.ts +114 -0
- package/dist/src/compat.js +2 -0
- package/dist/src/computed-keys.d.ts +12 -0
- package/dist/src/computed-keys.js +2 -0
- package/dist/src/concurrency.d.ts +4 -0
- package/dist/src/concurrency.js +2 -0
- package/dist/src/config.d.ts +35 -0
- package/dist/src/config.js +2 -0
- package/dist/src/dangling-refs.d.ts +11 -0
- package/dist/src/dangling-refs.js +2 -0
- package/dist/src/declaration-project.d.ts +33 -0
- package/dist/src/declaration-project.js +2 -0
- package/dist/src/declaration-publication.d.ts +15 -0
- package/dist/src/declaration-publication.js +2 -0
- package/dist/src/declaration-references.d.ts +19 -0
- package/dist/src/declaration-references.js +2 -0
- package/dist/src/diff.d.ts +82 -0
- package/dist/src/diff.js +2 -0
- package/dist/src/docs.d.ts +97 -0
- package/dist/src/docs.js +2 -0
- package/dist/src/enum-declarations.d.ts +6 -0
- package/dist/src/enum-declarations.js +2 -0
- package/dist/src/errors.d.ts +113 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/extractor/directives.d.ts +5 -0
- package/dist/src/extractor/directives.js +2 -0
- package/dist/src/extractor/extract.d.ts +10 -0
- package/dist/src/extractor/extract.js +2 -0
- package/dist/src/extractor/hash.d.ts +1 -0
- package/dist/src/extractor/hash.js +2 -0
- package/dist/src/extractor/scanner.d.ts +32 -0
- package/dist/src/extractor/scanner.js +2 -0
- package/dist/src/extractor.d.ts +5 -0
- package/dist/src/extractor.js +2 -0
- package/dist/src/formats.d.ts +50 -0
- package/dist/src/formats.js +2 -0
- package/dist/src/formatter.d.ts +61 -0
- package/dist/src/formatter.js +2 -0
- package/dist/src/function-properties.d.ts +3 -0
- package/dist/src/function-properties.js +2 -0
- package/dist/src/generator.d.ts +18 -0
- package/dist/src/generator.js +2 -0
- package/dist/src/global-types.d.ts +17 -0
- package/dist/src/global-types.js +2 -0
- package/dist/src/import-sorter.d.ts +99 -0
- package/dist/src/import-sorter.js +2 -0
- package/dist/src/incremental.d.ts +103 -0
- package/dist/src/incremental.js +2 -0
- package/dist/src/index.d.ts +62 -0
- package/dist/src/index.js +2 -0
- package/dist/src/inferred-imports.d.ts +4 -0
- package/dist/src/inferred-imports.js +2 -0
- package/dist/src/json-config.d.ts +2 -0
- package/dist/src/json-config.js +2 -0
- package/dist/src/lexical.d.ts +6 -0
- package/dist/src/lexical.js +2 -0
- package/dist/src/logger.d.ts +57 -0
- package/dist/src/logger.js +2 -0
- package/dist/src/lsp.d.ts +333 -0
- package/dist/src/lsp.js +2 -0
- package/dist/src/memory.d.ts +127 -0
- package/dist/src/memory.js +2 -0
- package/dist/src/merger.d.ts +38 -0
- package/dist/src/merger.js +2 -0
- package/dist/src/module-graph.d.ts +70 -0
- package/dist/src/module-graph.js +2 -0
- package/dist/src/module-references.d.ts +30 -0
- package/dist/src/module-references.js +2 -0
- package/dist/src/native-checker.d.ts +55 -0
- package/dist/src/native-checker.js +2 -0
- package/dist/src/native-engine.d.ts +16 -0
- package/dist/src/native-engine.js +2 -0
- package/dist/src/native-extractor.d.ts +9 -0
- package/dist/src/native-extractor.js +2 -0
- package/dist/src/native-generation.d.ts +20 -0
- package/dist/src/native-generation.js +2 -0
- package/dist/src/native-project.d.ts +35 -0
- package/dist/src/native-project.js +2 -0
- package/dist/src/optimizer.d.ts +56 -0
- package/dist/src/optimizer.js +2 -0
- package/dist/src/output-normalizer.d.ts +123 -0
- package/dist/src/output-normalizer.js +2 -0
- package/dist/src/parallel-processor.d.ts +63 -0
- package/dist/src/parallel-processor.js +2 -0
- package/dist/src/parameters.d.ts +5 -0
- package/dist/src/parameters.js +2 -0
- package/dist/src/parser.d.ts +68 -0
- package/dist/src/parser.js +2 -0
- package/dist/src/plugins/bun.d.ts +58 -0
- package/dist/src/plugins/bun.js +2 -0
- package/dist/src/plugins/esbuild.d.ts +63 -0
- package/dist/src/plugins/esbuild.js +2 -0
- package/dist/src/plugins/index.d.ts +16 -0
- package/dist/src/plugins/index.js +2 -0
- package/dist/src/plugins/tsdown.d.ts +30 -0
- package/dist/src/plugins/tsdown.js +2 -0
- package/dist/src/plugins/tsup.d.ts +53 -0
- package/dist/src/plugins/tsup.js +2 -0
- package/dist/src/plugins/vite.d.ts +49 -0
- package/dist/src/plugins/vite.js +2 -0
- package/dist/src/plugins/webpack.d.ts +69 -0
- package/dist/src/plugins/webpack.js +2 -0
- package/dist/src/plugins.d.ts +88 -0
- package/dist/src/plugins.js +2 -0
- package/dist/src/process-source.d.ts +28 -0
- package/dist/src/process-source.js +2 -0
- package/dist/src/processor/cache.d.ts +18 -0
- package/dist/src/processor/cache.js +2 -0
- package/dist/src/processor/comments.d.ts +9 -0
- package/dist/src/processor/comments.js +2 -0
- package/dist/src/processor/declarations.d.ts +37 -0
- package/dist/src/processor/declarations.js +2 -0
- package/dist/src/processor/import-usage.d.ts +6 -0
- package/dist/src/processor/import-usage.js +2 -0
- package/dist/src/processor/imports.d.ts +68 -0
- package/dist/src/processor/imports.js +2 -0
- package/dist/src/processor/index.d.ts +33 -0
- package/dist/src/processor/index.js +2 -0
- package/dist/src/processor/type-inference.d.ts +116 -0
- package/dist/src/processor/type-inference.js +2 -0
- package/dist/src/processor.d.ts +5 -0
- package/dist/src/processor.js +2 -0
- package/dist/src/profiling.d.ts +114 -0
- package/dist/src/profiling.js +2 -0
- package/dist/src/return-type-scope.d.ts +3 -0
- package/dist/src/return-type-scope.js +2 -0
- package/dist/src/security.d.ts +100 -0
- package/dist/src/security.js +2 -0
- package/dist/src/source-cache.d.ts +16 -0
- package/dist/src/source-cache.js +2 -0
- package/dist/src/sourcemap.d.ts +137 -0
- package/dist/src/sourcemap.js +2 -0
- package/dist/src/stx.d.ts +20 -0
- package/dist/src/stx.js +2 -0
- package/dist/src/syntax-validator.d.ts +7 -0
- package/dist/src/syntax-validator.js +2 -0
- package/dist/src/tracking.d.ts +95 -0
- package/dist/src/tracking.js +2 -0
- package/dist/src/transformers.d.ts +188 -0
- package/dist/src/transformers.js +2 -0
- package/dist/src/tree-shaker.d.ts +69 -0
- package/dist/src/tree-shaker.js +2 -0
- package/dist/src/tsconfig.d.ts +8 -0
- package/dist/src/tsconfig.js +2 -0
- package/dist/src/type-mappings.d.ts +145 -0
- package/dist/src/type-mappings.js +2 -0
- package/dist/src/types.d.ts +230 -0
- package/dist/src/types.js +1 -0
- package/dist/src/utils.d.ts +63 -0
- package/dist/src/utils.js +2 -0
- package/dist/src/value-inference.d.ts +6 -0
- package/dist/src/value-inference.js +2 -0
- package/dist/src/vue.d.ts +108 -0
- package/dist/src/vue.js +2 -0
- package/dist/src/watcher.d.ts +64 -0
- package/dist/src/watcher.js +2 -0
- package/dist/src/worker-thread.d.ts +1 -0
- package/dist/src/worker-thread.js +2 -0
- package/dist/src/worker.d.ts +98 -0
- package/dist/src/worker.js +2 -0
- package/dist/src/workspace.d.ts +62 -0
- package/dist/src/workspace.js +2 -0
- package/native/README.md +6 -0
- package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
- package/native/darwin-x64/libzig-dtsx.dylib +0 -0
- package/native/freebsd-x64/libzig-dtsx.so +0 -0
- package/native/linux-arm64/libzig-dtsx.so +0 -0
- package/native/linux-x64/libzig-dtsx.so +0 -0
- package/native/windows-x64/zig-dtsx.dll +0 -0
- package/package.json +120 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split generated declaration text into top-level statements, each with the
|
|
3
|
+
* comments that lead it. dtsx writes one top-level statement per line start;
|
|
4
|
+
* nested lines are indented, and a continuation at column 0 starts with a
|
|
5
|
+
* bracket or an operator, never an identifier.
|
|
6
|
+
*/
|
|
7
|
+
export declare function splitTopLevelStatements(text: string): DeclarationStatement[];
|
|
8
|
+
/**
|
|
9
|
+
* Rename identifier references in declaration text. Strings, comments,
|
|
10
|
+
* qualified-name members (`a.b`) and property or parameter names (`{ b: T }`,
|
|
11
|
+
* `(b: T)`) are left alone.
|
|
12
|
+
*/
|
|
13
|
+
export declare function renameIdentifiers(text: string, renames: Map<string, string>): string;
|
|
14
|
+
/**
|
|
15
|
+
* Link one entrypoint's reachable declarations into a single declaration
|
|
16
|
+
* file. `dtsContents` maps each source file to the declaration text dtsx
|
|
17
|
+
* generated for it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function linkBundle(entry: string, files: string[], dtsContents: Map<string, string>, options: LinkBundleOptions): LinkBundleResult;
|
|
20
|
+
export declare interface LinkBundleOptions {
|
|
21
|
+
cwd: string
|
|
22
|
+
keepComments?: boolean
|
|
23
|
+
}
|
|
24
|
+
export declare interface LinkBundleResult {
|
|
25
|
+
content: string
|
|
26
|
+
files: string[]
|
|
27
|
+
exportCount: number
|
|
28
|
+
warnings: string[]
|
|
29
|
+
}
|
|
30
|
+
export declare interface DeclarationStatement {
|
|
31
|
+
text: string
|
|
32
|
+
comments: string[]
|
|
33
|
+
}
|
|
34
|
+
declare type Binding = | { kind: 'local', name: string }
|
|
35
|
+
| { kind: 'namespace', file: string }
|
|
36
|
+
| { kind: 'external', source: string, imported: string }
|
|
37
|
+
| { kind: 'external-namespace', source: string }
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{bo,Ue,hn}from"../chunk-wnqg6hem.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{hn as linkBundle,Ue as renameIdentifiers,bo as splitTopLevelStatements};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bundle multiple TypeScript files into a single .d.ts file
|
|
4
|
+
*/
|
|
5
|
+
export declare function bundleDeclarations(files: string[], sourceContents: Map<string, string>, config: DtsGenerationConfig): Promise<BundleResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Bundle multiple .d.ts files into a single file
|
|
8
|
+
*/
|
|
9
|
+
export declare function bundleDtsFiles(files: string[], config?: Partial<BundleConfig>): Promise<BundleResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Bundle and write to file
|
|
12
|
+
*/
|
|
13
|
+
export declare function bundleAndWrite(files: string[], outputPath: string, config?: Partial<BundleConfig>): Promise<BundleResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a bundler with preset configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare function createBundler(config?: Partial<BundleConfig>): {
|
|
18
|
+
bundle: (files: string[]) => Promise<BundleResult>
|
|
19
|
+
bundleAndWrite: (files: string[], output: string) => Promise<BundleResult>
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Resolve entry files from glob patterns
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveEntryFiles(patterns: string | string[], cwd?: string): Promise<string[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Bundle configuration options
|
|
27
|
+
*/
|
|
28
|
+
export declare interface BundleConfig {
|
|
29
|
+
entry: string | string[]
|
|
30
|
+
output: string
|
|
31
|
+
name?: string
|
|
32
|
+
includeSourceComments?: boolean
|
|
33
|
+
preserveFileSections?: boolean
|
|
34
|
+
externals?: string[]
|
|
35
|
+
banner?: string
|
|
36
|
+
footer?: string
|
|
37
|
+
sortDeclarations?: boolean
|
|
38
|
+
mergeDuplicates?: boolean
|
|
39
|
+
ambient?: boolean
|
|
40
|
+
moduleName?: string
|
|
41
|
+
includeReferences?: boolean
|
|
42
|
+
references?: string[]
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Bundle result containing the combined declarations
|
|
46
|
+
*/
|
|
47
|
+
export declare interface BundleResult {
|
|
48
|
+
content: string
|
|
49
|
+
files: string[]
|
|
50
|
+
declarationCount: number
|
|
51
|
+
importCount: number
|
|
52
|
+
exportCount: number
|
|
53
|
+
size: number
|
|
54
|
+
warnings: string[]
|
|
55
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ns,_t,pr,rs,is}from"../chunk-t4va49p3.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{pr as bundleAndWrite,ns as bundleDeclarations,_t as bundleDtsFiles,rs as createBundler,is as resolveEntryFiles};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/** Clear only the cache manifest, preserving other tools' files in the directory. */
|
|
3
|
+
export declare function clearBuildCache(cacheDir: string): void;
|
|
4
|
+
/**
|
|
5
|
+
* Add .dtsx-cache to .gitignore if not already present
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureGitignore(cwd: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Cache entry for a single file
|
|
10
|
+
*/
|
|
11
|
+
export declare interface CacheEntry {
|
|
12
|
+
sourcePath: string
|
|
13
|
+
sourceHash: string
|
|
14
|
+
sourceMtime: number
|
|
15
|
+
sourceCtime: number
|
|
16
|
+
sourceSize: number
|
|
17
|
+
dtsContent: string
|
|
18
|
+
dtsHash: string
|
|
19
|
+
generatedAt: number
|
|
20
|
+
configHash: string
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Cache manifest containing all cached entries
|
|
24
|
+
*/
|
|
25
|
+
export declare interface CacheManifest {
|
|
26
|
+
version: number
|
|
27
|
+
configHash: string
|
|
28
|
+
entries: Record<string, CacheEntry>
|
|
29
|
+
createdAt: number
|
|
30
|
+
updatedAt: number
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Incremental build cache manager
|
|
34
|
+
*/
|
|
35
|
+
export declare class BuildCache {
|
|
36
|
+
private cacheDir;
|
|
37
|
+
private manifestPath;
|
|
38
|
+
private manifest;
|
|
39
|
+
private configHash;
|
|
40
|
+
constructor(config: DtsGenerationConfig, resolutionContext?: string);
|
|
41
|
+
private hashConfig;
|
|
42
|
+
private hashString;
|
|
43
|
+
load(): boolean;
|
|
44
|
+
save(): void;
|
|
45
|
+
needsRegeneration(filePath: string, cwd: string): boolean;
|
|
46
|
+
getCached(filePath: string, cwd: string): string | null;
|
|
47
|
+
getCachedIfValid(filePath: string, cwd: string): string | null;
|
|
48
|
+
update(filePath: string, sourceContent: string, dtsContent: string, cwd: string): void;
|
|
49
|
+
remove(filePath: string, cwd: string): void;
|
|
50
|
+
clear(): void;
|
|
51
|
+
getStats(): { entries: number, size: number };
|
|
52
|
+
prune(existingFiles: Set<string>, cwd: string): number;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function functionCount(source: string, name: string): number;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Load TypeScript compiler options from tsconfig.json
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadCompilerOptions(tsconfigPath: string, overrides?: Partial<ts.CompilerOptions>): ts.CompilerOptions;
|
|
7
|
+
/**
|
|
8
|
+
* Type check TypeScript/declaration files
|
|
9
|
+
*/
|
|
10
|
+
export declare function typeCheck(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Validate that generated .d.ts files are valid TypeScript
|
|
13
|
+
*/
|
|
14
|
+
export declare function validateDeclarations(dtsFiles: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if source files are compatible with TypeScript's isolatedDeclarations mode
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkIsolatedDeclarations(files: string[], tsconfigPath?: string): Promise<Map<string, IsolatedDeclarationsResult>>;
|
|
19
|
+
/**
|
|
20
|
+
* Get type information for a specific position in a file
|
|
21
|
+
*/
|
|
22
|
+
export declare function getTypeAtPosition(filePath: string, line: number, column: number, tsconfigPath?: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Get quick info (hover information) for a position
|
|
25
|
+
*/
|
|
26
|
+
export declare function getQuickInfo(filePath: string, line: number, column: number, tsconfigPath?: string): { type: string, documentation?: string } | null;
|
|
27
|
+
/**
|
|
28
|
+
* Format type check results as a human-readable string
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatTypeCheckResults(result: TypeCheckResult): string;
|
|
31
|
+
/**
|
|
32
|
+
* Integrate type checking into DTS generation config
|
|
33
|
+
*/
|
|
34
|
+
export declare function typeCheckWithConfig(config: DtsGenerationConfig): Promise<TypeCheckResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Validate generated declarations match the source types
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateGeneratedDeclarations(_sourceFiles: string[], _dtsFiles: string[], _tsconfigPath?: string): Promise<{
|
|
39
|
+
valid: boolean
|
|
40
|
+
mismatches: Array<{
|
|
41
|
+
sourceName: string
|
|
42
|
+
sourceType: string
|
|
43
|
+
dtsType: string
|
|
44
|
+
}>
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* A diagnostic message from type checking
|
|
48
|
+
*/
|
|
49
|
+
export declare interface TypeDiagnostic {
|
|
50
|
+
file: string
|
|
51
|
+
line: number
|
|
52
|
+
column: number
|
|
53
|
+
message: string
|
|
54
|
+
code: number
|
|
55
|
+
severity: DiagnosticSeverity
|
|
56
|
+
source?: string
|
|
57
|
+
suggestion?: string
|
|
58
|
+
category: string
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Result of type checking
|
|
62
|
+
*/
|
|
63
|
+
export declare interface TypeCheckResult {
|
|
64
|
+
success: boolean
|
|
65
|
+
diagnostics: TypeDiagnostic[]
|
|
66
|
+
errorCount: number
|
|
67
|
+
warningCount: number
|
|
68
|
+
infoCount: number
|
|
69
|
+
filesChecked: string[]
|
|
70
|
+
durationMs: number
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Type checking configuration
|
|
74
|
+
*/
|
|
75
|
+
export declare interface TypeCheckConfig {
|
|
76
|
+
tsconfigPath?: string
|
|
77
|
+
rootDir?: string
|
|
78
|
+
strict?: boolean
|
|
79
|
+
declarationsOnly?: boolean
|
|
80
|
+
skipLibCheck?: boolean
|
|
81
|
+
include?: string[]
|
|
82
|
+
exclude?: string[]
|
|
83
|
+
warningsAsErrors?: boolean
|
|
84
|
+
maxErrors?: number
|
|
85
|
+
compilerOptions?: Partial<ts.CompilerOptions>
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Isolated declarations checking result
|
|
89
|
+
*/
|
|
90
|
+
export declare interface IsolatedDeclarationsResult {
|
|
91
|
+
compatible: boolean
|
|
92
|
+
issues: IsolatedDeclarationsIssue[]
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* An issue found during isolated declarations checking
|
|
96
|
+
*/
|
|
97
|
+
export declare interface IsolatedDeclarationsIssue {
|
|
98
|
+
line: number
|
|
99
|
+
column: number
|
|
100
|
+
message: string
|
|
101
|
+
declarationName?: string
|
|
102
|
+
missingAnnotation?: 'return' | 'parameter' | 'variable' | 'property'
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Diagnostic severity levels
|
|
106
|
+
*/
|
|
107
|
+
export type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a dependency graph from TypeScript source files
|
|
3
|
+
*/
|
|
4
|
+
export declare function buildDependencyGraph(files: string[], options?: CircularDetectionOptions): Promise<Map<string, DependencyNode>>;
|
|
5
|
+
/**
|
|
6
|
+
* Detect circular dependencies in a dependency graph
|
|
7
|
+
*/
|
|
8
|
+
export declare function detectCircularDependencies(graph: Map<string, DependencyNode>, options?: CircularDetectionOptions): CircularDependency[];
|
|
9
|
+
/**
|
|
10
|
+
* Analyze files for circular dependencies
|
|
11
|
+
*/
|
|
12
|
+
export declare function analyzeCircularDependencies(files: string[], options?: CircularDetectionOptions): Promise<CircularAnalysisResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Format circular dependency analysis as a string
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatCircularAnalysis(result: CircularAnalysisResult, rootDir?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get a summary of the dependency graph
|
|
19
|
+
*/
|
|
20
|
+
export declare function getGraphSummary(graph: Map<string, DependencyNode>): {
|
|
21
|
+
totalFiles: number
|
|
22
|
+
totalDependencies: number
|
|
23
|
+
avgDependencies: number
|
|
24
|
+
maxDependencies: { file: string, count: number }
|
|
25
|
+
isolatedFiles: string[]
|
|
26
|
+
mostDepended: { file: string, count: number }
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Find all files that depend on a given file (transitive)
|
|
30
|
+
*/
|
|
31
|
+
export declare function findAllDependents(filePath: string, graph: Map<string, DependencyNode>): Set<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Find all dependencies of a given file (transitive)
|
|
34
|
+
*/
|
|
35
|
+
export declare function findAllDependencies(filePath: string, graph: Map<string, DependencyNode>): Set<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Export dependency graph as DOT format (for visualization with Graphviz)
|
|
38
|
+
*/
|
|
39
|
+
export declare function exportGraphAsDot(graph: Map<string, DependencyNode>, rootDir?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Export dependency graph as JSON
|
|
42
|
+
*/
|
|
43
|
+
export declare function exportGraphAsJson(graph: Map<string, DependencyNode>, rootDir?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* A node in the dependency graph
|
|
46
|
+
*/
|
|
47
|
+
export declare interface DependencyNode {
|
|
48
|
+
path: string
|
|
49
|
+
exports: Set<string>
|
|
50
|
+
imports: Map<string, string>
|
|
51
|
+
dependencies: Set<string>
|
|
52
|
+
dependents: Set<string>
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A circular dependency chain
|
|
56
|
+
*/
|
|
57
|
+
export declare interface CircularDependency {
|
|
58
|
+
chain: string[]
|
|
59
|
+
symbols: string[]
|
|
60
|
+
severity: 'error' | 'warning'
|
|
61
|
+
reason: string
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Result of circular dependency analysis
|
|
65
|
+
*/
|
|
66
|
+
export declare interface CircularAnalysisResult {
|
|
67
|
+
hasCircular: boolean
|
|
68
|
+
cycles: CircularDependency[]
|
|
69
|
+
graph: Map<string, DependencyNode>
|
|
70
|
+
filesAnalyzed: string[]
|
|
71
|
+
durationMs: number
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Options for circular dependency detection
|
|
75
|
+
*/
|
|
76
|
+
export declare interface CircularDetectionOptions {
|
|
77
|
+
rootDir?: string
|
|
78
|
+
ignore?: string[]
|
|
79
|
+
typesOnly?: boolean
|
|
80
|
+
maxDepth?: number
|
|
81
|
+
includeNodeModules?: boolean
|
|
82
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{mr,gr,ss,os,as,cs,ls,us,fs}from"../chunk-rkstz4w1.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{ss as analyzeCircularDependencies,mr as buildDependencyGraph,gr as detectCircularDependencies,us as exportGraphAsDot,fs as exportGraphAsJson,ls as findAllDependencies,cs as findAllDependents,os as formatCircularAnalysis,as as getGraphSummary};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Cross-runtime file handle creator
|
|
4
|
+
* Compatible with Bun.file() API
|
|
5
|
+
*/
|
|
6
|
+
export declare function file(path: string): FileHandle;
|
|
7
|
+
/**
|
|
8
|
+
* Cross-runtime file writer
|
|
9
|
+
* Compatible with Bun.write() API
|
|
10
|
+
*/
|
|
11
|
+
export declare function write(path: string, content: string | Uint8Array | ArrayBuffer): Promise<number>;
|
|
12
|
+
/**
|
|
13
|
+
* Cross-runtime process spawner
|
|
14
|
+
* Compatible with Bun.spawn() API
|
|
15
|
+
*/
|
|
16
|
+
export declare function spawnProcess(command: string | string[], options?: CompatSpawnOptions): SpawnResult;
|
|
17
|
+
/**
|
|
18
|
+
* Read a file as text with cross-runtime compatibility.
|
|
19
|
+
* On Node.js we skip the FileHandle wrapper allocation and call readFile directly.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readTextFile(path: string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a file exists with cross-runtime compatibility.
|
|
24
|
+
* On Node.js we go straight to stat() — the FileHandle indirection only
|
|
25
|
+
* mattered for Bun's optimized exists() check.
|
|
26
|
+
*/
|
|
27
|
+
export declare function fileExists(path: string): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Write text to a file with cross-runtime compatibility
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeTextFile(path: string, content: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Get runtime information
|
|
34
|
+
*/
|
|
35
|
+
export declare function getRuntimeInfo(): RuntimeInfo;
|
|
36
|
+
/**
|
|
37
|
+
* Runtime detection
|
|
38
|
+
*/
|
|
39
|
+
export declare const isBun: boolean;
|
|
40
|
+
export declare const isNode: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Current runtime name
|
|
43
|
+
*/
|
|
44
|
+
export declare const runtime: 'bun' | 'node';
|
|
45
|
+
/**
|
|
46
|
+
* File handle interface compatible with Bun.file()
|
|
47
|
+
*/
|
|
48
|
+
export declare interface FileHandle {
|
|
49
|
+
exists: () => Promise<boolean>
|
|
50
|
+
text: () => Promise<string>
|
|
51
|
+
arrayBuffer: () => Promise<ArrayBuffer>
|
|
52
|
+
size: number
|
|
53
|
+
name: string
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Spawn result interface compatible with Bun.spawn()
|
|
57
|
+
*/
|
|
58
|
+
export declare interface SpawnResult {
|
|
59
|
+
pid: number
|
|
60
|
+
stdout: ReadableStream<Uint8Array> | NodeJS.ReadableStream
|
|
61
|
+
stderr: ReadableStream<Uint8Array> | NodeJS.ReadableStream
|
|
62
|
+
stdin: WritableStream<Uint8Array> | NodeJS.WritableStream | null
|
|
63
|
+
exited: Promise<number>
|
|
64
|
+
kill: (signal?: number) => void
|
|
65
|
+
ref: () => void
|
|
66
|
+
unref: () => void
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Spawn options compatible with Bun.spawn()
|
|
70
|
+
*/
|
|
71
|
+
export declare interface CompatSpawnOptions {
|
|
72
|
+
cwd?: string
|
|
73
|
+
env?: Record<string, string | undefined>
|
|
74
|
+
stdin?: 'inherit' | 'pipe' | 'ignore' | null
|
|
75
|
+
stdout?: 'inherit' | 'pipe' | 'ignore' | null
|
|
76
|
+
stderr?: 'inherit' | 'pipe' | 'ignore' | null
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Runtime information
|
|
80
|
+
*/
|
|
81
|
+
export declare interface RuntimeInfo {
|
|
82
|
+
name: 'bun' | 'node'
|
|
83
|
+
version: string
|
|
84
|
+
isBun: boolean
|
|
85
|
+
isNode: boolean
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Node.js implementation of Bun-like file handle
|
|
89
|
+
*/
|
|
90
|
+
declare class NodeFileHandle implements FileHandle {
|
|
91
|
+
name: string;
|
|
92
|
+
private _size;
|
|
93
|
+
constructor(path: string);
|
|
94
|
+
exists(): Promise<boolean>;
|
|
95
|
+
text(): Promise<string>;
|
|
96
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
97
|
+
get size(): number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Node.js implementation of Bun-like spawn result
|
|
101
|
+
*/
|
|
102
|
+
declare class NodeSpawnResult implements SpawnResult {
|
|
103
|
+
pid: number;
|
|
104
|
+
stdout: NodeJS.ReadableStream;
|
|
105
|
+
stderr: NodeJS.ReadableStream;
|
|
106
|
+
stdin: NodeJS.WritableStream | null;
|
|
107
|
+
exited: Promise<number>;
|
|
108
|
+
private process;
|
|
109
|
+
constructor(proc: ChildProcess);
|
|
110
|
+
kill(signal?: number): void;
|
|
111
|
+
ref(): void;
|
|
112
|
+
unref(): void;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/** Evaluate the string/number constant grammar used by computed template keys. */
|
|
3
|
+
export declare function evaluateKeyConstant(expression: string, constants: KeyConstants, depth?: number): KeyConstant | undefined;
|
|
4
|
+
/** Snapshot eligible const syntax before private declaration pruning. */
|
|
5
|
+
export declare function attachComputedKeyConstants(declarations: Declaration[], privateDeclarations: ReadonlyMap<string, Declaration>): void;
|
|
6
|
+
export declare function resolveTemplateKey(key: string, constants?: KeyConstants): { name: string } | { index: true } | undefined;
|
|
7
|
+
/** Symbol properties do not contribute to a string index's value union. */
|
|
8
|
+
export declare function isSymbolKey(key: string, constants?: KeyConstants): boolean;
|
|
9
|
+
export declare function hasTemplateSubstitution(key: string): boolean;
|
|
10
|
+
export type KeyConstant = string | number;
|
|
11
|
+
export type KeyBinding = KeyConstant | { kind: 'symbol' }
|
|
12
|
+
export type KeyConstants = ReadonlyMap<string, KeyBinding> & { mutableBindingTypes?: ReadonlyMap<string, string> }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the configuration, loading from config file if available
|
|
4
|
+
*/
|
|
5
|
+
export declare function getConfig(cwd?: string): Promise<DtsGenerationConfig>;
|
|
6
|
+
/**
|
|
7
|
+
* Reset the cached config (useful for testing)
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetConfig(): void;
|
|
10
|
+
/*.ts'],
|
|
11
|
+
* keepComments: true,
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function defineConfig(config: Partial<DtsGenerationConfig>): DtsGenerationConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Define a dtsx configuration with async support
|
|
18
|
+
* Allows loading plugins or other async dependencies
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* // dtsx.config.ts
|
|
23
|
+
* import { defineConfigAsync } from 'dtsx'
|
|
24
|
+
*
|
|
25
|
+
* export default defineConfigAsync(async () => ({
|
|
26
|
+
* root: './src',
|
|
27
|
+
* outdir: './dist',
|
|
28
|
+
* plugins: [await loadPlugin()],
|
|
29
|
+
* }))
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function defineConfigAsync(configFn: () => Promise<Partial<DtsGenerationConfig>>): () => Promise<DtsGenerationConfig>;
|
|
33
|
+
export declare const defaultConfig: DtsGenerationConfig;
|
|
34
|
+
// For backwards compatibility - synchronous access with default fallback
|
|
35
|
+
export declare const config: DtsGenerationConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type names the emitted declaration references but never resolves.
|
|
3
|
+
*
|
|
4
|
+
* Returns an empty array for a self-contained file, which is the normal case.
|
|
5
|
+
*/
|
|
6
|
+
export declare function findDanglingTypeReferences(dts: string): DanglingReference[];
|
|
7
|
+
export declare interface DanglingReference {
|
|
8
|
+
name: string
|
|
9
|
+
line: number
|
|
10
|
+
context: string
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
import type { ModuleResolver, ReachabilityResult } from './module-graph.js';
|
|
3
|
+
/**
|
|
4
|
+
* Plan sources and intended declaration outputs from an effective config.
|
|
5
|
+
* The optional resolver provider lets the generator retain its config-scoped
|
|
6
|
+
* resolver lifecycle; it runs only after the existing entrypoint validation.
|
|
7
|
+
*/
|
|
8
|
+
export declare function planDeclarationProject(config: DtsGenerationConfig, provideResolver?: () => Promise<ModuleResolver>): Promise<DeclarationProjectPlan>;
|
|
9
|
+
/**
|
|
10
|
+
* Check if a file matches any of the exclude patterns
|
|
11
|
+
*/
|
|
12
|
+
export declare function isExcluded(filePath: string, excludePatterns: string[], rootPath: string): boolean;
|
|
13
|
+
export declare function isWithinRoot(filePath: string, rootPath: string): boolean;
|
|
14
|
+
/** Get the declaration output path without accessing or changing the filesystem. */
|
|
15
|
+
export declare function getDeclarationOutputPath(inputPath: string, config: DtsGenerationConfig): string;
|
|
16
|
+
export declare function getDeclarationSpecifier(fromOutputPath: string, toOutputPath: string, runtimeExtension?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve one reference encountered in declaration output. A supplied delivery
|
|
19
|
+
* set identifies the current project boundary; omitting it retains standalone
|
|
20
|
+
* transform behavior and does not establish package delivery.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createDeclarationReferenceResolver(filePath: string, config: DtsGenerationConfig, resolveSpecifier: ModuleResolver, delivered?: ReadonlySet<string>): (specifier: string) => DeclarationReference;
|
|
23
|
+
export declare interface DeclarationProjectPlan {
|
|
24
|
+
readonly entryFiles: readonly string[]
|
|
25
|
+
readonly files: readonly string[]
|
|
26
|
+
readonly outputBySource: ReadonlyMap<string, string>
|
|
27
|
+
readonly resolver: ModuleResolver
|
|
28
|
+
readonly reachability: ReachabilityResult | null
|
|
29
|
+
readonly augmentationImports: ReadonlyMap<string, ReadonlySet<string>>
|
|
30
|
+
getResolutionFingerprint: () => string | undefined
|
|
31
|
+
}
|
|
32
|
+
export type DeclarationReference = | { kind: 'unchanged', reason: 'external' | 'unresolved' | 'preserved-declaration', specifier: string, emittedSpecifier: string }
|
|
33
|
+
| { kind: 'local', specifier: string, resolvedSource: string, declarationOutput: string, emittedSpecifier: string }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ye,J,S,G,Vo,be}from"../chunk-davy89dj.js";import"../chunk-g2120ysy.js";import"../chunk-4fygcxtb.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{be as createDeclarationReferenceResolver,G as getDeclarationOutputPath,Vo as getDeclarationSpecifier,J as isExcluded,S as isWithinRoot,ye as planDeclarationProject};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
/** Keep the generator's existing early configuration checks in their owner. */
|
|
3
|
+
export declare function assertSafeOutputConfiguration(config: DtsGenerationConfig): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* Stage all normalized declaration/map bytes, then commit with reversible
|
|
6
|
+
* renames. This protects detected preparation/commit failures, not atomic
|
|
7
|
+
* visibility to concurrent readers or process/power-loss crash recovery.
|
|
8
|
+
* Callers prepare bundles before publication; cache saving and processFile
|
|
9
|
+
* remain separate caller operations.
|
|
10
|
+
*/
|
|
11
|
+
export declare function publishDeclarationOutputs(config: DtsGenerationConfig, pending: ReadonlyMap<string, DeclarationOutput>): Promise<void>;
|
|
12
|
+
export declare interface DeclarationOutput {
|
|
13
|
+
content: string
|
|
14
|
+
lineEnding?: 'lf' | 'crlf' | 'auto'
|
|
15
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z,de}from"../chunk-kfk554fj.js";import"../chunk-7tremqhs.js";import"../chunk-danfamyx.js";import"../chunk-p023fhce.js";import"../chunk-6yvk3q1e.js";import"../chunk-davy89dj.js";import"../chunk-g2120ysy.js";import"../chunk-4fygcxtb.js";import"../chunk-ebjafajx.js";import"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-jcckwgb9.js";import"../chunk-189nn4fc.js";import"../chunk-83qnrx0m.js";import"../chunk-sd8bywh9.js";import"../chunk-3fbt79hx.js";import"../chunk-pga5m4wm.js";import"../chunk-v6fwy63g.js";import"../chunk-yx1jy7fx.js";import"../chunk-cyr45de1.js";import"../chunk-xfjfhe9d.js";import"../chunk-xa6rsd4b.js";import"../chunk-ft2zk7jx.js";import"../chunk-vf3ybe5r.js";import"../chunk-3t57mzvf.js";import"../chunk-ag1b6d30.js";import"../chunk-8d3sdkv4.js";import"../chunk-cv29b4zb.js";import"../chunk-32qexm3w.js";import"../chunk-0rmbc5zp.js";import"../chunk-42j9cfte.js";import"../chunk-1qtghb2x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{z as assertSafeOutputConfiguration,de as publishDeclarationOutputs};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/** A direct const alias preserves the referenced value's type identity. */
|
|
3
|
+
export declare function directConstValueAlias(value: string): string | undefined;
|
|
4
|
+
/** Whether a depth-zero brace starts a type operand instead of a function body. */
|
|
5
|
+
export declare function returnTypeExpectsObject(prefix: string): boolean;
|
|
6
|
+
/** Original top-level syntax, independent of imports or declarations pruned later. */
|
|
7
|
+
export declare function isExternalModuleSource(source: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The same check for generated text, whose tokens nobody reuses. Emitted
|
|
10
|
+
* declarations usually start with an import or export, and tokens ending
|
|
11
|
+
* strictly before a cut are the same with or without the rest of the text
|
|
12
|
+
* (lexing is left to right and never fails), so growing prefixes usually
|
|
13
|
+
* answer after a few hundred bytes.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isExternalModuleText(text: string): boolean;
|
|
16
|
+
/** Bindings in an ambient external module are implicitly exported without a clause. */
|
|
17
|
+
export declare function isPrivateImportableDeclaration(declaration: Declaration): boolean;
|
|
18
|
+
/** Functions have value bindings. Type names and labels cannot retain them. */
|
|
19
|
+
export declare function collectDeclarationValueReferences(declaration: Declaration, references: Set<string>): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qe,Dt,W,jn,_n,Gn}from"../chunk-ag1b6d30.js";import"../chunk-42j9cfte.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Gn as collectDeclarationValueReferences,Qe as directConstValueAlias,W as isExternalModuleSource,jn as isExternalModuleText,_n as isPrivateImportableDeclaration,Dt as returnTypeExpectsObject};
|