strict-ts-lib-v7.0 0.2.0 → 0.5.0

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.
Files changed (109) hide show
  1. package/README.md +15 -7
  2. package/libs-branded/decorators/index.d.ts +360 -0
  3. package/libs-branded/decorators/legacy/index.d.ts +17 -0
  4. package/libs-branded/dom/asynciterable/index.d.ts +2 -0
  5. package/libs-branded/dom/index.d.ts +53074 -0
  6. package/libs-branded/dom/iterable/index.d.ts +2 -0
  7. package/libs-branded/es2015/collection/index.d.ts +160 -0
  8. package/libs-branded/es2015/core/index.d.ts +710 -0
  9. package/libs-branded/es2015/generator/index.d.ts +63 -0
  10. package/libs-branded/es2015/index.d.ts +10 -0
  11. package/libs-branded/es2015/iterable/index.d.ts +703 -0
  12. package/libs-branded/es2015/promise/index.d.ts +72 -0
  13. package/libs-branded/es2015/proxy/index.d.ts +129 -0
  14. package/libs-branded/es2015/reflect/index.d.ts +143 -0
  15. package/libs-branded/es2015/symbol/index.d.ts +28 -0
  16. package/libs-branded/es2015/symbol-wellknown/index.d.ts +334 -0
  17. package/libs-branded/es2016/array-include/index.d.ts +131 -0
  18. package/libs-branded/es2016/full/index.d.ts +5 -0
  19. package/libs-branded/es2016/index.d.ts +3 -0
  20. package/libs-branded/es2016/intl/index.d.ts +15 -0
  21. package/libs-branded/es2017/arraybuffer/index.d.ts +3 -0
  22. package/libs-branded/es2017/date/index.d.ts +21 -0
  23. package/libs-branded/es2017/full/index.d.ts +5 -0
  24. package/libs-branded/es2017/index.d.ts +8 -0
  25. package/libs-branded/es2017/intl/index.d.ts +26 -0
  26. package/libs-branded/es2017/object/index.d.ts +113 -0
  27. package/libs-branded/es2017/sharedmemory/index.d.ts +390 -0
  28. package/libs-branded/es2017/string/index.d.ts +37 -0
  29. package/libs-branded/es2017/typedarrays/index.d.ts +35 -0
  30. package/libs-branded/es2018/asyncgenerator/index.d.ts +67 -0
  31. package/libs-branded/es2018/asynciterable/index.d.ts +47 -0
  32. package/libs-branded/es2018/full/index.d.ts +6 -0
  33. package/libs-branded/es2018/index.d.ts +6 -0
  34. package/libs-branded/es2018/intl/index.d.ts +90 -0
  35. package/libs-branded/es2018/promise/index.d.ts +12 -0
  36. package/libs-branded/es2018/regexp/index.d.ts +19 -0
  37. package/libs-branded/es2019/array/index.d.ts +98 -0
  38. package/libs-branded/es2019/full/index.d.ts +6 -0
  39. package/libs-branded/es2019/index.d.ts +6 -0
  40. package/libs-branded/es2019/intl/index.d.ts +5 -0
  41. package/libs-branded/es2019/object/index.d.ts +140 -0
  42. package/libs-branded/es2019/string/index.d.ts +19 -0
  43. package/libs-branded/es2019/symbol/index.d.ts +6 -0
  44. package/libs-branded/es2020/bigint/index.d.ts +1066 -0
  45. package/libs-branded/es2020/date/index.d.ts +33 -0
  46. package/libs-branded/es2020/full/index.d.ts +6 -0
  47. package/libs-branded/es2020/index.d.ts +9 -0
  48. package/libs-branded/es2020/intl/index.d.ts +492 -0
  49. package/libs-branded/es2020/number/index.d.ts +13 -0
  50. package/libs-branded/es2020/promise/index.d.ts +35 -0
  51. package/libs-branded/es2020/sharedmemory/index.d.ts +171 -0
  52. package/libs-branded/es2020/string/index.d.ts +30 -0
  53. package/libs-branded/es2020/symbol-wellknown/index.d.ts +27 -0
  54. package/libs-branded/es2021/full/index.d.ts +6 -0
  55. package/libs-branded/es2021/index.d.ts +5 -0
  56. package/libs-branded/es2021/intl/index.d.ts +160 -0
  57. package/libs-branded/es2021/promise/index.d.ts +32 -0
  58. package/libs-branded/es2021/string/index.d.ts +18 -0
  59. package/libs-branded/es2021/weakref/index.d.ts +60 -0
  60. package/libs-branded/es2022/array/index.d.ts +125 -0
  61. package/libs-branded/es2022/error/index.d.ts +57 -0
  62. package/libs-branded/es2022/full/index.d.ts +6 -0
  63. package/libs-branded/es2022/index.d.ts +7 -0
  64. package/libs-branded/es2022/intl/index.d.ts +142 -0
  65. package/libs-branded/es2022/object/index.d.ts +40 -0
  66. package/libs-branded/es2022/regexp/index.d.ts +26 -0
  67. package/libs-branded/es2022/string/index.d.ts +7 -0
  68. package/libs-branded/es2023/array/index.d.ts +1095 -0
  69. package/libs-branded/es2023/collection/index.d.ts +3 -0
  70. package/libs-branded/es2023/full/index.d.ts +6 -0
  71. package/libs-branded/es2023/index.d.ts +4 -0
  72. package/libs-branded/es2023/intl/index.d.ts +112 -0
  73. package/libs-branded/es2024/arraybuffer/index.d.ts +56 -0
  74. package/libs-branded/es2024/collection/index.d.ts +11 -0
  75. package/libs-branded/es2024/full/index.d.ts +6 -0
  76. package/libs-branded/es2024/index.d.ts +8 -0
  77. package/libs-branded/es2024/object/index.d.ts +11 -0
  78. package/libs-branded/es2024/promise/index.d.ts +17 -0
  79. package/libs-branded/es2024/regexp/index.d.ts +7 -0
  80. package/libs-branded/es2024/sharedmemory/index.d.ts +69 -0
  81. package/libs-branded/es2024/string/index.d.ts +11 -0
  82. package/libs-branded/es2025/collection/index.d.ts +78 -0
  83. package/libs-branded/es2025/float16/index.d.ts +503 -0
  84. package/libs-branded/es2025/full/index.d.ts +6 -0
  85. package/libs-branded/es2025/index.d.ts +7 -0
  86. package/libs-branded/es2025/intl/index.d.ts +221 -0
  87. package/libs-branded/es2025/iterator/index.d.ts +170 -0
  88. package/libs-branded/es2025/promise/index.d.ts +19 -0
  89. package/libs-branded/es2025/regexp/index.d.ts +14 -0
  90. package/libs-branded/es5/index.d.ts +6562 -0
  91. package/libs-branded/es6/index.d.ts +5 -0
  92. package/libs-branded/esnext/array/index.d.ts +26 -0
  93. package/libs-branded/esnext/collection/index.d.ts +31 -0
  94. package/libs-branded/esnext/date/index.d.ts +5 -0
  95. package/libs-branded/esnext/decorators/index.d.ts +10 -0
  96. package/libs-branded/esnext/disposable/index.d.ts +173 -0
  97. package/libs-branded/esnext/error/index.d.ts +6 -0
  98. package/libs-branded/esnext/full/index.d.ts +6 -0
  99. package/libs-branded/esnext/index.d.ts +11 -0
  100. package/libs-branded/esnext/intl/index.d.ts +105 -0
  101. package/libs-branded/esnext/sharedmemory/index.d.ts +7 -0
  102. package/libs-branded/esnext/temporal/index.d.ts +684 -0
  103. package/libs-branded/esnext/typedarrays/index.d.ts +78 -0
  104. package/libs-branded/scripthost/index.d.ts +308 -0
  105. package/libs-branded/webworker/asynciterable/index.d.ts +2 -0
  106. package/libs-branded/webworker/importscripts/index.d.ts +5 -0
  107. package/libs-branded/webworker/index.d.ts +18826 -0
  108. package/libs-branded/webworker/iterable/index.d.ts +2 -0
  109. package/package.json +4 -2
