@tsonic/globals 0.3.2 → 0.3.4
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/index.d.ts +27 -21
- package/package.json +2 -6
- package/tsconfig.json +11 -0
package/index.d.ts
CHANGED
|
@@ -4,55 +4,61 @@
|
|
|
4
4
|
* Global type definitions for Tsonic.
|
|
5
5
|
*
|
|
6
6
|
* This package provides:
|
|
7
|
-
* 1.
|
|
8
|
-
* 2.
|
|
9
|
-
* 3.
|
|
10
|
-
*
|
|
11
|
-
* For dotnet mode: Use this package alone. Primitives have BCL methods.
|
|
12
|
-
* For JS mode: Use with @tsonic/js-globals which extends base types with JS methods.
|
|
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)
|
|
13
10
|
*/
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
// BCL types from @tsonic/dotnet
|
|
13
|
+
import {
|
|
14
|
+
Array$instance, __Array$views,
|
|
15
|
+
String$instance, __String$views,
|
|
16
|
+
Double$instance, __Double$views,
|
|
17
|
+
Boolean$instance, __Boolean$views,
|
|
18
|
+
Object$instance
|
|
19
|
+
} from "@tsonic/dotnet/System/internal/index.js";
|
|
20
|
+
import { IList_1, ICollection_1, IEnumerable_1, IReadOnlyList_1, IReadOnlyCollection_1 } from "@tsonic/dotnet/System.Collections.Generic/internal/index.js";
|
|
16
21
|
|
|
17
22
|
declare global {
|
|
18
23
|
/**
|
|
19
|
-
* Array
|
|
20
|
-
*
|
|
21
|
-
*
|
|
24
|
+
* Array<T> - Synthesized generic array type
|
|
25
|
+
*
|
|
26
|
+
* Combines:
|
|
27
|
+
* - System.Array instance methods (length, rank, clone, copyTo, etc.)
|
|
28
|
+
* - Generic collection interfaces (IList<T>, ICollection<T>, IEnumerable<T>)
|
|
29
|
+
* - TypeScript indexer and iterator
|
|
30
|
+
*
|
|
31
|
+
* This gives arrays full BCL method support.
|
|
22
32
|
*/
|
|
23
|
-
interface Array<T> {
|
|
33
|
+
interface Array<T> extends Array$instance, __Array$views, IList_1<T>, ICollection_1<T>, IEnumerable_1<T>, IReadOnlyList_1<T>, IReadOnlyCollection_1<T> {
|
|
24
34
|
[n: number]: T;
|
|
25
35
|
[Symbol.iterator](): IterableIterator<T>;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
|
-
interface ReadonlyArray<T> {
|
|
38
|
+
interface ReadonlyArray<T> extends Array$instance, __Array$views, IReadOnlyList_1<T>, IReadOnlyCollection_1<T>, IEnumerable_1<T> {
|
|
29
39
|
readonly [n: number]: T;
|
|
30
40
|
[Symbol.iterator](): IterableIterator<T>;
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
/**
|
|
34
44
|
* String - augmented with BCL methods from System.String
|
|
35
|
-
* All System.String instance methods are available on string primitives.
|
|
36
|
-
* In JS mode, @tsonic/js-globals may override with JS-specific methods.
|
|
37
45
|
*/
|
|
38
|
-
interface String extends String$instance {}
|
|
46
|
+
interface String extends String$instance, __String$views {}
|
|
39
47
|
|
|
40
48
|
/**
|
|
41
49
|
* Number - augmented with BCL methods from System.Double
|
|
42
|
-
* All System.Double instance methods are available on number primitives.
|
|
43
50
|
*/
|
|
44
|
-
interface Number extends Double$instance {}
|
|
51
|
+
interface Number extends Double$instance, __Double$views {}
|
|
45
52
|
|
|
46
53
|
/**
|
|
47
54
|
* Boolean - augmented with BCL methods from System.Boolean
|
|
48
|
-
* All System.Boolean instance methods are available on boolean primitives.
|
|
49
55
|
*/
|
|
50
|
-
interface Boolean extends Boolean$instance {}
|
|
56
|
+
interface Boolean extends Boolean$instance, __Boolean$views {}
|
|
51
57
|
|
|
52
58
|
/**
|
|
53
|
-
* Object -
|
|
59
|
+
* Object - augmented with BCL methods from System.Object
|
|
54
60
|
*/
|
|
55
|
-
interface Object {
|
|
61
|
+
interface Object extends Object$instance {
|
|
56
62
|
constructor: Function;
|
|
57
63
|
}
|
|
58
64
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsonic/globals",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
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
|
-
"files": [
|
|
8
|
-
"index.d.ts",
|
|
9
|
-
"README.md"
|
|
10
|
-
],
|
|
11
7
|
"scripts": {
|
|
12
8
|
"typecheck": "tsc --noEmit"
|
|
13
9
|
},
|
|
14
10
|
"dependencies": {
|
|
15
|
-
"@tsonic/dotnet": "^0.
|
|
11
|
+
"@tsonic/dotnet": "^0.8.1"
|
|
16
12
|
},
|
|
17
13
|
"devDependencies": {
|
|
18
14
|
"typescript": "^5.0.0"
|