@tsonic/core 0.5.0 → 0.6.0

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/runtime.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ // Generated by tsbindgen - Architecture
2
+ // Namespace: Tsonic.Runtime
3
+ // Facade - Public API Surface
4
+
5
+ // Import internal declarations
6
+ import * as Internal from './runtime/internal/index.js';
7
+
8
+ // Cross-namespace type imports for constraints
9
+ import type { Dictionary, IEnumerable } from '@tsonic/dotnet/System.Collections.Generic.js';
10
+ import type { Action, Boolean as ClrBoolean, Func, IEquatable, Int32, Object as ClrObject, String as ClrString, Type, ValueType, Void } from '@tsonic/dotnet/System.js';
11
+
12
+ // Public API exports (curated - no internal $instance/$views leakage)
13
+ export { ArrayHelpers$instance as ArrayHelpers } from './runtime/internal/index.js';
14
+ export { DynamicObject as DynamicObject } from './runtime/internal/index.js';
15
+ export { IteratorResult_1 as IteratorResult } from './runtime/internal/index.js';
16
+ export { Operators$instance as Operators } from './runtime/internal/index.js';
17
+ export { Structural$instance as Structural } from './runtime/internal/index.js';
18
+ export { DictionaryAdapter_1 as DictionaryAdapter } from './runtime/internal/index.js';
19
+
20
+ // Multi-arity family sentinel (detects unspecified type parameters)
21
+ declare const __unspecified: unique symbol;
22
+ export type __ = typeof __unspecified;
23
+
24
+ export type Union<
25
+ T1 = __,
26
+ T2 = __,
27
+ T3 = __,
28
+ T4 = __,
29
+ T5 = __,
30
+ T6 = __,
31
+ T7 = __,
32
+ T8 = __,
33
+ > =
34
+ [T3] extends [__] ? Internal.Union_2<T1, T2> :
35
+ [T4] extends [__] ? Internal.Union_3<T1, T2, T3> :
36
+ [T5] extends [__] ? Internal.Union_4<T1, T2, T3, T4> :
37
+ [T6] extends [__] ? Internal.Union_5<T1, T2, T3, T4, T5> :
38
+ [T7] extends [__] ? Internal.Union_6<T1, T2, T3, T4, T5, T6> :
39
+ [T8] extends [__] ? Internal.Union_7<T1, T2, T3, T4, T5, T6, T7> :
40
+ Internal.Union_8<T1, T2, T3, T4, T5, T6, T7, T8>;
41
+
package/runtime.js ADDED
@@ -0,0 +1,9 @@
1
+ // Generated by tsbindgen - Architecture
2
+ // Namespace: Tsonic.Runtime
3
+ // Module Stub - Do Not Execute
4
+
5
+ throw new Error(
6
+ 'Cannot import CLR namespace Tsonic.Runtime in JavaScript runtime. ' +
7
+ 'This module provides TypeScript type definitions only. ' +
8
+ 'Actual implementation requires .NET runtime via Tsonic compiler.'
9
+ );
package/types.d.ts CHANGED
@@ -142,35 +142,3 @@ export interface struct {
142
142
  readonly __brand: unique symbol;
143
143
  }
144
144
 
145
- // ============================================================================
146
- // Safe Casting
147
- // ============================================================================
148
-
149
- /**
150
- * Safe cast function - returns T or null if cast fails.
151
- *
152
- * TypeScript: `tryCast<Person>(obj)`
153
- * C#: `obj as Person`
154
- *
155
- * Unlike `x as T` which throws on failure (C# `(T)x`), this returns null.
156
- * This is the C# "as" operator behavior.
157
- *
158
- * @example
159
- * ```typescript
160
- * import { tryCast } from "@tsonic/core/types.js";
161
- *
162
- * const person = tryCast<Person>(unknownObj);
163
- * if (person !== null) {
164
- * console.log(person.name);
165
- * }
166
- * ```
167
- *
168
- * In C#, this emits:
169
- * ```csharp
170
- * Person? person = unknownObj as Person;
171
- * if (person != null) {
172
- * Console.WriteLine(person.name);
173
- * }
174
- * ```
175
- */
176
- export declare function tryCast<T>(value: unknown): T | null;