@tsonic/core 10.0.3 → 10.0.5
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/lang.d.ts +32 -0
- package/package.json +1 -1
package/lang.d.ts
CHANGED
|
@@ -188,6 +188,38 @@ export declare function trycast<T>(value: unknown): T | null;
|
|
|
188
188
|
*/
|
|
189
189
|
export declare function asinterface<T>(value: unknown): T;
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Parameter passing modifiers (call-site markers).
|
|
193
|
+
*
|
|
194
|
+
* These are compile-time-only intrinsics. The compiler must erase them and emit
|
|
195
|
+
* the corresponding C# argument modifiers: `out`, `ref`, `in`.
|
|
196
|
+
*
|
|
197
|
+
* These are *not* runtime functions.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* import { defaultof, out } from "@tsonic/core/lang.js";
|
|
202
|
+
*
|
|
203
|
+
* let value = defaultof<int>();
|
|
204
|
+
* if (dict.TryGetValue("key", out(value))) {
|
|
205
|
+
* // value is assigned by the call
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
export declare function out<T>(value: T): T;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Compile-time-only `ref` argument marker (emits `ref x`).
|
|
213
|
+
*/
|
|
214
|
+
export declare function ref<T>(value: T): T;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Compile-time-only `in` argument marker (emits `in x`).
|
|
218
|
+
*
|
|
219
|
+
* Named `inref` because `in` is a TypeScript reserved keyword.
|
|
220
|
+
*/
|
|
221
|
+
export declare function inref<T>(value: T): T;
|
|
222
|
+
|
|
191
223
|
/**
|
|
192
224
|
* Compile-time-only type selection marker.
|
|
193
225
|
*
|