@tsonic/dotnet 10.0.40 → 10.0.41

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.
Files changed (187) hide show
  1. package/Internal/internal/index.d.ts +4 -3
  2. package/Microsoft.CSharp.RuntimeBinder/internal/index.d.ts +19 -18
  3. package/Microsoft.VisualBasic/internal/index.d.ts +52 -54
  4. package/Microsoft.VisualBasic.CompilerServices/internal/index.d.ts +117 -119
  5. package/Microsoft.VisualBasic.FileIO/internal/index.d.ts +3 -2
  6. package/Microsoft.Win32/internal/index.d.ts +19 -18
  7. package/Microsoft.Win32.SafeHandles/internal/index.d.ts +3 -2
  8. package/README.md +76 -104
  9. package/System/bindings.json +1520 -2039
  10. package/System/internal/index.d.ts +1549 -1602
  11. package/System.Buffers/bindings.json +12 -3
  12. package/System.Buffers/internal/index.d.ts +12 -14
  13. package/System.Buffers.Binary/internal/index.d.ts +2 -4
  14. package/System.Buffers.Text/internal/index.d.ts +2 -4
  15. package/System.CodeDom.Compiler/internal/index.d.ts +32 -31
  16. package/System.Collections/internal/index.d.ts +129 -131
  17. package/System.Collections.Concurrent/bindings.json +218 -218
  18. package/System.Collections.Concurrent/internal/index.d.ts +34 -36
  19. package/System.Collections.Frozen/bindings.json +413 -611
  20. package/System.Collections.Frozen/internal/index.d.ts +81 -97
  21. package/System.Collections.Frozen.d.ts +14 -2
  22. package/System.Collections.Generic/bindings.json +9420 -14155
  23. package/System.Collections.Generic/internal/index.d.ts +547 -758
  24. package/System.Collections.Generic.d.ts +1 -1
  25. package/System.Collections.Immutable/bindings.json +6000 -9080
  26. package/System.Collections.Immutable/internal/index.d.ts +265 -354
  27. package/System.Collections.Immutable.d.ts +49 -12
  28. package/System.Collections.ObjectModel/bindings.json +132 -654
  29. package/System.Collections.ObjectModel/internal/index.d.ts +10 -30
  30. package/System.Collections.Specialized/bindings.json +0 -123
  31. package/System.Collections.Specialized/internal/index.d.ts +88 -101
  32. package/System.ComponentModel/bindings.json +163 -102
  33. package/System.ComponentModel/internal/index.d.ts +618 -608
  34. package/System.ComponentModel.DataAnnotations/internal/index.d.ts +133 -132
  35. package/System.ComponentModel.DataAnnotations.Schema/internal/index.d.ts +8 -7
  36. package/System.ComponentModel.Design/bindings.json +22 -292
  37. package/System.ComponentModel.Design/internal/index.d.ts +101 -109
  38. package/System.ComponentModel.Design.Serialization/internal/index.d.ts +61 -60
  39. package/System.ComponentModel.d.ts +1 -0
  40. package/System.Configuration.Assemblies/internal/index.d.ts +3 -2
  41. package/System.Data/bindings.json +4 -1
  42. package/System.Data/internal/index.d.ts +351 -350
  43. package/System.Data.Common/internal/index.d.ts +151 -152
  44. package/System.Data.SqlTypes/internal/index.d.ts +68 -67
  45. package/System.Diagnostics/bindings.json +7044 -7249
  46. package/System.Diagnostics/internal/index.d.ts +446 -461
  47. package/System.Diagnostics.CodeAnalysis/internal/index.d.ts +44 -43
  48. package/System.Diagnostics.Contracts/internal/index.d.ts +16 -18
  49. package/System.Diagnostics.Metrics/internal/index.d.ts +92 -94
  50. package/System.Diagnostics.Metrics.d.ts +1 -1
  51. package/System.Diagnostics.SymbolStore/internal/index.d.ts +12 -11
  52. package/System.Diagnostics.Tracing/bindings.json +81 -21
  53. package/System.Diagnostics.Tracing/internal/index.d.ts +69 -56
  54. package/System.Diagnostics.Tracing.d.ts +2 -1
  55. package/System.Drawing/internal/index.d.ts +76 -75
  56. package/System.Dynamic/internal/index.d.ts +55 -57
  57. package/System.Formats.Asn1/bindings.json +48 -69
  58. package/System.Formats.Asn1/internal/index.d.ts +21 -28
  59. package/System.Formats.Tar/internal/index.d.ts +8 -7
  60. package/System.Globalization/internal/index.d.ts +40 -42
  61. package/System.IO/internal/index.d.ts +187 -189
  62. package/System.IO.Compression/internal/index.d.ts +29 -31
  63. package/System.IO.Enumeration/bindings.json +250 -250
  64. package/System.IO.Enumeration/internal/index.d.ts +15 -17
  65. package/System.IO.IsolatedStorage/internal/index.d.ts +19 -18
  66. package/System.IO.MemoryMappedFiles/internal/index.d.ts +11 -10
  67. package/System.IO.Pipelines/internal/index.d.ts +15 -17
  68. package/System.IO.Pipes/internal/index.d.ts +8 -7
  69. package/System.Linq/internal/index.d.ts +223 -225
  70. package/System.Linq.Expressions/internal/index.d.ts +205 -207
  71. package/System.Linq.Expressions.Interpreter/internal/index.d.ts +5 -4
  72. package/System.Net/bindings.json +104 -104
  73. package/System.Net/internal/index.d.ts +279 -281
  74. package/System.Net.Cache/internal/index.d.ts +3 -2
  75. package/System.Net.Http/internal/index.d.ts +128 -130
  76. package/System.Net.Http.Headers/bindings.json +0 -204
  77. package/System.Net.Http.Headers/internal/index.d.ts +111 -127
  78. package/System.Net.Http.Json/internal/index.d.ts +67 -69
  79. package/System.Net.Http.Metrics/internal/index.d.ts +6 -5
  80. package/System.Net.Mail/internal/index.d.ts +76 -78
  81. package/System.Net.Mime/internal/index.d.ts +11 -10
  82. package/System.Net.NetworkInformation/internal/index.d.ts +30 -32
  83. package/System.Net.Quic/internal/index.d.ts +10 -9
  84. package/System.Net.Security/internal/index.d.ts +87 -89
  85. package/System.Net.ServerSentEvents/internal/index.d.ts +6 -5
  86. package/System.Net.Sockets/internal/index.d.ts +91 -93
  87. package/System.Net.WebSockets/internal/index.d.ts +47 -46
  88. package/System.Numerics/bindings.json +544 -116
  89. package/System.Numerics/internal/index.d.ts +110 -112
  90. package/System.Reflection/internal/index.d.ts +270 -272
  91. package/System.Reflection.Emit/internal/index.d.ts +114 -116
  92. package/System.Reflection.Metadata/bindings.json +166 -3169
  93. package/System.Reflection.Metadata/internal/index.d.ts +154 -361
  94. package/System.Reflection.Metadata.Ecma335/internal/index.d.ts +13 -15
  95. package/System.Reflection.PortableExecutable/bindings.json +58 -0
  96. package/System.Reflection.PortableExecutable/internal/index.d.ts +24 -11
  97. package/System.Reflection.PortableExecutable.d.ts +1 -0
  98. package/System.Resources/internal/index.d.ts +33 -35
  99. package/System.Runtime/internal/index.d.ts +12 -11
  100. package/System.Runtime.CompilerServices/bindings.json +519 -717
  101. package/System.Runtime.CompilerServices/internal/index.d.ts +113 -137
  102. package/System.Runtime.CompilerServices.d.ts +14 -4
  103. package/System.Runtime.ConstrainedExecution/internal/index.d.ts +3 -2
  104. package/System.Runtime.ExceptionServices/internal/index.d.ts +4 -3
  105. package/System.Runtime.InteropServices/bindings.json +101 -101
  106. package/System.Runtime.InteropServices/internal/index.d.ts +234 -236
  107. package/System.Runtime.InteropServices.ComTypes/internal/index.d.ts +34 -36
  108. package/System.Runtime.InteropServices.Java/internal/index.d.ts +4 -6
  109. package/System.Runtime.InteropServices.JavaScript/bindings.json +328 -328
  110. package/System.Runtime.InteropServices.JavaScript/internal/index.d.ts +67 -69
  111. package/System.Runtime.InteropServices.JavaScript.d.ts +8 -26
  112. package/System.Runtime.InteropServices.Marshalling/bindings.json +2619 -2619
  113. package/System.Runtime.InteropServices.Marshalling/internal/index.d.ts +308 -310
  114. package/System.Runtime.InteropServices.ObjectiveC/bindings.json +141 -141
  115. package/System.Runtime.InteropServices.ObjectiveC/internal/index.d.ts +17 -19
  116. package/System.Runtime.InteropServices.Swift/internal/index.d.ts +4 -6
  117. package/System.Runtime.InteropServices.Swift.d.ts +1 -1
  118. package/System.Runtime.Intrinsics/bindings.json +64 -16
  119. package/System.Runtime.Intrinsics/internal/index.d.ts +22 -24
  120. package/System.Runtime.Intrinsics.Arm/internal/index.d.ts +12 -13
  121. package/System.Runtime.Intrinsics.Wasm/internal/index.d.ts +2 -4
  122. package/System.Runtime.Intrinsics.X86/internal/index.d.ts +42 -41
  123. package/System.Runtime.Loader/bindings.json +48 -69
  124. package/System.Runtime.Loader/internal/index.d.ts +30 -34
  125. package/System.Runtime.Remoting/internal/index.d.ts +5 -4
  126. package/System.Runtime.Serialization/internal/index.d.ts +175 -177
  127. package/System.Runtime.Serialization.DataContracts/internal/index.d.ts +29 -31
  128. package/System.Runtime.Serialization.Formatters/internal/index.d.ts +7 -6
  129. package/System.Runtime.Serialization.Formatters.Binary/internal/index.d.ts +10 -9
  130. package/System.Runtime.Serialization.Json/internal/index.d.ts +37 -36
  131. package/System.Runtime.Versioning/internal/index.d.ts +20 -19
  132. package/System.Security/internal/index.d.ts +64 -66
  133. package/System.Security.AccessControl/bindings.json +104 -0
  134. package/System.Security.AccessControl/internal/index.d.ts +59 -58
  135. package/System.Security.AccessControl.d.ts +6 -5
  136. package/System.Security.Authentication/internal/index.d.ts +7 -6
  137. package/System.Security.Authentication.ExtendedProtection/internal/index.d.ts +12 -11
  138. package/System.Security.Claims/internal/index.d.ts +45 -44
  139. package/System.Security.Cryptography/bindings.json +469 -469
  140. package/System.Security.Cryptography/internal/index.d.ts +269 -271
  141. package/System.Security.Cryptography.X509Certificates/bindings.json +0 -62
  142. package/System.Security.Cryptography.X509Certificates/internal/index.d.ts +98 -105
  143. package/System.Security.Permissions/internal/index.d.ts +5 -4
  144. package/System.Security.Policy/internal/index.d.ts +11 -10
  145. package/System.Security.Principal/internal/index.d.ts +28 -27
  146. package/System.Text/bindings.json +1562 -1562
  147. package/System.Text/internal/index.d.ts +119 -121
  148. package/System.Text.Encodings.Web/internal/index.d.ts +2 -4
  149. package/System.Text.Json/bindings.json +0 -290
  150. package/System.Text.Json/internal/index.d.ts +135 -153
  151. package/System.Text.Json.Nodes/internal/index.d.ts +60 -62
  152. package/System.Text.Json.Schema/internal/index.d.ts +9 -8
  153. package/System.Text.Json.Serialization/internal/index.d.ts +32 -34
  154. package/System.Text.Json.Serialization.Metadata/internal/index.d.ts +86 -85
  155. package/System.Text.Json.Serialization.d.ts +1 -1
  156. package/System.Text.RegularExpressions/bindings.json +198 -402
  157. package/System.Text.RegularExpressions/internal/index.d.ts +48 -64
  158. package/System.Text.Unicode/bindings.json +508 -508
  159. package/System.Text.Unicode/internal/index.d.ts +29 -31
  160. package/System.Threading/bindings.json +42 -42
  161. package/System.Threading/internal/index.d.ts +157 -159
  162. package/System.Threading.Channels/internal/index.d.ts +10 -12
  163. package/System.Threading.Tasks/bindings.json +4 -1
  164. package/System.Threading.Tasks/internal/index.d.ts +115 -114
  165. package/System.Threading.Tasks.Dataflow/internal/index.d.ts +32 -33
  166. package/System.Threading.Tasks.Sources/internal/index.d.ts +6 -5
  167. package/System.Timers/internal/index.d.ts +8 -7
  168. package/System.Transactions/internal/index.d.ts +31 -30
  169. package/System.Web/internal/index.d.ts +32 -31
  170. package/System.Windows.Input/internal/index.d.ts +5 -4
  171. package/System.Windows.Markup/internal/index.d.ts +3 -2
  172. package/System.Xml/internal/index.d.ts +383 -385
  173. package/System.Xml.Linq/internal/index.d.ts +103 -102
  174. package/System.Xml.Resolvers/internal/index.d.ts +10 -9
  175. package/System.Xml.Schema/bindings.json +76 -76
  176. package/System.Xml.Schema/internal/index.d.ts +233 -232
  177. package/System.Xml.Serialization/bindings.json +193 -0
  178. package/System.Xml.Serialization/internal/index.d.ts +277 -245
  179. package/System.Xml.Serialization.d.ts +2 -0
  180. package/System.Xml.XPath/internal/index.d.ts +46 -45
  181. package/System.Xml.Xsl/internal/index.d.ts +53 -52
  182. package/System.Xml.Xsl.Runtime/bindings.json +4 -1
  183. package/System.Xml.Xsl.Runtime/internal/index.d.ts +35 -37
  184. package/System.d.ts +2 -2
  185. package/__internal/extensions/index.d.ts +517 -515
  186. package/families.json +63 -7
  187. package/package.json +2 -2
