@tsonic/core 0.6.0 → 0.6.1

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 +25 -0
  2. package/package.json +1 -1
package/lang.d.ts CHANGED
@@ -169,6 +169,31 @@ export declare function nameof(expression: unknown): string;
169
169
  */
170
170
  export declare function trycast<T>(value: unknown): T | null;
171
171
 
172
+ // ============================================================================
173
+ // Extension Method Intrinsics
174
+ // ============================================================================
175
+
176
+ /**
177
+ * Marks the receiver parameter of a C# extension method.
178
+ *
179
+ * Use as a wrapper for the FIRST parameter type of a static function.
180
+ * The compiler emits `this` on that parameter.
181
+ *
182
+ * @example
183
+ * ```typescript
184
+ * import type { thisarg } from "@tsonic/core/lang.js";
185
+ * import type { IEnumerable } from "@tsonic/dotnet/System.Collections.Generic.js";
186
+ *
187
+ * export function where<TSource>(
188
+ * source: thisarg<IEnumerable<TSource>>,
189
+ * predicate: (x: TSource) => boolean
190
+ * ): IEnumerable<TSource> {
191
+ * throw new Error("not implemented");
192
+ * }
193
+ * ```
194
+ */
195
+ export type thisarg<T> = T;
196
+
172
197
  // ============================================================================
173
198
  // Span type (for stackalloc return type)
174
199
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/core",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Core type definitions for Tsonic - TypeScript to native compiler",
5
5
  "type": "module",
6
6
  "keywords": [