@tsonic/js 10.0.38 → 10.0.39

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 ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "bindings": {
3
+ "console": {
4
+ "kind": "global",
5
+ "assembly": "Tsonic.JSRuntime",
6
+ "type": "Tsonic.JSRuntime.console"
7
+ },
8
+ "Date": {
9
+ "kind": "global",
10
+ "assembly": "Tsonic.JSRuntime",
11
+ "type": "Tsonic.JSRuntime.Date"
12
+ },
13
+ "JSON": {
14
+ "kind": "global",
15
+ "assembly": "Tsonic.JSRuntime",
16
+ "type": "Tsonic.JSRuntime.JSON"
17
+ },
18
+ "Math": {
19
+ "kind": "global",
20
+ "assembly": "Tsonic.JSRuntime",
21
+ "type": "Tsonic.JSRuntime.Math"
22
+ },
23
+ "RegExp": {
24
+ "kind": "global",
25
+ "assembly": "Tsonic.JSRuntime",
26
+ "type": "Tsonic.JSRuntime.RegExp"
27
+ },
28
+ "Map": {
29
+ "kind": "global",
30
+ "assembly": "Tsonic.JSRuntime",
31
+ "type": "Tsonic.JSRuntime.Map`2",
32
+ "csharpName": "Map"
33
+ },
34
+ "Set": {
35
+ "kind": "global",
36
+ "assembly": "Tsonic.JSRuntime",
37
+ "type": "Tsonic.JSRuntime.Set`1",
38
+ "csharpName": "Set"
39
+ },
40
+ "Array": {
41
+ "kind": "global",
42
+ "assembly": "Tsonic.JSRuntime",
43
+ "type": "Tsonic.JSRuntime.JSArray`1",
44
+ "csharpName": "JSArray"
45
+ },
46
+ "ReadonlyArray": {
47
+ "kind": "global",
48
+ "assembly": "Tsonic.JSRuntime",
49
+ "type": "Tsonic.JSRuntime.JSArray`1",
50
+ "csharpName": "JSArray"
51
+ },
52
+ "parseInt": {
53
+ "kind": "global",
54
+ "assembly": "Tsonic.JSRuntime",
55
+ "type": "Tsonic.JSRuntime.Globals",
56
+ "csharpName": "Globals.parseInt"
57
+ },
58
+ "parseFloat": {
59
+ "kind": "global",
60
+ "assembly": "Tsonic.JSRuntime",
61
+ "type": "Tsonic.JSRuntime.Globals",
62
+ "csharpName": "Globals.parseFloat"
63
+ },
64
+ "isFinite": {
65
+ "kind": "global",
66
+ "assembly": "Tsonic.JSRuntime",
67
+ "type": "Tsonic.JSRuntime.Globals",
68
+ "csharpName": "Globals.isFinite"
69
+ },
70
+ "isNaN": {
71
+ "kind": "global",
72
+ "assembly": "Tsonic.JSRuntime",
73
+ "type": "Tsonic.JSRuntime.Globals",
74
+ "csharpName": "Globals.isNaN"
75
+ }
76
+ }
77
+ }
package/globals.d.ts ADDED
@@ -0,0 +1,183 @@
1
+ import type { int, long, double } from "@tsonic/core/types.js";
2
+
3
+ declare global {
4
+ interface String {
5
+ readonly length: int;
6
+ trim(): string;
7
+ toUpperCase(): string;
8
+ toLowerCase(): string;
9
+ 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;
14
+ slice(start?: int, end?: int): string;
15
+ substring(start: int, end?: int): string;
16
+ replace(searchValue: string, replaceValue: string): string;
17
+ charAt(index: int): string;
18
+ charCodeAt(index: int): int;
19
+ }
20
+ interface Array<T> {
21
+ readonly length: int;
22
+ at(index: int): T;
23
+ concat(...items: T[]): T[];
24
+ every(callback: (value: T) => boolean): boolean;
25
+ filter(callback: (value: T) => boolean): T[];
26
+ filter(callback: (value: T, index: int) => boolean): T[];
27
+ find(callback: (value: T) => boolean): T | undefined;
28
+ find(callback: (value: T, index: int) => boolean): T | undefined;
29
+ findIndex(callback: (value: T) => boolean): int;
30
+ findIndex(callback: (value: T, index: int) => boolean): int;
31
+ findLast(callback: (value: T) => boolean): T | undefined;
32
+ findLast(callback: (value: T, index: int) => boolean): T | undefined;
33
+ findLastIndex(callback: (value: T) => boolean): int;
34
+ findLastIndex(callback: (value: T, index: int) => boolean): int;
35
+ flat(depth?: int): unknown[];
36
+ forEach(callback: (value: T) => void): void;
37
+ forEach(callback: (value: T, index: int) => void): void;
38
+ includes(searchElement: T): boolean;
39
+ includes(searchElement: T, fromIndex?: int): boolean;
40
+ indexOf(searchElement: T, fromIndex?: int): int;
41
+ join(separator?: string): string;
42
+ lastIndexOf(searchElement: T, fromIndex?: int): int;
43
+ map<TResult>(callback: (value: T) => TResult): TResult[];
44
+ map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
45
+ 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;
54
+ slice(start?: int, end?: int): T[];
55
+ some(callback: (value: T) => boolean): boolean;
56
+ }
57
+ interface ReadonlyArray<T> {
58
+ readonly length: int;
59
+ at(index: int): T;
60
+ concat(...items: T[]): T[];
61
+ every(callback: (value: T) => boolean): boolean;
62
+ filter(callback: (value: T) => boolean): T[];
63
+ filter(callback: (value: T, index: int) => boolean): T[];
64
+ find(callback: (value: T) => boolean): T | undefined;
65
+ find(callback: (value: T, index: int) => boolean): T | undefined;
66
+ findIndex(callback: (value: T) => boolean): int;
67
+ findIndex(callback: (value: T, index: int) => boolean): int;
68
+ findLast(callback: (value: T) => boolean): T | undefined;
69
+ findLast(callback: (value: T, index: int) => boolean): T | undefined;
70
+ findLastIndex(callback: (value: T) => boolean): int;
71
+ findLastIndex(callback: (value: T, index: int) => boolean): int;
72
+ flat(depth?: int): unknown[];
73
+ forEach(callback: (value: T) => void): void;
74
+ forEach(callback: (value: T, index: int) => void): void;
75
+ includes(searchElement: T): boolean;
76
+ includes(searchElement: T, fromIndex?: int): boolean;
77
+ indexOf(searchElement: T, fromIndex?: int): int;
78
+ join(separator?: string): string;
79
+ lastIndexOf(searchElement: T, fromIndex?: int): int;
80
+ map<TResult>(callback: (value: T) => TResult): TResult[];
81
+ map<TResult>(callback: (value: T, index: int) => TResult): TResult[];
82
+ 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;
91
+ slice(start?: int, end?: int): T[];
92
+ some(callback: (value: T) => boolean): boolean;
93
+ }
94
+ interface Console {
95
+ log(...data: unknown[]): void;
96
+ error(...data: unknown[]): void;
97
+ warn(...data: unknown[]): void;
98
+ info(...data: unknown[]): void;
99
+ debug(...data: unknown[]): void;
100
+ }
101
+ const console: Console;
102
+ interface Date {
103
+ toISOString(): string;
104
+ getTime(): long;
105
+ }
106
+ interface DateConstructor {
107
+ new (): Date;
108
+ new (value: string | number | long): Date;
109
+ now(): long;
110
+ parse(s: string): long;
111
+ }
112
+ const Date: DateConstructor;
113
+ interface JSON {
114
+ parse<T = unknown>(text: string): T;
115
+ stringify(
116
+ value: unknown,
117
+ replacer?: unknown,
118
+ space?: string | number | int
119
+ ): string;
120
+ }
121
+ const JSON: JSON;
122
+ interface Math {
123
+ round(x: double): double;
124
+ max(...values: double[]): double;
125
+ min(...values: double[]): double;
126
+ random(): double;
127
+ }
128
+ const Math: Math;
129
+ interface RegExpMatchArray extends Array<string> {
130
+ index?: int;
131
+ input?: string;
132
+ }
133
+ interface RegExp {
134
+ exec(string: string): RegExpMatchArray | null;
135
+ test(string: string): boolean;
136
+ }
137
+ interface RegExpConstructor {
138
+ new (pattern: string | RegExp, flags?: string): RegExp;
139
+ (pattern: string | RegExp, flags?: string): RegExp;
140
+ }
141
+ const RegExp: RegExpConstructor;
142
+ interface Map<K, V> {
143
+ readonly size: int;
144
+ clear(): void;
145
+ delete(key: K): boolean;
146
+ get(key: K): V | undefined;
147
+ has(key: K): boolean;
148
+ set(key: K, value: V): this;
149
+ }
150
+ interface MapConstructor {
151
+ new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
152
+ }
153
+ const Map: MapConstructor;
154
+ interface Set<T> {
155
+ readonly size: int;
156
+ add(value: T): this;
157
+ clear(): void;
158
+ delete(value: T): boolean;
159
+ has(value: T): boolean;
160
+ }
161
+ interface SetConstructor {
162
+ new <T = unknown>(values?: readonly T[] | null): Set<T>;
163
+ }
164
+ const Set: SetConstructor;
165
+ function parseInt(str: string, radix?: int): long | undefined;
166
+ function parseFloat(str: string): double;
167
+ function isFinite(value: double): boolean;
168
+ function isNaN(value: double): boolean;
169
+ function setTimeout(
170
+ handler: (...args: unknown[]) => void,
171
+ timeout?: int,
172
+ ...args: unknown[]
173
+ ): int;
174
+ function clearTimeout(id: int): void;
175
+ function setInterval(
176
+ handler: (...args: unknown[]) => void,
177
+ timeout?: int,
178
+ ...args: unknown[]
179
+ ): int;
180
+ function clearInterval(id: int): void;
181
+ }
182
+
183
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/js",
3
- "version": "10.0.38",
3
+ "version": "10.0.39",
4
4
  "description": "TypeScript type definitions for JavaScript Runtime (JSRuntime) library",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -0,0 +1,7 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "@tsonic/js",
4
+ "extends": [],
5
+ "requiredTypeRoots": ["."],
6
+ "useStandardLib": false
7
+ }