@tsonic/tsbindgen 0.7.25 → 0.7.27
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/README.md +10 -37
- package/lib/cs/System.CommandLine.resources.dll +0 -0
- package/lib/de/System.CommandLine.resources.dll +0 -0
- package/lib/es/System.CommandLine.resources.dll +0 -0
- package/lib/fr/System.CommandLine.resources.dll +0 -0
- package/lib/it/System.CommandLine.resources.dll +0 -0
- package/lib/ja/System.CommandLine.resources.dll +0 -0
- package/lib/ko/System.CommandLine.resources.dll +0 -0
- package/lib/pl/System.CommandLine.resources.dll +0 -0
- package/lib/pt-BR/System.CommandLine.resources.dll +0 -0
- package/lib/ru/System.CommandLine.resources.dll +0 -0
- package/lib/tr/System.CommandLine.resources.dll +0 -0
- package/lib/tsbindgen +0 -0
- package/lib/tsbindgen.dll +0 -0
- package/lib/tsbindgen.pdb +0 -0
- package/lib/zh-Hans/System.CommandLine.resources.dll +0 -0
- package/lib/zh-Hant/System.CommandLine.resources.dll +0 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ tsbindgen generates TypeScript declaration files (`.d.ts`) from .NET assemblies
|
|
|
10
10
|
- **Zero TypeScript errors** - Output validates cleanly with `tsc --strict`
|
|
11
11
|
- **Nullable reference types** - NRT support for output positions (returns, properties, fields)
|
|
12
12
|
- **CLR primitives** - Numeric type aliases (`int`, `long`, `decimal`, etc.) via `@tsonic/core`
|
|
13
|
-
- **
|
|
13
|
+
- **CLR-faithful names** - No casing transforms; member names match the CLR surface
|
|
14
14
|
- **Generic type preservation** - Full generic type parameter support with constraints
|
|
15
|
-
- **
|
|
15
|
+
- **Unified bindings manifest** - CLR-specific information lives in `<Namespace>/bindings.json` (no metadata sidecars)
|
|
16
16
|
- **Library mode** - Generate only your assembly's types, importing BCL types from pre-existing packages
|
|
17
17
|
- **Namespace mapping** - Customize output directory names with `--namespace-map`
|
|
18
18
|
- **Class flattening** - Export static class methods as top-level functions with `--flatten-class`
|
|
@@ -89,7 +89,6 @@ npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./my-lib --lib .
|
|
|
89
89
|
| `--ref-dir` | - | Additional directory to search for referenced assemblies (repeatable) | - |
|
|
90
90
|
| `--out-dir` | `-o` | Output directory for generated files | `out` |
|
|
91
91
|
| `--namespaces` | `-n` | Namespace filter (reserved; currently ignored) | (all) |
|
|
92
|
-
| `--naming` | - | Naming convention: `js` (camelCase) or `clr` (PascalCase) | `clr` |
|
|
93
92
|
| `--lib` | - | Path to pre-existing tsbindgen package (repeatable) | - |
|
|
94
93
|
| `--namespace-map` | - | Map CLR namespace to output name (repeatable) | - |
|
|
95
94
|
| `--flatten-class` | - | Flatten static class to top-level exports (repeatable) | - |
|
|
@@ -113,9 +112,6 @@ npx tsbindgen resolve-closure \
|
|
|
113
112
|
### Examples
|
|
114
113
|
|
|
115
114
|
```bash
|
|
116
|
-
# Generate BCL with JavaScript naming
|
|
117
|
-
npx tsbindgen generate -d $DOTNET_RUNTIME -o ./out --naming js
|
|
118
|
-
|
|
119
115
|
# Generate a custom assembly when dependencies live outside the runtime directory
|
|
120
116
|
npx tsbindgen generate -a ./MyLibrary.dll -d $DOTNET_RUNTIME -o ./out \
|
|
121
117
|
--ref-dir ./libs
|
|
@@ -139,16 +135,12 @@ output/
|
|
|
139
135
|
├── System.js # Runtime stub (throws)
|
|
140
136
|
├── System/
|
|
141
137
|
│ ├── bindings.json
|
|
142
|
-
│ └── internal/
|
|
143
|
-
│ ├── index.d.ts # Full declarations
|
|
144
|
-
│ └── metadata.json # CLR semantics
|
|
138
|
+
│ └── internal/index.d.ts # Full declarations
|
|
145
139
|
├── System.Collections.Generic.d.ts
|
|
146
140
|
├── System.Collections.Generic.js
|
|
147
141
|
└── System.Collections.Generic/
|
|
148
142
|
├── bindings.json
|
|
149
|
-
└── internal/
|
|
150
|
-
├── index.d.ts
|
|
151
|
-
└── metadata.json
|
|
143
|
+
└── internal/index.d.ts
|
|
152
144
|
```
|
|
153
145
|
|
|
154
146
|
### Publishing Bindings Packages (dist/ + npm `exports`)
|
|
@@ -161,9 +153,7 @@ dist/tsonic/bindings/
|
|
|
161
153
|
Acme.Domain.d.ts
|
|
162
154
|
Acme.Domain/
|
|
163
155
|
bindings.json
|
|
164
|
-
internal/
|
|
165
|
-
index.d.ts
|
|
166
|
-
metadata.json
|
|
156
|
+
internal/index.d.ts
|
|
167
157
|
```
|
|
168
158
|
|
|
169
159
|
`package.json`:
|
|
@@ -196,8 +186,7 @@ Tsonic resolves the import using Node’s module resolution (including `exports`
|
|
|
196
186
|
| `<Namespace>.d.ts` | Public facade with curated exports and friendly aliases |
|
|
197
187
|
| `<Namespace>.js` | Module stub that throws if executed in Node |
|
|
198
188
|
| `<Namespace>/internal/index.d.ts` | Full type declarations (`$instance` + `__views`) |
|
|
199
|
-
| `<Namespace>/
|
|
200
|
-
| `<Namespace>/bindings.json` | CLR↔TS name mappings for the Tsonic compiler |
|
|
189
|
+
| `<Namespace>/bindings.json` | CLR bindings manifest for the Tsonic compiler (names + CLR semantics) |
|
|
201
190
|
|
|
202
191
|
## Extension Methods (C# `using` Semantics)
|
|
203
192
|
|
|
@@ -217,14 +206,9 @@ import type { IEnumerable } from "@tsonic/dotnet/System.Collections.Generic.js";
|
|
|
217
206
|
type LinqSeq<T> = Linq<IEnumerable<T>>;
|
|
218
207
|
|
|
219
208
|
declare const xs: LinqSeq<number>;
|
|
220
|
-
xs.
|
|
209
|
+
xs.Where((x) => x > 0).Select((x) => x * 2);
|
|
221
210
|
```
|
|
222
211
|
|
|
223
|
-
Naming mode applies to extension method member names too:
|
|
224
|
-
|
|
225
|
-
- `--naming clr`: `.Where(...)`, `.Select(...)`
|
|
226
|
-
- `--naming js`: `.where(...)`, `.select(...)`
|
|
227
|
-
|
|
228
212
|
## Type Mapping
|
|
229
213
|
|
|
230
214
|
### Primitive Types
|
|
@@ -271,19 +255,9 @@ import { List } from "@tsonic/dotnet/System.Collections.Generic.js"; // Friendl
|
|
|
271
255
|
| Delegate | `type` (function signature + CLR type intersection) |
|
|
272
256
|
| Static class | `abstract class` (static methods only) |
|
|
273
257
|
|
|
274
|
-
## Naming
|
|
275
|
-
|
|
276
|
-
### Default (CLR) Naming
|
|
277
|
-
```typescript
|
|
278
|
-
list.GetEnumerator(); // PascalCase
|
|
279
|
-
Console.WriteLine(); // PascalCase
|
|
280
|
-
```
|
|
258
|
+
## Naming
|
|
281
259
|
|
|
282
|
-
|
|
283
|
-
```typescript
|
|
284
|
-
list.getEnumerator(); // camelCase
|
|
285
|
-
Console.writeLine(); // camelCase
|
|
286
|
-
```
|
|
260
|
+
tsbindgen emits **CLR-faithful names** (no casing transforms).
|
|
287
261
|
|
|
288
262
|
## Testing
|
|
289
263
|
|
|
@@ -344,8 +318,7 @@ dotnet run --project src/tsbindgen/tsbindgen.csproj -- <args>
|
|
|
344
318
|
|
|
345
319
|
## Related Projects
|
|
346
320
|
|
|
347
|
-
- **[@tsonic/dotnet](https://www.npmjs.com/package/@tsonic/dotnet)** - Pre-generated BCL types
|
|
348
|
-
- **[@tsonic/dotnet-pure](https://www.npmjs.com/package/@tsonic/dotnet-pure)** - Pre-generated BCL types with CLR naming
|
|
321
|
+
- **[@tsonic/dotnet](https://www.npmjs.com/package/@tsonic/dotnet)** - Pre-generated BCL types (generated by tsbindgen)
|
|
349
322
|
- **[@tsonic/core](https://www.npmjs.com/package/@tsonic/core)** - Tsonic runtime types and primitives
|
|
350
323
|
|
|
351
324
|
## License
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/tsbindgen
ADDED
|
Binary file
|
package/lib/tsbindgen.dll
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsonic/tsbindgen",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.27",
|
|
4
4
|
"description": "Generate TypeScript declarations from .NET assemblies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "dotnet publish src/tsbindgen/tsbindgen.csproj -c Release -o lib/"
|
|
21
|
+
"build": "dotnet publish src/tsbindgen/tsbindgen.csproj -c Release -o lib/",
|
|
22
|
+
"prepack": "npm run build",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
22
24
|
},
|
|
23
25
|
"keywords": [
|
|
24
26
|
"tsonic",
|