@@ -0,0 +1,131 @@
1
+ interface Array<T> {
2
+ /**
3
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
4
+ * @param searchElement The element to search for.
5
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
6
+ */
7
+ includes(
8
+ searchElement: T | (import('ts-type-forge').WidenLiteral<T> & {}),
9
+ fromIndex?: NumberType.ArraySizeArg,
10
+ ): searchElement is T;
11
+ }
12
+
13
+ interface ReadonlyArray<T> {
14
+ /**
15
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
16
+ * @param searchElement The element to search for.
17
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
18
+ */
19
+ includes(
20
+ searchElement: T | (import('ts-type-forge').WidenLiteral<T> & {}),
21
+ fromIndex?: NumberType.ArraySizeArg,
22
+ ): searchElement is T;
23
+ }
24
+
25
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike> {
26
+ /**
27
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
28
+ * @param searchElement The element to search for.
29
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
30
+ */
31
+ includes(
32
+ searchElement: import('ts-type-forge').Int8,
33
+ fromIndex?: NumberType.TypedArraySizeArg,
34
+ ): boolean;
35
+ }
36
+
37
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
38
+ /**
39
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
40
+ * @param searchElement The element to search for.
41
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
42
+ */
43
+ includes(
44
+ searchElement: import('ts-type-forge').Uint8,
45
+ fromIndex?: NumberType.TypedArraySizeArg,
46
+ ): boolean;
47
+ }
48
+
49
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike> {
50
+ /**
51
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
52
+ * @param searchElement The element to search for.
53
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
54
+ */
55
+ includes(
56
+ searchElement: import('ts-type-forge').Uint8,
57
+ fromIndex?: NumberType.TypedArraySizeArg,
58
+ ): boolean;
59
+ }
60
+
61
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike> {
62
+ /**
63
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
64
+ * @param searchElement The element to search for.
65
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
66
+ */
67
+ includes(
68
+ searchElement: import('ts-type-forge').Int16,
69
+ fromIndex?: NumberType.TypedArraySizeArg,
70
+ ): boolean;
71
+ }
72
+
73
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike> {
74
+ /**
75
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
76
+ * @param searchElement The element to search for.
77
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
78
+ */
79
+ includes(
80
+ searchElement: import('ts-type-forge').Uint16,
81
+ fromIndex?: NumberType.TypedArraySizeArg,
82
+ ): boolean;
83
+ }
84
+
85
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike> {
86
+ /**
87
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
88
+ * @param searchElement The element to search for.
89
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
90
+ */
91
+ includes(
92
+ searchElement: import('ts-type-forge').Int32,
93
+ fromIndex?: NumberType.TypedArraySizeArg,
94
+ ): boolean;
95
+ }
96
+
97
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike> {
98
+ /**
99
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
100
+ * @param searchElement The element to search for.
101
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
102
+ */
103
+ includes(
104
+ searchElement: import('ts-type-forge').Uint32,
105
+ fromIndex?: NumberType.TypedArraySizeArg,
106
+ ): boolean;
107
+ }
108
+
109
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike> {
110
+ /**
111
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
112
+ * @param searchElement The element to search for.
113
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
114
+ */
115
+ includes(
116
+ searchElement: import('ts-type-forge').Float32,
117
+ fromIndex?: NumberType.TypedArraySizeArg,
118
+ ): boolean;
119
+ }
120
+
121
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike> {
122
+ /**
123
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
124
+ * @param searchElement The element to search for.
125
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
126
+ */
127
+ includes(
128
+ searchElement: import('ts-type-forge').Float64,
129
+ fromIndex?: NumberType.TypedArraySizeArg,
130
+ ): boolean;
131
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference lib="es2016" />
2
+ /// <reference lib="dom" />
3
+ /// <reference lib="webworker.importscripts" />
4
+ /// <reference lib="scripthost" />
5
+ /// <reference lib="dom.iterable" />
@@ -0,0 +1,3 @@
1
+ /// <reference lib="es2015" />
2
+ /// <reference lib="es2016.array.include" />
3
+ /// <reference lib="es2016.intl" />
@@ -0,0 +1,15 @@
1
+ declare namespace Intl {
2
+ /**
3
+ * The `Intl.getCanonicalLocales()` method returns an array containing
4
+ * the canonical locale names. Duplicates will be omitted and elements
5
+ * will be validated as structurally valid language tags.
6
+ *
7
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales)
8
+ *
9
+ * @param locale A list of String values for which to get the canonical locale names
10
+ * @returns An array containing the canonical and validated locale names.
11
+ */
12
+ function getCanonicalLocales(
13
+ locale?: string | readonly string[],
14
+ ): readonly string[];
15
+ }
@@ -0,0 +1,3 @@
1
+ interface ArrayBufferConstructor {
2
+ new (): ArrayBuffer;
3
+ }
@@ -0,0 +1,21 @@
1
+ interface DateConstructor {
2
+ /**
3
+ * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
4
+ * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
5
+ * @param monthIndex The month as a number between 0 and 11 (January to December).
6
+ * @param date The date as a number between 1 and 31.
7
+ * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
8
+ * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
9
+ * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
10
+ * @param ms A number from 0 to 999 that specifies the milliseconds.
11
+ */
12
+ UTC(
13
+ year: NumberType.YearEnum,
14
+ monthIndex?: import('ts-type-forge').MonthIndexEnum,
15
+ date?: import('ts-type-forge').DateEnum,
16
+ hours?: import('ts-type-forge').HoursEnum,
17
+ minutes?: import('ts-type-forge').MinutesEnum,
18
+ seconds?: import('ts-type-forge').SecondsEnum,
19
+ ms?: import('ts-type-forge').MillisecondsEnum,
20
+ ): import('ts-type-forge').SafeUint;
21
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference lib="es2017" />
2
+ /// <reference lib="dom" />
3
+ /// <reference lib="webworker.importscripts" />
4
+ /// <reference lib="scripthost" />
5
+ /// <reference lib="dom.iterable" />
@@ -0,0 +1,8 @@
1
+ /// <reference lib="es2016" />
2
+ /// <reference lib="es2017.arraybuffer" />
3
+ /// <reference lib="es2017.date" />
4
+ /// <reference lib="es2017.intl" />
5
+ /// <reference lib="es2017.object" />
6
+ /// <reference lib="es2017.sharedmemory" />
7
+ /// <reference lib="es2017.string" />
8
+ /// <reference lib="es2017.typedarrays" />
@@ -0,0 +1,26 @@
1
+ declare namespace Intl {
2
+ interface DateTimeFormatPartTypesRegistry {
3
+ readonly day: unknown;
4
+ readonly dayPeriod: unknown;
5
+ readonly era: unknown;
6
+ readonly hour: unknown;
7
+ readonly literal: unknown;
8
+ readonly minute: unknown;
9
+ readonly month: unknown;
10
+ readonly second: unknown;
11
+ readonly timeZoneName: unknown;
12
+ readonly weekday: unknown;
13
+ readonly year: unknown;
14
+ }
15
+
16
+ type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;
17
+
18
+ interface DateTimeFormatPart {
19
+ readonly type: DateTimeFormatPartTypes;
20
+ readonly value: string;
21
+ }
22
+
23
+ interface DateTimeFormat {
24
+ formatToParts(date?: Date | number): readonly DateTimeFormatPart[];
25
+ }
26
+ }
@@ -0,0 +1,113 @@
1
+ declare namespace StrictLibInternals {
2
+ /**
3
+ * Opens a union of string literals so that it still accepts — and
4
+ * completes to — the literals, without rejecting the excess keys a
5
+ * wider object may carry.
6
+ *
7
+ * Adds nothing when `K` already contains `string`: `string | (string & {})`
8
+ * *is* `string`, so the arm would only leave a confusing artifact in
9
+ * every type computed from it.
10
+ *
11
+ * @internal
12
+ */
13
+ type WithOpenString<K> = string extends K ? K : K | (string & {});
14
+
15
+ /** @internal */
16
+ type ToObjectKeys<R extends import('ts-type-forge').UnknownRecord> =
17
+ WithOpenString<ToStr<keyof R>>;
18
+
19
+ /** @internal */
20
+ type ToStr<A> = A extends string ? A : A extends number ? `${A}` : never;
21
+
22
+ /** @internal */
23
+ type PickByValue<R, V> = Pick<
24
+ R,
25
+ {
26
+ [K in keyof R]: R[K] extends V ? K : never;
27
+ }[keyof R]
28
+ >;
29
+
30
+ /** @internal */
31
+ type ToObjectEntries<R extends import('ts-type-forge').UnknownRecord> =
32
+ R extends R
33
+ ? readonly (
34
+ | (string extends ToStr<keyof R>
35
+ ? never
36
+ : readonly [
37
+ string & {},
38
+ import('ts-type-forge').WidenLiteral<
39
+ import('ts-type-forge').ValueOf<R>
40
+ >,
41
+ ])
42
+ | {
43
+ readonly [K in keyof R]: readonly [
44
+ ToStr<keyof PickByValue<R, R[K]>>,
45
+ R[K],
46
+ ];
47
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
48
+ }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
49
+ )[]
50
+ : never;
51
+ }
52
+
53
+ interface ObjectConstructor {
54
+ /**
55
+ * Returns an array of values of the enumerable own properties of an object
56
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
57
+ */
58
+ values<T>(o: { readonly [s: string]: T } | ArrayLike<T>): readonly T[];
59
+
60
+ /**
61
+ * Returns an array of values of the enumerable own properties of an object
62
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
63
+ */
64
+ values(o: {}): readonly unknown[];
65
+
66
+ /**
67
+ * Returns an array of key/values of the enumerable own properties of an object
68
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
69
+ *
70
+ * ```ts
71
+ * const obj = {
72
+ * x: 1,
73
+ * y: 2,
74
+ * z: 2,
75
+ * 3: 4,
76
+ * } as const;
77
+ *
78
+ * const entries = Object.entries(obj); // (['3', 4] | ['x', 1] | ['y' | 'z', 2] | [string, unknown])[]
79
+ * ```
80
+ *
81
+ */
82
+ entries<const R extends import('ts-type-forge').UnknownRecord>(
83
+ object: R,
84
+ ): StrictLibInternals.ToObjectEntries<R>;
85
+
86
+ /**
87
+ * Returns an array of key/values of the enumerable own properties of an
88
+ * object
89
+ *
90
+ * @param o Object that contains the properties and methods. This can be an
91
+ * object that you created or an existing Document Object Model (DOM)
92
+ * object.
93
+ */
94
+ entries<T>(
95
+ o: { readonly [s: string]: T } | ArrayLike<T>,
96
+ ): readonly (readonly [string, T])[];
97
+
98
+ /**
99
+ * Returns an array of key/values of the enumerable own properties of an object
100
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
101
+ */
102
+ entries(o: {}): readonly (readonly [string, unknown])[];
103
+
104
+ /**
105
+ * Returns an object containing all own property descriptors of an object
106
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
107
+ */
108
+ getOwnPropertyDescriptors<T>(o: T): {
109
+ readonly [P in keyof T]: TypedPropertyDescriptor<T[P]>;
110
+ } & {
111
+ readonly [x: string]: PropertyDescriptor;
112
+ };
113
+ }