package/README.md CHANGED
@@ -1,143 +1,115 @@
1
1
  # @tsonic/dotnet
2
2
 
3
- TypeScript type definitions for .NET 10 BCL (Base Class Library).
3
+ TypeScript declarations and CLR binding metadata for the .NET 10 base class library.
4
4
 
5
- ## Versioning
6
-
7
- This repo is versioned by **.NET major**:
8
-
9
- - **.NET 10** → `versions/10/` → npm: `@tsonic/dotnet@10.x`
10
-
11
- When publishing, run: `npm publish versions/10 --access public`
5
+ `@tsonic/dotnet` is a generated binding package. It gives Tsonic projects an
6
+ importable TypeScript surface for `Microsoft.NETCore.App` assemblies while the
7
+ compiled program still targets the real .NET runtime assemblies.
12
8
 
13
- ## Features
14
-
15
- - ✅ **Complete .NET 10 BCL coverage** - 130 namespaces, 4,296 types, 50,675 members
16
- - ✅ **camelCase members** - TypeScript-friendly naming conventions
17
- - ✅ **Friendly generic aliases** - Use `List<T>` instead of `List_1<T>`
18
- - ✅ **Primitive aliases** - `int`, `long`, `decimal`, etc. via `@tsonic/core`
19
- - ✅ **Full type safety** - Zero TypeScript errors
20
-
21
- ## Installation
9
+ ## Install
22
10
 
23
11
  ```bash
24
12
  npm install @tsonic/dotnet @tsonic/core
25
13
  ```
26
14
 
27
- ## Usage
15
+ ## Use with Tsonic
28
16
 
29
- ### Collections
17
+ Default CLR workspaces include the BCL binding package in the normal compiler
18
+ setup. Import CLR namespaces explicitly:
30
19
 
31
- ```typescript
32
- import type { List, Dictionary, HashSet } from "@tsonic/dotnet/System.Collections.Generic.js";
33
- import type { int, decimal } from "@tsonic/core/types.js";
34
-
35
- const ages: List<int> = null!;
36
- const prices: Dictionary<string, decimal> = null!;
37
- const uniqueIds: HashSet<int> = null!;
38
- ```
39
-
40
- ### Async Programming
41
-
42
- ```typescript
43
- import type { Task } from "@tsonic/dotnet/System.Threading.Tasks.js";
20
+ ```ts
21
+ import { Console } from "@tsonic/dotnet/System.js";
22
+ import { List } from "@tsonic/dotnet/System.Collections.Generic.js";
44
23
  import type { int } from "@tsonic/core/types.js";
45
24
 
46
- const asyncResult: Task<int> = null!;
25
+ export function main(): void {
26
+ const values = new List<int>();
27
+ values.Add(42);
28
+ Console.WriteLine(values.Count.ToString());
29
+ }
47
30
  ```
48
31
 
49
- ### Core Types
32
+ ## Package shape
50
33
 
51
- ```typescript
52
- import type { Nullable, Action, Func } from "@tsonic/dotnet/System.js";
53
- import type { int } from "@tsonic/core/types.js";
34
+ The package exposes one ESM facade per CLR namespace plus compiler metadata:
54
35
 
