@tsonic/globals 0.2.0 → 0.3.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.
- package/index.d.ts +8 -5
- package/package.json +5 -2
package/index.d.ts
CHANGED
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
* This package provides:
|
|
7
7
|
* 1. Base types required by TypeScript (Array, String, Object, Function, etc.)
|
|
8
8
|
* 2. Shared types used by both modes (utility types, iterators, Promise, Symbol)
|
|
9
|
+
* 3. BCL primitive methods on String, Number, Boolean (from @tsonic/dotnet)
|
|
9
10
|
*
|
|
10
|
-
* For dotnet mode: Use this package alone.
|
|
11
|
+
* For dotnet mode: Use this package alone. Primitives have BCL methods.
|
|
11
12
|
* For JS mode: Use with @tsonic/js-globals which extends base types with JS methods.
|
|
12
13
|
*/
|
|
13
14
|
|
|
15
|
+
import { String$instance } from "@tsonic/dotnet/System";
|
|
16
|
+
|
|
14
17
|
declare global {
|
|
15
18
|
/**
|
|
16
19
|
* Array type - minimal base definition
|
|
@@ -28,11 +31,11 @@ declare global {
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
* String -
|
|
32
|
-
*
|
|
33
|
-
* In JS mode, @tsonic/js-globals
|
|
34
|
+
* 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.
|
|
34
37
|
*/
|
|
35
|
-
interface String {}
|
|
38
|
+
interface String extends String$instance {}
|
|
36
39
|
|
|
37
40
|
interface Number {}
|
|
38
41
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsonic/globals",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
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": [
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"typecheck": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@tsonic/dotnet": "^0.7.7"
|
|
16
|
+
},
|
|
14
17
|
"devDependencies": {
|
|
15
18
|
"typescript": "^5.0.0"
|
|
16
19
|
},
|