@tsonic/globals 0.3.4 → 0.3.6
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 +21 -8
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -17,29 +17,42 @@ import {
|
|
|
17
17
|
Boolean$instance, __Boolean$views,
|
|
18
18
|
Object$instance
|
|
19
19
|
} from "@tsonic/dotnet/System/internal/index.js";
|
|
20
|
-
import {
|
|
20
|
+
import { IEnumerable_1 } from "@tsonic/dotnet/System.Collections.Generic/internal/index.js";
|
|
21
21
|
|
|
22
22
|
declare global {
|
|
23
23
|
/**
|
|
24
|
-
* Array<T> -
|
|
24
|
+
* Array<T> - C# array type (T[])
|
|
25
25
|
*
|
|
26
|
-
*
|
|
26
|
+
* C# arrays are fixed-size and do NOT have IList<T>/ICollection<T> instance methods.
|
|
27
|
+
* They only support:
|
|
27
28
|
* - System.Array instance methods (length, rank, clone, copyTo, etc.)
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
29
|
+
* - IEnumerable<T> for iteration (foreach)
|
|
30
|
+
* - Indexer access
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
+
* For mutable collection operations (add, remove, etc.), use List<T> instead.
|
|
33
|
+
* For LINQ operations (map, filter, etc.), use Enumerable methods.
|
|
32
34
|
*/
|
|
33
|
-
interface Array<T> extends Array$instance, __Array$views,
|
|
35
|
+
interface Array<T> extends Array$instance, __Array$views, IEnumerable_1<T> {
|
|
34
36
|
[n: number]: T;
|
|
35
37
|
[Symbol.iterator](): IterableIterator<T>;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
interface ReadonlyArray<T> extends Array$instance, __Array$views,
|
|
40
|
+
interface ReadonlyArray<T> extends Array$instance, __Array$views, IEnumerable_1<T> {
|
|
39
41
|
readonly [n: number]: T;
|
|
40
42
|
[Symbol.iterator](): IterableIterator<T>;
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
/**
|
|
46
|
+
* ArrayConstructor - allows new Array<T>(size) syntax
|
|
47
|
+
* In dotnet mode: emits as new T[size]
|
|
48
|
+
* In js mode: emits as new List<T>() with capacity
|
|
49
|
+
*/
|
|
50
|
+
interface ArrayConstructor {
|
|
51
|
+
new <T>(size?: number): T[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const Array: ArrayConstructor;
|
|
55
|
+
|
|
43
56
|
/**
|
|
44
57
|
* String - augmented with BCL methods from System.String
|
|
45
58
|
*/
|