mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
feat(cli): upgrade to TypeScript 4.3 (#9960)
This commit is contained in:
parent
56f6e57438
commit
59237d195f
29 changed files with 15418 additions and 11339 deletions
|
@ -131,6 +131,10 @@ fn create_compiler_snapshot(
|
|||
"es2020.sharedmemory",
|
||||
"es2020.string",
|
||||
"es2020.symbol.wellknown",
|
||||
"es2021",
|
||||
"es2021.promise",
|
||||
"es2021.string",
|
||||
"es2021.weakref",
|
||||
"esnext",
|
||||
"esnext.intl",
|
||||
"esnext.promise",
|
||||
|
|
911
cli/dts/lib.dom.d.ts
vendored
911
cli/dts/lib.dom.d.ts
vendored
File diff suppressed because it is too large
Load diff
6
cli/dts/lib.dom.iterable.d.ts
vendored
6
cli/dts/lib.dom.iterable.d.ts
vendored
|
@ -139,7 +139,7 @@ interface IDBDatabase {
|
|||
interface IDBObjectStore {
|
||||
/**
|
||||
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
|
||||
|
@ -287,10 +287,6 @@ interface WEBGL_draw_buffers {
|
|||
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
|
||||
}
|
||||
|
||||
interface WebAuthentication {
|
||||
makeCredential(accountInformation: Account, cryptoParameters: Iterable<ScopedCredentialParameters>, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;
|
||||
}
|
||||
|
||||
interface WebGL2RenderingContextBase {
|
||||
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
|
||||
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
|
||||
|
|
4
cli/dts/lib.es2015.core.d.ts
vendored
4
cli/dts/lib.es2015.core.d.ts
vendored
|
@ -268,8 +268,8 @@ interface NumberConstructor {
|
|||
|
||||
/**
|
||||
* Converts A string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* @param string A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
|
|
2
cli/dts/lib.es2015.iterable.d.ts
vendored
2
cli/dts/lib.es2015.iterable.d.ts
vendored
|
@ -25,7 +25,7 @@ interface SymbolConstructor {
|
|||
* A method that returns the default iterator for an object. Called by the semantics of the
|
||||
* for-of statement.
|
||||
*/
|
||||
readonly iterator: symbol;
|
||||
readonly iterator: unique symbol;
|
||||
}
|
||||
|
||||
interface IteratorYieldResult<TYield> {
|
||||
|
|
20
cli/dts/lib.es2015.symbol.wellknown.d.ts
vendored
20
cli/dts/lib.es2015.symbol.wellknown.d.ts
vendored
|
@ -25,61 +25,61 @@ interface SymbolConstructor {
|
|||
* A method that determines if a constructor object recognizes an object as one of the
|
||||
* constructor’s instances. Called by the semantics of the instanceof operator.
|
||||
*/
|
||||
readonly hasInstance: symbol;
|
||||
readonly hasInstance: unique symbol;
|
||||
|
||||
/**
|
||||
* A Boolean value that if true indicates that an object should flatten to its array elements
|
||||
* by Array.prototype.concat.
|
||||
*/
|
||||
readonly isConcatSpreadable: symbol;
|
||||
readonly isConcatSpreadable: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that matches the regular expression against a string. Called
|
||||
* by the String.prototype.match method.
|
||||
*/
|
||||
readonly match: symbol;
|
||||
readonly match: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that replaces matched substrings of a string. Called by the
|
||||
* String.prototype.replace method.
|
||||
*/
|
||||
readonly replace: symbol;
|
||||
readonly replace: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that returns the index within a string that matches the
|
||||
* regular expression. Called by the String.prototype.search method.
|
||||
*/
|
||||
readonly search: symbol;
|
||||
readonly search: unique symbol;
|
||||
|
||||
/**
|
||||
* A function valued property that is the constructor function that is used to create
|
||||
* derived objects.
|
||||
*/
|
||||
readonly species: symbol;
|
||||
readonly species: unique symbol;
|
||||
|
||||
/**
|
||||
* A regular expression method that splits a string at the indices that match the regular
|
||||
* expression. Called by the String.prototype.split method.
|
||||
*/
|
||||
readonly split: symbol;
|
||||
readonly split: unique symbol;
|
||||
|
||||
/**
|
||||
* A method that converts an object to a corresponding primitive value.
|
||||
* Called by the ToPrimitive abstract operation.
|
||||
*/
|
||||
readonly toPrimitive: symbol;
|
||||
readonly toPrimitive: unique symbol;
|
||||
|
||||
/**
|
||||
* A String value that is used in the creation of the default string description of an object.
|
||||
* Called by the built-in method Object.prototype.toString.
|
||||
*/
|
||||
readonly toStringTag: symbol;
|
||||
readonly toStringTag: unique symbol;
|
||||
|
||||
/**
|
||||
* An Object whose own property names are property names that are excluded from the 'with'
|
||||
* environment bindings of the associated objects.
|
||||
*/
|
||||
readonly unscopables: symbol;
|
||||
readonly unscopables: unique symbol;
|
||||
}
|
||||
|
||||
interface Symbol {
|
||||
|
|
2
cli/dts/lib.es2018.asynciterable.d.ts
vendored
2
cli/dts/lib.es2018.asynciterable.d.ts
vendored
|
@ -26,7 +26,7 @@ interface SymbolConstructor {
|
|||
* A method that returns the default async iterator for an object. Called by the semantics of
|
||||
* the for-await-of statement.
|
||||
*/
|
||||
readonly asyncIterator: symbol;
|
||||
readonly asyncIterator: unique symbol;
|
||||
}
|
||||
|
||||
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
|
||||
|
|
2
cli/dts/lib.es2020.bigint.d.ts
vendored
2
cli/dts/lib.es2020.bigint.d.ts
vendored
|
@ -121,7 +121,7 @@ interface BigInt {
|
|||
}
|
||||
|
||||
interface BigIntConstructor {
|
||||
(value?: any): bigint;
|
||||
(value: bigint | boolean | number | string): bigint;
|
||||
readonly prototype: BigInt;
|
||||
|
||||
/**
|
||||
|
|
13
cli/dts/lib.es2020.intl.d.ts
vendored
13
cli/dts/lib.es2020.intl.d.ts
vendored
|
@ -21,13 +21,12 @@ and limitations under the License.
|
|||
declare namespace Intl {
|
||||
|
||||
/**
|
||||
* [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.
|
||||
* [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
|
||||
*
|
||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
||||
*
|
||||
* [Wikipedia](https://en.wikipedia.org/wiki/IETF_language_tag).
|
||||
*/
|
||||
type BCP47LanguageTag = string;
|
||||
type UnicodeBCP47LocaleIdentifier = string;
|
||||
|
||||
/**
|
||||
* Unit to use in the relative time internationalized message.
|
||||
|
@ -98,7 +97,7 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#table-relativetimeformat-resolvedoptions-properties)
|
||||
*/
|
||||
interface ResolvedRelativeTimeFormatOptions {
|
||||
locale: BCP47LanguageTag;
|
||||
locale: UnicodeBCP47LocaleIdentifier;
|
||||
style: RelativeTimeFormatStyle;
|
||||
numeric: RelativeTimeFormatNumeric;
|
||||
numberingSystem: string;
|
||||
|
@ -241,7 +240,7 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor).
|
||||
*/
|
||||
new(
|
||||
locales?: BCP47LanguageTag | BCP47LanguageTag[],
|
||||
locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
|
||||
options?: RelativeTimeFormatOptions,
|
||||
): RelativeTimeFormat;
|
||||
|
||||
|
@ -277,9 +276,9 @@ declare namespace Intl {
|
|||
* [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.supportedLocalesOf).
|
||||
*/
|
||||
supportedLocalesOf(
|
||||
locales: BCP47LanguageTag | BCP47LanguageTag[],
|
||||
locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
|
||||
options?: RelativeTimeFormatOptions,
|
||||
): BCP47LanguageTag[];
|
||||
): UnicodeBCP47LocaleIdentifier[];
|
||||
};
|
||||
|
||||
interface NumberFormatOptions {
|
||||
|
|
2
cli/dts/lib.es2020.symbol.wellknown.d.ts
vendored
2
cli/dts/lib.es2020.symbol.wellknown.d.ts
vendored
|
@ -26,7 +26,7 @@ interface SymbolConstructor {
|
|||
* A regular expression method that matches the regular expression against a string. Called
|
||||
* by the String.prototype.matchAll method.
|
||||
*/
|
||||
readonly matchAll: symbol;
|
||||
readonly matchAll: unique symbol;
|
||||
}
|
||||
|
||||
interface RegExp {
|
||||
|
|
24
cli/dts/lib.es2021.d.ts
vendored
Normal file
24
cli/dts/lib.es2021.d.ts
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2020" />
|
||||
/// <reference lib="es2021.promise" />
|
||||
/// <reference lib="es2021.string" />
|
||||
/// <reference lib="es2021.weakref" />
|
25
cli/dts/lib.es2021.full.d.ts
vendored
Normal file
25
cli/dts/lib.es2021.full.d.ts
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="dom" />
|
||||
/// <reference lib="webworker.importscripts" />
|
||||
/// <reference lib="scripthost" />
|
||||
/// <reference lib="dom.iterable" />
|
43
cli/dts/lib.es2021.promise.d.ts
vendored
Normal file
43
cli/dts/lib.es2021.promise.d.ts
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface AggregateError extends Error {
|
||||
errors: any[]
|
||||
}
|
||||
|
||||
interface AggregateErrorConstructor {
|
||||
new(errors: Iterable<any>, message?: string): AggregateError;
|
||||
(errors: Iterable<any>, message?: string): AggregateError;
|
||||
readonly prototype: AggregateError;
|
||||
}
|
||||
|
||||
declare var AggregateError: AggregateErrorConstructor;
|
||||
|
||||
/**
|
||||
* Represents the completion of an asynchronous operation
|
||||
*/
|
||||
interface PromiseConstructor {
|
||||
/**
|
||||
* The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
|
||||
* @param values An array or iterable of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
any<T>(values: (T | PromiseLike<T>)[] | Iterable<T | PromiseLike<T>>): Promise<T>
|
||||
}
|
35
cli/dts/lib.es2021.string.d.ts
vendored
Normal file
35
cli/dts/lib.es2021.string.d.ts
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface String {
|
||||
/**
|
||||
* Replace all instances of a substring in a string, using a regular expression or search string.
|
||||
* @param searchValue A string to search for.
|
||||
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
||||
*/
|
||||
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
|
||||
|
||||
/**
|
||||
* Replace all instances of a substring in a string, using a regular expression or search string.
|
||||
* @param searchValue A string to search for.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
}
|
75
cli/dts/lib.es2021.weakref.d.ts
vendored
Normal file
75
cli/dts/lib.es2021.weakref.d.ts
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
interface WeakRef<T extends object> {
|
||||
readonly [Symbol.toStringTag]: "WeakRef";
|
||||
|
||||
/**
|
||||
* Returns the WeakRef instance's target object, or undefined if the target object has been
|
||||
* reclaimed.
|
||||
*/
|
||||
deref(): T | undefined;
|
||||
}
|
||||
|
||||
interface WeakRefConstructor {
|
||||
readonly prototype: WeakRef<any>;
|
||||
|
||||
/**
|
||||
* Creates a WeakRef instance for the given target object.
|
||||
* @param target The target object for the WeakRef instance.
|
||||
*/
|
||||
new<T extends object>(target: T): WeakRef<T>;
|
||||
}
|
||||
|
||||
declare var WeakRef: WeakRefConstructor;
|
||||
|
||||
interface FinalizationRegistry<T> {
|
||||
readonly [Symbol.toStringTag]: "FinalizationRegistry";
|
||||
|
||||
/**
|
||||
* Registers an object with the registry.
|
||||
* @param target The target object to register.
|
||||
* @param heldValue The value to pass to the finalizer for this object. This cannot be the
|
||||
* target object.
|
||||
* @param unregisterToken The token to pass to the unregister method to unregister the target
|
||||
* object. If provided (and not undefined), this must be an object. If not provided, the target
|
||||
* cannot be unregistered.
|
||||
*/
|
||||
register(target: object, heldValue: T, unregisterToken?: object): void;
|
||||
|
||||
/**
|
||||
* Unregisters an object from the registry.
|
||||
* @param unregisterToken The token that was used as the unregisterToken argument when calling
|
||||
* register to register the target object.
|
||||
*/
|
||||
unregister(unregisterToken: object): void;
|
||||
}
|
||||
|
||||
interface FinalizationRegistryConstructor {
|
||||
readonly prototype: FinalizationRegistry<any>;
|
||||
|
||||
/**
|
||||
* Creates a finalization registry with an associated cleanup callback
|
||||
* @param cleanupCallback The callback to call after an object in the registry has been reclaimed.
|
||||
*/
|
||||
new<T>(cleanupCallback: (heldValue: T) => void): FinalizationRegistry<T>;
|
||||
}
|
||||
|
||||
declare var FinalizationRegistry: FinalizationRegistryConstructor;
|
18
cli/dts/lib.es5.d.ts
vendored
18
cli/dts/lib.es5.d.ts
vendored
|
@ -33,12 +33,12 @@ declare function eval(x: string): any;
|
|||
|
||||
/**
|
||||
* Converts a string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* @param string A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
declare function parseInt(s: string, radix?: number): number;
|
||||
declare function parseInt(string: string, radix?: number): number;
|
||||
|
||||
/**
|
||||
* Converts a string to a floating-point number.
|
||||
|
@ -197,14 +197,14 @@ interface ObjectConstructor {
|
|||
* @param p The property name.
|
||||
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
|
||||
*/
|
||||
defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;
|
||||
defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
|
||||
* @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
|
||||
* @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
|
||||
*/
|
||||
defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;
|
||||
defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
|
||||
|
@ -1093,7 +1093,7 @@ interface ReadonlyArray<T> {
|
|||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
|
||||
*/
|
||||
toLocaleString(): string;
|
||||
/**
|
||||
|
@ -1227,7 +1227,7 @@ interface Array<T> {
|
|||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
|
||||
* Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
|
||||
*/
|
||||
toLocaleString(): string;
|
||||
/**
|
||||
|
@ -1528,7 +1528,7 @@ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P)
|
|||
/**
|
||||
* Obtain the parameters of a constructor function type in a tuple
|
||||
*/
|
||||
type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
|
||||
type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;
|
||||
|
||||
/**
|
||||
* Obtain the return type of a function type
|
||||
|
@ -1538,7 +1538,7 @@ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => i
|
|||
/**
|
||||
* Obtain the return type of a constructor function type
|
||||
*/
|
||||
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
|
||||
type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;
|
||||
|
||||
/**
|
||||
* Convert string literal type to uppercase
|
||||
|
|
5
cli/dts/lib.esnext.d.ts
vendored
5
cli/dts/lib.esnext.d.ts
vendored
|
@ -18,8 +18,5 @@ and limitations under the License.
|
|||
/// <reference no-default-lib="true"/>
|
||||
|
||||
|
||||
/// <reference lib="es2020" />
|
||||
/// <reference lib="es2021" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.string" />
|
||||
/// <reference lib="esnext.promise" />
|
||||
/// <reference lib="esnext.weakref" />
|
||||
|
|
251
cli/dts/lib.webworker.d.ts
vendored
251
cli/dts/lib.webworker.d.ts
vendored
|
@ -382,11 +382,6 @@ interface PushPermissionDescriptor extends PermissionDescriptor {
|
|||
userVisibleOnly?: boolean;
|
||||
}
|
||||
|
||||
interface PushSubscriptionChangeEventInit extends ExtendableEventInit {
|
||||
newSubscription?: PushSubscription;
|
||||
oldSubscription?: PushSubscription;
|
||||
}
|
||||
|
||||
interface PushSubscriptionJSON {
|
||||
endpoint?: string;
|
||||
expirationTime?: number | null;
|
||||
|
@ -406,7 +401,7 @@ interface QueuingStrategy<T = any> {
|
|||
interface QueuingStrategyInit {
|
||||
/**
|
||||
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
|
||||
*
|
||||
*
|
||||
* Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
|
||||
*/
|
||||
highWaterMark: number;
|
||||
|
@ -426,7 +421,7 @@ interface ReadableWritablePair<R = any, W = any> {
|
|||
readable: ReadableStream<R>;
|
||||
/**
|
||||
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
|
||||
*
|
||||
*
|
||||
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
||||
*/
|
||||
writable: WritableStream<W>;
|
||||
|
@ -536,19 +531,19 @@ interface StreamPipeOptions {
|
|||
preventCancel?: boolean;
|
||||
/**
|
||||
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
|
||||
*
|
||||
*
|
||||
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
|
||||
*
|
||||
*
|
||||
* Errors and closures of the source and destination streams propagate as follows:
|
||||
*
|
||||
*
|
||||
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
|
||||
*
|
||||
*
|
||||
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
|
||||
*
|
||||
*
|
||||
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
|
||||
*
|
||||
*
|
||||
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
|
||||
*
|
||||
*
|
||||
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
|
||||
*/
|
||||
preventClose?: boolean;
|
||||
|
@ -833,7 +828,7 @@ interface CanvasFilters {
|
|||
interface CanvasGradient {
|
||||
/**
|
||||
* Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.
|
||||
*
|
||||
*
|
||||
* Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed.
|
||||
*/
|
||||
addColorStop(offset: number, color: string): void;
|
||||
|
@ -1515,15 +1510,15 @@ declare var EventSource: {
|
|||
interface EventTarget {
|
||||
/**
|
||||
* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
|
||||
*
|
||||
*
|
||||
* The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
|
||||
*
|
||||
*
|
||||
* When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
|
||||
*
|
||||
*
|
||||
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
|
||||
*
|
||||
*
|
||||
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
|
||||
*
|
||||
*
|
||||
* The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
|
||||
*/
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
||||
|
@ -1570,7 +1565,6 @@ declare var ExtendableMessageEvent: {
|
|||
interface FetchEvent extends ExtendableEvent {
|
||||
readonly clientId: string;
|
||||
readonly preloadResponse: Promise<any>;
|
||||
readonly replacesClientId: string;
|
||||
readonly request: Request;
|
||||
readonly resultingClientId: string;
|
||||
respondWith(r: Response | Promise<Response>): void;
|
||||
|
@ -1730,15 +1724,15 @@ interface IDBCursor {
|
|||
continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;
|
||||
/**
|
||||
* Delete the record pointed at by the cursor with a new value.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be undefined.
|
||||
*/
|
||||
delete(): IDBRequest<undefined>;
|
||||
/**
|
||||
* Updated the record pointed at by the cursor with a new value.
|
||||
*
|
||||
*
|
||||
* Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the record's key.
|
||||
*/
|
||||
update(value: any): IDBRequest<IDBValidKey>;
|
||||
|
@ -1793,13 +1787,13 @@ interface IDBDatabase extends EventTarget {
|
|||
close(): void;
|
||||
/**
|
||||
* Creates a new object store with the given name and options and returns a new IDBObjectStore.
|
||||
*
|
||||
*
|
||||
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;
|
||||
/**
|
||||
* Deletes the object store with the given name.
|
||||
*
|
||||
*
|
||||
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
deleteObjectStore(name: string): void;
|
||||
|
@ -1822,7 +1816,7 @@ declare var IDBDatabase: {
|
|||
interface IDBFactory {
|
||||
/**
|
||||
* Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.
|
||||
*
|
||||
*
|
||||
* Throws a "DataError" DOMException if either input is not a valid key.
|
||||
*/
|
||||
cmp(first: any, second: any): number;
|
||||
|
@ -1856,43 +1850,43 @@ interface IDBIndex {
|
|||
readonly unique: boolean;
|
||||
/**
|
||||
* Retrieves the number of records matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the count.
|
||||
*/
|
||||
count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;
|
||||
/**
|
||||
* Retrieves the value of the first record matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the value, or undefined if there was no matching record.
|
||||
*/
|
||||
get(key: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;
|
||||
/**
|
||||
* Retrieves the values of the records matching the given key or key range in query (up to count if given).
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an Array of the values.
|
||||
*/
|
||||
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
|
||||
/**
|
||||
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an Array of the keys.
|
||||
*/
|
||||
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
|
||||
/**
|
||||
* Retrieves the key of the first record matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the key, or undefined if there was no matching record.
|
||||
*/
|
||||
getKey(key: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;
|
||||
/**
|
||||
* Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
|
||||
*/
|
||||
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
|
||||
/**
|
||||
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an IDBCursor, or null if there were no matching records.
|
||||
*/
|
||||
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
|
||||
|
@ -1972,88 +1966,88 @@ interface IDBObjectStore {
|
|||
readonly transaction: IDBTransaction;
|
||||
/**
|
||||
* Adds or updates a record in store with the given value and key.
|
||||
*
|
||||
*
|
||||
* If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.
|
||||
*
|
||||
*
|
||||
* If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the record's key.
|
||||
*/
|
||||
add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
|
||||
/**
|
||||
* Deletes all records in store.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be undefined.
|
||||
*/
|
||||
clear(): IDBRequest<undefined>;
|
||||
/**
|
||||
* Retrieves the number of records matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the count.
|
||||
*/
|
||||
count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;
|
||||
/**
|
||||
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;
|
||||
/**
|
||||
* Deletes records in store with the given key or in the given key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be undefined.
|
||||
*/
|
||||
delete(key: IDBValidKey | IDBKeyRange): IDBRequest<undefined>;
|
||||
/**
|
||||
* Deletes the index in store with the given name.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
deleteIndex(name: string): void;
|
||||
/**
|
||||
* Retrieves the value of the first record matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the value, or undefined if there was no matching record.
|
||||
*/
|
||||
get(query: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;
|
||||
/**
|
||||
* Retrieves the values of the records matching the given key or key range in query (up to count if given).
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an Array of the values.
|
||||
*/
|
||||
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
|
||||
/**
|
||||
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an Array of the keys.
|
||||
*/
|
||||
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
|
||||
/**
|
||||
* Retrieves the key of the first record matching the given key or key range in query.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the key, or undefined if there was no matching record.
|
||||
*/
|
||||
getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;
|
||||
index(name: string): IDBIndex;
|
||||
/**
|
||||
* Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
|
||||
*/
|
||||
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
|
||||
/**
|
||||
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.
|
||||
*/
|
||||
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
|
||||
/**
|
||||
* Adds or updates a record in store with the given value and key.
|
||||
*
|
||||
*
|
||||
* If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.
|
||||
*
|
||||
*
|
||||
* If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.
|
||||
*
|
||||
*
|
||||
* If successful, request's result will be the record's key.
|
||||
*/
|
||||
put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
|
||||
|
@ -2299,7 +2293,7 @@ interface MessagePort extends EventTarget {
|
|||
close(): void;
|
||||
/**
|
||||
* Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
|
||||
*
|
||||
*
|
||||
* Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
|
||||
*/
|
||||
postMessage(message: any, transfer: Transferable[]): void;
|
||||
|
@ -2447,27 +2441,27 @@ interface OES_vertex_array_object {
|
|||
interface OffscreenCanvas extends EventTarget {
|
||||
/**
|
||||
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
|
||||
*
|
||||
*
|
||||
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
|
||||
*
|
||||
*
|
||||
* They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.
|
||||
*
|
||||
*
|
||||
* The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.
|
||||
*/
|
||||
convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;
|
||||
/**
|
||||
* Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
|
||||
*
|
||||
*
|
||||
* This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
|
||||
*
|
||||
*
|
||||
* Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
|
||||
*/
|
||||
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;
|
||||
|
@ -2722,16 +2716,6 @@ declare var PushSubscription: {
|
|||
new(): PushSubscription;
|
||||
};
|
||||
|
||||
interface PushSubscriptionChangeEvent extends ExtendableEvent {
|
||||
readonly newSubscription: PushSubscription | null;
|
||||
readonly oldSubscription: PushSubscription | null;
|
||||
}
|
||||
|
||||
declare var PushSubscriptionChangeEvent: {
|
||||
prototype: PushSubscriptionChangeEvent;
|
||||
new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent;
|
||||
};
|
||||
|
||||
interface PushSubscriptionOptions {
|
||||
readonly applicationServerKey: ArrayBuffer | null;
|
||||
readonly userVisibleOnly: boolean;
|
||||
|
@ -2933,7 +2917,6 @@ interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
|
|||
"notificationclick": NotificationEvent;
|
||||
"notificationclose": NotificationEvent;
|
||||
"push": PushEvent;
|
||||
"pushsubscriptionchange": PushSubscriptionChangeEvent;
|
||||
"sync": SyncEvent;
|
||||
}
|
||||
|
||||
|
@ -2948,7 +2931,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||
onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
||||
onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
||||
onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
|
||||
onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;
|
||||
onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;
|
||||
readonly registration: ServiceWorkerRegistration;
|
||||
readonly serviceWorker: ServiceWorker;
|
||||
|
@ -3098,7 +3080,7 @@ declare var SyncManager: {
|
|||
interface TextDecoder extends TextDecoderCommon {
|
||||
/**
|
||||
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
||||
* while(buffer = next_chunk()) {
|
||||
|
@ -3106,7 +3088,7 @@ interface TextDecoder extends TextDecoderCommon {
|
|||
* }
|
||||
* string += decoder.decode(); // end-of-queue
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
||||
*/
|
||||
decode(input?: BufferSource, options?: TextDecodeOptions): string;
|
||||
|
@ -3194,34 +3176,6 @@ interface TextMetrics {
|
|||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly actualBoundingBoxRight: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly alphabeticBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly emHeightAscent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly emHeightDescent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly fontBoundingBoxAscent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly fontBoundingBoxDescent: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly hangingBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
readonly ideographicBaseline: number;
|
||||
/**
|
||||
* Returns the measurement described below.
|
||||
*/
|
||||
|
@ -4407,7 +4361,7 @@ declare var WebGLActiveInfo: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
|
||||
interface WebGLBuffer extends WebGLObject {
|
||||
interface WebGLBuffer {
|
||||
}
|
||||
|
||||
declare var WebGLBuffer: {
|
||||
|
@ -4426,7 +4380,7 @@ declare var WebGLContextEvent: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
|
||||
interface WebGLFramebuffer extends WebGLObject {
|
||||
interface WebGLFramebuffer {
|
||||
}
|
||||
|
||||
declare var WebGLFramebuffer: {
|
||||
|
@ -4434,16 +4388,8 @@ declare var WebGLFramebuffer: {
|
|||
new(): WebGLFramebuffer;
|
||||
};
|
||||
|
||||
interface WebGLObject {
|
||||
}
|
||||
|
||||
declare var WebGLObject: {
|
||||
prototype: WebGLObject;
|
||||
new(): WebGLObject;
|
||||
};
|
||||
|
||||
/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
|
||||
interface WebGLProgram extends WebGLObject {
|
||||
interface WebGLProgram {
|
||||
}
|
||||
|
||||
declare var WebGLProgram: {
|
||||
|
@ -4451,7 +4397,7 @@ declare var WebGLProgram: {
|
|||
new(): WebGLProgram;
|
||||
};
|
||||
|
||||
interface WebGLQuery extends WebGLObject {
|
||||
interface WebGLQuery {
|
||||
}
|
||||
|
||||
declare var WebGLQuery: {
|
||||
|
@ -4460,7 +4406,7 @@ declare var WebGLQuery: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
|
||||
interface WebGLRenderbuffer extends WebGLObject {
|
||||
interface WebGLRenderbuffer {
|
||||
}
|
||||
|
||||
declare var WebGLRenderbuffer: {
|
||||
|
@ -5239,7 +5185,7 @@ interface WebGLRenderingContextOverloads {
|
|||
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;
|
||||
}
|
||||
|
||||
interface WebGLSampler extends WebGLObject {
|
||||
interface WebGLSampler {
|
||||
}
|
||||
|
||||
declare var WebGLSampler: {
|
||||
|
@ -5248,7 +5194,7 @@ declare var WebGLSampler: {
|
|||
};
|
||||
|
||||
/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
|
||||
interface WebGLShader extends WebGLObject {
|
||||
interface WebGLShader {
|
||||
}
|
||||
|
||||
declare var WebGLShader: {
|
||||
|
@ -5268,7 +5214,7 @@ declare var WebGLShaderPrecisionFormat: {
|
|||
new(): WebGLShaderPrecisionFormat;
|
||||
};
|
||||
|
||||
interface WebGLSync extends WebGLObject {
|
||||
interface WebGLSync {
|
||||
}
|
||||
|
||||
declare var WebGLSync: {
|
||||
|
@ -5277,7 +5223,7 @@ declare var WebGLSync: {
|
|||
};
|
||||
|
||||
/** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
|
||||
interface WebGLTexture extends WebGLObject {
|
||||
interface WebGLTexture {
|
||||
}
|
||||
|
||||
declare var WebGLTexture: {
|
||||
|
@ -5285,7 +5231,7 @@ declare var WebGLTexture: {
|
|||
new(): WebGLTexture;
|
||||
};
|
||||
|
||||
interface WebGLTransformFeedback extends WebGLObject {
|
||||
interface WebGLTransformFeedback {
|
||||
}
|
||||
|
||||
declare var WebGLTransformFeedback: {
|
||||
|
@ -5302,7 +5248,7 @@ declare var WebGLUniformLocation: {
|
|||
new(): WebGLUniformLocation;
|
||||
};
|
||||
|
||||
interface WebGLVertexArrayObject extends WebGLObject {
|
||||
interface WebGLVertexArrayObject {
|
||||
}
|
||||
|
||||
declare var WebGLVertexArrayObject: {
|
||||
|
@ -5310,7 +5256,7 @@ declare var WebGLVertexArrayObject: {
|
|||
new(): WebGLVertexArrayObject;
|
||||
};
|
||||
|
||||
interface WebGLVertexArrayObjectOES extends WebGLObject {
|
||||
interface WebGLVertexArrayObjectOES {
|
||||
}
|
||||
|
||||
interface WebSocketEventMap {
|
||||
|
@ -5324,13 +5270,13 @@ interface WebSocketEventMap {
|
|||
interface WebSocket extends EventTarget {
|
||||
/**
|
||||
* Returns a string that indicates how binary data from the WebSocket object is exposed to scripts:
|
||||
*
|
||||
*
|
||||
* Can be set, to change how binary data is returned. The default is "blob".
|
||||
*/
|
||||
binaryType: BinaryType;
|
||||
/**
|
||||
* Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network.
|
||||
*
|
||||
*
|
||||
* If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.)
|
||||
*/
|
||||
readonly bufferedAmount: number;
|
||||
|
@ -5383,7 +5329,6 @@ declare var WebSocket: {
|
|||
|
||||
/** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
|
||||
interface WindowClient extends Client {
|
||||
readonly ancestorOrigins: ReadonlyArray<string>;
|
||||
readonly focused: boolean;
|
||||
readonly visibilityState: VisibilityState;
|
||||
focus(): Promise<WindowClient>;
|
||||
|
@ -5506,7 +5451,6 @@ declare var WorkerLocation: {
|
|||
/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
|
||||
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorStorage {
|
||||
readonly permissions: Permissions;
|
||||
readonly serviceWorker: ServiceWorkerContainer;
|
||||
}
|
||||
|
||||
declare var WorkerNavigator: {
|
||||
|
@ -5569,19 +5513,19 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|||
readonly response: any;
|
||||
/**
|
||||
* Returns the text response.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
|
||||
*/
|
||||
readonly responseText: string;
|
||||
/**
|
||||
* Returns the response type.
|
||||
*
|
||||
*
|
||||
* Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
|
||||
*
|
||||
*
|
||||
* When set: setting to "document" is ignored if current global object is not a Window object.
|
||||
*
|
||||
*
|
||||
* When set: throws an "InvalidStateError" DOMException if state is loading or done.
|
||||
*
|
||||
*
|
||||
* When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
|
||||
*/
|
||||
responseType: XMLHttpRequestResponseType;
|
||||
|
@ -5590,7 +5534,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|||
readonly statusText: string;
|
||||
/**
|
||||
* Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method).
|
||||
*
|
||||
*
|
||||
* When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
|
||||
*/
|
||||
timeout: number;
|
||||
|
@ -5600,7 +5544,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|||
readonly upload: XMLHttpRequestUpload;
|
||||
/**
|
||||
* True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false.
|
||||
*
|
||||
*
|
||||
* When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set.
|
||||
*/
|
||||
withCredentials: boolean;
|
||||
|
@ -5612,32 +5556,32 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|||
getResponseHeader(name: string): string | null;
|
||||
/**
|
||||
* Sets the request method, request URL, and synchronous flag.
|
||||
*
|
||||
*
|
||||
* Throws a "SyntaxError" DOMException if either method is not a valid HTTP method or url cannot be parsed.
|
||||
*
|
||||
*
|
||||
* Throws a "SecurityError" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
|
||||
*/
|
||||
open(method: string, url: string): void;
|
||||
open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;
|
||||
/**
|
||||
* Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if state is loading or done.
|
||||
*/
|
||||
overrideMimeType(mime: string): void;
|
||||
/**
|
||||
* Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
|
||||
*/
|
||||
send(body?: BodyInit | null): void;
|
||||
/**
|
||||
* Combines a header in author request headers.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
|
||||
*
|
||||
*
|
||||
* Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.
|
||||
*/
|
||||
setRequestHeader(name: string, value: string): void;
|
||||
|
@ -5737,34 +5681,34 @@ declare namespace WebAssembly {
|
|||
value: any;
|
||||
valueOf(): any;
|
||||
}
|
||||
|
||||
|
||||
var Global: {
|
||||
prototype: Global;
|
||||
new(descriptor: GlobalDescriptor, v?: any): Global;
|
||||
};
|
||||
|
||||
|
||||
interface Instance {
|
||||
readonly exports: Exports;
|
||||
}
|
||||
|
||||
|
||||
var Instance: {
|
||||
prototype: Instance;
|
||||
new(module: Module, importObject?: Imports): Instance;
|
||||
};
|
||||
|
||||
|
||||
interface Memory {
|
||||
readonly buffer: ArrayBuffer;
|
||||
grow(delta: number): number;
|
||||
}
|
||||
|
||||
|
||||
var Memory: {
|
||||
prototype: Memory;
|
||||
new(descriptor: MemoryDescriptor): Memory;
|
||||
};
|
||||
|
||||
|
||||
interface Module {
|
||||
}
|
||||
|
||||
|
||||
var Module: {
|
||||
prototype: Module;
|
||||
new(bytes: BufferSource): Module;
|
||||
|
@ -5772,51 +5716,52 @@ declare namespace WebAssembly {
|
|||
exports(moduleObject: Module): ModuleExportDescriptor[];
|
||||
imports(moduleObject: Module): ModuleImportDescriptor[];
|
||||
};
|
||||
|
||||
|
||||
interface Table {
|
||||
readonly length: number;
|
||||
get(index: number): Function | null;
|
||||
grow(delta: number): number;
|
||||
set(index: number, value: Function | null): void;
|
||||
}
|
||||
|
||||
|
||||
var Table: {
|
||||
prototype: Table;
|
||||
new(descriptor: TableDescriptor): Table;
|
||||
};
|
||||
|
||||
|
||||
interface GlobalDescriptor {
|
||||
mutable?: boolean;
|
||||
value: ValueType;
|
||||
}
|
||||
|
||||
|
||||
interface MemoryDescriptor {
|
||||
initial: number;
|
||||
maximum?: number;
|
||||
shared?: boolean;
|
||||
}
|
||||
|
||||
|
||||
interface ModuleExportDescriptor {
|
||||
kind: ImportExportKind;
|
||||
name: string;
|
||||
}
|
||||
|
||||
|
||||
interface ModuleImportDescriptor {
|
||||
kind: ImportExportKind;
|
||||
module: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
|
||||
interface TableDescriptor {
|
||||
element: TableKind;
|
||||
initial: number;
|
||||
maximum?: number;
|
||||
}
|
||||
|
||||
|
||||
interface WebAssemblyInstantiatedSource {
|
||||
instance: Instance;
|
||||
module: Module;
|
||||
}
|
||||
|
||||
|
||||
type ImportExportKind = "function" | "global" | "memory" | "table";
|
||||
type TableKind = "anyfunc";
|
||||
type ValueType = "f32" | "f64" | "i32" | "i64";
|
||||
|
|
2
cli/dts/lib.webworker.iterable.d.ts
vendored
2
cli/dts/lib.webworker.iterable.d.ts
vendored
|
@ -80,7 +80,7 @@ interface IDBDatabase {
|
|||
interface IDBObjectStore {
|
||||
/**
|
||||
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
|
||||
*
|
||||
*
|
||||
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
|
||||
*/
|
||||
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
|
||||
|
|
873
cli/dts/typescript.d.ts
vendored
873
cli/dts/typescript.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -183,36 +183,45 @@ fn display_parts_to_string(parts: &[SymbolDisplayPart]) -> String {
|
|||
}
|
||||
|
||||
fn get_tag_body_text(tag: &JsDocTagInfo) -> Option<String> {
|
||||
tag.text.as_ref().map(|text| match tag.name.as_str() {
|
||||
"example" => {
|
||||
let caption_regex =
|
||||
Regex::new(r"<caption>(.*?)</caption>\s*\r?\n((?:\s|\S)*)").unwrap();
|
||||
if caption_regex.is_match(&text) {
|
||||
caption_regex
|
||||
.replace(text, |c: &Captures| {
|
||||
format!("{}\n\n{}", &c[1], make_codeblock(&c[2]))
|
||||
})
|
||||
.to_string()
|
||||
} else {
|
||||
make_codeblock(text)
|
||||
tag.text.as_ref().map(|display_parts| {
|
||||
// TODO(@kitsonk) check logic in vscode about handling this API change in
|
||||
// tsserver
|
||||
let text = display_parts_to_string(display_parts);
|
||||
match tag.name.as_str() {
|
||||
"example" => {
|
||||
let caption_regex =
|
||||
Regex::new(r"<caption>(.*?)</caption>\s*\r?\n((?:\s|\S)*)").unwrap();
|
||||
if caption_regex.is_match(&text) {
|
||||
caption_regex
|
||||
.replace(&text, |c: &Captures| {
|
||||
format!("{}\n\n{}", &c[1], make_codeblock(&c[2]))
|
||||
})
|
||||
.to_string()
|
||||
} else {
|
||||
make_codeblock(&text)
|
||||
}
|
||||
}
|
||||
"author" => {
|
||||
let email_match_regex =
|
||||
Regex::new(r"(.+)\s<([-.\w]+@[-.\w]+)>").unwrap();
|
||||
email_match_regex
|
||||
.replace(&text, |c: &Captures| format!("{} {}", &c[1], &c[2]))
|
||||
.to_string()
|
||||
}
|
||||
"default" => make_codeblock(&text),
|
||||
_ => replace_links(&text),
|
||||
}
|
||||
"author" => {
|
||||
let email_match_regex = Regex::new(r"(.+)\s<([-.\w]+@[-.\w]+)>").unwrap();
|
||||
email_match_regex
|
||||
.replace(text, |c: &Captures| format!("{} {}", &c[1], &c[2]))
|
||||
.to_string()
|
||||
}
|
||||
"default" => make_codeblock(text),
|
||||
_ => replace_links(text),
|
||||
})
|
||||
}
|
||||
|
||||
fn get_tag_documentation(tag: &JsDocTagInfo) -> String {
|
||||
match tag.name.as_str() {
|
||||
"augments" | "extends" | "param" | "template" => {
|
||||
if let Some(text) = &tag.text {
|
||||
if let Some(display_parts) = &tag.text {
|
||||
let part_regex = Regex::new(r"^(\S+)\s*-?\s*").unwrap();
|
||||
// TODO(@kitsonk) check logic in vscode about handling this API change
|
||||
// in tsserver
|
||||
let text = display_parts_to_string(display_parts);
|
||||
let body: Vec<&str> = part_regex.split(&text).collect();
|
||||
if body.len() == 3 {
|
||||
let param = body[1];
|
||||
|
@ -474,7 +483,7 @@ pub struct SymbolDisplayPart {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JsDocTagInfo {
|
||||
name: String,
|
||||
text: Option<String>,
|
||||
text: Option<Vec<SymbolDisplayPart>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
@ -2703,7 +2712,7 @@ mod tests {
|
|||
"character": 7
|
||||
},
|
||||
"fileName": "file:///a.ts",
|
||||
"messageText": "Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.",
|
||||
"messageText": "Cannot find name 'console'. Do you need to change your target library? Try changing the \'lib\' compiler option to include 'dom'.",
|
||||
"sourceLine": "console.log(\"hello deno\");",
|
||||
"category": 1,
|
||||
"code": 2584
|
||||
|
|
|
@ -7,6 +7,7 @@ unitTest(function version(): void {
|
|||
// Unreleased version of TypeScript now set the version to 0-dev
|
||||
assert(
|
||||
pattern.test(Deno.version.typescript) ||
|
||||
Deno.version.typescript === "0-dev",
|
||||
Deno.version.typescript === "0-dev" ||
|
||||
Deno.version.typescript === "0-beta",
|
||||
);
|
||||
});
|
||||
|
|
|
@ -73,6 +73,7 @@ lazy_static::lazy_static! {
|
|||
("lib.es2018.full.d.ts", inc!("lib.es2018.full.d.ts")),
|
||||
("lib.es2019.full.d.ts", inc!("lib.es2019.full.d.ts")),
|
||||
("lib.es2020.full.d.ts", inc!("lib.es2020.full.d.ts")),
|
||||
("lib.es2021.full.d.ts", inc!("lib.es2021.full.d.ts")),
|
||||
("lib.esnext.full.d.ts", inc!("lib.esnext.full.d.ts")),
|
||||
("lib.scripthost.d.ts", inc!("lib.scripthost.d.ts")),
|
||||
("lib.webworker.d.ts", inc!("lib.webworker.d.ts")),
|
||||
|
|
24319
cli/tsc/00_typescript.js
vendored
24319
cli/tsc/00_typescript.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -287,20 +287,20 @@
|
|||
return finalBuffer;
|
||||
}
|
||||
|
||||
#createBoundary = () => {
|
||||
#createBoundary() {
|
||||
return (
|
||||
"----------" +
|
||||
Array.from(Array(32))
|
||||
.map(() => Math.random().toString(36)[2] || 0)
|
||||
.join("")
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {[string, string][]} headers
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeHeaders = (headers) => {
|
||||
#writeHeaders(headers) {
|
||||
let buf = (this.chunks.length === 0) ? "" : "\r\n";
|
||||
|
||||
buf += `--${this.boundary}\r\n`;
|
||||
|
@ -310,7 +310,7 @@
|
|||
buf += `\r\n`;
|
||||
|
||||
this.chunks.push(encoder.encode(buf));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
|
@ -318,11 +318,11 @@
|
|||
* @param {string} [type]
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFileHeaders = (
|
||||
#writeFileHeaders(
|
||||
field,
|
||||
filename,
|
||||
type,
|
||||
) => {
|
||||
) {
|
||||
/** @type {[string, string][]} */
|
||||
const headers = [
|
||||
[
|
||||
|
@ -332,37 +332,37 @@
|
|||
["Content-Type", type || "application/octet-stream"],
|
||||
];
|
||||
return this.#writeHeaders(headers);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFieldHeaders = (field) => {
|
||||
#writeFieldHeaders(field) {
|
||||
/** @type {[string, string][]} */
|
||||
const headers = [["Content-Disposition", `form-data; name="${field}"`]];
|
||||
return this.#writeHeaders(headers);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {string} value
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeField = (field, value) => {
|
||||
#writeField(field, value) {
|
||||
this.#writeFieldHeaders(field);
|
||||
this.chunks.push(encoder.encode(value));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {File} value
|
||||
* @returns {void}
|
||||
*/
|
||||
#writeFile = (field, value) => {
|
||||
#writeFile(field, value) {
|
||||
this.#writeFileHeaders(field, value.name, value.type);
|
||||
this.chunks.push(value[_byteSequence]);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -418,7 +418,7 @@
|
|||
* @param {string} headersText
|
||||
* @returns {{ headers: Headers, disposition: Map<string, string> }}
|
||||
*/
|
||||
#parseHeaders = (headersText) => {
|
||||
#parseHeaders(headersText) {
|
||||
const headers = new Headers();
|
||||
const rawHeaders = headersText.split("\r\n");
|
||||
for (const rawHeader of rawHeaders) {
|
||||
|
@ -436,7 +436,7 @@
|
|||
);
|
||||
|
||||
return { headers, disposition };
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {FormData}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* @param {Blob} blob
|
||||
* @param {{kind: "ArrayBuffer" | "Text" | "DataUrl" | "BinaryString", encoding?: string}} readtype
|
||||
*/
|
||||
#readOperation = (blob, readtype) => {
|
||||
#readOperation(blob, readtype) {
|
||||
// 1. If fr’s state is "loading", throw an InvalidStateError DOMException.
|
||||
if (this[state] === "loading") {
|
||||
throw new DOMException(
|
||||
|
@ -221,7 +221,7 @@
|
|||
}
|
||||
}
|
||||
})();
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
@ -58,14 +58,14 @@
|
|||
urls.set(this, null);
|
||||
}
|
||||
|
||||
#updateUrlSearch = () => {
|
||||
#updateUrlSearch() {
|
||||
const url = urls.get(this);
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
const parseArgs = { href: url.href, setSearch: this.toString() };
|
||||
parts.set(url, core.opSync("op_url_parse", parseArgs));
|
||||
};
|
||||
}
|
||||
|
||||
append(name, value) {
|
||||
requiredArguments("URLSearchParams.append", arguments.length, 2);
|
||||
|
@ -227,7 +227,7 @@
|
|||
return `${this.constructor.name} ${inspect(object)}`;
|
||||
}
|
||||
|
||||
#updateSearchParams = () => {
|
||||
#updateSearchParams() {
|
||||
if (this.#searchParams != null) {
|
||||
const params = paramLists.get(this.#searchParams);
|
||||
const newParams = core.opSync(
|
||||
|
@ -236,7 +236,7 @@
|
|||
);
|
||||
params.splice(0, params.length, ...newParams);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
get hash() {
|
||||
return parts.get(this).hash;
|
||||
|
|
|
@ -192,16 +192,16 @@
|
|||
this.#poll();
|
||||
}
|
||||
|
||||
#handleMessage = (data) => {
|
||||
#handleMessage(data) {
|
||||
const msgEvent = new MessageEvent("message", {
|
||||
cancelable: false,
|
||||
data,
|
||||
});
|
||||
|
||||
this.dispatchEvent(msgEvent);
|
||||
};
|
||||
}
|
||||
|
||||
#handleError = (e) => {
|
||||
#handleError(e) {
|
||||
const event = new ErrorEvent("error", {
|
||||
cancelable: true,
|
||||
message: e.message,
|
||||
|
@ -219,7 +219,7 @@
|
|||
}
|
||||
|
||||
return handled;
|
||||
};
|
||||
}
|
||||
|
||||
#poll = async () => {
|
||||
while (!this.#terminated) {
|
||||
|
|
|
@ -73,19 +73,19 @@
|
|||
this.#off = 0;
|
||||
}
|
||||
|
||||
#tryGrowByReslice = (n) => {
|
||||
#tryGrowByReslice(n) {
|
||||
const l = this.#buf.byteLength;
|
||||
if (n <= this.capacity - l) {
|
||||
this.#reslice(l + n);
|
||||
return l;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
#reslice = (len) => {
|
||||
#reslice(len) {
|
||||
assert(len <= this.#buf.buffer.byteLength);
|
||||
this.#buf = new Uint8Array(this.#buf.buffer, 0, len);
|
||||
};
|
||||
}
|
||||
|
||||
readSync(p) {
|
||||
if (this.empty()) {
|
||||
|
@ -117,7 +117,7 @@
|
|||
return Promise.resolve(n);
|
||||
}
|
||||
|
||||
#grow = (n) => {
|
||||
#grow(n) {
|
||||
const m = this.length;
|
||||
// If buffer is empty, reset to recover space.
|
||||
if (m === 0 && this.#off !== 0) {
|
||||
|
@ -147,7 +147,7 @@
|
|||
this.#off = 0;
|
||||
this.#reslice(Math.min(m + n, MAX_SIZE));
|
||||
return m;
|
||||
};
|
||||
}
|
||||
|
||||
grow(n) {
|
||||
if (n < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue