@tsonic/globals 10.0.37 → 10.0.38
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/README.md +8 -0
- package/core-globals.d.ts +205 -0
- package/globals.d.ts +32 -0
- package/index.d.ts +2 -258
- package/package.json +5 -1
- package/tsonic.surface.json +13 -0
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Global type definitions for Tsonic.
|
|
4
4
|
|
|
5
|
+
## Versioning
|
|
6
|
+
|
|
7
|
+
This repo is versioned by **.NET major**:
|
|
8
|
+
|
|
9
|
+
- **.NET 10** → `versions/10/` → npm: `@tsonic/globals@10.x`
|
|
10
|
+
|
|
11
|
+
When publishing, run: `npm publish versions/10 --access public`
|
|
12
|
+
|
|
5
13
|
This package provides:
|
|
6
14
|
1. **Base types** required by TypeScript (Array, String, Object, Function, etc.)
|
|
7
15
|
2. **Shared types** used by both modes (utility types, iterators, Promise, Symbol)
|
|
@@ -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
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { char } from "@tsonic/core/types.js";
|
|
2
|
+
import { Array$instance, __Array$views, String$instance, __String$views, Double$instance, __Double$views, Boolean$instance, __Boolean$views, Object$instance } from "@tsonic/dotnet/System/internal/index.js";
|
|
3
|
+
import type { IEnumerable, IEnumerator as IEnumeratorT } from "@tsonic/dotnet/System.Collections.Generic.js";
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface Array<T> extends Array$instance, __Array$views, IEnumerable<T> {
|
|
7
|
+
[n: number]: T;
|
|
8
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
9
|
+
GetEnumerator(): IEnumeratorT<T>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ReadonlyArray<T> extends Array$instance, __Array$views, IEnumerable<T> {
|
|
13
|
+
readonly [n: number]: T;
|
|
14
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
15
|
+
GetEnumerator(): IEnumeratorT<T>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface String extends String$instance, __String$views {
|
|
19
|
+
readonly [index: number]: char;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Number extends Double$instance, __Double$views {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Boolean extends Boolean$instance, __Boolean$views {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface Object extends Object$instance {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,260 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Global type definitions for Tsonic.
|
|
5
|
-
*
|
|
6
|
-
* This package provides:
|
|
7
|
-
* 1. Synthesized Array<T> combining System.Array with generic collection interfaces
|
|
8
|
-
* 2. BCL primitive methods on String, Number, Boolean (from @tsonic/dotnet)
|
|
9
|
-
* 3. TypeScript compiler intrinsics (utility types, iterators, Promise, Symbol)
|
|
10
|
-
*/
|
|
1
|
+
/// <reference path="./core-globals.d.ts" />
|
|
2
|
+
/// <reference path="./globals.d.ts" />
|
|
11
3
|
|
|
12
|
-
// Core primitives (char, int, etc) referenced by some global surfaces (e.g. String indexer).
|
|
13
|
-
import type { char } from "@tsonic/core/types.js";
|
|
14
|
-
|
|
15
|
-
// BCL types from @tsonic/dotnet
|
|
16
|
-
import {
|
|
17
|
-
Array$instance, __Array$views,
|
|
18
|
-
String$instance, __String$views,
|
|
19
|
-
Double$instance, __Double$views,
|
|
20
|
-
Boolean$instance, __Boolean$views,
|
|
21
|
-
Object$instance
|
|
22
|
-
} from "@tsonic/dotnet/System/internal/index.js";
|
|
23
|
-
import type { IEnumerator } from "@tsonic/dotnet/System.Collections.js";
|
|
24
|
-
import type { IEnumerable, IEnumerator as IEnumeratorT } from "@tsonic/dotnet/System.Collections.Generic.js";
|
|
25
|
-
|
|
26
|
-
declare global {
|
|
27
|
-
// Minimal Error surface (noLib mode).
|
|
28
|
-
// Compiler maps this to CLR System.Exception via builtin bindings.
|
|
29
|
-
class Error {
|
|
30
|
-
name: string;
|
|
31
|
-
message: string;
|
|
32
|
-
stack?: string;
|
|
33
|
-
constructor(message?: string);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Array<T> - C# array type (T[])
|
|
38
|
-
*
|
|
39
|
-
* C# arrays are fixed-size and do NOT have IList<T>/ICollection<T> instance methods.
|
|
40
|
-
* They only support:
|
|
41
|
-
* - System.Array instance methods (Length, Rank, Clone, CopyTo, etc.)
|
|
42
|
-
* - IEnumerable<T> for iteration (foreach)
|
|
43
|
-
* - Indexer access
|
|
44
|
-
*
|
|
45
|
-
* For mutable collection operations (add, remove, etc.), use List<T> instead.
|
|
46
|
-
* For LINQ operations (map, filter, etc.), use Enumerable methods.
|
|
47
|
-
*/
|
|
48
|
-
interface Array<T> extends Array$instance, __Array$views, IEnumerable<T> {
|
|
49
|
-
[n: number]: T;
|
|
50
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
51
|
-
GetEnumerator(): IEnumeratorT<T>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface ReadonlyArray<T> extends Array$instance, __Array$views, IEnumerable<T> {
|
|
55
|
-
readonly [n: number]: T;
|
|
56
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
57
|
-
GetEnumerator(): IEnumeratorT<T>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* ArrayConstructor - allows new Array<T>(size) syntax
|
|
62
|
-
* In dotnet mode: emits as new T[size]
|
|
63
|
-
* In js mode: emits as new List<T>() with capacity
|
|
64
|
-
*/
|
|
65
|
-
interface ArrayConstructor {
|
|
66
|
-
new <T>(size?: number): T[];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const Array: ArrayConstructor;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* String - augmented with BCL methods from System.String
|
|
73
|
-
*/
|
|
74
|
-
interface String extends String$instance, __String$views {
|
|
75
|
-
readonly [index: number]: char;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Number - augmented with BCL methods from System.Double
|
|
80
|
-
*/
|
|
81
|
-
interface Number extends Double$instance, __Double$views {}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Boolean - augmented with BCL methods from System.Boolean
|
|
85
|
-
*/
|
|
86
|
-
interface Boolean extends Boolean$instance, __Boolean$views {}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Object - augmented with BCL methods from System.Object
|
|
90
|
-
*/
|
|
91
|
-
interface Object extends Object$instance {
|
|
92
|
-
constructor: Function;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Function - minimal base definition
|
|
97
|
-
*/
|
|
98
|
-
interface Function {
|
|
99
|
-
prototype: any;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Required TypeScript compiler internals
|
|
104
|
-
*/
|
|
105
|
-
interface CallableFunction extends Function {}
|
|
106
|
-
interface NewableFunction extends Function {}
|
|
107
|
-
interface IArguments {}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* RegExp - minimal base definition
|
|
111
|
-
*/
|
|
112
|
-
interface RegExp {}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Symbol
|
|
116
|
-
*/
|
|
117
|
-
interface SymbolConstructor {
|
|
118
|
-
readonly iterator: symbol;
|
|
119
|
-
readonly asyncIterator: symbol;
|
|
120
|
-
readonly hasInstance: symbol;
|
|
121
|
-
readonly isConcatSpreadable: symbol;
|
|
122
|
-
readonly species: symbol;
|
|
123
|
-
readonly toPrimitive: symbol;
|
|
124
|
-
readonly toStringTag: symbol;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const Symbol: SymbolConstructor;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* PropertyKey - required for index signatures
|
|
131
|
-
*/
|
|
132
|
-
type PropertyKey = string | number | symbol;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Utility types
|
|
136
|
-
*/
|
|
137
|
-
type Partial<T> = { [P in keyof T]?: T[P] };
|
|
138
|
-
type Required<T> = { [P in keyof T]-?: T[P] };
|
|
139
|
-
type Readonly<T> = { readonly [P in keyof T]: T[P] };
|
|
140
|
-
type Pick<T, K extends keyof T> = { [P in K]: T[P] };
|
|
141
|
-
type Record<K extends keyof any, T> = { [P in K]: T };
|
|
142
|
-
type Exclude<T, U> = T extends U ? never : T;
|
|
143
|
-
type Extract<T, U> = T extends U ? T : never;
|
|
144
|
-
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
|
145
|
-
type NonNullable<T> = T extends null | undefined ? never : T;
|
|
146
|
-
type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
|
|
147
|
-
type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
|
|
148
|
-
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
|
|
149
|
-
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
|
|
150
|
-
type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Promise types
|
|
154
|
-
*/
|
|
155
|
-
interface Promise<T> {
|
|
156
|
-
then<TResult1 = T, TResult2 = never>(
|
|
157
|
-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
|
158
|
-
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
|
|
159
|
-
): Promise<TResult1 | TResult2>;
|
|
160
|
-
catch<TResult = never>(
|
|
161
|
-
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null
|
|
162
|
-
): Promise<T | TResult>;
|
|
163
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
interface PromiseLike<T> {
|
|
167
|
-
then<TResult1 = T, TResult2 = never>(
|
|
168
|
-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
|
169
|
-
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
|
|
170
|
-
): PromiseLike<TResult1 | TResult2>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
interface PromiseConstructor {
|
|
174
|
-
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
175
|
-
resolve(): Promise<void>;
|
|
176
|
-
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
177
|
-
reject<T = never>(reason?: any): Promise<T>;
|
|
178
|
-
all<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>;
|
|
179
|
-
race<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const Promise: PromiseConstructor;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Iterator types
|
|
186
|
-
*/
|
|
187
|
-
interface Iterator<T, TReturn = any, TNext = undefined> {
|
|
188
|
-
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
189
|
-
return?(value?: TReturn): IteratorResult<T, TReturn>;
|
|
190
|
-
throw?(e?: any): IteratorResult<T, TReturn>;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
interface IteratorResult<T, TReturn = any> {
|
|
194
|
-
done: boolean;
|
|
195
|
-
value: T | TReturn;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
interface IteratorYieldResult<T> {
|
|
199
|
-
done: false;
|
|
200
|
-
value: T;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
interface IteratorReturnResult<TReturn> {
|
|
204
|
-
done: true;
|
|
205
|
-
value: TReturn;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
interface Iterable<T, TReturn = any, TNext = undefined> {
|
|
209
|
-
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
interface IterableIterator<T, TReturn = any, TNext = undefined> extends Iterator<T, TReturn, TNext> {
|
|
213
|
-
[Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Async Iterator types
|
|
218
|
-
*/
|
|
219
|
-
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
|
|
220
|
-
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
|
221
|
-
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
|
222
|
-
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
interface AsyncIterable<T, TReturn = any, TNext = undefined> {
|
|
226
|
-
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
interface AsyncIterableIterator<T, TReturn = any, TNext = undefined> extends AsyncIterator<T, TReturn, TNext> {
|
|
230
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Generator types
|
|
235
|
-
*/
|
|
236
|
-
interface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {
|
|
237
|
-
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
238
|
-
return(value: TReturn): IteratorResult<T, TReturn>;
|
|
239
|
-
throw(e: any): IteratorResult<T, TReturn>;
|
|
240
|
-
[Symbol.iterator](): Generator<T, TReturn, TNext>;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
|
|
244
|
-
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
|
245
|
-
return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
|
246
|
-
throw(e: any): Promise<IteratorResult<T, TReturn>>;
|
|
247
|
-
[Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Template literal type utilities
|
|
252
|
-
*/
|
|
253
|
-
type Uppercase<S extends string> = intrinsic;
|
|
254
|
-
type Lowercase<S extends string> = intrinsic;
|
|
255
|
-
type Capitalize<S extends string> = intrinsic;
|
|
256
|
-
type Uncapitalize<S extends string> = intrinsic;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// This export is required to make this file a module
|
|
260
4
|
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsonic/globals",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.38",
|
|
4
4
|
"description": "Global type definitions for Tsonic with BCL primitive methods",
|
|
5
5
|
"main": "index.d.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"index.d.ts",
|
|
9
|
+
"core-globals.d.ts",
|
|
10
|
+
"globals.d.ts",
|
|
11
|
+
"tsonic.surface.json",
|
|
9
12
|
"README.md",
|
|
10
13
|
"LICENSE"
|
|
11
14
|
],
|
|
@@ -13,6 +16,7 @@
|
|
|
13
16
|
"typecheck": "tsc --noEmit"
|
|
14
17
|
},
|
|
15
18
|
"dependencies": {
|
|
19
|
+
"@tsonic/core": "10.0.37",
|
|
16
20
|
"@tsonic/dotnet": "10.0.37"
|
|
17
21
|
},
|
|
18
22
|
"devDependencies": {
|