55
- const optional: Nullable<int> = null!;
56
- const callback: Action<int> = null!;
57
- const converter: Func<int, string> = null!;
36
+ ```text
37
+ @tsonic/dotnet/
38
+ System.d.ts
39
+ System.js
40
+ System/
41
+ bindings.json
42
+ internal/index.d.ts
43
+ System.Collections.Generic.d.ts
44
+ System.Collections.Generic.js
45
+ System.Collections.Generic/
46
+ bindings.json
47
+ internal/index.d.ts
48
+ __internal/extensions/index.d.ts
49
+ families.json
58
50
  ```
59
51
 
60
- ### LINQ
61
-
62
- ```typescript
63
- import type { IEnumerable, IQueryable } from "@tsonic/dotnet/System.Linq.js";
52
+ - `<Namespace>.d.ts` is the public import facade.
53
+ - `<Namespace>.js` is an ESM stub for package resolution.
54
+ - `<Namespace>/internal/index.d.ts` contains the full generated declaration surface.
55
+ - `<Namespace>/bindings.json` carries CLR identity, overload, receiver, extension,
56
+ nullable, and generic metadata for the Tsonic compiler.
57
+ - `__internal/extensions/index.d.ts` contains generated extension-method wrapper
58
+ types used for C#-style `using` semantics.
59
+ - `families.json` records multi-arity type families such as `Func`, `Action`, and
60
+ `ValueTuple`.
61
+
62
+ ## Type model
63
+
64
+ - CLR type and member names are emitted with CLR-faithful casing.
65
+ - CLR primitives use `@tsonic/core/types.js` aliases such as `int`, `long`,
66
+ `double`, `bool`, and `char`.
67
+ - Generic CLR names keep their arity-safe declarations, with facade aliases for
68
+ common families.
69
+ - Delegates emit callable TypeScript types.
70
+ - `Task` and `ValueTask` are thenable in TypeScript positions.
71
+ - Extension methods are available through generated `ExtensionMethods` helpers.
72
+
73
+ Example extension-method wrapper:
74
+
75
+ ```ts
76
+ import type { ExtensionMethods as Linq } from "@tsonic/dotnet/System.Linq.js";
77
+ import type { IEnumerable } from "@tsonic/dotnet/System.Collections.Generic.js";
64
78
  import type { int } from "@tsonic/core/types.js";
