strict-ts-lib-v6.0 0.2.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 +28 -0
  2. package/libs/decorators/index.d.ts +360 -0
  3. package/libs/decorators/legacy/index.d.ts +17 -0
  4. package/libs/dom/asynciterable/index.d.ts +2 -0
  5. package/libs/dom/index.d.ts +53065 -0
  6. package/libs/dom/iterable/index.d.ts +2 -0
  7. package/libs/es2015/collection/index.d.ts +151 -0
  8. package/libs/es2015/core/index.d.ts +645 -0
  9. package/libs/es2015/generator/index.d.ts +63 -0
  10. package/libs/es2015/index.d.ts +10 -0
  11. package/libs/es2015/iterable/index.d.ts +658 -0
  12. package/libs/es2015/promise/index.d.ts +72 -0
  13. package/libs/es2015/proxy/index.d.ts +129 -0
  14. package/libs/es2015/reflect/index.d.ts +143 -0
  15. package/libs/es2015/symbol/index.d.ts +28 -0
  16. package/libs/es2015/symbol-wellknown/index.d.ts +329 -0
  17. package/libs/es2016/array-include/index.d.ts +113 -0
  18. package/libs/es2016/full/index.d.ts +5 -0
  19. package/libs/es2016/index.d.ts +3 -0
  20. package/libs/es2016/intl/index.d.ts +13 -0
  21. package/libs/es2017/arraybuffer/index.d.ts +3 -0
  22. package/libs/es2017/date/index.d.ts +21 -0
  23. package/libs/es2017/full/index.d.ts +5 -0
  24. package/libs/es2017/index.d.ts +8 -0
  25. package/libs/es2017/intl/index.d.ts +26 -0
  26. package/libs/es2017/object/index.d.ts +113 -0
  27. package/libs/es2017/sharedmemory/index.d.ts +246 -0
  28. package/libs/es2017/string/index.d.ts +27 -0
  29. package/libs/es2017/typedarrays/index.d.ts +35 -0
  30. package/libs/es2018/asyncgenerator/index.d.ts +67 -0
  31. package/libs/es2018/asynciterable/index.d.ts +47 -0
  32. package/libs/es2018/full/index.d.ts +6 -0
  33. package/libs/es2018/index.d.ts +6 -0
  34. package/libs/es2018/intl/index.d.ts +90 -0
  35. package/libs/es2018/promise/index.d.ts +12 -0
  36. package/libs/es2018/regexp/index.d.ts +19 -0
  37. package/libs/es2019/array/index.d.ts +92 -0
  38. package/libs/es2019/full/index.d.ts +6 -0
  39. package/libs/es2019/index.d.ts +6 -0
  40. package/libs/es2019/intl/index.d.ts +5 -0
  41. package/libs/es2019/object/index.d.ts +142 -0
  42. package/libs/es2019/string/index.d.ts +19 -0
  43. package/libs/es2019/symbol/index.d.ts +6 -0
  44. package/libs/es2020/bigint/index.d.ts +952 -0
  45. package/libs/es2020/date/index.d.ts +33 -0
  46. package/libs/es2020/full/index.d.ts +6 -0
  47. package/libs/es2020/index.d.ts +9 -0
  48. package/libs/es2020/intl/index.d.ts +492 -0
  49. package/libs/es2020/number/index.d.ts +13 -0
  50. package/libs/es2020/promise/index.d.ts +35 -0
  51. package/libs/es2020/sharedmemory/index.d.ts +144 -0
  52. package/libs/es2020/string/index.d.ts +30 -0
  53. package/libs/es2020/symbol-wellknown/index.d.ts +27 -0
  54. package/libs/es2021/full/index.d.ts +6 -0
  55. package/libs/es2021/index.d.ts +5 -0
  56. package/libs/es2021/intl/index.d.ts +159 -0
  57. package/libs/es2021/promise/index.d.ts +32 -0
  58. package/libs/es2021/string/index.d.ts +18 -0
  59. package/libs/es2021/weakref/index.d.ts +60 -0
  60. package/libs/es2022/array/index.d.ts +103 -0
  61. package/libs/es2022/error/index.d.ts +57 -0
  62. package/libs/es2022/full/index.d.ts +6 -0
  63. package/libs/es2022/index.d.ts +7 -0
  64. package/libs/es2022/intl/index.d.ts +142 -0
  65. package/libs/es2022/object/index.d.ts +40 -0
  66. package/libs/es2022/regexp/index.d.ts +23 -0
  67. package/libs/es2022/string/index.d.ts +7 -0
  68. package/libs/es2023/array/index.d.ts +913 -0
  69. package/libs/es2023/collection/index.d.ts +3 -0
  70. package/libs/es2023/full/index.d.ts +6 -0
  71. package/libs/es2023/index.d.ts +4 -0
  72. package/libs/es2023/intl/index.d.ts +112 -0
  73. package/libs/es2024/arraybuffer/index.d.ts +50 -0
  74. package/libs/es2024/collection/index.d.ts +11 -0
  75. package/libs/es2024/full/index.d.ts +6 -0
  76. package/libs/es2024/index.d.ts +8 -0
  77. package/libs/es2024/object/index.d.ts +11 -0
  78. package/libs/es2024/promise/index.d.ts +17 -0
  79. package/libs/es2024/regexp/index.d.ts +7 -0
  80. package/libs/es2024/sharedmemory/index.d.ts +67 -0
  81. package/libs/es2024/string/index.d.ts +11 -0
  82. package/libs/es2025/collection/index.d.ts +78 -0
  83. package/libs/es2025/float16/index.d.ts +503 -0
  84. package/libs/es2025/full/index.d.ts +6 -0
  85. package/libs/es2025/index.d.ts +7 -0
  86. package/libs/es2025/intl/index.d.ts +221 -0
  87. package/libs/es2025/iterator/index.d.ts +170 -0
  88. package/libs/es2025/promise/index.d.ts +19 -0
  89. package/libs/es2025/regexp/index.d.ts +14 -0
  90. package/libs/es5/index.d.ts +5844 -0
  91. package/libs/es6/index.d.ts +5 -0
  92. package/libs/esnext/array/index.d.ts +26 -0
  93. package/libs/esnext/collection/index.d.ts +31 -0
  94. package/libs/esnext/date/index.d.ts +5 -0
  95. package/libs/esnext/decorators/index.d.ts +10 -0
  96. package/libs/esnext/disposable/index.d.ts +173 -0
  97. package/libs/esnext/error/index.d.ts +6 -0
  98. package/libs/esnext/full/index.d.ts +6 -0
  99. package/libs/esnext/index.d.ts +11 -0
  100. package/libs/esnext/intl/index.d.ts +105 -0
  101. package/libs/esnext/sharedmemory/index.d.ts +7 -0
  102. package/libs/esnext/temporal/index.d.ts +684 -0
  103. package/libs/esnext/typedarrays/index.d.ts +78 -0
  104. package/libs/scripthost/index.d.ts +308 -0
  105. package/libs/webworker/asynciterable/index.d.ts +2 -0
  106. package/libs/webworker/importscripts/index.d.ts +5 -0
  107. package/libs/webworker/index.d.ts +18819 -0
  108. package/libs/webworker/iterable/index.d.ts +2 -0
  109. package/package.json +23 -0
