@tsonic/js 10.0.39 → 10.0.40

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/bindings.json CHANGED
@@ -20,6 +20,11 @@
20
20
  "assembly": "Tsonic.JSRuntime",
21
21
  "type": "Tsonic.JSRuntime.Math"
22
22
  },
23
+ "Number": {
24
+ "kind": "global",
25
+ "assembly": "Tsonic.JSRuntime",
26
+ "type": "Tsonic.JSRuntime.Number"
27
+ },
23
28
  "RegExp": {
24
29
  "kind": "global",
25
30
  "assembly": "Tsonic.JSRuntime",
@@ -37,10 +42,16 @@
37
42
  "type": "Tsonic.JSRuntime.Set`1",
38
43
  "csharpName": "Set"
39
44
  },
45
+ "String": {
46
+ "kind": "global",
47
+ "assembly": "Tsonic.JSRuntime",
48
+ "type": "Tsonic.JSRuntime.String"
49
+ },
40
50
  "Array": {
41
51
  "kind": "global",
42
52
  "assembly": "Tsonic.JSRuntime",
43
53
  "type": "Tsonic.JSRuntime.JSArray`1",
54
+ "staticType": "Tsonic.JSRuntime.JSArrayStatics",
44
55
  "csharpName": "JSArray"
45
56
  },
46
57
  "ReadonlyArray": {
@@ -72,6 +83,16 @@
72
83
  "assembly": "Tsonic.JSRuntime",
73
84
  "type": "Tsonic.JSRuntime.Globals",
74
85
  "csharpName": "Globals.isNaN"
86
+ },
87
+ "RangeError": {
88
+ "kind": "global",
89
+ "assembly": "Tsonic.JSRuntime",
90
+ "type": "Tsonic.JSRuntime.RangeError"
91
+ },
92
+ "Error": {
93
+ "kind": "global",
94
+ "assembly": "Tsonic.JSRuntime",
95
+ "type": "Tsonic.JSRuntime.Error"
75
96
  }
76
97
  }
77
98
  }
