@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,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse an import statement
|
|
3
|
+
*/
|
|
4
|
+
export declare function parseImport(statement: string): ParsedImport | null;
|
|
5
|
+
/**
|
|
6
|
+
* Detect the group for an import source
|
|
7
|
+
*/
|
|
8
|
+
export declare function detectGroup(source: string, isTypeOnly?: boolean): ImportGroup;
|
|
9
|
+
/**
|
|
10
|
+
* Sort imports according to configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare function sortImports(imports: string[], config?: ImportSortConfig): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Sort imports in a file content
|
|
15
|
+
*/
|
|
16
|
+
export declare function sortImportsInContent(content: string, config?: ImportSortConfig): string;
|
|
17
|
+
/**
|
|
18
|
+
* Create a configured import sorter
|
|
19
|
+
*/
|
|
20
|
+
export declare function createImportSorter(config?: ImportSortConfig): {
|
|
21
|
+
sort: (imports: string[]) => string[]
|
|
22
|
+
sortContent: (content: string) => string
|
|
23
|
+
parse: typeof parseImport
|
|
24
|
+
detectGroup: typeof detectGroup
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Default import group order
|
|
28
|
+
*/
|
|
29
|
+
export declare const DEFAULT_GROUP_ORDER: ImportGroup[];
|
|
30
|
+
/**
|
|
31
|
+
* Preset configurations
|
|
32
|
+
*/
|
|
33
|
+
export declare const presets: {
|
|
34
|
+
/**
|
|
35
|
+
* Default preset - groups by type, alphabetizes
|
|
36
|
+
*/
|
|
37
|
+
default: unknown;
|
|
38
|
+
/**
|
|
39
|
+
* Node.js style - node: first, then external, then relative
|
|
40
|
+
*/
|
|
41
|
+
node: unknown;
|
|
42
|
+
/**
|
|
43
|
+
* Bun style - bun first
|
|
44
|
+
*/
|
|
45
|
+
bun: unknown;
|
|
46
|
+
/**
|
|
47
|
+
* Type imports separated
|
|
48
|
+
*/
|
|
49
|
+
typeSeparated: unknown;
|
|
50
|
+
/**
|
|
51
|
+
* No grouping, just alphabetize
|
|
52
|
+
*/
|
|
53
|
+
alphabetical: unknown;
|
|
54
|
+
/**
|
|
55
|
+
* Keep original order
|
|
56
|
+
*/
|
|
57
|
+
none: unknown
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Import sorting module for organizing imports in declaration files
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Import sorting configuration
|
|
64
|
+
*/
|
|
65
|
+
export declare interface ImportSortConfig {
|
|
66
|
+
order?: string[]
|
|
67
|
+
groupByType?: boolean
|
|
68
|
+
groups?: ImportGroup[]
|
|
69
|
+
alphabetize?: boolean
|
|
70
|
+
caseInsensitive?: boolean
|
|
71
|
+
typeImportsLast?: boolean
|
|
72
|
+
separateTypeImports?: boolean
|
|
73
|
+
customGroups?: Record<string, string[]>
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parsed import information
|
|
77
|
+
*/
|
|
78
|
+
export declare interface ParsedImport {
|
|
79
|
+
statement: string
|
|
80
|
+
source: string
|
|
81
|
+
isTypeOnly: boolean
|
|
82
|
+
group: ImportGroup
|
|
83
|
+
specifiers: string[]
|
|
84
|
+
defaultImport?: string
|
|
85
|
+
namespaceImport?: string
|
|
86
|
+
lineNumber?: number
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Import group types
|
|
90
|
+
*/
|
|
91
|
+
export type ImportGroup = | 'builtin'
|
|
92
|
+
| 'external'
|
|
93
|
+
| 'internal'
|
|
94
|
+
| 'parent'
|
|
95
|
+
| 'sibling'
|
|
96
|
+
| 'index'
|
|
97
|
+
| 'type'
|
|
98
|
+
| 'unknown'
|
|
99
|
+
| string // Custom group name;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Declaration, DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create an incremental build wrapper
|
|
4
|
+
*/
|
|
5
|
+
export declare function createIncrementalBuilder(cache: IncrementalCache, configHash: string): {
|
|
6
|
+
needsRebuild: (filePath: string) => Promise<boolean>;
|
|
7
|
+
getCachedDeclarations: (filePath: string) => Promise<Declaration[] | null>;
|
|
8
|
+
getCachedDts: (filePath: string) => Promise<string | null>;
|
|
9
|
+
cacheResult: (filePath: string,
|
|
10
|
+
content: string,
|
|
11
|
+
declarations: Declaration[],
|
|
12
|
+
dtsContent: string,
|
|
13
|
+
dependencies?: string[],) => Promise<void>;
|
|
14
|
+
skip: (filePath: string) => void;
|
|
15
|
+
getResult: () => IncrementalBuildResult;
|
|
16
|
+
save: () => Promise<void>
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Prune old cache entries
|
|
20
|
+
*/
|
|
21
|
+
export declare function pruneCache(cache: IncrementalCache, _maxAge?: number): Promise<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Format incremental build result
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatIncrementalResult(result: IncrementalBuildResult): string;
|
|
26
|
+
/**
|
|
27
|
+
* Extract dependencies from source content
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractDependencies(content: string, basePath: string): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Incremental build configuration
|
|
32
|
+
*/
|
|
33
|
+
export declare interface IncrementalConfig {
|
|
34
|
+
enabled?: boolean
|
|
35
|
+
cacheDir?: string
|
|
36
|
+
format?: 'json' | 'binary'
|
|
37
|
+
maxAge?: number
|
|
38
|
+
force?: boolean
|
|
39
|
+
validateCache?: boolean
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Cached file entry for incremental builds
|
|
43
|
+
*/
|
|
44
|
+
export declare interface IncrementalCacheEntry {
|
|
45
|
+
filePath: string
|
|
46
|
+
hash: string
|
|
47
|
+
mtime: number
|
|
48
|
+
declarations: Declaration[]
|
|
49
|
+
dtsContent: string
|
|
50
|
+
dependencies: string[]
|
|
51
|
+
cachedAt: number
|
|
52
|
+
configHash: string
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Cache manifest for incremental builds
|
|
56
|
+
*/
|
|
57
|
+
export declare interface IncrementalCacheManifest {
|
|
58
|
+
version: string
|
|
59
|
+
entries: Record<string, IncrementalCacheEntry>
|
|
60
|
+
createdAt: number
|
|
61
|
+
updatedAt: number
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Incremental build result
|
|
65
|
+
*/
|
|
66
|
+
export declare interface IncrementalBuildResult {
|
|
67
|
+
rebuilt: string[]
|
|
68
|
+
cached: string[]
|
|
69
|
+
skipped: string[]
|
|
70
|
+
stats: CacheStats
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Cache statistics
|
|
74
|
+
*/
|
|
75
|
+
export declare interface CacheStats {
|
|
76
|
+
totalEntries: number
|
|
77
|
+
hits: number
|
|
78
|
+
misses: number
|
|
79
|
+
hitRatio: number
|
|
80
|
+
sizeBytes: number
|
|
81
|
+
timeSavedMs: number
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Incremental build cache manager
|
|
85
|
+
*/
|
|
86
|
+
export declare class IncrementalCache {
|
|
87
|
+
private config;
|
|
88
|
+
private manifest;
|
|
89
|
+
private dirty;
|
|
90
|
+
private stats;
|
|
91
|
+
constructor(config?: IncrementalConfig);
|
|
92
|
+
init(): Promise<void>;
|
|
93
|
+
private loadManifest;
|
|
94
|
+
save(): Promise<void>;
|
|
95
|
+
get(filePath: string, configHash: string): Promise<IncrementalCacheEntry | null>;
|
|
96
|
+
set(filePath: string, content: string, declarations: Declaration[], dtsContent: string, dependencies: string[], configHash: string): Promise<void>;
|
|
97
|
+
invalidate(filePath: string): void;
|
|
98
|
+
clear(): Promise<void>;
|
|
99
|
+
getStats(): CacheStats;
|
|
100
|
+
private hashContent;
|
|
101
|
+
private updateHitRatio;
|
|
102
|
+
static hashConfig(config: DtsGenerationConfig): string;
|
|
103
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @dtsx/dtsx - A modern, fast .d.ts generation tool
|
|
3
|
+
*
|
|
4
|
+
* This module exports the full API. For minimal bundle size when only
|
|
5
|
+
* using the core generator, import directly from './generator'.
|
|
6
|
+
*
|
|
7
|
+
* Core exports (most commonly used):
|
|
8
|
+
* - generate, watch, processFile, processSource from './generator'
|
|
9
|
+
* - extractDeclarations, extractDeclarationsAsync from './extractor'
|
|
10
|
+
* - processDeclarations from './processor'
|
|
11
|
+
* - DtsGenerationConfig, Declaration types from './types'
|
|
12
|
+
*
|
|
13
|
+
* Optional/Advanced exports are available but may increase bundle size:
|
|
14
|
+
* - LSP support: './lsp'
|
|
15
|
+
* - Type checking: './checker'
|
|
16
|
+
* - Circular dependency detection: './circular'
|
|
17
|
+
* - Custom transformers: './transformers'
|
|
18
|
+
* - Worker pool: './worker'
|
|
19
|
+
*/
|
|
20
|
+
// Common utilities
|
|
21
|
+
export * from './branded-types.js';
|
|
22
|
+
export * from './bundler.js';
|
|
23
|
+
export * from './cache.js';
|
|
24
|
+
export * from './native-checker.js';
|
|
25
|
+
// Advanced features - larger bundle impact
|
|
26
|
+
export * from './circular.js';
|
|
27
|
+
export * from './compat.js';
|
|
28
|
+
export * from './config.js';
|
|
29
|
+
export * from './diff.js';
|
|
30
|
+
export * from './docs.js';
|
|
31
|
+
export * from './errors.js';
|
|
32
|
+
export * from './extractor.js';
|
|
33
|
+
export * from './formats.js';
|
|
34
|
+
export * from './formatter.js';
|
|
35
|
+
// Core API - essential for dts generation
|
|
36
|
+
export * from './generator.js';
|
|
37
|
+
export * from './native-generation.js';
|
|
38
|
+
export { nativeEngineAvailable } from './native-engine.js';
|
|
39
|
+
export * from './import-sorter.js';
|
|
40
|
+
export * from './incremental.js';
|
|
41
|
+
export * from './logger.js';
|
|
42
|
+
export * from './lsp.js';
|
|
43
|
+
export * from './memory.js';
|
|
44
|
+
export * from './merger.js';
|
|
45
|
+
export * from './optimizer.js';
|
|
46
|
+
export * from './output-normalizer.js';
|
|
47
|
+
export * from './parallel-processor.js';
|
|
48
|
+
export * from './parser.js';
|
|
49
|
+
export * from './plugins.js';
|
|
50
|
+
export * from './processor.js';
|
|
51
|
+
export * from './profiling.js';
|
|
52
|
+
export * from './security.js';
|
|
53
|
+
export * from './sourcemap.js';
|
|
54
|
+
export * from './tracking.js';
|
|
55
|
+
export * from './transformers.js';
|
|
56
|
+
export * from './tree-shaker.js';
|
|
57
|
+
export * from './type-mappings.js';
|
|
58
|
+
export * from './types.js';
|
|
59
|
+
export * from './utils.js';
|
|
60
|
+
export * from './watcher.js';
|
|
61
|
+
export * from './worker.js';
|
|
62
|
+
export * from './workspace.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$i,Ei,ki,Ti,Ai,Pi,Di,Ri,Mi,Oi,Ii,Fi,Li,Ni}from"../chunk-9gts9ymh.js";import"../chunk-pga5m4wm.js";import"../chunk-sd8bywh9.js";import"../chunk-83qnrx0m.js";import"../chunk-zq93f8ca.js";import"../chunk-1j6092xz.js";import"../chunk-v6fwy63g.js";import"../chunk-1qtghb2x.js";import"../chunk-42j9cfte.js";import"../chunk-32qexm3w.js";import"../chunk-ag1b6d30.js";import"../chunk-xfjfhe9d.js";import"../chunk-0rmbc5zp.js";import{f}from"../chunk-cv29b4zb.js";import{n,Ot,ke,oe,et,o,tt,Ae,j}from"../chunk-8d3sdkv4.js";import"../chunk-cyr45de1.js";import{ee,h,te,ne,re,ie,On,In,se}from"../chunk-xa6rsd4b.js";import"../chunk-yx1jy7fx.js";import{Wn}from"../chunk-3t57mzvf.js";import{Ln,y}from"../chunk-vf3ybe5r.js";import"../chunk-ft2zk7jx.js";import"../chunk-189nn4fc.js";import{At,Q,kn,An,Pn,Dn}from"../chunk-3fbt79hx.js";import{hi,r,$n,yi}from"../chunk-jcckwgb9.js";import{ns,_t,pr,rs,is}from"../chunk-t4va49p3.js";import{Qr,Ge,mt}from"../chunk-tka2m4af.js";import"../chunk-danfamyx.js";import{hs,at,xr,ys,Cr,bs,ws,xs,Cs}from"../chunk-a7nvyxpg.js";import{mr,gr,ss,os,as,cs,ls,us,fs}from"../chunk-rkstz4w1.js";import{g,Jo,Yo,Z,Ke,xt,u,Xo,Zo,Qo}from"../chunk-73dzve1s.js";import{N,zo,Ho,Ko,qo,E}from"../chunk-ebjafajx.js";import{ea,e,ta,A,na,ra,ia,gi}from"../chunk-yay68832.js";import{ot,_i,ir,Gi,sr,Vi,or,ar,Ui}from"../chunk-e29rp5xj.js";import{Ht,Kt,Ne,qt,Jt,Sr,$s,Es}from"../chunk-hv8bx8xx.js";import{fe,v,pn,Yr,Xr,mn,gn,Zr,io,so,oo,ao,co,lo,uo,_e,pt,fo}from"../chunk-vkahj2ab.js";import{$r,Er,kr,Tr,Ar,Pr,ks,Ts}from"../chunk-gspsxc9d.js";import{U,Ur,Zs,Qs}from"../chunk-rbx6q1r0.js";import"../chunk-4fygcxtb.js";import"../chunk-g2120ysy.js";import"../chunk-cpmqa8kd.js";import"../chunk-qzjzw9p2.js";import"../chunk-p9vfxn8g.js";import"../chunk-wnqg6hem.js";import"../chunk-davy89dj.js";import"../chunk-6yvk3q1e.js";import"../chunk-p023fhce.js";import{Ve,yo,_,ni,H,gt,ht,yt,bt}from"../chunk-7tremqhs.js";import"../chunk-kfk554fj.js";import"../chunk-ghfd34r7.js";import{ti}from"../chunk-mkakbjvs.js";import{rn,zr,We,sn,eo,on,an,cn,Hr,ln,un,to,no,ro}from"../chunk-0k0fhq13.js";import{he,Wo,q,jo,_o,Go}from"../chunk-bxc2herz.js";import"../chunk-zk3w5sqv.js";import{l}from"../chunk-y1g6v96c.js";import{ri,ii,si,oi,ai,yn,K,wo,xo,wt,Co}from"../chunk-0yg5mcrf.js";import{dt,Kr,qr,Jr,fn}from"../chunk-hzn9kmq7.js";import{s,Ys,Xs}from"../chunk-0zfzhn19.js";import"../chunk-96atbsd3.js";import{Si}from"../chunk-y5k0szq6.js";import{Vt,Ut,ct,zt,vr,vs,Ss}from"../chunk-2qd3axyx.js";import{ei,po,mo,go,ho}from"../chunk-082w7zvy.js";import{Dr,Rr,Mr,Or,Yt,As,Ps}from"../chunk-8tzd98q8.js";import{Gt,hr,yr,br,wr,ds,ps,ms,gs}from"../chunk-2436cnmb.js";import{Bi,Wi}from"../chunk-kkshxyex.js";import{Qn,vi,er}from"../chunk-bnry23ve.js";import{ur,Xi,Zi,fr,dr,Qi}from"../chunk-sv8h007a.js";import{Ls,Ns,Zt,Bs,Ws,Qt,js,_s,Gs,Vs}from"../chunk-hnqm1zb3.js";import{Ft,cr,zi,Hi,Lt,Ki}from"../chunk-88gwzbew.js";import{L,C,Be,Fr,en,Lr,Nr,Br,ut,tn,ft,Wr,Us,zs,Hs,Ks}from"../chunk-h3n6256r.js";import{Xt,lt,Ds,Rs,Ms,Os,Ir,Is,Fs}from"../chunk-pjqzkgzk.js";import{Bt,Wt,jt,es,ts}from"../chunk-zgcdx773.js";import{ci,li,Cn,vo,ui,So,ge,$o,He,Eo,fi,ko,di,To,Ao,Po,Do,pi,mi,Ro,Mo,Oo,Io,Fo,Lo,No,Bo}from"../chunk-kpbz61yy.js";import{rt,it,st,tr,nr,rr,ji}from"../chunk-eba562w8.js";import{xi,la,Ci,ua}from"../chunk-rz060wxt.js";import{Nt,lr,qi,Ji,Yi}from"../chunk-50h54rax.js";import{jr,_r,nn,qs,Gr,Vr,Js}from"../chunk-xwpn40p0.js";export{Ni as BrandedPath,Ge as BuildCache,Zr as CircularDependencyError,Mr as CompletionItemKind,gn as ConfigError,rn as DEFAULT_DECLARATION_ORDER,Vt as DEFAULT_GROUP_ORDER,zr as DEFAULT_IMPORT_GROUP_ORDER,L as DEFAULT_SECURITY_CONFIG,hr as DeclarationPool,Or as DocumentHighlightKind,v as DtsxError,Yt as DtsxLanguageServer,fe as ErrorCodes,Yr as ExtractionError,mn as FileError,ei as IncrementalCache,yr as LazyLoader,Dr as LspDiagnosticSeverity,wr as ObjectPool,pn as ParseError,he as PluginManager,Xr as ProcessingError,Ft as Profiler,C as SecurityError,lt as SourceMapConsumer,Xt as SourceMapGenerator,Gt as StreamingProcessor,br as StringInterner,Rr as SymbolKind,Lt as Timer,Bt as Tracker,yn as TypeMapper,Co as TypeTransformers,Nt as WorkerPool,bt as addSourceMapComment,ss as analyzeCircularDependencies,rr as analyzeDependencies,es as analyzeImports,Qi as analyzeParallelizationPotential,ts as analyzeTypes,Ms as appendInlineSourceMap,Rs as appendSourceMapComment,wt as applyTypeMappings,Mi as asAbsolutePath,Ri as asDeclarationName,Ei as asDirectoryPath,Ai as asDtsContent,$i as asFilePath,ki as asGlobPattern,Ii as asJsonString,Pi as asModuleSpecifier,Oi as asRelativePath,Ti as asSourceCode,Di as asTypeName,yo as assertNever,yi as batchExtractDeclarations,Ji as batchFiles,kn as batchParseSourceFiles,it as buildDeclarationDependencyGraph,Fs as buildDeclarationMappings,mr as buildDependencyGraph,ur as buildProcessingGraph,pr as bundleAndWrite,ns as bundleDeclarations,_t as bundleDtsFiles,Yi as calculateOptimalBatchSize,ys as checkIsolatedDeclarations,H as checkIsolatedDeclarationsConfig,Qr as clearBuildCache,Wn as clearProcessorCaches,Jr as clearResultCache,hi as clearSourceFileCache,li as cloneDeclaration,So as composeTransformers,ot as computeDiff,E as config,ks as convertToFormat,_o as createBannerPlugin,rs as createBundler,ci as createDeclaration,ht as createDiff,Es as createDocsGenerator,_e as createDtsError,Ps as createFileWatcher,Go as createFilterPlugin,Zs as createFormatter,vs as createImportSorter,po as createIncrementalBuilder,To as createJSDocTransformer,ea as createLogger,ds as createMemoryOptimizedConfig,pi as createModifierTransformer,Bo as createNamespacePrefixPlugin,no as createOutputNormalizer,Do as createParameterTransformer,fi as createPrefixTransformer,Hi as createProfiledIo,cr as createProfiler,di as createRemoveTransformer,Eo as createRenameTransformer,Po as createReturnTypeTransformer,Us as createSecureBatchProcessor,Wr as createSecureProcessor,Ks as createSecurityMiddleware,Ds as createSourceMap,gs as createStreamingProcessor,Oo as createStripTagsTransformer,ko as createSuffixTransformer,Ki as createTimer,Wt as createTracker,He as createTransformerPlugin,ji as createTreeShaker,K as createTypeMapper,Ao as createTypeTransformer,ua as createWatchLogger,xi as createWatcher,lr as createWorkerPool,Io as createWrapTypeTransformer,No as declarePlugin,N as defaultConfig,wo as defaultTypeMapper,ri as defaultTypeMappings,Ko as defineConfig,qo as defineConfigAsync,q as definePlugin,gr as detectCircularDependencies,ct as detectGroup,eo as detectLineEnding,sr as diffFile,Vi as diffFiles,Gr as discoverWorkspaceFromPackageJson,jr as discoverWorkspaceProjects,mt as ensureGitignore,cn as ensureTrailingNewline,ps as estimateMemoryUsage,us as exportGraphAsDot,fs as exportGraphAsJson,y as extractAllImportedItems,Qt as extractBalancedSymbols,r as extractDeclarations,$n as extractDeclarationsAsync,ho as extractDependencies,Kt as extractDocumentation,Bs as extractLeadingComments,Ns as extractLeadingCommentsFromNode,j as extractSatisfiesType,Is as extractSourceMap,Ws as extractTrailingComment,st as extractTypeReferences,Z as file,Xo as fileExists,ge as filterByKind,$o as filterByPredicate,ls as findAllDependencies,cs as findAllDependents,vo as findDeclarations,fr as findIndependentFiles,o as findMatchingBracket,nr as findUnusedDeclarations,os as formatCircularAnalysis,ir as formatColoredDiff,f as formatComments,Gi as formatDiffSummary,U as formatDts,pt as formatDtsError,uo as formatErrorWithContext,Ur as formatFiles,go as formatIncrementalResult,ms as formatMemoryStats,ws as formatTypeCheckResults,_i as formatUnifiedDiff,Ci as formatWatchResult,s as generate,yt as generateDeclarationMap,$s as generateDocs,Js as generateFromPackageWorkspaces,qt as generateHTML,Jt as generateJSON,Ne as generateMarkdown,qs as generateMonorepo,Si as generateNativeDeclarationProject,Sr as generateTypeDocJSON,nn as generateWorkspace,ni as getAllTypeScriptFiles,zo as getConfig,Ts as getFormatExtension,as as getGraphSummary,lo as getLocationFromOffset,na as getLogLevel,Ls as getNodeText,Pn as getPendingParseCount,ai as getPresetMappings,dr as getProcessingLevels,bs as getQuickInfo,Qo as getRuntimeInfo,At as getSourceFile,Q as getSourceFileAsync,An as getSourceFileCacheSize,Zi as getTopologicalOrder,Cr as getTypeAtPosition,ke as inferArrayType,tt as inferFunctionType,n as inferNarrowType,Ot as inferNarrowTypeInUnion,et as inferObjectType,en as isBlockedPath,Fi as isBranded,g as isBun,ao as isConfigError,io as isDtsxError,_s as isExportStatement,oo as isFileError,Ae as isGenericType,Jo as isNode,so as isParseError,Hs as isSafePath,Nr as isSymlink,Gs as isTypeOnlyExport,hs as loadCompilerOptions,e as logger,ui as mapDeclarations,Bi as mergeDeclarations,Wi as mergeDeclarationsInContent,er as minifyDts,ti as nativeEngineAvailable,an as normalizeBlankLines,Hr as normalizeIndent,sn as normalizeLineEndings,We as normalizeOutput,ro as normalizerPresets,gi as nullLogger,Qn as optimizeDeclarations,vi as optimizeFile,Mo as optionalTransformer,un as orderDeclarations,qi as parallelProcess,oe as parseArrayElements,js as parseFunctionDeclaration,Ut as parseImport,Ln as parseImportStatement,Ht as parseJSDoc,Vs as parseVariableDeclaration,Wo as pluginManager,to as preserveCommentFormatting,Ss as presets,ar as printDiff,Ui as printDiffs,re as processClassDeclaration,l as processDeclarations,ie as processEnumDeclaration,In as processExportDeclaration,Ys as processFile,ee as processFunctionDeclaration,On as processImportDeclaration,ln as processImports,Xi as processInParallel,te as processInterfaceDeclaration,se as processModuleDeclaration,dt as processSource,Kr as processSourceIsolated,qr as processSourceSemantic,fn as processSourceWithTypeScriptEngine,ne as processTypeDeclaration,h as processVariableDeclaration,zi as profileExecution,mo as pruneCache,Qs as quickFormat,Ir as readSourceMap,u as readTextFile,Fo as readonlyPlugin,mi as readonlyTransformer,si as readonlyTypeMappings,Zt as removeLeadingComments,on as removeTrailingWhitespace,Ro as requiredTransformer,Ho as resetConfig,is as resolveEntryFiles,Vr as resolveWorkspacePatterns,Yo as runtime,zs as sanitizeFilename,ta as scopedLogger,A as setLogLevel,ra as setLogPrefix,ia as setTimestamps,Dn as shouldUseAsyncParsing,oi as simplifiedTypeMappings,zt as sortImports,vr as sortImportsInContent,_r as sortProjectsByDependencies,Ve as sourceMapCommentPrefix,xt as spawnProcess,As as startLSPServer,xo as strictTypeMapper,ii as strictTypeMappings,jo as stripInternalPlugin,Lo as stripPrivatePlugin,or as summarizeDiffs,fo as summarizeErrors,Pr as toArkType,Tr as toIoTs,$r as toJsonSchema,kr as toValibot,Ar as toYup,Er as toZod,jt as trackDeclarations,rt as treeShake,tr as treeShakeContent,at as typeCheck,xs as typeCheckWithConfig,Li as unwrap,xr as validateDeclarations,gt as validateDtsContent,tn as validateFileBatch,ut as validateFilePath,Lr as validateFileSize,Cs as validateGeneratedDeclarations,Be as validatePath,Fr as validatePaths,Br as validateSymlink,Cn as walkDeclarations,Xs as watch,la as watchAndGenerate,ft as withTimeout,co as wrapError,Ke as write,Os as writeSourceMap,Zo as writeTextFile,_ as writeToFile};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Verify callable identities from resolved authored sources, never from names alone. */
|
|
2
|
+
export declare function monomorphicImportFunctions(source: string, imports: ReadonlyMap<string, string>): Set<string>;
|
|
3
|
+
/** The identities whose call results can safely be represented by ReturnType. */
|
|
4
|
+
export declare function monomorphicExportedFunctions(source: string): Array<{ name: string, isDefault: boolean }>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xn,ze}from"../chunk-ghfd34r7.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{ze as monomorphicExportedFunctions,xn as monomorphicImportFunctions};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isIdentStart(ch: number): boolean;
|
|
2
|
+
export declare function isIdentChar(ch: number): boolean;
|
|
3
|
+
/** Check if `/` at current pos is the start of a regex literal (not division). */
|
|
4
|
+
export declare function isRegexStart(source: string, pos: number): boolean;
|
|
5
|
+
/** Skip a regex literal /.../ including flags */
|
|
6
|
+
export declare function skipRegexLiteral(source: string, start: number): number;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a logger instance
|
|
3
|
+
*/
|
|
4
|
+
export declare function createLogger(options?: LoggerOptions): Logger;
|
|
5
|
+
/**
|
|
6
|
+
* Create a scoped logger for a specific module
|
|
7
|
+
* @example
|
|
8
|
+
* const log = scopedLogger('extractor')
|
|
9
|
+
* log.debug('Parsing file...') // [dtsx:extractor] Parsing file...
|
|
10
|
+
*/
|
|
11
|
+
export declare function scopedLogger(scope: string): Logger;
|
|
12
|
+
/**
|
|
13
|
+
* Set the global log level
|
|
14
|
+
*/
|
|
15
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
16
|
+
/**
|
|
17
|
+
* Get the current log level
|
|
18
|
+
*/
|
|
19
|
+
export declare function getLogLevel(): LogLevel;
|
|
20
|
+
/**
|
|
21
|
+
* Set the log prefix
|
|
22
|
+
*/
|
|
23
|
+
export declare function setLogPrefix(prefix: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Enable or disable timestamps
|
|
26
|
+
*/
|
|
27
|
+
export declare function setTimestamps(enabled: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* Default logger instance
|
|
30
|
+
*/
|
|
31
|
+
export declare const logger: Logger;
|
|
32
|
+
/**
|
|
33
|
+
* No-op logger for silent mode or testing
|
|
34
|
+
*/
|
|
35
|
+
export declare const nullLogger: Logger;
|
|
36
|
+
export declare interface LoggerOptions {
|
|
37
|
+
level?: LogLevel
|
|
38
|
+
prefix?: string
|
|
39
|
+
timestamps?: boolean
|
|
40
|
+
output?: (level: LogLevel, ...args: unknown[]) => void
|
|
41
|
+
}
|
|
42
|
+
export declare interface Logger {
|
|
43
|
+
debug: (...args: unknown[]) => void
|
|
44
|
+
info: (...args: unknown[]) => void
|
|
45
|
+
warn: (...args: unknown[]) => void
|
|
46
|
+
error: (...args: unknown[]) => void
|
|
47
|
+
setLevel: (level: LogLevel) => void
|
|
48
|
+
getLevel: () => LogLevel
|
|
49
|
+
child: (scope: string) => Logger
|
|
50
|
+
time: (label: string) => () => void
|
|
51
|
+
progress: (message: string) => void
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Logger abstraction for dtsx
|
|
55
|
+
* Provides configurable logging with verbosity levels and scoped loggers
|
|
56
|
+
*/
|
|
57
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|