strict-ts-lib-v5.4 0.4.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.
- package/README.md +28 -0
- package/libs/decorators/index.d.ts +364 -0
- package/libs/decorators/legacy/index.d.ts +19 -0
- package/libs/dom/asynciterable/index.d.ts +14 -0
- package/libs/dom/index.d.ts +35333 -0
- package/libs/dom/iterable/index.d.ts +748 -0
- package/libs/es2015/collection/index.d.ts +148 -0
- package/libs/es2015/core/index.d.ts +574 -0
- package/libs/es2015/generator/index.d.ts +65 -0
- package/libs/es2015/index.d.ts +12 -0
- package/libs/es2015/iterable/index.d.ts +524 -0
- package/libs/es2015/promise/index.d.ts +74 -0
- package/libs/es2015/proxy/index.d.ts +131 -0
- package/libs/es2015/reflect/index.d.ts +145 -0
- package/libs/es2015/symbol/index.d.ts +30 -0
- package/libs/es2015/symbol-wellknown/index.d.ts +331 -0
- package/libs/es2016/array-include/index.d.ts +115 -0
- package/libs/es2016/full/index.d.ts +7 -0
- package/libs/es2016/index.d.ts +5 -0
- package/libs/es2016/intl/index.d.ts +15 -0
- package/libs/es2017/date/index.d.ts +23 -0
- package/libs/es2017/full/index.d.ts +7 -0
- package/libs/es2017/index.d.ts +9 -0
- package/libs/es2017/intl/index.d.ts +28 -0
- package/libs/es2017/object/index.d.ts +115 -0
- package/libs/es2017/sharedmemory/index.d.ts +244 -0
- package/libs/es2017/string/index.d.ts +29 -0
- package/libs/es2017/typedarrays/index.d.ts +37 -0
- package/libs/es2018/asyncgenerator/index.d.ts +69 -0
- package/libs/es2018/asynciterable/index.d.ts +31 -0
- package/libs/es2018/full/index.d.ts +8 -0
- package/libs/es2018/index.d.ts +8 -0
- package/libs/es2018/intl/index.d.ts +103 -0
- package/libs/es2018/promise/index.d.ts +14 -0
- package/libs/es2018/regexp/index.d.ts +21 -0
- package/libs/es2019/array/index.d.ts +94 -0
- package/libs/es2019/full/index.d.ts +8 -0
- package/libs/es2019/index.d.ts +8 -0
- package/libs/es2019/intl/index.d.ts +7 -0
- package/libs/es2019/object/index.d.ts +143 -0
- package/libs/es2019/string/index.d.ts +21 -0
- package/libs/es2019/symbol/index.d.ts +8 -0
- package/libs/es2020/bigint/index.d.ts +833 -0
- package/libs/es2020/date/index.d.ts +35 -0
- package/libs/es2020/full/index.d.ts +8 -0
- package/libs/es2020/index.d.ts +11 -0
- package/libs/es2020/intl/index.d.ts +473 -0
- package/libs/es2020/number/index.d.ts +15 -0
- package/libs/es2020/promise/index.d.ts +37 -0
- package/libs/es2020/sharedmemory/index.d.ts +119 -0
- package/libs/es2020/string/index.d.ts +30 -0
- package/libs/es2020/symbol-wellknown/index.d.ts +21 -0
- package/libs/es2021/full/index.d.ts +8 -0
- package/libs/es2021/index.d.ts +7 -0
- package/libs/es2021/intl/index.d.ts +161 -0
- package/libs/es2021/promise/index.d.ts +34 -0
- package/libs/es2021/string/index.d.ts +20 -0
- package/libs/es2021/weakref/index.d.ts +60 -0
- package/libs/es2022/array/index.d.ts +105 -0
- package/libs/es2022/error/index.d.ts +57 -0
- package/libs/es2022/full/index.d.ts +8 -0
- package/libs/es2022/index.d.ts +10 -0
- package/libs/es2022/intl/index.d.ts +112 -0
- package/libs/es2022/object/index.d.ts +41 -0
- package/libs/es2022/regexp/index.d.ts +23 -0
- package/libs/es2022/sharedmemory/index.d.ts +37 -0
- package/libs/es2022/string/index.d.ts +9 -0
- package/libs/es2023/array/index.d.ts +906 -0
- package/libs/es2023/collection/index.d.ts +5 -0
- package/libs/es2023/full/index.d.ts +8 -0
- package/libs/es2023/index.d.ts +5 -0
- package/libs/es5/index.d.ts +5738 -0
- package/libs/es6/index.d.ts +7 -0
- package/libs/esnext/collection/index.d.ts +13 -0
- package/libs/esnext/decorators/index.d.ts +12 -0
- package/libs/esnext/disposable/index.d.ts +169 -0
- package/libs/esnext/full/index.d.ts +8 -0
- package/libs/esnext/index.d.ts +9 -0
- package/libs/esnext/intl/index.d.ts +15 -0
- package/libs/esnext/object/index.d.ts +13 -0
- package/libs/esnext/promise/index.d.ts +19 -0
- package/libs/scripthost/index.d.ts +310 -0
- package/libs/webworker/asynciterable/index.d.ts +14 -0
- package/libs/webworker/importscripts/index.d.ts +7 -0
- package/libs/webworker/index.d.ts +11758 -0
- package/libs/webworker/iterable/index.d.ts +543 -0
- package/package.json +23 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
declare namespace Intl {
|
|
4
|
+
/**
|
|
5
|
+
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
|
|
6
|
+
*
|
|
7
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
|
|
8
|
+
*/
|
|
9
|
+
interface SegmenterOptions {
|
|
10
|
+
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
|
|
11
|
+
readonly localeMatcher?: 'best fit' | 'lookup' | undefined;
|
|
12
|
+
/** The type of input to be split */
|
|
13
|
+
readonly granularity?: 'grapheme' | 'word' | 'sentence' | undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Segmenter {
|
|
17
|
+
/**
|
|
18
|
+
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
|
|
19
|
+
*
|
|
20
|
+
* @param input - The text to be segmented as a `string`.
|
|
21
|
+
*
|
|
22
|
+
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
|
|
23
|
+
*/
|
|
24
|
+
segment(input: string): Segments;
|
|
25
|
+
resolvedOptions(): ResolvedSegmenterOptions;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ResolvedSegmenterOptions {
|
|
29
|
+
readonly locale: string;
|
|
30
|
+
readonly granularity: 'grapheme' | 'word' | 'sentence';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Segments {
|
|
34
|
+
/**
|
|
35
|
+
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
|
|
36
|
+
*
|
|
37
|
+
* @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`.
|
|
38
|
+
*/
|
|
39
|
+
containing(codeUnitIndex?: number): SegmentData;
|
|
40
|
+
|
|
41
|
+
/** Returns an iterator to iterate over the segments. */
|
|
42
|
+
[Symbol.iterator](): IterableIterator<SegmentData>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface SegmentData {
|
|
46
|
+
/** A string containing the segment extracted from the original input string. */
|
|
47
|
+
readonly segment: string;
|
|
48
|
+
/** The code unit index in the original input string at which the segment begins. */
|
|
49
|
+
readonly index: number;
|
|
50
|
+
/** The complete input string that was segmented. */
|
|
51
|
+
readonly input: string;
|
|
52
|
+
/**
|
|
53
|
+
* A boolean value only if granularity is "word"; otherwise, undefined.
|
|
54
|
+
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
|
|
55
|
+
*/
|
|
56
|
+
readonly isWordLike?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const Segmenter: {
|
|
60
|
+
readonly prototype: Segmenter;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Creates a new `Intl.Segmenter` object.
|
|
64
|
+
*
|
|
65
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
66
|
+
* For the general form and interpretation of the `locales` argument,
|
|
67
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
68
|
+
*
|
|
69
|
+
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
|
|
70
|
+
* with some or all options of `SegmenterOptions`.
|
|
71
|
+
*
|
|
72
|
+
* @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object.
|
|
73
|
+
*
|
|
74
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
|
|
75
|
+
*/
|
|
76
|
+
new (locales?: LocalesArgument, options?: SegmenterOptions): Segmenter;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
|
|
80
|
+
*
|
|
81
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
82
|
+
* For the general form and interpretation of the `locales` argument,
|
|
83
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
84
|
+
*
|
|
85
|
+
* @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters).
|
|
86
|
+
* with some or all possible options.
|
|
87
|
+
*
|
|
88
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
|
|
89
|
+
*/
|
|
90
|
+
supportedLocalesOf(
|
|
91
|
+
locales: LocalesArgument,
|
|
92
|
+
options?: Pick<SegmenterOptions, 'localeMatcher'>,
|
|
93
|
+
): UnicodeBCP47LocaleIdentifier[];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns a sorted array of the supported collation, calendar, currency, numbering system, timezones, and units by the implementation.
|
|
98
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf)
|
|
99
|
+
*
|
|
100
|
+
* @param key A string indicating the category of values to return.
|
|
101
|
+
* @returns A sorted array of the supported values.
|
|
102
|
+
*/
|
|
103
|
+
function supportedValuesOf(
|
|
104
|
+
key:
|
|
105
|
+
| 'calendar'
|
|
106
|
+
| 'collation'
|
|
107
|
+
| 'currency'
|
|
108
|
+
| 'numberingSystem'
|
|
109
|
+
| 'timeZone'
|
|
110
|
+
| 'unit',
|
|
111
|
+
): string[];
|
|
112
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
/// <reference lib="es5" />
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* R が union 型(要素数1の場合も含む)のとき、 union の要素の中に K をキーとして含むものが一つでもあれば、
|
|
7
|
+
* union 型を K をキーとして含むもののみに絞った型を返す。
|
|
8
|
+
* union の要素の中に K をキーとして含むものが一つも無ければ、`MutableRecord<K, unknown>` を返す。
|
|
9
|
+
* 結果には Readonly を付ける。
|
|
10
|
+
*/
|
|
11
|
+
declare namespace StrictLibInternals {
|
|
12
|
+
export type HasOwnReturnType<
|
|
13
|
+
R extends import('ts-type-forge').UnknownRecord,
|
|
14
|
+
K extends PropertyKey,
|
|
15
|
+
> = R extends R // union distribution
|
|
16
|
+
? K extends keyof R
|
|
17
|
+
? string extends keyof R
|
|
18
|
+
? import('ts-type-forge').MutableRecord<K, R[keyof R]> & R
|
|
19
|
+
: number extends keyof R
|
|
20
|
+
? import('ts-type-forge').MutableRecord<K, R[keyof R]> & R
|
|
21
|
+
: symbol extends keyof R
|
|
22
|
+
? import('ts-type-forge').MutableRecord<K, R[keyof R]> & R
|
|
23
|
+
: R
|
|
24
|
+
: never // omit union member that does not have key K
|
|
25
|
+
: never; // dummy case for union distribution
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ObjectConstructor {
|
|
29
|
+
/**
|
|
30
|
+
* Determines whether an object has a property with the specified name.
|
|
31
|
+
* @param obj An object.
|
|
32
|
+
* @param key A property name.
|
|
33
|
+
*/
|
|
34
|
+
hasOwn<
|
|
35
|
+
R extends import('ts-type-forge').UnknownRecord,
|
|
36
|
+
K extends PropertyKey,
|
|
37
|
+
>(
|
|
38
|
+
obj: R,
|
|
39
|
+
key: K,
|
|
40
|
+
): obj is StrictLibInternals.HasOwnReturnType<R, K>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface RegExpMatchArray {
|
|
4
|
+
readonly indices?: RegExpIndicesArray;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface RegExpExecArray {
|
|
8
|
+
readonly indices?: RegExpIndicesArray;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface RegExpIndicesArray extends Array<readonly [number, number]> {
|
|
12
|
+
readonly groups?: {
|
|
13
|
+
readonly [key: string]: readonly [number, number];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface RegExp {
|
|
18
|
+
/**
|
|
19
|
+
* Returns a Boolean value indicating the state of the hasIndices flag (d) used with with a regular expression.
|
|
20
|
+
* Default is false. Read-only.
|
|
21
|
+
*/
|
|
22
|
+
readonly hasIndices: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface Atomics {
|
|
4
|
+
/**
|
|
5
|
+
* A non-blocking, asynchronous version of wait which is usable on the main thread.
|
|
6
|
+
* Waits asynchronously on a shared memory location and returns a Promise
|
|
7
|
+
* @param typedArray A shared Int32Array or BigInt64Array.
|
|
8
|
+
* @param index The position in the typedArray to wait on.
|
|
9
|
+
* @param value The expected value to test.
|
|
10
|
+
* @param [timeout] The expected value to test.
|
|
11
|
+
*/
|
|
12
|
+
waitAsync(
|
|
13
|
+
typedArray: Int32Array,
|
|
14
|
+
index: number,
|
|
15
|
+
value: number,
|
|
16
|
+
timeout?: number,
|
|
17
|
+
):
|
|
18
|
+
| { readonly async: false; readonly value: 'not-equal' | 'timed-out' }
|
|
19
|
+
| { readonly async: true; readonly value: Promise<'ok' | 'timed-out'> };
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A non-blocking, asynchronous version of wait which is usable on the main thread.
|
|
23
|
+
* Waits asynchronously on a shared memory location and returns a Promise
|
|
24
|
+
* @param typedArray A shared Int32Array or BigInt64Array.
|
|
25
|
+
* @param index The position in the typedArray to wait on.
|
|
26
|
+
* @param value The expected value to test.
|
|
27
|
+
* @param [timeout] The expected value to test.
|
|
28
|
+
*/
|
|
29
|
+
waitAsync(
|
|
30
|
+
typedArray: BigInt64Array,
|
|
31
|
+
index: number,
|
|
32
|
+
value: bigint,
|
|
33
|
+
timeout?: number,
|
|
34
|
+
):
|
|
35
|
+
| { readonly async: false; readonly value: 'not-equal' | 'timed-out' }
|
|
36
|
+
| { readonly async: true; readonly value: Promise<'ok' | 'timed-out'> };
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface String {
|
|
4
|
+
/**
|
|
5
|
+
* Returns a new String consisting of the single UTF-16 code unit located at the specified index.
|
|
6
|
+
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
|
|
7
|
+
*/
|
|
8
|
+
at(index: number): string | undefined;
|
|
9
|
+
}
|