You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+178-2Lines changed: 178 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@
12
12
13
13
## Features
14
14
15
+
- 🎯 Narrowest possible type inference — no `isolatedDeclarations` needed
15
16
- ⚡ Extremely fast .d.ts generation
16
17
- 🔄 Parallel processing support
17
18
- 📥 Stdin/stdout support for piping
@@ -21,6 +22,122 @@
21
22
- 👀 Watch mode for development
22
23
- ✅ Built-in validation
23
24
25
+
## Type Inference — dtsx vs oxc vs tsc
26
+
27
+
dtsx generates the **narrowest possible types** from your source values — no `isolatedDeclarations` flag required, no explicit type annotations needed. Where other tools emit broad types like `string`, `number`, or `number[]`, dtsx preserves the exact literal types from your code.
28
+
29
+
All output below is real — same source file, three tools, nothing hand-edited.
dtsx infers the narrowest possible type from every value — no `as const`, no explicit annotations, no `isolatedDeclarations` flag required. Just write normal TypeScript.
140
+
24
141
## Install
25
142
26
143
```bash
@@ -40,12 +157,12 @@ pkgx install dtsx # wip
40
157
41
158
There are two ways of using this ".d.ts generation" tool: _as a library or as a CLI._
42
159
43
-
_But before you get started, please ensure you enabled `isolatedDeclarations`in your `tsconfig.json` file._
160
+
_dtsx works out of the box — no `isolatedDeclarations`required. It infers narrow types directly from your source values. If you do enable `isolatedDeclarations`, dtsx uses it as a fast path to skip initializer parsing when explicit type annotations are present._
44
161
45
162
```json
46
163
{
47
164
"compilerOptions": {
48
-
"isolatedDeclarations": true
165
+
"isolatedDeclarations": true// optional — dtsx works great without it
0 commit comments