@tsonic/core 10.0.21 → 10.0.22

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 (2) hide show
  1. package/lang.d.ts +27 -0
  2. package/package.json +1 -1
package/lang.d.ts CHANGED
@@ -210,6 +210,33 @@ export type Interface<T> = {
210
210
  [K in keyof T as K extends `__tsonic_iface_${string}` ? never : K]: T[K];
211
211
  };
212
212
 
213
+ /**
214
+ * Compile-time-only field marker.
215
+ *
216
+ * By default, Tsonic emits TypeScript class properties as C# auto-properties.
217
+ * Use `field<T>` to force emission as a C# field instead.
218
+ *
219
+ * This is a type-level marker only and is erased for typing (`field<T> = T`).
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * import type { field } from "@tsonic/core/lang.js";
224
+ *
225
+ * export class User {
226
+ * private email: field<string> = "";
227
+ * }
228
+ * ```
229
+ *
230
+ * Emits:
231
+ * ```csharp
232
+ * class User
233
+ * {
234
+ * private string email = "";
235
+ * }
236
+ * ```
237
+ */
238
+ export type field<T> = T;
239
+
213
240
  /**
214
241
  * Parameter passing modifiers (call-site markers).
215
242
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/core",
3
- "version": "10.0.21",
3
+ "version": "10.0.22",
4
4
  "description": "Core type definitions for Tsonic (versioned by .NET major)",
5
5
  "type": "module",
6
6
  "keywords": [