@dtsx/dtsx 0.0.0-stage → 0.11.37
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-0azm93j9.js +31 -0
- package/dist/chunk-0ke9xh7t.js +4 -0
- package/dist/chunk-1bpv3tck.js +10 -0
- package/dist/chunk-1e10w914.js +18 -0
- package/dist/chunk-1h6ycqza.js +6 -0
- package/dist/chunk-1j6092xz.js +7 -0
- package/dist/chunk-1pz7zxhc.js +3 -0
- package/dist/chunk-25vyhfzh.js +3 -0
- package/dist/chunk-2kwjbk55.js +3 -0
- package/dist/chunk-437g8zz6.js +177 -0
- package/dist/chunk-4f2mwn7p.js +5 -0
- package/dist/chunk-5hyv43ps.js +12 -0
- package/dist/chunk-5n0tfrpc.js +6 -0
- package/dist/chunk-60ssvwc8.js +4 -0
- package/dist/chunk-69dbf6de.js +3 -0
- package/dist/chunk-7610h2tf.js +3 -0
- package/dist/chunk-79nv7twc.js +14 -0
- package/dist/chunk-853ftm92.js +8 -0
- package/dist/chunk-90aptjh6.js +24 -0
- package/dist/chunk-acyj1dev.js +18 -0
- package/dist/chunk-asws39qs.js +31 -0
- package/dist/chunk-aw48mk3t.js +3 -0
- package/dist/chunk-bdxq6500.js +4 -0
- package/dist/chunk-bqabznps.js +7 -0
- package/dist/chunk-cen2t56g.js +3 -0
- package/dist/chunk-ckq8g1ck.js +4 -0
- package/dist/chunk-cs4gwz1k.js +27 -0
- package/dist/chunk-d43bpfk6.js +3 -0
- package/dist/chunk-dfye109x.js +3 -0
- package/dist/chunk-dv5hhg1a.js +3 -0
- package/dist/chunk-ezbp8tss.js +10 -0
- package/dist/chunk-fgbdm1y6.js +6 -0
- package/dist/chunk-fy97syc2.js +3 -0
- package/dist/chunk-g9d5r6a8.js +3 -0
- package/dist/chunk-ggbahdr2.js +4 -0
- package/dist/chunk-gpq2kggq.js +3 -0
- package/dist/chunk-gs7wfk8b.js +2 -0
- package/dist/chunk-gsb3ty07.js +3 -0
- package/dist/chunk-gsv5yc32.js +6 -0
- package/dist/chunk-h7k9wamx.js +3 -0
- package/dist/chunk-j6pfxvy8.js +3 -0
- package/dist/chunk-km8t8gqg.js +3 -0
- package/dist/chunk-knrtwppp.js +102 -0
- package/dist/chunk-m1khpcqb.js +3 -0
- package/dist/chunk-mt9219xc.js +7 -0
- package/dist/chunk-n2nyd0ck.js +3 -0
- package/dist/chunk-n37yj3xv.js +8 -0
- package/dist/chunk-n3p7wedp.js +3 -0
- package/dist/chunk-n6nw7sn2.js +7 -0
- package/dist/chunk-n94729d9.js +3 -0
- package/dist/chunk-nchp0pqa.js +3 -0
- package/dist/chunk-nn9tpxx3.js +3 -0
- package/dist/chunk-p2qz2nk2.js +3 -0
- package/dist/chunk-p7w9ydhe.js +9 -0
- package/dist/chunk-pga5m4wm.js +3 -0
- package/dist/chunk-psrgw9f8.js +19 -0
- package/dist/chunk-py7pj8aj.js +5 -0
- package/dist/chunk-pzedkn7z.js +4 -0
- package/dist/chunk-q0hn0ymb.js +6 -0
- package/dist/chunk-qnf4byak.js +3 -0
- package/dist/chunk-r4s18nn5.js +3 -0
- package/dist/chunk-r4zkf9ag.js +3 -0
- package/dist/chunk-rdzfdjkb.js +7 -0
- package/dist/chunk-rmdwvzgn.js +3 -0
- package/dist/chunk-s0mvstt0.js +3 -0
- package/dist/chunk-s6c98nad.js +29 -0
- package/dist/chunk-sjneg7p7.js +34 -0
- package/dist/chunk-sq34kkhy.js +3 -0
- package/dist/chunk-srg5qhch.js +22 -0
- package/dist/chunk-strqhcqs.js +3 -0
- package/dist/chunk-t1jtn2r0.js +10 -0
- package/dist/chunk-ttc5pr8y.js +37 -0
- package/dist/chunk-v44crx69.js +62 -0
- package/dist/chunk-v6fwy63g.js +3 -0
- package/dist/chunk-vae5wxar.js +3 -0
- package/dist/chunk-vtskg4r2.js +4 -0
- package/dist/chunk-w9av39jy.js +3 -0
- package/dist/chunk-wnk9yjw2.js +3 -0
- package/dist/chunk-wrnz0e76.js +4 -0
- package/dist/chunk-wzcwctba.js +9 -0
- package/dist/chunk-xb92nrsm.js +3 -0
- package/dist/chunk-xr1h3tv2.js +8 -0
- package/dist/chunk-xsf941gw.js +3 -0
- package/dist/chunk-z4mvkazp.js +21 -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,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{me,J,v,G,Eo,ge}from"../chunk-853ftm92.js";import"../chunk-xb92nrsm.js";import"../chunk-vtskg4r2.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-d43bpfk6.js";import"../chunk-rmdwvzgn.js";import"../chunk-pzedkn7z.js";import"../chunk-km8t8gqg.js";import"../chunk-dfye109x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{ge as createDeclarationReferenceResolver,G as getDeclarationOutputPath,Eo as getDeclarationSpecifier,J as isExcluded,v as isWithinRoot,me 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{K,pe}from"../chunk-s0mvstt0.js";import"../chunk-79nv7twc.js";import"../chunk-n37yj3xv.js";import"../chunk-aw48mk3t.js";import"../chunk-853ftm92.js";import"../chunk-xb92nrsm.js";import"../chunk-v44crx69.js";import"../chunk-vae5wxar.js";import"../chunk-vtskg4r2.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-d43bpfk6.js";import"../chunk-rmdwvzgn.js";import"../chunk-pzedkn7z.js";import"../chunk-km8t8gqg.js";import"../chunk-dfye109x.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{K as assertSafeOutputConfiguration,pe 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{et,Mt,j,Vn,Un,zn}from"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{zn as collectDeclarationValueReferences,et as directConstValueAlias,j as isExternalModuleSource,Vn as isExternalModuleText,Un as isPrivateImportableDeclaration,Mt as returnTypeExpectsObject};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute diff between two strings
|
|
3
|
+
*/
|
|
4
|
+
export declare function computeDiff(oldContent: string, newContent: string, filePath: string, options?: DiffOptions): DiffResult;
|
|
5
|
+
/**
|
|
6
|
+
* Format diff result as unified diff string
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatUnifiedDiff(result: DiffResult): string;
|
|
9
|
+
/**
|
|
10
|
+
* Format diff with colors for terminal output
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatColoredDiff(result: DiffResult): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format diff as simple summary
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatDiffSummary(result: DiffResult): string;
|
|
17
|
+
/**
|
|
18
|
+
* Compare a file against new content
|
|
19
|
+
*/
|
|
20
|
+
export declare function diffFile(filePath: string, newContent: string, options?: DiffOptions): Promise<DiffResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Compare multiple files
|
|
23
|
+
*/
|
|
24
|
+
export declare function diffFiles(files: Map<string, string>, options?: DiffOptions): Promise<Map<string, DiffResult>>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate a summary of all diffs
|
|
27
|
+
*/
|
|
28
|
+
export declare function summarizeDiffs(results: Map<string, DiffResult>): {
|
|
29
|
+
totalFiles: number
|
|
30
|
+
changedFiles: number
|
|
31
|
+
unchangedFiles: number
|
|
32
|
+
totalAdditions: number
|
|
33
|
+
totalDeletions: number
|
|
34
|
+
newFiles: number
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Print colored diff to console
|
|
38
|
+
*/
|
|
39
|
+
export declare function printDiff(result: DiffResult): void;
|
|
40
|
+
/**
|
|
41
|
+
* Print all diffs to console
|
|
42
|
+
*/
|
|
43
|
+
export declare function printDiffs(results: Map<string, DiffResult>, showUnchanged?: boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* A single diff hunk (change)
|
|
46
|
+
*/
|
|
47
|
+
export declare interface DiffHunk {
|
|
48
|
+
operation: DiffOperation
|
|
49
|
+
lines: string[]
|
|
50
|
+
oldStart: number
|
|
51
|
+
oldCount: number
|
|
52
|
+
newStart: number
|
|
53
|
+
newCount: number
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Complete diff result
|
|
57
|
+
*/
|
|
58
|
+
export declare interface DiffResult {
|
|
59
|
+
filePath: string
|
|
60
|
+
identical: boolean
|
|
61
|
+
hunks: DiffHunk[]
|
|
62
|
+
stats: {
|
|
63
|
+
additions: number
|
|
64
|
+
deletions: number
|
|
65
|
+
unchanged: number
|
|
66
|
+
}
|
|
67
|
+
oldContent?: string
|
|
68
|
+
newContent: string
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Options for diff generation
|
|
72
|
+
*/
|
|
73
|
+
export declare interface DiffOptions {
|
|
74
|
+
context?: number
|
|
75
|
+
ignoreWhitespace?: boolean
|
|
76
|
+
ignoreBlankLines?: boolean
|
|
77
|
+
treatMissingAsEmpty?: boolean
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Diff operation type
|
|
81
|
+
*/
|
|
82
|
+
export type DiffOperation = 'add' | 'remove' | 'equal';
|
package/dist/src/diff.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ut,Ps,Mr,Ds,Or,Rs,Ir,Fr,Ms}from"../chunk-n6nw7sn2.js";import"../chunk-dfye109x.js";export{ut as computeDiff,Or as diffFile,Rs as diffFiles,Mr as formatColoredDiff,Ds as formatDiffSummary,Ps as formatUnifiedDiff,Fr as printDiff,Ms as printDiffs,Ir as summarizeDiffs};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parse JSDoc comments from a declaration
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseJSDoc(comments: string[] | undefined): JSDocInfo;
|
|
6
|
+
/**
|
|
7
|
+
* Extract documentation from source files
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractDocumentation(files: string[], config?: Partial<DocsConfig>): Promise<Documentation>;
|
|
10
|
+
/**
|
|
11
|
+
* Generate markdown documentation
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateMarkdown(docs: Documentation, config?: Partial<DocsConfig>): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generate HTML documentation
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateHTML(docs: Documentation, config?: Partial<DocsConfig>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Generate JSON documentation
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateJSON(docs: Documentation, config?: Partial<DocsConfig>): string;
|
|
22
|
+
/**
|
|
23
|
+
* Generate documentation in TypeDoc-compatible JSON format
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateTypeDocJSON(docs: Documentation): string;
|
|
26
|
+
/**
|
|
27
|
+
* Generate and write documentation files
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateDocs(files: string[], config: DocsConfig): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Create a documentation generator with preset configuration
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDocsGenerator(config?: Partial<DocsConfig>): {
|
|
34
|
+
extract: (files: string[]) => Promise<Documentation>
|
|
35
|
+
generateMarkdown: (docs: Documentation) => string
|
|
36
|
+
generateHTML: (docs: Documentation) => string
|
|
37
|
+
generateJSON: (docs: Documentation) => string
|
|
38
|
+
parseJSDoc: typeof parseJSDoc
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Documentation configuration
|
|
42
|
+
*/
|
|
43
|
+
export declare interface DocsConfig {
|
|
44
|
+
format: 'markdown' | 'html' | 'json'
|
|
45
|
+
outdir: string
|
|
46
|
+
includePrivate?: boolean
|
|
47
|
+
includeInternal?: boolean
|
|
48
|
+
groupByCategory?: boolean
|
|
49
|
+
title?: string
|
|
50
|
+
description?: string
|
|
51
|
+
includeSourceLinks?: boolean
|
|
52
|
+
sourceBaseUrl?: string
|
|
53
|
+
includeTypes?: boolean
|
|
54
|
+
splitByModule?: boolean
|
|
55
|
+
template?: 'default' | 'minimal' | 'detailed'
|
|
56
|
+
customCss?: string
|
|
57
|
+
includeSidebar?: boolean
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parsed JSDoc information
|
|
61
|
+
*/
|
|
62
|
+
export declare interface JSDocInfo {
|
|
63
|
+
description: string
|
|
64
|
+
params: Array<{ name: string, type?: string, description: string, optional?: boolean }>
|
|
65
|
+
returns?: { type?: string, description: string }
|
|
66
|
+
examples: string[]
|
|
67
|
+
tags: Record<string, string[]>
|
|
68
|
+
deprecated?: string
|
|
69
|
+
since?: string
|
|
70
|
+
see: string[]
|
|
71
|
+
throws: Array<{ type?: string, description: string }>
|
|
72
|
+
category?: string
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Documentation entry for a declaration
|
|
76
|
+
*/
|
|
77
|
+
export declare interface DocEntry {
|
|
78
|
+
name: string
|
|
79
|
+
kind: Declaration['kind']
|
|
80
|
+
signature: string
|
|
81
|
+
jsdoc: JSDocInfo
|
|
82
|
+
isExported: boolean
|
|
83
|
+
isDefault?: boolean
|
|
84
|
+
sourceFile?: string
|
|
85
|
+
sourceLine?: number
|
|
86
|
+
members?: DocEntry[]
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Documentation output structure
|
|
90
|
+
*/
|
|
91
|
+
export declare interface Documentation {
|
|
92
|
+
title: string
|
|
93
|
+
description?: string
|
|
94
|
+
entries: DocEntry[]
|
|
95
|
+
categories: Map<string, DocEntry[]>
|
|
96
|
+
generatedAt: Date
|
|
97
|
+
}
|
package/dist/src/docs.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wt,jt,Be,_t,Gt,gr,Yi,Xi}from"../chunk-knrtwppp.js";import"../chunk-qnf4byak.js";import"../chunk-1pz7zxhc.js";import"../chunk-pga5m4wm.js";import"../chunk-25vyhfzh.js";import"../chunk-mt9219xc.js";import"../chunk-v6fwy63g.js";import"../chunk-ttc5pr8y.js";import"../chunk-xr1h3tv2.js";import"../chunk-gsb3ty07.js";import"../chunk-s6c98nad.js";import"../chunk-z4mvkazp.js";import"../chunk-g9d5r6a8.js";import"../chunk-wnk9yjw2.js";import"../chunk-gpq2kggq.js";import"../chunk-90aptjh6.js";import"../chunk-rdzfdjkb.js";import"../chunk-n2nyd0ck.js";import"../chunk-j6pfxvy8.js";import"../chunk-2kwjbk55.js";import"../chunk-69dbf6de.js";import"../chunk-cen2t56g.js";import"../chunk-km8t8gqg.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Xi as createDocsGenerator,jt as extractDocumentation,Yi as generateDocs,_t as generateHTML,Gt as generateJSON,Be as generateMarkdown,gr as generateTypeDocJSON,Wt as parseJSDoc};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
import type { KeyBinding, KeyConstants } from './computed-keys.js';
|
|
3
|
+
/** Runtime enum values become uninitialized numeric ambient members. */
|
|
4
|
+
export declare function lowerEnumBody(body: string, name: string, outer?: KeyConstants): { body: string, members: Map<string, KeyBinding> };
|
|
5
|
+
/** Preserve source constants before pruning implementation-only declarations. */
|
|
6
|
+
export declare function attachEnumBodies(declarations: Declaration[], privateDeclarations: ReadonlyMap<string, Declaration>): void;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { DtsError, SourceLocation } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type guards for error types
|
|
4
|
+
*/
|
|
5
|
+
export declare function isDtsxError(error: unknown): error is DtsxError;
|
|
6
|
+
export declare function isParseError(error: unknown): error is ParseError;
|
|
7
|
+
export declare function isFileError(error: unknown): error is FileError;
|
|
8
|
+
export declare function isConfigError(error: unknown): error is ConfigError;
|
|
9
|
+
/**
|
|
10
|
+
* Wrap an unknown error in a DtsxError
|
|
11
|
+
*/
|
|
12
|
+
export declare function wrapError(error: unknown, code?: ErrorCode, message?: string): DtsxError;
|
|
13
|
+
/**
|
|
14
|
+
* Calculate line and column from source code offset
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLocationFromOffset(sourceCode: string, offset: number): SourceLocation;
|
|
17
|
+
/**
|
|
18
|
+
* Create a formatted error message with source location context
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatErrorWithContext(sourceCode: string, location: SourceLocation, message: string, filePath?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Create a DtsError from an exception
|
|
23
|
+
*/
|
|
24
|
+
export declare function createDtsError(error: unknown, file: string, _sourceCode?: string): DtsError;
|
|
25
|
+
/**
|
|
26
|
+
* Format a DtsError for display
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatDtsError(error: DtsError, sourceCode?: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Aggregate multiple errors into a summary
|
|
31
|
+
*/
|
|
32
|
+
export declare function summarizeErrors(errors: DtsError[]): string;
|
|
33
|
+
/**
|
|
34
|
+
* Error codes for categorizing errors
|
|
35
|
+
*/
|
|
36
|
+
export declare const ErrorCodes: {
|
|
37
|
+
readonly PARSE_ERROR: 'PARSE_ERROR';
|
|
38
|
+
readonly SYNTAX_ERROR: 'SYNTAX_ERROR';
|
|
39
|
+
readonly FILE_NOT_FOUND: 'FILE_NOT_FOUND';
|
|
40
|
+
readonly FILE_READ_ERROR: 'FILE_READ_ERROR';
|
|
41
|
+
readonly FILE_WRITE_ERROR: 'FILE_WRITE_ERROR';
|
|
42
|
+
readonly TYPE_INFERENCE_ERROR: 'TYPE_INFERENCE_ERROR';
|
|
43
|
+
readonly UNRESOLVED_TYPE: 'UNRESOLVED_TYPE';
|
|
44
|
+
readonly EXTRACTION_ERROR: 'EXTRACTION_ERROR';
|
|
45
|
+
readonly PROCESSING_ERROR: 'PROCESSING_ERROR';
|
|
46
|
+
readonly VALIDATION_ERROR: 'VALIDATION_ERROR';
|
|
47
|
+
readonly INVALID_DECLARATION: 'INVALID_DECLARATION';
|
|
48
|
+
readonly CONFIG_ERROR: 'CONFIG_ERROR';
|
|
49
|
+
readonly INVALID_ENTRYPOINT: 'INVALID_ENTRYPOINT';
|
|
50
|
+
readonly CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY';
|
|
51
|
+
readonly TIMEOUT_ERROR: 'TIMEOUT_ERROR';
|
|
52
|
+
readonly NOT_SUPPORTED: 'NOT_SUPPORTED';
|
|
53
|
+
readonly UNKNOWN_ERROR: 'UNKNOWN_ERROR'
|
|
54
|
+
};
|
|
55
|
+
export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
|
|
56
|
+
/**
|
|
57
|
+
* Base error class for dtsx errors
|
|
58
|
+
*/
|
|
59
|
+
export declare class DtsxError extends Error {
|
|
60
|
+
readonly code: ErrorCode;
|
|
61
|
+
readonly context?: Record<string, unknown>;
|
|
62
|
+
constructor(message: string, code?: ErrorCode, context?: Record<string, unknown>);
|
|
63
|
+
toString(): string;
|
|
64
|
+
toJSON(): Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Error during file parsing
|
|
68
|
+
*/
|
|
69
|
+
export declare class ParseError extends DtsxError {
|
|
70
|
+
readonly filePath: string;
|
|
71
|
+
readonly line?: number;
|
|
72
|
+
readonly column?: number;
|
|
73
|
+
constructor(message: string, filePath: string, options?: { line?: number, column?: number, cause?: Error });
|
|
74
|
+
get locationString(): string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Error during declaration extraction
|
|
78
|
+
*/
|
|
79
|
+
export declare class ExtractionError extends DtsxError {
|
|
80
|
+
readonly filePath: string;
|
|
81
|
+
readonly declarationKind?: string;
|
|
82
|
+
constructor(message: string, filePath: string, declarationKind?: string, cause?: Error);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Error during type processing
|
|
86
|
+
*/
|
|
87
|
+
export declare class ProcessingError extends DtsxError {
|
|
88
|
+
readonly declarationName?: string;
|
|
89
|
+
constructor(message: string, declarationName?: string, cause?: Error);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Error during file I/O operations
|
|
93
|
+
*/
|
|
94
|
+
export declare class FileError extends DtsxError {
|
|
95
|
+
readonly filePath: string;
|
|
96
|
+
readonly operation: 'read' | 'write' | 'delete' | 'stat' | 'glob';
|
|
97
|
+
constructor(message: string, filePath: string, operation: 'read' | 'write' | 'delete' | 'stat' | 'glob', cause?: Error);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Error during configuration loading or validation
|
|
101
|
+
*/
|
|
102
|
+
export declare class ConfigError extends DtsxError {
|
|
103
|
+
readonly configPath?: string;
|
|
104
|
+
readonly invalidKey?: string;
|
|
105
|
+
constructor(message: string, options?: { configPath?: string, invalidKey?: string, cause?: Error });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Error when circular dependency is detected
|
|
109
|
+
*/
|
|
110
|
+
export declare class CircularDependencyError extends DtsxError {
|
|
111
|
+
readonly cycle: string[];
|
|
112
|
+
constructor(cycle: string[]);
|
|
113
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ce,E,$n,mi,gi,En,kn,hi,Io,Fo,Lo,No,Bo,Wo,jo,ze,xt,_o}from"../chunk-ezbp8tss.js";export{hi as CircularDependencyError,kn as ConfigError,E as DtsxError,Ce as ErrorCodes,mi as ExtractionError,En as FileError,$n as ParseError,gi as ProcessingError,ze as createDtsError,xt as formatDtsError,jo as formatErrorWithContext,Wo as getLocationFromOffset,No as isConfigError,Io as isDtsxError,Lo as isFileError,Fo as isParseError,_o as summarizeErrors,Bo as wrapError};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Declaration } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extract declarations using the fast string scanner (no TS parser).
|
|
4
|
+
* Results are cached by file path + keepComments flag.
|
|
5
|
+
*/
|
|
6
|
+
export declare function extractDeclarations(sourceCode: string, filePath: string, keepComments?: boolean, isolatedDeclarations?: boolean, importedFunctions?: ReadonlySet<string>): Declaration[];
|
|
7
|
+
/**
|
|
8
|
+
* Clear the declaration cache (for benchmarks and testing)
|
|
9
|
+
*/
|
|
10
|
+
export declare function clearDeclarationCache(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xe,Sn}from"../../chunk-25vyhfzh.js";import"../../chunk-mt9219xc.js";import"../../chunk-v6fwy63g.js";import"../../chunk-ttc5pr8y.js";import"../../chunk-xr1h3tv2.js";import"../../chunk-gsb3ty07.js";import"../../chunk-s6c98nad.js";import"../../chunk-z4mvkazp.js";import"../../chunk-g9d5r6a8.js";import"../../chunk-wnk9yjw2.js";import"../../chunk-gpq2kggq.js";import"../../chunk-90aptjh6.js";import"../../chunk-rdzfdjkb.js";import"../../chunk-n2nyd0ck.js";import"../../chunk-j6pfxvy8.js";import"../../chunk-2kwjbk55.js";import"../../chunk-69dbf6de.js";import"../../chunk-cen2t56g.js";import"../../chunk-1j6092xz.js";import"../../chunk-zq93f8ca.js";export{Sn as clearDeclarationCache,xe as extractDeclarations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hashContent(content: string): number | bigint;
|