@@ -0,0 +1,205 @@
1
+ declare global {
2
+ class Error {
3
+ name: string;
4
+ message: string;
5
+ stack?: string;
6
+ constructor(message?: string);
7
+ }
8
+
9
+ interface Function {
10
+ prototype: any;
11
+ }
12
+
13
+ interface CallableFunction extends Function {
14
+ }
15
+
16
+ interface NewableFunction extends Function {
17
+ }
18
+
19
+ interface IArguments {
20
+ }
21
+
22
+ interface RegExp {
23
+ }
24
+
25
+ interface ImportMeta {
26
+ }
27
+
28
+ interface String {
29
+ }
30
+
31
+ interface Number {
32
+ }
33
+
34
+ interface Boolean {
35
+ }
36
+
37
+ interface Object {
38
+ constructor: Function;
39
+ }
40
+
41
+ interface SymbolConstructor {
42
+ readonly iterator: symbol;
43
+ readonly asyncIterator: symbol;
44
+ readonly hasInstance: symbol;
45
+ readonly isConcatSpreadable: symbol;
46
+ readonly species: symbol;
47
+ readonly toPrimitive: symbol;
48
+ readonly toStringTag: symbol;
49
+ }
50
+
51
+ interface Array<T> {
52
+ [n: number]: T;
53
+ readonly length: number;
54
+ [Symbol.iterator](): IterableIterator<T>;
55
+ }
56
+
57
+ interface ReadonlyArray<T> {
58
+ readonly [n: number]: T;
59
+ readonly length: number;
60
+ [Symbol.iterator](): IterableIterator<T>;
61
+ }
62
+
63
+ interface ArrayConstructor {
64
+ new<T>(size?: number): T[];
65
+ }
66
+
67
+ interface Promise<T> {
68
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: | ((value: T) => TResult1 | PromiseLike<TResult1>)
69
+ | undefined
70
+ | null, onrejected?: | ((reason: any) => TResult2 | PromiseLike<TResult2>)
71
+ | undefined
72
+ | null): Promise<TResult1 | TResult2>;
73
+ catch<TResult = never>(onrejected?: | ((reason: any) => TResult | PromiseLike<TResult>)
74
+ | undefined
75
+ | null): Promise<T | TResult>;
76
+ finally(onfinally?: (() => void) | undefined | null): Promise<T>;
77
+ }
78
+
79
+ interface PromiseLike<T> {
80
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: | ((value: T) => TResult1 | PromiseLike<TResult1>)
81
+ | undefined
82
+ | null, onrejected?: | ((reason: any) => TResult2 | PromiseLike<TResult2>)
83
+ | undefined
84
+ | null): PromiseLike<TResult1 | TResult2>;
85
+ }
86
+
87
+ interface PromiseConstructor {
88
+ new<T>(executor: (
89
+ resolve: (value: T | PromiseLike<T>) => void,
90
+ reject: (reason?: any) => void
91
+ ) => void): Promise<T>;
92
+ resolve(): Promise<void>;
93
+ resolve<T>(value: T | PromiseLike<T>): Promise<T>;
94
+ reject<T = never>(reason?: any): Promise<T>;
95
+ all<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>;
96
+ race<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T>;
97
+ }
98
+
99
+ interface Iterator<T, TReturn = any, TNext = undefined> {
100
+ next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
101
+ return(value?: TReturn): IteratorResult<T, TReturn>;
102
+ throw(e?: any): IteratorResult<T, TReturn>;
103
+ }
104
+
105
+ interface IteratorResult<T, TReturn = any> {
106
+ done: boolean;
107
+ value: T | TReturn;
108
+ }
109
+
110
+ interface IteratorYieldResult<T> {
111
+ done: false;
112
+ value: T;
113
+ }
114
+
115
+ interface IteratorReturnResult<TReturn> {
116
+ done: true;
117
+ value: TReturn;
118
+ }
119
+
120
+ interface Iterable<T, TReturn = any, TNext = undefined> {
121
+ [Symbol.iterator](): Iterator<T, TReturn, TNext>;
122
+ }
123
+
124
+ interface IterableIterator<T, TReturn = any, TNext = undefined> extends Iterator<T, TReturn, TNext> {
125
+ [Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
126
+ }
127
+
128
+ interface AsyncIterator<T, TReturn = any, TNext = undefined> {
129
+ next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
130
+ return(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
131
+ throw(e?: any): Promise<IteratorResult<T, TReturn>>;
132
+ }
133
+
134
+ interface AsyncIterable<T, TReturn = any, TNext = undefined> {
135
+ [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
136
+ }
137
+
138
+ interface AsyncIterableIterator<T, TReturn = any, TNext = undefined> extends AsyncIterator<T, TReturn, TNext> {
139
+ [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
140
+ }
141
+
142
+ interface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {
143
+ next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
144
+ return(value: TReturn): IteratorResult<T, TReturn>;
145
+ throw(e: any): IteratorResult<T, TReturn>;
146
+ [Symbol.iterator](): Generator<T, TReturn, TNext>;
147
+ }
148
+
149
+ interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
150
+ next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
151
+ return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
152
+ throw(e: any): Promise<IteratorResult<T, TReturn>>;
153
+ [Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
154
+ }
155
+
156
+ interface TemplateStringsArray extends ReadonlyArray<string> {
157
+ readonly raw: readonly string[];
158
+ }
159
+
160
+ type PropertyKey = string | number | symbol;
161
+
162
+ type Partial<T> = { [P in keyof T]?: T[P] };
163
+
164
+ type Required<T> = { [P in keyof T]-?: T[P] };
165
+
166
+ type Readonly<T> = { readonly [P in keyof T]: T[P] };
167
+
168
+ type Pick<T, K extends keyof T> = { [P in K]: T[P] };
169
+
170
+ type Record<K extends keyof any, T> = { [P in K]: T };
171
+
172
+ type Exclude<T, U> = T extends U ? never : T;
173
+
174
+ type Extract<T, U> = T extends U ? T : never;
175
+
176
+ type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
177
+
178
+ type NonNullable<T> = T extends null | undefined ? never : T;
179
+
180
+ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
181
+
182
+ type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
183
+
184
+ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
185
+
186
+ type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
187
+
188
+ type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
189
+
190
+ type Uppercase<S extends string> = intrinsic;
191
+
192
+ type Lowercase<S extends string> = intrinsic;
193
+
194
+ type Capitalize<S extends string> = intrinsic;
195
+
196
+ type Uncapitalize<S extends string> = intrinsic;
197
+
198
+ const Symbol: SymbolConstructor;
199
+
200
+ const Array: ArrayConstructor;
201
+
202
+ const Promise: PromiseConstructor;
203
+ }
204
+
205
+ export {};
package/globals.d.ts CHANGED
@@ -1,96 +1,219 @@
1
1
  import type { int, long, double } from "@tsonic/core/types.js";
2
2
 
3
3
  declare global {
4
+ class RangeError extends Error {
5
+ constructor(message?: string);
6
+ }
7
+
8
+ interface ArrayLike<T> {
9
+ readonly length: int;
10
+ readonly [n: number]: T;
11
+ }
12
+
4
13
  interface String {
5
14
  readonly length: int;
6
- trim(): string;
7
- toUpperCase(): string;
8
- toLowerCase(): string;
15
+ at(index: int): string;
16
+ charAt(index: int): string;
17
+ charCodeAt(index: int): int;
18
+ codePointAt(index: int): int;
19
+ concat(...strings: string[]): string;
20
+ endsWith(searchString: string): boolean;
21
+ includes(searchString: string): boolean;
9
22
  indexOf(searchString: string, position?: int): int;
10
- split(separator: string, limit?: int): string[];
11
- includes(searchString: string, position?: int): boolean;
12
- startsWith(searchString: string, position?: int): boolean;
13
- endsWith(searchString: string, endPosition?: int): boolean;
23
+ isWellFormed(): boolean;
24
+ lastIndexOf(searchString: string, position?: int): int;
25
+ localeCompare(compareString: string): int;
26
+ match(pattern: string): string[] | undefined;
27
+ matchAll(pattern: string): string[][];
28
+ normalize(form?: string): string;
29
+ padEnd(targetLength: int, padString?: string): string;
30
+ padStart(targetLength: int, padString?: string): string;
31
+ repeat(count: int): string;
32
+ replace(searchValue: string, replaceValue: string): string;
33
+ replaceAll(searchValue: string, replaceValue: string): string;
34
+ search(pattern: string): int;
14
35
  slice(start?: int, end?: int): string;
36
+ split(separator: string, limit?: int): string[];
37
+ startsWith(searchString: string): boolean;
38
+ substr(start: int, length?: int): string;
15
39
  substring(start: int, end?: int): string;
16
- replace(searchValue: string, replaceValue: string): string;
17
- charAt(index: int): string;
18
- charCodeAt(index: int): int;
40
+ toLocaleLowerCase(): string;
41
+ toLocaleUpperCase(): string;
42
+ toLowerCase(): string;
43
+ toString(): string;
44
+ trim(): string;
45
+ trimLeft(): string;
46
+ trimRight(): string;
47
+ trimStart(): string;
48
+ trimEnd(): string;
49
+ toUpperCase(): string;
50
+ toWellFormed(): string;
51
+ valueOf(): string;
52
+ }
53
+
54
+ interface StringConstructor {
55
+ fromCharCode(...codes: int[]): string;
56
+ fromCodePoint(...codePoints: int[]): string;
57
+ }
58
+
59
+ interface Number {
60
+ toString(): string;
61
+ valueOf(): double;
19
62
  }
63
+
64
+ interface NumberConstructor {
65
+ readonly EPSILON: double;
66
+ readonly MAX_SAFE_INTEGER: double;
67
+ readonly MAX_VALUE: double;
68
+ readonly MIN_SAFE_INTEGER: double;
69
+ readonly MIN_VALUE: double;
70
+ readonly NEGATIVE_INFINITY: double;
71
+ readonly POSITIVE_INFINITY: double;
72
+ readonly NaN: double;
73
+ isFinite(value: double): boolean;
74
+ isInteger(value: double): boolean;
75
+ isNaN(value: double): boolean;
76
+ isSafeInteger(value: double): boolean;
77
+ parseFloat(str: string): double;
78
+ parseInt(str: string, radix?: int): long | undefined;
79
+ }
80
+
20
81
  interface Array<T> {
21
82
  readonly length: int;
22
83
  at(index: int): T;
23
- concat(...items: T[]): T[];
84
+ concat(...items: unknown[]): T[];
85
+ copyWithin(target: int, start?: int, end?: int): T[];
86
+ entries(): Iterable<[int, T]>;
24
87
  every(callback: (value: T) => boolean): boolean;
88
+ every(callback: (value: T, index: int, array: T[]) => boolean): boolean;
89
+ fill(value: T, start?: int, end?: int): T[];
25
90
  filter(callback: (value: T) => boolean): T[];
26
91
  filter(callback: (value: T, index: int) => boolean): T[];
92
+ filter(callback: (value: T, index: int, array: T[]) => boolean): T[];
27
93
  find(callback: (value: T) => boolean): T | undefined;
28
94
  find(callback: (value: T, index: int) => boolean): T | undefined;
95
+ find(callback: (value: T, index: int, array: T[]) => boolean): T | undefined;
29
96
  findIndex(callback: (value: T) => boolean): int;
30
97
  findIndex(callback: (value: T, index: int) => boolean): int;
98
+ findIndex(callback: (value: T, index: int, array: T[]) => boolean): int;
31
99
  findLast(callback: (value: T) => boolean): T | undefined;
32
100
  findLast(callback: (value: T, index: int) => boolean): T | undefined;
101
+ findLast(callback: (value: T, index: int, array: T[]) => boolean): T | undefined;
33
102
  findLastIndex(callback: (value: T) => boolean): int;
34
103
  findLastIndex(callback: (value: T, index: int) => boolean): int;
104
+ findLastIndex(callback: (value: T, index: int, array: T[]) => boolean): int;
35
105
  flat(depth?: int): unknown[];
106
+ flatMap<TResult>(callback: (value: T, index: int, array: T[]) => unknown): TResult[];
36
107
  forEach(callback: (value: T) => void): void;
37
108
  forEach(callback: (value: T, index: int) => void): void;
109
+ forEach(callback: (value: T, index: int, array: T[]) => void): void;
38
110
  includes(searchElement: T): boolean;
39
- includes(searchElement: T, fromIndex?: int): boolean;
40
111
  indexOf(searchElement: T, fromIndex?: int): int;
41
112
  join(separator?: string): string;
113
+ keys(): Iterable<int>;
42
114
  lastIndexOf(searchElement: T, fromIndex?: int): int;
43
115
  map<TResult>(callback: (value: T) => TResult): TResult[];
44
116
  map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
117
+ map<TResult>(callback: (value: T, index: int, array: T[]) => TResult): TResult[];
118
+ pop(): T;
119
+ push(...items: T[]): int;
45
120
  reduce(callback: (previousValue: T, currentValue: T) => T): T;
46
- reduce<TResult>(
47
- callback: (previousValue: TResult, currentValue: T) => TResult,
48
- initialValue: TResult
49
- ): TResult;
50
- reduceRight<TResult>(
51
- callback: (previousValue: TResult, currentValue: T) => TResult,
52
- initialValue: TResult
53
- ): TResult;
121
+ reduce<TResult>(callback: (previousValue: TResult, currentValue: T) => TResult, initialValue: TResult): TResult;
122
+ reduce<TResult>(callback: (previousValue: TResult, currentValue: T, index: int) => TResult, initialValue: TResult): TResult;
123
+ reduce<TResult>(callback: (
124
+ previousValue: TResult,
125
+ currentValue: T,
126
+ index: int,
127
+ array: T[]
128
+ ) => TResult, initialValue: TResult): TResult;
129
+ reduceRight<TResult>(callback: (previousValue: TResult, currentValue: T) => TResult, initialValue: TResult): TResult;
130
+ reduceRight<TResult>(callback: (previousValue: TResult, currentValue: T, index: int) => TResult, initialValue: TResult): TResult;
131
+ reduceRight<TResult>(callback: (
132
+ previousValue: TResult,
133
+ currentValue: T,
134
+ index: int,
135
+ array: T[]
136
+ ) => TResult, initialValue: TResult): TResult;
137
+ reverse(): T[];
138
+ shift(): T;
54
139
  slice(start?: int, end?: int): T[];
55
140
  some(callback: (value: T) => boolean): boolean;
141
+ some(callback: (value: T, index: int, array: T[]) => boolean): boolean;
142
+ sort(compareFunc?: (left: T, right: T) => double): T[];
143
+ splice(start: int, deleteCount?: int, ...items: T[]): T[];
144
+ toLocaleString(): string;
145
+ toReversed(): T[];
146
+ toSorted(compareFunc?: (left: T, right: T) => double): T[];
147
+ toSpliced(start: int, deleteCount?: int, ...items: T[]): T[];
148
+ toString(): string;
149
+ unshift(...items: T[]): int;
150
+ values(): Iterable<T>;
151
+ with(index: int, value: T): T[];
56
152
  }
153
+
57
154
  interface ReadonlyArray<T> {
58
155
  readonly length: int;
59
156
  at(index: int): T;
60
- concat(...items: T[]): T[];
157
+ concat(...items: unknown[]): T[];
158
+ entries(): Iterable<[int, T]>;
61
159
  every(callback: (value: T) => boolean): boolean;
160
+ every(callback: (value: T, index: int, array: readonly T[]) => boolean): boolean;
62
161
  filter(callback: (value: T) => boolean): T[];
63
162
  filter(callback: (value: T, index: int) => boolean): T[];
163
+ filter(callback: (value: T, index: int, array: readonly T[]) => boolean): T[];
64
164
  find(callback: (value: T) => boolean): T | undefined;
65
165
  find(callback: (value: T, index: int) => boolean): T | undefined;
166
+ find(callback: (value: T, index: int, array: readonly T[]) => boolean): T | undefined;
66
167
  findIndex(callback: (value: T) => boolean): int;
67
168
  findIndex(callback: (value: T, index: int) => boolean): int;
169
+ findIndex(callback: (value: T, index: int, array: readonly T[]) => boolean): int;
68
170
  findLast(callback: (value: T) => boolean): T | undefined;
69
171
  findLast(callback: (value: T, index: int) => boolean): T | undefined;
172
+ findLast(callback: (value: T, index: int, array: readonly T[]) => boolean): T | undefined;
70
173
  findLastIndex(callback: (value: T) => boolean): int;
71
174
  findLastIndex(callback: (value: T, index: int) => boolean): int;
175
+ findLastIndex(callback: (value: T, index: int, array: readonly T[]) => boolean): int;
72
176
  flat(depth?: int): unknown[];
177
+ flatMap<TResult>(callback: (value: T, index: int, array: readonly T[]) => unknown): TResult[];
73
178
  forEach(callback: (value: T) => void): void;
74
179
  forEach(callback: (value: T, index: int) => void): void;
180
+ forEach(callback: (value: T, index: int, array: readonly T[]) => void): void;
75
181
  includes(searchElement: T): boolean;
76
- includes(searchElement: T, fromIndex?: int): boolean;
77
182
  indexOf(searchElement: T, fromIndex?: int): int;
78
183
  join(separator?: string): string;
184
+ keys(): Iterable<int>;
79
185
  lastIndexOf(searchElement: T, fromIndex?: int): int;
80
186
  map<TResult>(callback: (value: T) => TResult): TResult[];
81
187
  map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
188
+ map<TResult>(callback: (value: T, index: int, array: readonly T[]) => TResult): TResult[];
82
189
  reduce(callback: (previousValue: T, currentValue: T) => T): T;
83
- reduce<TResult>(
84
- callback: (previousValue: TResult, currentValue: T) => TResult,
85
- initialValue: TResult
86
- ): TResult;
87
- reduceRight<TResult>(
88
- callback: (previousValue: TResult, currentValue: T) => TResult,
89
- initialValue: TResult
90
- ): TResult;
190
+ reduce<TResult>(callback: (previousValue: TResult, currentValue: T) => TResult, initialValue: TResult): TResult;
191
+ reduce<TResult>(callback: (previousValue: TResult, currentValue: T, index: int) => TResult, initialValue: TResult): TResult;
192
+ reduce<TResult>(callback: (
193
+ previousValue: TResult,
194
+ currentValue: T,
195
+ index: int,
196
+ array: readonly T[]
197
+ ) => TResult, initialValue: TResult): TResult;
198
+ reduceRight<TResult>(callback: (previousValue: TResult, currentValue: T) => TResult, initialValue: TResult): TResult;
199
+ reduceRight<TResult>(callback: (previousValue: TResult, currentValue: T, index: int) => TResult, initialValue: TResult): TResult;
200
+ reduceRight<TResult>(callback: (
201
+ previousValue: TResult,
202
+ currentValue: T,
203
+ index: int,
204
+ array: readonly T[]
205
+ ) => TResult, initialValue: TResult): TResult;
91
206
  slice(start?: int, end?: int): T[];
92
207
  some(callback: (value: T) => boolean): boolean;
208
+ some(callback: (value: T, index: int, array: readonly T[]) => boolean): boolean;
209
+ toLocaleString(): string;
210
+ toReversed(): T[];
211
+ toSorted(compareFunc?: (left: T, right: T) => double): T[];
212
+ toString(): string;
213
+ values(): Iterable<T>;
214
+ with(index: int, value: T): T[];
93
215
  }
216
+
94
217
  interface Console {
95
218
  log(...data: unknown[]): void;
96
219
  error(...data: unknown[]): void;
@@ -98,47 +221,55 @@ declare global {
98
221
  info(...data: unknown[]): void;
99
222
  debug(...data: unknown[]): void;
100
223
  }
101
- const console: Console;
224
+
225
+ interface ArrayConstructor {
226
+ isArray(value: unknown): boolean;
227
+ from(source: string): string[];
228
+ from<TResult>(source: string, mapfn: (value: string, index: int) => TResult): TResult[];
229
+ from<T>(source: Iterable<T> | ArrayLike<T>): T[];
230
+ from<T, TResult>(source: Iterable<T> | ArrayLike<T>, mapfn: (value: T, index: int) => TResult): TResult[];
231
+ of<T>(...items: T[]): T[];
232
+ }
233
+
102
234
  interface Date {
103
235
  toISOString(): string;
104
236
  getTime(): long;
105
237
  }
238
+
106
239
  interface DateConstructor {
107
- new (): Date;
108
- new (value: string | number | long): Date;
240
+ new(): Date;
241
+ new(value: string | number | long): Date;
109
242
  now(): long;
110
243
  parse(s: string): long;
111
244
  }
112
- const Date: DateConstructor;
245
+
113
246
  interface JSON {
114
247
  parse<T = unknown>(text: string): T;
115
- stringify(
116
- value: unknown,
117
- replacer?: unknown,
118
- space?: string | number | int
119
- ): string;
248
+ stringify(value: unknown, replacer?: unknown, space?: string | number | int): string;
120
249
  }
121
- const JSON: JSON;
250
+
122
251
  interface Math {
123
252
  round(x: double): double;
124
253
  max(...values: double[]): double;
125
254
  min(...values: double[]): double;
126
255
  random(): double;
127
256
  }
128
- const Math: Math;
257
+
129
258
  interface RegExpMatchArray extends Array<string> {
130
259
  index?: int;
131
260
  input?: string;
132
261
  }
262
+
133
263
  interface RegExp {
134
264
  exec(string: string): RegExpMatchArray | null;
135
265
  test(string: string): boolean;
136
266
  }
267
+
137
268
  interface RegExpConstructor {
138
- new (pattern: string | RegExp, flags?: string): RegExp;
269
+ new(pattern: string | RegExp, flags?: string): RegExp;
139
270
  (pattern: string | RegExp, flags?: string): RegExp;
140
271
  }
141
- const RegExp: RegExpConstructor;
272
+
142
273
  interface Map<K, V> {
143
274
  readonly size: int;
144
275
  clear(): void;
@@ -147,10 +278,11 @@ declare global {
147
278
  has(key: K): boolean;
148
279
  set(key: K, value: V): this;
149
280
  }
281
+
150
282
  interface MapConstructor {
151
- new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
283
+ new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
152
284
  }
153
- const Map: MapConstructor;
285
+
154
286
  interface Set<T> {
155
287
  readonly size: int;
156
288
  add(value: T): this;
@@ -158,25 +290,43 @@ declare global {
158
290
  delete(value: T): boolean;
159
291
  has(value: T): boolean;
160
292
  }
293
+
161
294
  interface SetConstructor {
162
- new <T = unknown>(values?: readonly T[] | null): Set<T>;
295
+ new<T = unknown>(values?: readonly T[] | null): Set<T>;
163
296
  }
297
+
298
+ const String: StringConstructor;
299
+
300
+ const Number: NumberConstructor;
301
+
302
+ const console: Console;
303
+
304
+ const Date: DateConstructor;
305
+
306
+ const JSON: JSON;
307
+
308
+ const Math: Math;
309
+
310
+ const RegExp: RegExpConstructor;
311
+
312
+ const Map: MapConstructor;
313
+
164
314
  const Set: SetConstructor;
315
+
165
316
  function parseInt(str: string, radix?: int): long | undefined;
317
+
166
318
  function parseFloat(str: string): double;
319
+
167
320
  function isFinite(value: double): boolean;
321
+
168
322
  function isNaN(value: double): boolean;
169
- function setTimeout(
170
- handler: (...args: unknown[]) => void,
171
- timeout?: int,
172
- ...args: unknown[]
173
- ): int;
323
+
324
+ function setTimeout(handler: (...args: unknown[]) => void, timeout?: int, ...args: unknown[]): int;
325
+
174
326
  function clearTimeout(id: int): void;
175
- function setInterval(
176
- handler: (...args: unknown[]) => void,
177
- timeout?: int,
178
- ...args: unknown[]
179
- ): int;
327
+
328
+ function setInterval(handler: (...args: unknown[]) => void, timeout?: int, ...args: unknown[]): int;
329
+
180
330
  function clearInterval(id: int): void;
181
331
  }
182
332
 
package/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /// <reference path="./core-globals.d.ts" />
2
+ /// <reference path="./globals.d.ts" />
3
+
1
4
  // Generated by tsbindgen - Architecture
2
5
  // Namespace: Tsonic.JSRuntime
3
6
  // Facade - Public API Surface
@@ -11,12 +14,14 @@ import type { sbyte, byte, short, ushort, int, uint, long, ulong, int128, uint12
11
14
  // Cross-namespace type imports for constraints
12
15
  import type { IEnumerable as IEnumerable__System_Collections_Generic, IEnumerator, KeyValuePair, List } from '@tsonic/dotnet/System.Collections.Generic.js';
13
16
  import type { IEnumerable } from '@tsonic/dotnet/System.Collections.js';
14
- import type { Action, Boolean as ClrBoolean, Byte, Comparison, Double, Func, Int16, Int32, Int64, Nullable, Object as ClrObject, SByte, Single, String as ClrString, UInt16, UInt32, ValueTuple, Void } from '@tsonic/dotnet/System.js';
17
+ import type { Action, Boolean as ClrBoolean, Byte, Comparison, Double, Exception, Func, Int16, Int32, Int64, Nullable, Object as ClrObject, SByte, Single, String as ClrString, UInt16, UInt32, ValueTuple, Void } from '@tsonic/dotnet/System.js';
18
+ import type { ISerializable } from '@tsonic/dotnet/System.Runtime.Serialization.js';
15
19
 
16
20
  // Public API exports (curated - no internal $instance/$views leakage)
17
21
  export { ArrayBuffer as ArrayBuffer } from './index/internal/index.js';
18
22
  export { console$instance as console } from './index/internal/index.js';
19
23
  export { Date as Date } from './index/internal/index.js';
24
+ export { Error as Error } from './index/internal/index.js';
20
25
  export { Float32Array as Float32Array } from './index/internal/index.js';
21
26
  export { Float64Array as Float64Array } from './index/internal/index.js';
22
27
  export { Globals$instance as Globals } from './index/internal/index.js';
@@ -24,10 +29,12 @@ export { Int16Array as Int16Array } from './index/internal/index.js';
24
29
  export { Int32Array as Int32Array } from './index/internal/index.js';
25
30
  export { Int8Array as Int8Array } from './index/internal/index.js';
26
31
  export { JSArray_1 as JSArray } from './index/internal/index.js';
32
+ export { JSArrayStatics$instance as JSArrayStatics } from './index/internal/index.js';
27
33
  export { JSON$instance as JSON } from './index/internal/index.js';
28
34
  export { Map_2 as Map } from './index/internal/index.js';
29
35
  export { Math$instance as Math } from './index/internal/index.js';
30
36
  export { Number$instance as Number } from './index/internal/index.js';
37
+ export { RangeError as RangeError } from './index/internal/index.js';
31
38
  export { RegExp as RegExp } from './index/internal/index.js';
32
39
  export { RegExpMatchResult as RegExpMatchResult } from './index/internal/index.js';
33
40
  export { Set_1 as Set } from './index/internal/index.js';