@@ -0,0 +1,67 @@
1
+ /// <reference lib="es2018.asynciterable" />
2
+
3
+ interface AsyncGenerator<
4
+ T = unknown,
5
+ TReturn = any,
6
+ TNext = unknown,
7
+ > extends AsyncIteratorObject<T, TReturn, TNext> {
8
+ // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
9
+ next(
10
+ ...[value]: readonly [] | readonly [TNext]
11
+ ): Promise<IteratorResult<T, TReturn>>;
12
+ return(
13
+ value: TReturn | PromiseLike<TReturn>,
14
+ ): Promise<IteratorResult<T, TReturn>>;
15
+ throw(e: unknown): Promise<IteratorResult<T, TReturn>>;
16
+ [Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
17
+ }
18
+
19
+ interface AsyncGeneratorFunction {
20
+ /**
21
+ * Creates a new AsyncGenerator object.
22
+ * @param args A list of arguments the function accepts.
23
+ */
24
+ new (...args: readonly unknown[]): AsyncGenerator;
25
+ /**
26
+ * Creates a new AsyncGenerator object.
27
+ * @param args A list of arguments the function accepts.
28
+ */
29
+ (...args: readonly unknown[]): AsyncGenerator;
30
+ /**
31
+ * The length of the arguments.
32
+ */
33
+ readonly length: number;
34
+ /**
35
+ * Returns the name of the function.
36
+ */
37
+ readonly name: string;
38
+ /**
39
+ * A reference to the prototype.
40
+ */
41
+ readonly prototype: AsyncGenerator;
42
+ }
43
+
44
+ interface AsyncGeneratorFunctionConstructor {
45
+ /**
46
+ * Creates a new AsyncGenerator function.
47
+ * @param args A list of arguments the function accepts.
48
+ */
49
+ new (...args: readonly string[]): AsyncGeneratorFunction;
50
+ /**
51
+ * Creates a new AsyncGenerator function.
52
+ * @param args A list of arguments the function accepts.
53
+ */
54
+ (...args: readonly string[]): AsyncGeneratorFunction;
55
+ /**
56
+ * The length of the arguments.
57
+ */
58
+ readonly length: number;
59
+ /**
60
+ * Returns the name of the function.
61
+ */
62
+ readonly name: string;
63
+ /**
64
+ * A reference to the prototype.
65
+ */
66
+ readonly prototype: AsyncGeneratorFunction;
67
+ }
@@ -0,0 +1,47 @@
1
+ /// <reference lib="es2015.symbol" />
2
+ /// <reference lib="es2015.iterable" />
3
+
4
+ interface SymbolConstructor {
5
+ /**
6
+ * A method that returns the default async iterator for an object. Called by the semantics of
7
+ * the for-await-of statement.
8
+ */
9
+ readonly asyncIterator: unique symbol;
10
+ }
11
+
12
+ interface AsyncIterator<T, TReturn = any, TNext = unknown> {
13
+ // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
14
+ next(
15
+ ...[value]: readonly [] | readonly [TNext]
16
+ ): Promise<IteratorResult<T, TReturn>>;
17
+ return?(
18
+ value?: TReturn | PromiseLike<TReturn>,
19
+ ): Promise<IteratorResult<T, TReturn>>;
20
+ throw?(e?: unknown): Promise<IteratorResult<T, TReturn>>;
21
+ }
22
+
23
+ interface AsyncIterable<T, TReturn = any, TNext = unknown> {
24
+ [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
25
+ }
26
+
27
+ /**
28
+ * Describes a user-defined {@link AsyncIterator} that is also async iterable.
29
+ */
30
+ interface AsyncIterableIterator<
31
+ T,
32
+ TReturn = any,
33
+ TNext = unknown,
34
+ > extends AsyncIterator<T, TReturn, TNext> {
35
+ [Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
36
+ }
37
+
38
+ /**
39
+ * Describes an {@link AsyncIterator} produced by the runtime that inherits from the intrinsic `AsyncIterator.prototype`.
40
+ */
41
+ interface AsyncIteratorObject<
42
+ T,
43
+ TReturn = any,
44
+ TNext = unknown,
45
+ > extends AsyncIterator<T, TReturn, TNext> {
46
+ [Symbol.asyncIterator](): AsyncIteratorObject<T, TReturn, TNext>;
47
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference lib="es2018" />
2
+ /// <reference lib="dom" />
3
+ /// <reference lib="webworker.importscripts" />
4
+ /// <reference lib="scripthost" />
5
+ /// <reference lib="dom.iterable" />
6
+ /// <reference lib="dom.asynciterable" />
@@ -0,0 +1,6 @@
1
+ /// <reference lib="es2017" />
2
+ /// <reference lib="es2018.asynciterable" />
3
+ /// <reference lib="es2018.asyncgenerator" />
4
+ /// <reference lib="es2018.promise" />
5
+ /// <reference lib="es2018.regexp" />
6
+ /// <reference lib="es2018.intl" />
@@ -0,0 +1,90 @@
1
+ declare namespace Intl {
2
+ // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories
3
+ type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
4
+ type PluralRuleType = 'cardinal' | 'ordinal';
5
+
6
+ interface PluralRulesOptions {
7
+ readonly localeMatcher?: 'lookup' | 'best fit' | undefined;
8
+ readonly type?: PluralRuleType | undefined;
9
+ readonly minimumIntegerDigits?:
10
+ | import('ts-type-forge').UintRange<1, 22>
11
+ | undefined;
12
+ readonly minimumFractionDigits?:
13
+ | import('ts-type-forge').UintRange<0, 21>
14
+ | undefined;
15
+ readonly maximumFractionDigits?:
16
+ | import('ts-type-forge').UintRange<0, 21>
17
+ | undefined;
18
+ readonly minimumSignificantDigits?:
19
+ | import('ts-type-forge').UintRange<1, 22>
20
+ | undefined;
21
+ readonly maximumSignificantDigits?:
22
+ | import('ts-type-forge').UintRange<1, 22>
23
+ | undefined;
24
+ }
25
+
26
+ interface ResolvedPluralRulesOptions {
27
+ readonly locale: string;
28
+ readonly pluralCategories: readonly LDMLPluralRule[];
29
+ readonly type: PluralRuleType;
30
+ readonly minimumIntegerDigits: import('ts-type-forge').UintRange<1, 22>;
31
+ readonly minimumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
32
+ readonly maximumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
33
+ readonly minimumSignificantDigits?: import('ts-type-forge').UintRange<
34
+ 1,
35
+ 22
36
+ >;
37
+ readonly maximumSignificantDigits?: import('ts-type-forge').UintRange<
38
+ 1,
39
+ 22
40
+ >;
41
+ }
42
+
43
+ interface PluralRules {
44
+ resolvedOptions(): ResolvedPluralRulesOptions;
45
+ select(n: number): LDMLPluralRule;
46
+ }
47
+
48
+ interface PluralRulesConstructor {
49
+ new (
50
+ locales?: string | readonly string[],
51
+ options?: PluralRulesOptions,
52
+ ): PluralRules;
53
+ (
54
+ locales?: string | readonly string[],
55
+ options?: PluralRulesOptions,
56
+ ): PluralRules;
57
+ supportedLocalesOf(
58
+ locales: string | readonly string[],
59
+ options?: { readonly localeMatcher?: 'lookup' | 'best fit' },
60
+ ): string[];
61
+ }
62
+
63
+ const PluralRules: PluralRulesConstructor;
64
+
65
+ interface NumberFormatPartTypeRegistry {
66
+ readonly literal: never;
67
+ readonly nan: never;
68
+ readonly infinity: never;
69
+ readonly percent: never;
70
+ readonly integer: never;
71
+ readonly group: never;
72
+ readonly decimal: never;
73
+ readonly fraction: never;
74
+ readonly plusSign: never;
75
+ readonly minusSign: never;
76
+ readonly percentSign: never;
77
+ readonly currency: never;
78
+ }
79
+
80
+ type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry;
81
+
82
+ interface NumberFormatPart {
83
+ readonly type: NumberFormatPartTypes;
84
+ readonly value: string;
85
+ }
86
+
87
+ interface NumberFormat {
88
+ formatToParts(number?: number | bigint): NumberFormatPart[];
89
+ }
90
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents the completion of an asynchronous operation
3
+ */
4
+ interface Promise<T> {
5
+ /**
6
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
7
+ * resolved value cannot be modified from the callback.
8
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
9
+ * @returns A Promise for the completion of the callback.
10
+ */
11
+ finally(onfinally?: (() => void) | undefined | null): Promise<T>;
12
+ }
@@ -0,0 +1,19 @@
1
+ interface RegExpMatchArray {
2
+ readonly groups?: {
3
+ readonly [key: string]: string;
4
+ };
5
+ }
6
+
7
+ interface RegExpExecArray {
8
+ readonly groups?: {
9
+ readonly [key: string]: string;
10
+ };
11
+ }
12
+
13
+ interface RegExp {
14
+ /**
15
+ * Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression.
16
+ * Default is false. Read-only.
17
+ */
18
+ readonly dotAll: boolean;
19
+ }
@@ -0,0 +1,92 @@
1
+ type FlatArray<Arr, Depth extends number> = {
2
+ readonly done: Arr;
3
+ readonly recur: Arr extends ReadonlyArray<infer InnerArr>
4
+ ? FlatArray<
5
+ InnerArr,
6
+ (readonly [
7
+ -1,
8
+ 0,
9
+ 1,
10
+ 2,
11
+ 3,
12
+ 4,
13
+ 5,
14
+ 6,
15
+ 7,
16
+ 8,
17
+ 9,
18
+ 10,
19
+ 11,
20
+ 12,
21
+ 13,
22
+ 14,
23
+ 15,
24
+ 16,
25
+ 17,
26
+ 18,
27
+ 19,
28
+ 20,
29
+ ])[Depth]
30
+ >
31
+ : Arr;
32
+ }[Depth extends -1 ? 'done' : 'recur'];
33
+
34
+ interface ReadonlyArray<T> {
35
+ /**
36
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
37
+ * a new array.
38
+ * This is identical to a map followed by flat with depth 1.
39
+ *
40
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
41
+ * callback function one time for each element in the array.
42
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
43
+ * thisArg is omitted, undefined is used as the this value.
44
+ */
45
+ flatMap<U, This = undefined>(
46
+ callback: (
47
+ this: This,
48
+ value: T,
49
+ index: number,
50
+ array: readonly T[],
51
+ ) => U | ReadonlyArray<U>,
52
+ thisArg?: This,
53
+ ): U[];
54
+
55
+ /**
56
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
57
+ * specified depth.
58
+ *
59
+ * @param depth The maximum recursion depth
60
+ */
61
+ flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
62
+ }
63
+
64
+ interface Array<T> {
65
+ /**
66
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
67
+ * a new array.
68
+ * This is identical to a map followed by flat with depth 1.
69
+ *
70
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
71
+ * callback function one time for each element in the array.
72
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
73
+ * thisArg is omitted, undefined is used as the this value.
74
+ */
75
+ flatMap<U, This = undefined>(
76
+ callback: (
77
+ this: This,
78
+ value: T,
79
+ index: number,
80
+ array: readonly T[],
81
+ ) => U | ReadonlyArray<U>,
82
+ thisArg?: This,
83
+ ): U[];
84
+
85
+ /**
86
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
87
+ * specified depth.
88
+ *
89
+ * @param depth The maximum recursion depth
90
+ */
91
+ flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
92
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference lib="es2019" />
2
+ /// <reference lib="dom" />
3
+ /// <reference lib="webworker.importscripts" />
4
+ /// <reference lib="scripthost" />
5
+ /// <reference lib="dom.iterable" />
6
+ /// <reference lib="dom.asynciterable" />
@@ -0,0 +1,6 @@
1
+ /// <reference lib="es2018" />
2
+ /// <reference lib="es2019.array" />
3
+ /// <reference lib="es2019.object" />
4
+ /// <reference lib="es2019.string" />
5
+ /// <reference lib="es2019.symbol" />
6
+ /// <reference lib="es2019.intl" />
@@ -0,0 +1,5 @@
1
+ declare namespace Intl {
2
+ interface DateTimeFormatPartTypesRegistry {
3
+ readonly unknown: never;
4
+ }
5
+ }
@@ -0,0 +1,142 @@
1
+ /// <reference lib="es5" />
2
+
3
+ /// <reference lib="es2015.iterable" />
4
+
5
+ declare namespace StrictLibInternals {
6
+ type RecursionLimit = 20;
7
+
8
+ /**
9
+ * - `[['x', 1], ['y', 3]]` -> `{ x: 1, y: 3 }`
10
+ *
11
+ * @internal
12
+ */
13
+ export type EntriesToObject<
14
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
15
+ > = import('ts-type-forge').MergeIntersection<
16
+ EntriesToObjectImpl<{}, Entries>
17
+ >;
18
+
19
+ /** @internal */
20
+ type EntriesToObjectImpl<
21
+ R,
22
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
23
+ > = import('ts-type-forge').TypeEq<Entries['length'], 0> extends true
24
+ ? R
25
+ : EntriesToObjectImpl<
26
+ R & { [key in Entries[0][0]]: Entries[0][1] },
27
+ import('ts-type-forge').List.Tail<Entries>
28
+ >;
29
+
30
+ /**
31
+ * - `['x' | 'y' | 'z', number][]]` -> `'x' | 'y' | 'z'`
32
+ * - `[['a' | 'b' | 'c', number], ...['x' | 'y' | 'z', number][]]` -> `'a' | 'b' |
33
+ * 'c' | 'x' | 'y' | 'z'`
34
+ *
35
+ * @internal
36
+ *
37
+ * @note 上の2個目の例に対応するためには、無限長の Entries に対しても再帰を回す必要があるが、
38
+ * 止めるタイミングを決められないので再帰制限を設けている。
39
+ */
40
+ export type KeysOfEntries<
41
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
42
+ > = KeysOfEntriesImpl<never, Entries, RecursionLimit>;
43
+
44
+ /** @internal */
45
+ type KeysOfEntriesImpl<
46
+ K,
47
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
48
+ RemainingNumRecursions extends number,
49
+ > = import('ts-type-forge').TypeEq<RemainingNumRecursions, 0> extends true
50
+ ? K
51
+ : import('ts-type-forge').TypeEq<Entries['length'], 0> extends true
52
+ ? K
53
+ : KeysOfEntriesImpl<
54
+ K | Entries[0][0],
55
+ import('ts-type-forge').List.Tail<Entries>,
56
+ import('ts-type-forge').Decrement<RemainingNumRecursions>
57
+ >;
58
+
59
+ /** @internal */
60
+ export type ValuesOfEntries<
61
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
62
+ > = ValuesOfEntriesImpl<never, Entries, RecursionLimit>;
63
+
64
+ /** @internal */
65
+ type ValuesOfEntriesImpl<
66
+ K,
67
+ Entries extends readonly (readonly [PropertyKey, unknown])[],
68
+ RemainingNumRecursions extends number,
69
+ > = import('ts-type-forge').TypeEq<RemainingNumRecursions, 0> extends true
70
+ ? K
71
+ : import('ts-type-forge').TypeEq<Entries['length'], 0> extends true
72
+ ? K
73
+ : ValuesOfEntriesImpl<
74
+ K | Entries[0][1],
75
+ import('ts-type-forge').List.Tail<Entries>,
76
+ import('ts-type-forge').Decrement<RemainingNumRecursions>
77
+ >;
78
+
79
+ /** @internal */
80
+ export type PartialIfKeyIsUnion<K, T> =
81
+ import('ts-type-forge').IsUnion<K> extends true ? Partial<T> : T;
82
+ }
83
+
84
+ interface ObjectConstructor {
85
+ /**
86
+ * Returns an object created by key-value entries for properties and methods
87
+ * @param entries An iterable object that contains key-value entries for properties and methods.
88
+ *
89
+ * @example
90
+ * const entries = [
91
+ * ['x', 1],
92
+ * ['y', 3],
93
+ * ] as const satisfies [['x', 1], ['y', 3]];
94
+ *
95
+ * const obj = Object.fromEntries(entries) satisfies { x: 1; y: 3 };
96
+ *
97
+ * @note `entries` がタプル型の場合には key-value の組み合わせも反映した型にする。
98
+ * そうでない場合、 `K` が union 型の場合、`entries` がそのすべてを網羅しているとは限らないため、
99
+ * `fromEntries` の返り値型がその union 要素すべてを含む型になってしまわないように `Partial` を付けている。
100
+ *
101
+ * index signature の record では `Object.entries` の key が `string` そのものになり
102
+ * union ではなくなるため、`Partial` は付かない(`WithOpenString` 参照)。
103
+ */
104
+ fromEntries<
105
+ const Entries extends readonly (readonly [PropertyKey, unknown])[],
106
+ >(
107
+ entries: Entries,
108
+ ): import('ts-type-forge').IsFixedLengthList<Entries> extends true
109
+ ? StrictLibInternals.EntriesToObject<Entries>
110
+ : StrictLibInternals.PartialIfKeyIsUnion<
111
+ StrictLibInternals.KeysOfEntries<Entries>,
112
+ import('ts-type-forge').MutableRecord<
113
+ StrictLibInternals.KeysOfEntries<Entries>,
114
+ StrictLibInternals.ValuesOfEntries<Entries>
115
+ >
116
+ >;
117
+
118
+ /**
119
+ * Returns an object created by key-value entries for properties and methods
120
+ * @param entries An iterable object that contains key-value entries for properties and methods.
121
+ *
122
+ * @example
123
+ * const entries: readonly (readonly ['x' | 'y' | 'z' | 4, 1 | 2 | 3])[] = [
124
+ * ['x', 1],
125
+ * ['y', 2],
126
+ * ['z', 3],
127
+ * [4, 3],
128
+ * ] as const;
129
+ *
130
+ * const obj = Object.fromEntries(entries); // Record<'x' | 'y' | 'z' | 4, 1 | 2 | 3>
131
+ *
132
+ */
133
+ fromEntries<K extends PropertyKey, V>(
134
+ entries: Iterable<readonly [K, V]>,
135
+ ): import('ts-type-forge').MutableRecord<K, V>;
136
+
137
+ /**
138
+ * Returns an object created by key-value entries for properties and methods
139
+ * @param entries An iterable object that contains key-value entries for properties and methods.
140
+ */
141
+ fromEntries(entries: Iterable<readonly unknown[]>): unknown;
142
+ }
@@ -0,0 +1,19 @@
1
+ interface String {
2
+ /** Removes the trailing white space and line terminator characters from a string. */
3
+ trimEnd(): string;
4
+
5
+ /** Removes the leading white space and line terminator characters from a string. */
6
+ trimStart(): string;
7
+
8
+ /**
9
+ * Removes the leading white space and line terminator characters from a string.
10
+ * @deprecated A legacy feature for browser compatibility. Use `trimStart` instead
11
+ */
12
+ trimLeft(): string;
13
+
14
+ /**
15
+ * Removes the trailing white space and line terminator characters from a string.
16
+ * @deprecated A legacy feature for browser compatibility. Use `trimEnd` instead
17
+ */
18
+ trimRight(): string;
19
+ }
@@ -0,0 +1,6 @@
1
+ interface Symbol {
2
+ /**
3
+ * Expose the [[Description]] internal slot of a symbol directly.
4
+ */
5
+ readonly description: string | undefined;
6
+ }