65
79
 
66
- const sequence: IEnumerable<int> = null!;
67
- ```
68
-
69
- ## Package Structure
80
+ type LinqEnumerable<T> = Linq<IEnumerable<T>>;
70
81
 
71
- - **130 namespaces** - All major .NET namespaces
72
- - **Flat ESM modules** - Clean import paths
73
- - **Metadata sidecars** - `metadata.json` files for CLR-specific info
74
- - **Support types** - Unsafe markers (`ptr<T>`) and primitives imported from `@tsonic/core`
75
-
76
- ## Naming Conventions
77
-
78
- - **Types**: PascalCase (matches .NET)
79
- - **Members**: camelCase (TypeScript convention)
80
- - **Generics**: Friendly aliases (`List<T>` vs `List_1<T>`)
81
-
82
- ## Examples
83
-
84
- ### File I/O
85
-
86
- ```typescript
87
- import type { Stream, FileStream } from "@tsonic/dotnet/System.IO.js";
82
+ declare const values: LinqEnumerable<int>;
83
+ const positive = values.Where((value) => value > 0);
88
84
  ```
89
85
 
90
- ### Networking
91
-
92
- ```typescript
93
- import type { HttpClient } from "@tsonic/dotnet/System.Net.Http.js";
94
- import type { IPAddress, Socket } from "@tsonic/dotnet/System.Net.js";
95
- ```
86
+ ## Versioning
96
87
 
97
- ### Serialization
88
+ This repo is versioned by .NET major:
98
89
 
99
- ```typescript
100
- import type { JsonSerializer } from "@tsonic/dotnet/System.Text.Json.js";
101
- ```
90
+ - .NET 10 declarations live under `versions/10/`.
91
+ - The npm package is published as `@tsonic/dotnet@10.x`.
102
92
 
103
93
  ## Development
104
94
 
105
- ### Regenerating Types
106
-
107
- To regenerate TypeScript declarations from .NET assemblies:
95
+ Regenerate the .NET 10 package from a sibling `tsbindgen` checkout:
108
96
 
109
97
  ```bash
