typescript 4.7.0-dev.20220504 → 4.8.0-dev.20220507
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/lib/lib.es2022.d.ts +1 -0
- package/lib/lib.es2022.intl.d.ts +111 -0
- package/lib/lib.es5.d.ts +2 -2
- package/lib/tsc.js +263 -91
- package/lib/tsserver.js +341 -129
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +341 -129
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +337 -126
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +337 -126
- package/lib/typingsInstaller.js +309 -108
- package/package.json +1 -1
package/lib/lib.es2022.d.ts
CHANGED
|
@@ -21,5 +21,6 @@ and limitations under the License.
|
|
|
21
21
|
/// <reference lib="es2021" />
|
|
22
22
|
/// <reference lib="es2022.array" />
|
|
23
23
|
/// <reference lib="es2022.error" />
|
|
24
|
+
/// <reference lib="es2022.intl" />
|
|
24
25
|
/// <reference lib="es2022.object" />
|
|
25
26
|
/// <reference lib="es2022.string" />
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
declare namespace Intl {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
|
|
25
|
+
*
|
|
26
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
|
|
27
|
+
*/
|
|
28
|
+
interface SegmenterOptions {
|
|
29
|
+
/** 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). */
|
|
30
|
+
localeMatcher?: "best fit" | "lookup" | undefined;
|
|
31
|
+
/** The type of input to be split */
|
|
32
|
+
granularity?: "grapheme" | "word" | "sentence" | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Segmenter {
|
|
36
|
+
/**
|
|
37
|
+
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
|
|
38
|
+
*
|
|
39
|
+
* @param input - The text to be segmented as a `string`.
|
|
40
|
+
*
|
|
41
|
+
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
|
|
42
|
+
*/
|
|
43
|
+
segment(input: string): Segments;
|
|
44
|
+
resolvedOptions(): ResolvedSegmenterOptions;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface ResolvedSegmenterOptions {
|
|
48
|
+
locale: string;
|
|
49
|
+
granularity: "grapheme" | "word" | "sentence";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface Segments {
|
|
53
|
+
/**
|
|
54
|
+
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
|
|
55
|
+
*
|
|
56
|
+
* @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`.
|
|
57
|
+
*/
|
|
58
|
+
containing(codeUnitIndex?: number): SegmentData;
|
|
59
|
+
|
|
60
|
+
/** Returns an iterator to iterate over the segments. */
|
|
61
|
+
[Symbol.iterator](): IterableIterator<SegmentData>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface SegmentData {
|
|
65
|
+
/** A string containing the segment extracted from the original input string. */
|
|
66
|
+
segment: string;
|
|
67
|
+
/** The code unit index in the original input string at which the segment begins. */
|
|
68
|
+
index: number;
|
|
69
|
+
/** The complete input string that was segmented. */
|
|
70
|
+
input: string;
|
|
71
|
+
/**
|
|
72
|
+
* A boolean value only if granularity is "word"; otherwise, undefined.
|
|
73
|
+
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
|
|
74
|
+
*/
|
|
75
|
+
isWordLike?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const Segmenter: {
|
|
79
|
+
prototype: Segmenter;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Creates a new `Intl.Segmenter` object.
|
|
83
|
+
*
|
|
84
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
85
|
+
* For the general form and interpretation of the `locales` argument,
|
|
86
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
87
|
+
*
|
|
88
|
+
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
|
|
89
|
+
* with some or all options of `SegmenterOptions`.
|
|
90
|
+
*
|
|
91
|
+
* @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object.
|
|
92
|
+
*
|
|
93
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
|
|
94
|
+
*/
|
|
95
|
+
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
|
|
99
|
+
*
|
|
100
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
101
|
+
* For the general form and interpretation of the `locales` argument,
|
|
102
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
103
|
+
*
|
|
104
|
+
* @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters).
|
|
105
|
+
* with some or all possible options.
|
|
106
|
+
*
|
|
107
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
|
|
108
|
+
*/
|
|
109
|
+
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
|
|
110
|
+
};
|
|
111
|
+
}
|
package/lib/lib.es5.d.ts
CHANGED
|
@@ -72,13 +72,13 @@ declare function decodeURIComponent(encodedURIComponent: string): string;
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Encodes a text string as a valid Uniform Resource Identifier (URI)
|
|
75
|
-
* @param uri A value representing an
|
|
75
|
+
* @param uri A value representing an unencoded URI.
|
|
76
76
|
*/
|
|
77
77
|
declare function encodeURI(uri: string): string;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
|
|
81
|
-
* @param uriComponent A value representing an
|
|
81
|
+
* @param uriComponent A value representing an unencoded URI component.
|
|
82
82
|
*/
|
|
83
83
|
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
|
|
84
84
|
|