@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,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start LSP server on stdio
|
|
3
|
+
*/
|
|
4
|
+
export declare function startLSPServer(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Create a simple file watcher that emits diagnostics
|
|
7
|
+
*/
|
|
8
|
+
export declare function createFileWatcher(server: DtsxLanguageServer, onDiagnostics: (uri: string, diagnostics: Diagnostic[]) => void): (filePath: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* LSP message types
|
|
11
|
+
*/
|
|
12
|
+
export declare interface LSPMessage {
|
|
13
|
+
jsonrpc: '2.0'
|
|
14
|
+
id?: number | string
|
|
15
|
+
method?: string
|
|
16
|
+
params?: unknown
|
|
17
|
+
result?: unknown
|
|
18
|
+
error?: LSPError
|
|
19
|
+
}
|
|
20
|
+
export declare interface LSPError {
|
|
21
|
+
code: number
|
|
22
|
+
message: string
|
|
23
|
+
data?: unknown
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* LSP initialization params
|
|
27
|
+
*/
|
|
28
|
+
export declare interface InitializeParams {
|
|
29
|
+
processId: number | null
|
|
30
|
+
rootUri: string | null
|
|
31
|
+
capabilities: ClientCapabilities
|
|
32
|
+
}
|
|
33
|
+
export declare interface ClientCapabilities {
|
|
34
|
+
textDocument?: {
|
|
35
|
+
synchronization?: {
|
|
36
|
+
dynamicRegistration?: boolean
|
|
37
|
+
willSave?: boolean
|
|
38
|
+
didSave?: boolean
|
|
39
|
+
}
|
|
40
|
+
hover?: {
|
|
41
|
+
dynamicRegistration?: boolean
|
|
42
|
+
contentFormat?: string[]
|
|
43
|
+
}
|
|
44
|
+
completion?: {
|
|
45
|
+
dynamicRegistration?: boolean
|
|
46
|
+
completionItem?: {
|
|
47
|
+
snippetSupport?: boolean
|
|
48
|
+
documentationFormat?: string[]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
definition?: {
|
|
52
|
+
dynamicRegistration?: boolean
|
|
53
|
+
}
|
|
54
|
+
diagnostic?: {
|
|
55
|
+
dynamicRegistration?: boolean
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
workspace?: {
|
|
59
|
+
workspaceFolders?: boolean
|
|
60
|
+
configuration?: boolean
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export declare interface ServerCapabilities {
|
|
64
|
+
textDocumentSync?: number
|
|
65
|
+
hoverProvider?: boolean
|
|
66
|
+
completionProvider?: {
|
|
67
|
+
triggerCharacters?: string[]
|
|
68
|
+
resolveProvider?: boolean
|
|
69
|
+
}
|
|
70
|
+
definitionProvider?: boolean
|
|
71
|
+
referencesProvider?: boolean
|
|
72
|
+
renameProvider?: boolean | { prepareProvider?: boolean }
|
|
73
|
+
documentSymbolProvider?: boolean
|
|
74
|
+
workspaceSymbolProvider?: boolean
|
|
75
|
+
codeActionProvider?: boolean | { codeActionKinds?: string[] }
|
|
76
|
+
signatureHelpProvider?: {
|
|
77
|
+
triggerCharacters?: string[]
|
|
78
|
+
retriggerCharacters?: string[]
|
|
79
|
+
}
|
|
80
|
+
documentHighlightProvider?: boolean
|
|
81
|
+
documentFormattingProvider?: boolean
|
|
82
|
+
diagnosticProvider?: {
|
|
83
|
+
interFileDependencies: boolean
|
|
84
|
+
workspaceDiagnostics: boolean
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Text document item
|
|
89
|
+
*/
|
|
90
|
+
export declare interface TextDocumentItem {
|
|
91
|
+
uri: string
|
|
92
|
+
languageId: string
|
|
93
|
+
version: number
|
|
94
|
+
text: string
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Position in a text document
|
|
98
|
+
*/
|
|
99
|
+
export declare interface Position {
|
|
100
|
+
line: number
|
|
101
|
+
character: number
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Range in a text document
|
|
105
|
+
*/
|
|
106
|
+
export declare interface Range {
|
|
107
|
+
start: Position
|
|
108
|
+
end: Position
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Diagnostic message
|
|
112
|
+
*/
|
|
113
|
+
export declare interface Diagnostic {
|
|
114
|
+
range: Range
|
|
115
|
+
severity?: LspDiagnosticSeverity
|
|
116
|
+
code?: string | number
|
|
117
|
+
source?: string
|
|
118
|
+
message: string
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Hover response
|
|
122
|
+
*/
|
|
123
|
+
export declare interface Hover {
|
|
124
|
+
contents: string | { kind: string, value: string }
|
|
125
|
+
range?: Range
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Location for go-to-definition
|
|
129
|
+
*/
|
|
130
|
+
export declare interface Location {
|
|
131
|
+
uri: string
|
|
132
|
+
range: Range
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Document symbol
|
|
136
|
+
*/
|
|
137
|
+
export declare interface DocumentSymbol {
|
|
138
|
+
name: string
|
|
139
|
+
detail?: string
|
|
140
|
+
kind: SymbolKind
|
|
141
|
+
range: Range
|
|
142
|
+
selectionRange: Range
|
|
143
|
+
children?: DocumentSymbol[]
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Workspace symbol
|
|
147
|
+
*/
|
|
148
|
+
export declare interface WorkspaceSymbol {
|
|
149
|
+
name: string
|
|
150
|
+
kind: SymbolKind
|
|
151
|
+
location: Location
|
|
152
|
+
containerName?: string
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Code action
|
|
156
|
+
*/
|
|
157
|
+
export declare interface CodeAction {
|
|
158
|
+
title: string
|
|
159
|
+
kind?: string
|
|
160
|
+
diagnostics?: Diagnostic[]
|
|
161
|
+
isPreferred?: boolean
|
|
162
|
+
edit?: WorkspaceEdit
|
|
163
|
+
command?: Command
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Workspace edit
|
|
167
|
+
*/
|
|
168
|
+
export declare interface WorkspaceEdit {
|
|
169
|
+
changes?: Record<string, TextEdit[]>
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Text edit
|
|
173
|
+
*/
|
|
174
|
+
export declare interface TextEdit {
|
|
175
|
+
range: Range
|
|
176
|
+
newText: string
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Command
|
|
180
|
+
*/
|
|
181
|
+
export declare interface Command {
|
|
182
|
+
title: string
|
|
183
|
+
command: string
|
|
184
|
+
arguments?: unknown[]
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Signature help
|
|
188
|
+
*/
|
|
189
|
+
export declare interface SignatureHelp {
|
|
190
|
+
signatures: SignatureInformation[]
|
|
191
|
+
activeSignature?: number
|
|
192
|
+
activeParameter?: number
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Signature information
|
|
196
|
+
*/
|
|
197
|
+
export declare interface SignatureInformation {
|
|
198
|
+
label: string
|
|
199
|
+
documentation?: string | { kind: string, value: string }
|
|
200
|
+
parameters?: ParameterInformation[]
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Parameter information
|
|
204
|
+
*/
|
|
205
|
+
export declare interface ParameterInformation {
|
|
206
|
+
label: string | [number, number]
|
|
207
|
+
documentation?: string | { kind: string, value: string }
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Document highlight
|
|
211
|
+
*/
|
|
212
|
+
export declare interface DocumentHighlight {
|
|
213
|
+
range: Range
|
|
214
|
+
kind?: DocumentHighlightKind
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* LSP Server for dtsx
|
|
218
|
+
*/
|
|
219
|
+
export declare class DtsxLanguageServer {
|
|
220
|
+
private documents;
|
|
221
|
+
private rootUri;
|
|
222
|
+
private config;
|
|
223
|
+
private messageId;
|
|
224
|
+
private watchers;
|
|
225
|
+
initialize(params: InitializeParams): { capabilities: ServerCapabilities };
|
|
226
|
+
didOpen(params: { textDocument: TextDocumentItem }): void;
|
|
227
|
+
didChange(params: { textDocument: { uri: string, version: number }, contentChanges: Array<{ text: string }> }): void;
|
|
228
|
+
didClose(params: { textDocument: { uri: string } }): void;
|
|
229
|
+
private updateDocument;
|
|
230
|
+
getDiagnostics(uri: string): Diagnostic[];
|
|
231
|
+
hover(params: { textDocument: { uri: string }, position: Position }): Hover | null;
|
|
232
|
+
completion(params: { textDocument: { uri: string }, position: Position }): Array<{ label: string, kind: number, detail?: string, documentation?: string }>;
|
|
233
|
+
definition(params: { textDocument: { uri: string }, position: Position }): Location | null;
|
|
234
|
+
references(params: { textDocument: { uri: string }, position: Position, context: { includeDeclaration: boolean } }): Location[];
|
|
235
|
+
prepareRename(params: { textDocument: { uri: string }, position: Position }): { range: Range, placeholder: string } | null;
|
|
236
|
+
rename(params: { textDocument: { uri: string }, position: Position, newName: string }): WorkspaceEdit | null;
|
|
237
|
+
documentSymbols(params: { textDocument: { uri: string } }): DocumentSymbol[];
|
|
238
|
+
workspaceSymbols(params: { query: string }): WorkspaceSymbol[];
|
|
239
|
+
codeActions(params: { textDocument: { uri: string }, range: Range, context: { diagnostics: Diagnostic[] } }): CodeAction[];
|
|
240
|
+
signatureHelp(params: { textDocument: { uri: string }, position: Position }): SignatureHelp | null;
|
|
241
|
+
documentHighlight(params: { textDocument: { uri: string }, position: Position }): DocumentHighlight[];
|
|
242
|
+
formatting(params: { textDocument: { uri: string }, options: { tabSize: number, insertSpaces: boolean } }): Promise<TextEdit[]>;
|
|
243
|
+
private getWordAtPosition;
|
|
244
|
+
private getWordAtRange;
|
|
245
|
+
private getDeclarationAtPosition;
|
|
246
|
+
private positionInRange;
|
|
247
|
+
private declarationKindToSymbolKind;
|
|
248
|
+
generateDts(uri: string): string | null;
|
|
249
|
+
private buildSignature;
|
|
250
|
+
private getDeclarationRange;
|
|
251
|
+
private offsetToPosition;
|
|
252
|
+
private uriToPath;
|
|
253
|
+
private pathToUri;
|
|
254
|
+
handleMessage(message: LSPMessage): LSPMessage | null;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* LSP Diagnostic severity (matches LSP specification)
|
|
258
|
+
*/
|
|
259
|
+
export declare enum LspDiagnosticSeverity {
|
|
260
|
+
Error = 1,
|
|
261
|
+
Warning = 2,
|
|
262
|
+
Information = 3,
|
|
263
|
+
Hint = 4,
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Symbol kind enum (LSP spec)
|
|
267
|
+
*/
|
|
268
|
+
export declare enum SymbolKind {
|
|
269
|
+
File = 1,
|
|
270
|
+
Module = 2,
|
|
271
|
+
Namespace = 3,
|
|
272
|
+
Package = 4,
|
|
273
|
+
Class = 5,
|
|
274
|
+
Method = 6,
|
|
275
|
+
Property = 7,
|
|
276
|
+
Field = 8,
|
|
277
|
+
Constructor = 9,
|
|
278
|
+
Enum = 10,
|
|
279
|
+
Interface = 11,
|
|
280
|
+
Function = 12,
|
|
281
|
+
Variable = 13,
|
|
282
|
+
Constant = 14,
|
|
283
|
+
String = 15,
|
|
284
|
+
Number = 16,
|
|
285
|
+
Boolean = 17,
|
|
286
|
+
Array = 18,
|
|
287
|
+
Object = 19,
|
|
288
|
+
Key = 20,
|
|
289
|
+
Null = 21,
|
|
290
|
+
EnumMember = 22,
|
|
291
|
+
Struct = 23,
|
|
292
|
+
Event = 24,
|
|
293
|
+
Operator = 25,
|
|
294
|
+
TypeParameter = 26,
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Completion item kind enum
|
|
298
|
+
*/
|
|
299
|
+
export declare enum CompletionItemKind {
|
|
300
|
+
Text = 1,
|
|
301
|
+
Method = 2,
|
|
302
|
+
Function = 3,
|
|
303
|
+
Constructor = 4,
|
|
304
|
+
Field = 5,
|
|
305
|
+
Variable = 6,
|
|
306
|
+
Class = 7,
|
|
307
|
+
Interface = 8,
|
|
308
|
+
Module = 9,
|
|
309
|
+
Property = 10,
|
|
310
|
+
Unit = 11,
|
|
311
|
+
Value = 12,
|
|
312
|
+
Enum = 13,
|
|
313
|
+
Keyword = 14,
|
|
314
|
+
Snippet = 15,
|
|
315
|
+
Color = 16,
|
|
316
|
+
File = 17,
|
|
317
|
+
Reference = 18,
|
|
318
|
+
Folder = 19,
|
|
319
|
+
EnumMember = 20,
|
|
320
|
+
Constant = 21,
|
|
321
|
+
Struct = 22,
|
|
322
|
+
Event = 23,
|
|
323
|
+
Operator = 24,
|
|
324
|
+
TypeParameter = 25,
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Document highlight kind
|
|
328
|
+
*/
|
|
329
|
+
export declare enum DocumentHighlightKind {
|
|
330
|
+
Text = 1,
|
|
331
|
+
Read = 2,
|
|
332
|
+
Write = 3,
|
|
333
|
+
}
|
package/dist/src/lsp.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Dr,Rr,Mr,Or,Yt,As,Ps}from"../chunk-8tzd98q8.js";import"../chunk-y1g6v96c.js";import"../chunk-zk3w5sqv.js";import"../chunk-4fygcxtb.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{Mr as CompletionItemKind,Or as DocumentHighlightKind,Yt as DtsxLanguageServer,Dr as LspDiagnosticSeverity,Rr as SymbolKind,Ps as createFileWatcher,As as startLSPServer};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { Declaration, DtsGenerationConfig } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create memory-optimized configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare function createMemoryOptimizedConfig(baseConfig: DtsGenerationConfig, memoryConfig?: MemoryConfig): DtsGenerationConfig & { memory: Required<MemoryConfig> };
|
|
6
|
+
/**
|
|
7
|
+
* Estimate memory usage for a file
|
|
8
|
+
*/
|
|
9
|
+
export declare function estimateMemoryUsage(filePath: string): {
|
|
10
|
+
fileSizeMB: number
|
|
11
|
+
estimatedMemoryMB: number
|
|
12
|
+
recommendedChunkSize: number
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Format memory stats for display
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatMemoryStats(stats: MemoryStats): string;
|
|
18
|
+
/**
|
|
19
|
+
* Create a streaming processor with default config
|
|
20
|
+
*/
|
|
21
|
+
export declare function createStreamingProcessor(config?: MemoryConfig): StreamingProcessor;
|
|
22
|
+
/**
|
|
23
|
+
* Memory configuration options
|
|
24
|
+
*/
|
|
25
|
+
export declare interface MemoryConfig {
|
|
26
|
+
maxMemoryMB?: number
|
|
27
|
+
chunkSize?: number
|
|
28
|
+
aggressiveGC?: boolean
|
|
29
|
+
maxDeclarationsInMemory?: number
|
|
30
|
+
profile?: boolean
|
|
31
|
+
cleanupInterval?: number
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Memory usage statistics
|
|
35
|
+
*/
|
|
36
|
+
export declare interface MemoryStats {
|
|
37
|
+
heapUsed: number
|
|
38
|
+
heapTotal: number
|
|
39
|
+
external: number
|
|
40
|
+
arrayBuffers: number
|
|
41
|
+
rss: number
|
|
42
|
+
heapUsedMB: number
|
|
43
|
+
percentUsed: number
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Memory profiling entry
|
|
47
|
+
*/
|
|
48
|
+
export declare interface MemoryProfile {
|
|
49
|
+
timestamp: number
|
|
50
|
+
operation: string
|
|
51
|
+
memoryBefore: MemoryStats
|
|
52
|
+
memoryAfter: MemoryStats
|
|
53
|
+
duration: number
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Streaming file processor for large files
|
|
57
|
+
*/
|
|
58
|
+
export declare class StreamingProcessor {
|
|
59
|
+
private config;
|
|
60
|
+
private profiles;
|
|
61
|
+
private cleanupTimer;
|
|
62
|
+
constructor(config?: MemoryConfig);
|
|
63
|
+
startMonitoring(): void;
|
|
64
|
+
stopMonitoring(): void;
|
|
65
|
+
private checkMemoryAndCleanup;
|
|
66
|
+
triggerCleanup(): void;
|
|
67
|
+
getMemoryStats(): MemoryStats;
|
|
68
|
+
profile<T>(operation: string, fn: () => Promise<T>): Promise<T>;
|
|
69
|
+
getProfiles(): MemoryProfile[];
|
|
70
|
+
clearProfiles(): void;
|
|
71
|
+
streamFile(filePath: string): AsyncGenerator<string, void, unknown>;
|
|
72
|
+
processFileInChunks<T>(filePath: string, processor: (chunk: string[]) => Promise<T[]>, chunkLines?: number): Promise<T[]>;
|
|
73
|
+
streamWrite(filePath: string, contentGenerator: AsyncGenerator<string>): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Declaration pool for memory-efficient declaration management
|
|
77
|
+
*/
|
|
78
|
+
export declare class DeclarationPool {
|
|
79
|
+
private declarations;
|
|
80
|
+
private registry;
|
|
81
|
+
private maxSize;
|
|
82
|
+
constructor(maxSize?: number);
|
|
83
|
+
add(key: string, declaration: Declaration): void;
|
|
84
|
+
get(key: string): Declaration | undefined;
|
|
85
|
+
has(key: string): boolean;
|
|
86
|
+
delete(key: string): void;
|
|
87
|
+
clear(): void;
|
|
88
|
+
get size(): number;
|
|
89
|
+
private evictOldest;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Lazy loading wrapper for large objects
|
|
93
|
+
*/
|
|
94
|
+
export declare class LazyLoader<T> {
|
|
95
|
+
private value;
|
|
96
|
+
private loaded;
|
|
97
|
+
private loader;
|
|
98
|
+
constructor(loader: () => T | Promise<T>);
|
|
99
|
+
get(): Promise<T>;
|
|
100
|
+
isLoaded(): boolean;
|
|
101
|
+
unload(): void;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* String interning for memory efficiency
|
|
105
|
+
*/
|
|
106
|
+
export declare class StringInterner {
|
|
107
|
+
private strings;
|
|
108
|
+
private maxSize;
|
|
109
|
+
constructor(maxSize?: number);
|
|
110
|
+
intern(str: string): string;
|
|
111
|
+
get size(): number;
|
|
112
|
+
clear(): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Object pool for reusing declaration objects
|
|
116
|
+
*/
|
|
117
|
+
export declare class ObjectPool<T> {
|
|
118
|
+
private pool;
|
|
119
|
+
private factory;
|
|
120
|
+
private reset;
|
|
121
|
+
private maxSize;
|
|
122
|
+
constructor(factory: () => T, reset: (obj: T) => void, maxSize?: number);
|
|
123
|
+
acquire(): T;
|
|
124
|
+
release(obj: T): void;
|
|
125
|
+
get size(): number;
|
|
126
|
+
clear(): void;
|
|
127
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gt,hr,yr,br,wr,ds,ps,ms,gs}from"../chunk-2436cnmb.js";export{hr as DeclarationPool,yr as LazyLoader,wr as ObjectPool,Gt as StreamingProcessor,br as StringInterner,ds as createMemoryOptimizedConfig,gs as createStreamingProcessor,ps as estimateMemoryUsage,ms as formatMemoryStats};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Declaration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Merge declarations with the same name
|
|
4
|
+
*/
|
|
5
|
+
export declare function mergeDeclarations(declarations: Declaration[], config?: MergeConfig): MergeResult;
|
|
6
|
+
/**
|
|
7
|
+
* Merge declarations in content string
|
|
8
|
+
*/
|
|
9
|
+
export declare function mergeDeclarationsInContent(content: string, _config?: MergeConfig): string;
|
|
10
|
+
/**
|
|
11
|
+
* Merge configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare interface MergeConfig {
|
|
14
|
+
mergeInterfaces?: boolean
|
|
15
|
+
mergeNamespaces?: boolean
|
|
16
|
+
mergeTypes?: boolean
|
|
17
|
+
mergeEnums?: boolean
|
|
18
|
+
deduplicateIdentical?: boolean
|
|
19
|
+
conflictStrategy?: 'first' | 'last' | 'error'
|
|
20
|
+
preserveAllComments?: boolean
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result of merge operation
|
|
24
|
+
*/
|
|
25
|
+
export declare interface MergeResult {
|
|
26
|
+
declarations: Declaration[]
|
|
27
|
+
mergedCount: number
|
|
28
|
+
merges: MergeDetail[]
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Details of a single merge
|
|
32
|
+
*/
|
|
33
|
+
export declare interface MergeDetail {
|
|
34
|
+
name: string
|
|
35
|
+
kind: string
|
|
36
|
+
sourceCount: number
|
|
37
|
+
memberCount: number
|
|
38
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a relative re-export specifier to an absolute path on disk.
|
|
3
|
+
*
|
|
4
|
+
* Resolves local specifiers to normalized absolute native paths. Bare
|
|
5
|
+
* specifiers (e.g. `react`, `@scope/foo`) return `{ resolved: null }`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveRelativeSpecifier(specifier: string, fromFile: string): ResolveResult;
|
|
8
|
+
/** Share local alias ownership between graph traversal and declaration output. */
|
|
9
|
+
export declare function createModuleResolver(options: ModuleResolutionOptions): Promise<ModuleResolver>;
|
|
10
|
+
/**
|
|
11
|
+
* Scan grammatical module references. Re-exports are returned first, followed
|
|
12
|
+
* by static imports and import types, preserving each group's source order.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scanReExportSpecifiers(source: string, options?: { includeImports?: boolean }): ReExportRef[];
|
|
15
|
+
/** Rewrite only module literals, preserving raw spelling when their value is unchanged. */
|
|
16
|
+
export declare function rewriteModuleSpecifiers(source: string, rewrite: (specifier: string) => string): string;
|
|
17
|
+
/**
|
|
18
|
+
* BFS the re-export graph starting from `entrypoints`.
|
|
19
|
+
*
|
|
20
|
+
* Each entrypoint and every file reached via `export … from './x'`
|
|
21
|
+
* (recursively, with normalized path identities and cycle protection) ends up in `reachable`. Files
|
|
22
|
+
* whose source can't be read are skipped silently — the caller is the
|
|
23
|
+
* one with the right context to decide whether that's an error.
|
|
24
|
+
*/
|
|
25
|
+
export declare function collectReachableViaReExports(entrypoints: string[], options?: { includeImports?: boolean, resolveSpecifier?: ModuleResolver }): Promise<ReachabilityResult>;
|
|
26
|
+
/**
|
|
27
|
+
* A single relative re-export or import reference parsed out of source.
|
|
28
|
+
*/
|
|
29
|
+
export declare interface ReExportRef {
|
|
30
|
+
specifier: string
|
|
31
|
+
kind: 'export-star' | 'export-star-as' | 'export-named' | 'import'
|
|
32
|
+
isTypeOnly: boolean
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result of resolving a specifier to disk.
|
|
36
|
+
*/
|
|
37
|
+
export declare interface ResolveResult {
|
|
38
|
+
resolved: string | null
|
|
39
|
+
isRelative: boolean
|
|
40
|
+
isAlias?: boolean
|
|
41
|
+
suffix?: string
|
|
42
|
+
}
|
|
43
|
+
export declare interface ModuleResolutionOptions {
|
|
44
|
+
cwd: string
|
|
45
|
+
root: string
|
|
46
|
+
tsconfigPath?: string
|
|
47
|
+
outputStructure?: 'mirror' | 'flat'
|
|
48
|
+
}
|
|
49
|
+
export declare interface ModuleResolver {
|
|
50
|
+
(specifier: string, fromFile: string): ResolveResult
|
|
51
|
+
isPackageLocal?: (fromFile: string, target: string) => boolean
|
|
52
|
+
cacheKey?: (files: string[]) => string
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* An unresolved relative re-export discovered during traversal.
|
|
56
|
+
*/
|
|
57
|
+
export declare interface UnresolvedReExport {
|
|
58
|
+
from: string
|
|
59
|
+
specifier: string
|
|
60
|
+
isTypeOnly: boolean
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Result of walking the re-export graph from a set of entrypoints.
|
|
64
|
+
*/
|
|
65
|
+
export declare interface ReachabilityResult {
|
|
66
|
+
reachable: Set<string>
|
|
67
|
+
reExports: Map<string, ReExportRef[]>
|
|
68
|
+
unresolved: UnresolvedReExport[]
|
|
69
|
+
sources: ReadonlyMap<string, string>
|
|
70
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Y,Ce,k,Sn,V}from"../chunk-p9vfxn8g.js";import"../chunk-qzjzw9p2.js";import"../chunk-cpmqa8kd.js";import"../chunk-73dzve1s.js";import"../chunk-yay68832.js";import"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{V as collectReachableViaReExports,Ce as createModuleResolver,Y as resolveRelativeSpecifier,Sn as rewriteModuleSpecifiers,k as scanReExportSpecifiers};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function tokenizeDeclarationSyntax(source: string): SyntaxToken[];
|
|
2
|
+
/**
|
|
3
|
+
* Tokens of a whole source file, shared by the analyses of one scan (module
|
|
4
|
+
* detection, expando properties, call inference) instead of re-lexing the
|
|
5
|
+
* same text for each. The array is read-only and reused for the same string.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sourceSyntaxTokens(source: string): readonly SyntaxToken[];
|
|
8
|
+
/** Drop the shared whole-source tokens (part of clearing extraction caches). */
|
|
9
|
+
export declare function clearSourceSyntaxTokens(): void;
|
|
10
|
+
/** Decode a quoted module literal without executing or transpiling source. */
|
|
11
|
+
export declare function decodeStringLiteral(literal: string): string | undefined;
|
|
12
|
+
/** Preserve the caller's quote style while safely spelling a new module value. */
|
|
13
|
+
export declare function quoteModuleSpecifier(value: string, quote: string): string;
|
|
14
|
+
/** Parse one complete external import-equals declaration, including trivia. */
|
|
15
|
+
export declare function parseImportEquals(source: string): { name: string, source: string, isTypeOnly: boolean, end: number } | undefined;
|
|
16
|
+
/** Source-order grammatical module literals, retaining spans for safe rewriting. */
|
|
17
|
+
export declare function scanModuleReferences(source: string): ModuleReference[];
|
|
18
|
+
export declare interface SyntaxToken {
|
|
19
|
+
start: number
|
|
20
|
+
end: number
|
|
21
|
+
kind: 'word' | 'quoted' | 'punctuation' | 'literal'
|
|
22
|
+
}
|
|
23
|
+
export declare interface ModuleReference {
|
|
24
|
+
specifier: string
|
|
25
|
+
kind: 'export-star' | 'export-star-as' | 'export-named' | 'import'
|
|
26
|
+
isTypeOnly: boolean
|
|
27
|
+
category: 'export' | 'static-import' | 'import-type' | 'augmentation'
|
|
28
|
+
start: number
|
|
29
|
+
end: number
|
|
30
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{t,F,Jn,d,x,Me,m}from"../chunk-1j6092xz.js";import"../chunk-zq93f8ca.js";export{Jn as clearSourceSyntaxTokens,d as decodeStringLiteral,Me as parseImportEquals,x as quoteModuleSpecifier,m as scanModuleReferences,F as sourceSyntaxTokens,t as tokenizeDeclarationSyntax};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DtsGenerationConfig } from './types.js';
|
|
2
|
+
export declare function loadCompilerOptions(path: string, overrides?: CompilerOptions): CompilerOptions;
|
|
3
|
+
export declare function typeCheck(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
|
|
4
|
+
export declare function validateDeclarations(files: string[], config?: TypeCheckConfig): Promise<TypeCheckResult>;
|
|
5
|
+
export declare function checkIsolatedDeclarations(files: string[]): Promise<Map<string, IsolatedDeclarationsResult>>;
|
|
6
|
+
export declare function getTypeAtPosition(file: string, line: number, column: number): string | null;
|
|
7
|
+
export declare function getQuickInfo(file: string, line: number, column: number): { type: string, documentation?: string } | null;
|
|
8
|
+
export declare function formatTypeCheckResults(result: TypeCheckResult): string;
|
|
9
|
+
export declare function typeCheckWithConfig(config: DtsGenerationConfig): Promise<TypeCheckResult>;
|
|
10
|
+
export declare function validateGeneratedDeclarations(sourceFiles: string[], declarationFiles: string[]): Promise<{ valid: boolean, mismatches: Array<{ sourceName: string, sourceType: string, dtsType: string }> }>;
|
|
11
|
+
export declare interface TypeDiagnostic {
|
|
12
|
+
file: string
|
|
13
|
+
line: number
|
|
14
|
+
column: number
|
|
15
|
+
message: string
|
|
16
|
+
code: number
|
|
17
|
+
severity: DiagnosticSeverity
|
|
18
|
+
source?: string
|
|
19
|
+
suggestion?: string
|
|
20
|
+
category: string
|
|
21
|
+
}
|
|
22
|
+
export declare interface TypeCheckResult {
|
|
23
|
+
success: boolean
|
|
24
|
+
diagnostics: TypeDiagnostic[]
|
|
25
|
+
errorCount: number
|
|
26
|
+
warningCount: number
|
|
27
|
+
infoCount: number
|
|
28
|
+
filesChecked: string[]
|
|
29
|
+
durationMs: number
|
|
30
|
+
}
|
|
31
|
+
export declare interface TypeCheckConfig {
|
|
32
|
+
tsconfigPath?: string
|
|
33
|
+
rootDir?: string
|
|
34
|
+
strict?: boolean
|
|
35
|
+
declarationsOnly?: boolean
|
|
36
|
+
skipLibCheck?: boolean
|
|
37
|
+
include?: string[]
|
|
38
|
+
exclude?: string[]
|
|
39
|
+
warningsAsErrors?: boolean
|
|
40
|
+
maxErrors?: number
|
|
41
|
+
compilerOptions?: CompilerOptions
|
|
42
|
+
}
|
|
43
|
+
export declare interface IsolatedDeclarationsIssue {
|
|
44
|
+
line: number
|
|
45
|
+
column: number
|
|
46
|
+
message: string
|
|
47
|
+
declarationName?: string
|
|
48
|
+
missingAnnotation?: 'return' | 'parameter' | 'variable' | 'property'
|
|
49
|
+
}
|
|
50
|
+
export declare interface IsolatedDeclarationsResult {
|
|
51
|
+
compatible: boolean
|
|
52
|
+
issues: IsolatedDeclarationsIssue[]
|
|
53
|
+
}
|
|
54
|
+
export type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
55
|
+
export type CompilerOptions = Record<string, unknown>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hs,at,xr,ys,Cr,bs,ws,xs,Cs}from"../chunk-a7nvyxpg.js";import"../chunk-danfamyx.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{ys as checkIsolatedDeclarations,ws as formatTypeCheckResults,bs as getQuickInfo,Cr as getTypeAtPosition,hs as loadCompilerOptions,at as typeCheck,xs as typeCheckWithConfig,xr as validateDeclarations,Cs as validateGeneratedDeclarations};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Whether declaration emission can run on the native engine in this process. */
|
|
2
|
+
export declare function nativeEngineAvailable(): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Emit declarations natively. Returns `null` when the engine is unavailable or
|
|
5
|
+
* the native emitter rejects the input, so the caller can use the TypeScript
|
|
6
|
+
* engine instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function emitWithNativeEngine(source: string, options: NativeEmitOptions): string | null;
|
|
9
|
+
/** Options for one native emission. */
|
|
10
|
+
export declare interface NativeEmitOptions {
|
|
11
|
+
keepComments: boolean
|
|
12
|
+
isolatedDeclarations: boolean
|
|
13
|
+
sourceFile?: string
|
|
14
|
+
inferenceSources?: ReadonlyMap<string, string>
|
|
15
|
+
augmentationImports?: ReadonlySet<string>
|
|
16
|
+
}
|