110
- ./__build/scripts/generate.sh
98
+ npm install
99
+ npm run generate:10
111
100
  ```
112
101
 
113
- **Prerequisites:**
114
- - .NET 10 SDK installed
115
- - `tsbindgen` repository cloned at `../tsbindgen` (sibling directory)
116
-
117
- The script will:
118
- 1. Clean existing namespace directories
119
- 2. Build tsbindgen
120
- 3. Generate fresh TypeScript declarations
102
+ The generation script requires:
121
103
 
122
- **Environment variables:**
123
- - `DOTNET_VERSION` - .NET runtime version (default: `10.0.1`)
124
- - `DOTNET_HOME` - .NET installation directory (default: `$HOME/.dotnet`)
104
+ - .NET 10 SDK/runtime
105
+ - `../tsbindgen`
106
+ - a `Microsoft.NETCore.App` runtime directory selected by `DOTNET_HOME` and
107
+ `DOTNET_VERSION`
125
108
 
126
- ### Package Structure
109
+ Example for a system install:
127
110
 
128
- ```
129
- @tsonic/dotnet/
130
- ├── families.json # Multi-arity family index
131
- ├── __internal/extensions/index.d.ts # Extension method buckets
132
- ├── System.d.ts # Facade (public API)
133
- ├── System.js # Runtime stub (throws)
134
- ├── System/
135
- │ ├── bindings.json
136
- │ └── internal/
137
- │ ├── index.d.ts
138
- │ └── metadata.json
139
- ├── ... (more namespaces)
140
- └── __build/scripts/generate.sh # Type regeneration script
111
+ ```bash
112
+ DOTNET_HOME=/usr/lib/dotnet DOTNET_VERSION=10.0.5 npm run generate:10
141
113
  ```
142
114
 
143
115
  ## License