modern-monaco 0.2.1 → 0.3.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.
@@ -88,7 +88,7 @@ export default {
88
88
  "lib.esnext.decorators.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"es2015.symbol\" />\n/// <reference lib=\"decorators\" />\n\ninterface SymbolConstructor {\n readonly metadata: unique symbol;\n}\n\ninterface Function {\n [Symbol.metadata]: DecoratorMetadata | null;\n}\n",
89
89
  "lib.esnext.disposable.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"es2015.symbol\" />\n/// <reference lib=\"es2015.iterable\" />\n/// <reference lib=\"es2018.asynciterable\" />\n\ninterface SymbolConstructor {\n /**\n * A method that is used to release resources held by an object. Called by the semantics of the `using` statement.\n */\n readonly dispose: unique symbol;\n\n /**\n * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.\n */\n readonly asyncDispose: unique symbol;\n}\n\ninterface Disposable {\n [Symbol.dispose](): void;\n}\n\ninterface AsyncDisposable {\n [Symbol.asyncDispose](): PromiseLike<void>;\n}\n\ninterface SuppressedError extends Error {\n error: any;\n suppressed: any;\n}\n\ninterface SuppressedErrorConstructor {\n new (error: any, suppressed: any, message?: string): SuppressedError;\n (error: any, suppressed: any, message?: string): SuppressedError;\n readonly prototype: SuppressedError;\n}\ndeclare var SuppressedError: SuppressedErrorConstructor;\n\ninterface DisposableStack {\n /**\n * Returns a value indicating whether this stack has been disposed.\n */\n readonly disposed: boolean;\n /**\n * Disposes each resource in the stack in the reverse order that they were added.\n */\n dispose(): void;\n /**\n * Adds a disposable resource to the stack, returning the resource.\n * @param value The resource to add. `null` and `undefined` will not be added, but will be returned.\n * @returns The provided {@link value}.\n */\n use<T extends Disposable | null | undefined>(value: T): T;\n /**\n * Adds a value and associated disposal callback as a resource to the stack.\n * @param value The value to add.\n * @param onDispose The callback to use in place of a `[Symbol.dispose]()` method. Will be invoked with `value`\n * as the first parameter.\n * @returns The provided {@link value}.\n */\n adopt<T>(value: T, onDispose: (value: T) => void): T;\n /**\n * Adds a callback to be invoked when the stack is disposed.\n */\n defer(onDispose: () => void): void;\n /**\n * Move all resources out of this stack and into a new `DisposableStack`, and marks this stack as disposed.\n * @example\n * ```ts\n * class C {\n * #res1: Disposable;\n * #res2: Disposable;\n * #disposables: DisposableStack;\n * constructor() {\n * // stack will be disposed when exiting constructor for any reason\n * using stack = new DisposableStack();\n *\n * // get first resource\n * this.#res1 = stack.use(getResource1());\n *\n * // get second resource. If this fails, both `stack` and `#res1` will be disposed.\n * this.#res2 = stack.use(getResource2());\n *\n * // all operations succeeded, move resources out of `stack` so that they aren't disposed\n * // when constructor exits\n * this.#disposables = stack.move();\n * }\n *\n * [Symbol.dispose]() {\n * this.#disposables.dispose();\n * }\n * }\n * ```\n */\n move(): DisposableStack;\n [Symbol.dispose](): void;\n readonly [Symbol.toStringTag]: string;\n}\n\ninterface DisposableStackConstructor {\n new (): DisposableStack;\n readonly prototype: DisposableStack;\n}\ndeclare var DisposableStack: DisposableStackConstructor;\n\ninterface AsyncDisposableStack {\n /**\n * Returns a value indicating whether this stack has been disposed.\n */\n readonly disposed: boolean;\n /**\n * Disposes each resource in the stack in the reverse order that they were added.\n */\n disposeAsync(): Promise<void>;\n /**\n * Adds a disposable resource to the stack, returning the resource.\n * @param value The resource to add. `null` and `undefined` will not be added, but will be returned.\n * @returns The provided {@link value}.\n */\n use<T extends AsyncDisposable | Disposable | null | undefined>(value: T): T;\n /**\n * Adds a value and associated disposal callback as a resource to the stack.\n * @param value The value to add.\n * @param onDisposeAsync The callback to use in place of a `[Symbol.asyncDispose]()` method. Will be invoked with `value`\n * as the first parameter.\n * @returns The provided {@link value}.\n */\n adopt<T>(value: T, onDisposeAsync: (value: T) => PromiseLike<void> | void): T;\n /**\n * Adds a callback to be invoked when the stack is disposed.\n */\n defer(onDisposeAsync: () => PromiseLike<void> | void): void;\n /**\n * Move all resources out of this stack and into a new `DisposableStack`, and marks this stack as disposed.\n * @example\n * ```ts\n * class C {\n * #res1: Disposable;\n * #res2: Disposable;\n * #disposables: DisposableStack;\n * constructor() {\n * // stack will be disposed when exiting constructor for any reason\n * using stack = new DisposableStack();\n *\n * // get first resource\n * this.#res1 = stack.use(getResource1());\n *\n * // get second resource. If this fails, both `stack` and `#res1` will be disposed.\n * this.#res2 = stack.use(getResource2());\n *\n * // all operations succeeded, move resources out of `stack` so that they aren't disposed\n * // when constructor exits\n * this.#disposables = stack.move();\n * }\n *\n * [Symbol.dispose]() {\n * this.#disposables.dispose();\n * }\n * }\n * ```\n */\n move(): AsyncDisposableStack;\n [Symbol.asyncDispose](): Promise<void>;\n readonly [Symbol.toStringTag]: string;\n}\n\ninterface AsyncDisposableStackConstructor {\n new (): AsyncDisposableStack;\n readonly prototype: AsyncDisposableStack;\n}\ndeclare var AsyncDisposableStack: AsyncDisposableStackConstructor;\n\ninterface IteratorObject<T, TReturn, TNext> extends Disposable {\n}\n\ninterface AsyncIteratorObject<T, TReturn, TNext> extends AsyncDisposable {\n}\n",
90
90
  "lib.esnext.error.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\ninterface ErrorConstructor {\n /**\n * Indicates whether the argument provided is a built-in Error instance or not.\n */\n isError(error: unknown): error is Error;\n}\n",
91
- "lib.esnext.float16.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"es2015.symbol\" />\n/// <reference lib=\"es2015.iterable\" />\n\n/**\n * A typed array of 16-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: TArrayBuffer;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the item located at the specified index.\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\n at(index: number): number | undefined;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the array until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;\n\n /**\n * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param predicate A function that accepts up to three arguments. The filter method calls\n * the predicate function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;\n\n /**\n * Returns the value of the last element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate findLast calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found, findLast\n * immediately returns that element value. Otherwise, findLast returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findLast<S extends number>(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => value is S,\n thisArg?: any,\n ): S | undefined;\n findLast(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => unknown,\n thisArg?: any,\n ): number | undefined;\n\n /**\n * Returns the index of the last element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate findLastIndex calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findLastIndex(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => unknown,\n thisArg?: any,\n ): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;\n\n /**\n * Determines whether an array includes a certain element, returning true or false as appropriate.\n * @param searchElement The element to search for.\n * @param fromIndex The position in this array at which to begin searching for searchElement.\n */\n includes(searchElement: number, fromIndex?: number): boolean;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): this;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike<number>, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\n */\n slice(start?: number, end?: number): Float16Array<ArrayBuffer>;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param predicate A function that accepts up to three arguments. The some method calls\n * the predicate function for each element in the array until the predicate returns a value\n * which is coercible to the Boolean value true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn Function used to determine the order of the elements. It is expected to return\n * a negative value if first argument is less than second argument, zero if they're equal and a positive\n * value otherwise. If omitted, the elements are sorted in ascending order.\n * ```ts\n * [11,2,22,1].sort((a, b) => a - b)\n * ```\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n\n /**\n * Copies the array and returns the copy with the elements in reverse order.\n */\n toReversed(): Float16Array<ArrayBuffer>;\n\n /**\n * Copies and sorts the array.\n * @param compareFn Function used to determine the order of the elements. It is expected to return\n * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive\n * value otherwise. If omitted, the elements are sorted in ascending order.\n * ```ts\n * const myNums = Float16Array.from([11.25, 2, -22.5, 1]);\n * myNums.toSorted((a, b) => a - b) // Float16Array(4) [-22.5, 1, 2, 11.5]\n * ```\n */\n toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): this;\n\n /**\n * Copies the array and inserts the given number at the provided index.\n * @param index The index of the value to overwrite. If the index is\n * negative, then it replaces from the end of the array.\n * @param value The value to insert into the copied array.\n * @returns A copy of the original array with the inserted value.\n */\n with(index: number, value: number): Float16Array<ArrayBuffer>;\n\n [index: number]: number;\n\n [Symbol.iterator](): ArrayIterator<number>;\n\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): ArrayIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): ArrayIterator<number>;\n\n /**\n * Returns an list of values in the array\n */\n values(): ArrayIterator<number>;\n\n readonly [Symbol.toStringTag]: \"Float16Array\";\n}\n\ninterface Float16ArrayConstructor {\n readonly prototype: Float16Array<ArrayBufferLike>;\n new (length?: number): Float16Array<ArrayBuffer>;\n new (array: ArrayLike<number> | Iterable<number>): Float16Array<ArrayBuffer>;\n new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array<TArrayBuffer>;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like object to convert to an array.\n */\n from(arrayLike: ArrayLike<number>): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param elements An iterable object to convert to an array.\n */\n from(elements: Iterable<number>): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param elements An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n}\ndeclare var Float16Array: Float16ArrayConstructor;\n\ninterface Math {\n /**\n * Returns the nearest half precision float representation of a number.\n * @param x A numeric expression.\n */\n f16round(x: number): number;\n}\n\ninterface DataView<TArrayBuffer extends ArrayBufferLike> {\n /**\n * Gets the Float16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n * @param littleEndian If false or undefined, a big-endian value should be read.\n */\n getFloat16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written.\n */\n setFloat16(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n",
91
+ "lib.esnext.float16.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"es2015.symbol\" />\n/// <reference lib=\"es2015.iterable\" />\n\n/**\n * A typed array of 16-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: TArrayBuffer;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the item located at the specified index.\n * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.\n */\n at(index: number): number | undefined;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param predicate A function that accepts up to three arguments. The every method calls\n * the predicate function for each element in the array until the predicate returns a value\n * which is coercible to the Boolean value false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;\n\n /**\n * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param predicate A function that accepts up to three arguments. The filter method calls\n * the predicate function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;\n\n /**\n * Returns the value of the last element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate findLast calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found, findLast\n * immediately returns that element value. Otherwise, findLast returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findLast<S extends number>(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => value is S,\n thisArg?: any,\n ): S | undefined;\n findLast(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => unknown,\n thisArg?: any,\n ): number | undefined;\n\n /**\n * Returns the index of the last element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate findLastIndex calls predicate once for each element of the array, in descending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findLastIndex(\n predicate: (\n value: number,\n index: number,\n array: this,\n ) => unknown,\n thisArg?: any,\n ): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;\n\n /**\n * Determines whether an array includes a certain element, returning true or false as appropriate.\n * @param searchElement The element to search for.\n * @param fromIndex The position in this array at which to begin searching for searchElement.\n */\n includes(searchElement: number, fromIndex?: number): boolean;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): this;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike<number>, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\n */\n slice(start?: number, end?: number): Float16Array<ArrayBuffer>;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param predicate A function that accepts up to three arguments. The some method calls\n * the predicate function for each element in the array until the predicate returns a value\n * which is coercible to the Boolean value true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the predicate function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn Function used to determine the order of the elements. It is expected to return\n * a negative value if first argument is less than second argument, zero if they're equal and a positive\n * value otherwise. If omitted, the elements are sorted in ascending order.\n * ```ts\n * [11,2,22,1].sort((a, b) => a - b)\n * ```\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n\n /**\n * Copies the array and returns the copy with the elements in reverse order.\n */\n toReversed(): Float16Array<ArrayBuffer>;\n\n /**\n * Copies and sorts the array.\n * @param compareFn Function used to determine the order of the elements. It is expected to return\n * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive\n * value otherwise. If omitted, the elements are sorted in ascending order.\n * ```ts\n * const myNums = Float16Array.from([11.25, 2, -22.5, 1]);\n * myNums.toSorted((a, b) => a - b) // Float16Array(4) [-22.5, 1, 2, 11.5]\n * ```\n */\n toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): this;\n\n /**\n * Copies the array and inserts the given number at the provided index.\n * @param index The index of the value to overwrite. If the index is\n * negative, then it replaces from the end of the array.\n * @param value The value to insert into the copied array.\n * @returns A copy of the original array with the inserted value.\n */\n with(index: number, value: number): Float16Array<ArrayBuffer>;\n\n [index: number]: number;\n\n [Symbol.iterator](): ArrayIterator<number>;\n\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): ArrayIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): ArrayIterator<number>;\n\n /**\n * Returns an list of values in the array\n */\n values(): ArrayIterator<number>;\n\n readonly [Symbol.toStringTag]: \"Float16Array\";\n}\n\ninterface Float16ArrayConstructor {\n readonly prototype: Float16Array<ArrayBufferLike>;\n new (length?: number): Float16Array<ArrayBuffer>;\n new (array: ArrayLike<number> | Iterable<number>): Float16Array<ArrayBuffer>;\n new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array<TArrayBuffer>;\n new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float16Array<ArrayBuffer>;\n new (array: ArrayLike<number> | ArrayBuffer): Float16Array<ArrayBuffer>;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like object to convert to an array.\n */\n from(arrayLike: ArrayLike<number>): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param elements An iterable object to convert to an array.\n */\n from(elements: Iterable<number>): Float16Array<ArrayBuffer>;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param elements An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from<T>(elements: Iterable<T>, mapfn?: (v: T, k: number) => number, thisArg?: any): Float16Array<ArrayBuffer>;\n}\ndeclare var Float16Array: Float16ArrayConstructor;\n\ninterface Math {\n /**\n * Returns the nearest half precision float representation of a number.\n * @param x A numeric expression.\n */\n f16round(x: number): number;\n}\n\ninterface DataView<TArrayBuffer extends ArrayBufferLike> {\n /**\n * Gets the Float16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n * @param littleEndian If false or undefined, a big-endian value should be read.\n */\n getFloat16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written.\n */\n setFloat16(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n",
92
92
  "lib.esnext.full.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"esnext\" />\n/// <reference lib=\"dom\" />\n/// <reference lib=\"webworker.importscripts\" />\n/// <reference lib=\"scripthost\" />\n/// <reference lib=\"dom.iterable\" />\n/// <reference lib=\"dom.asynciterable\" />\n",
93
93
  "lib.esnext.intl.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\ndeclare namespace Intl {\n // Empty\n}\n",
94
94
  "lib.esnext.iterator.d.ts": "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n/// <reference no-default-lib=\"true\"/>\n\n/// <reference lib=\"es2015.iterable\" />\n\n// NOTE: This is specified as what is essentially an unreachable module. All actual global declarations can be found\n// in the `declare global` section, below. This is necessary as there is currently no way to declare an `abstract`\n// member without declaring a `class`, but declaring `class Iterator<T>` globally would conflict with TypeScript's\n// general purpose `Iterator<T>` interface.\nexport {};\n\n// Abstract type that allows us to mark `next` as `abstract`\ndeclare abstract class Iterator<T, TResult = undefined, TNext = unknown> { // eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging\n abstract next(value?: TNext): IteratorResult<T, TResult>;\n}\n\n// Merge all members of `IteratorObject<T>` into `Iterator<T>`\ninterface Iterator<T, TResult, TNext> extends globalThis.IteratorObject<T, TResult, TNext> {}\n\n// Capture the `Iterator` constructor in a type we can use in the `extends` clause of `IteratorConstructor`.\ntype IteratorObjectConstructor = typeof Iterator;\n\ndeclare global {\n // Global `IteratorObject<T, TReturn, TNext>` interface that can be augmented by polyfills\n interface IteratorObject<T, TReturn, TNext> {\n /**\n * Returns this iterator.\n */\n [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;\n\n /**\n * Creates an iterator whose values are the result of applying the callback to the values from this iterator.\n * @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.\n */\n map<U>(callbackfn: (value: T, index: number) => U): IteratorObject<U, undefined, unknown>;\n\n /**\n * Creates an iterator whose values are those from this iterator for which the provided predicate returns true.\n * @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.\n */\n filter<S extends T>(predicate: (value: T, index: number) => value is S): IteratorObject<S, undefined, unknown>;\n\n /**\n * Creates an iterator whose values are those from this iterator for which the provided predicate returns true.\n * @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.\n */\n filter(predicate: (value: T, index: number) => unknown): IteratorObject<T, undefined, unknown>;\n\n /**\n * Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.\n * @param limit The maximum number of values to yield.\n */\n take(limit: number): IteratorObject<T, undefined, unknown>;\n\n /**\n * Creates an iterator whose values are the values from this iterator after skipping the provided count.\n * @param count The number of values to drop.\n */\n drop(count: number): IteratorObject<T, undefined, unknown>;\n\n /**\n * Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.\n * @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.\n */\n flatMap<U>(callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>): IteratorObject<U, undefined, unknown>;\n\n /**\n * Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;\n\n /**\n * Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.\n */\n reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;\n\n /**\n * Creates a new array from the values yielded by this iterator.\n */\n toArray(): T[];\n\n /**\n * Performs the specified action for each element in the iterator.\n * @param callbackfn A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.\n */\n forEach(callbackfn: (value: T, index: number) => void): void;\n\n /**\n * Determines whether the specified callback function returns true for any element of this iterator.\n * @param predicate A function that accepts up to two arguments. The some method calls\n * the predicate function for each element in this iterator until the predicate returns a value\n * true, or until the end of the iterator.\n */\n some(predicate: (value: T, index: number) => unknown): boolean;\n\n /**\n * Determines whether all the members of this iterator satisfy the specified test.\n * @param predicate A function that accepts up to two arguments. The every method calls\n * the predicate function for each element in this iterator until the predicate returns\n * false, or until the end of this iterator.\n */\n every(predicate: (value: T, index: number) => unknown): boolean;\n\n /**\n * Returns the value of the first element in this iterator where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of this iterator, in\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n */\n find<S extends T>(predicate: (value: T, index: number) => value is S): S | undefined;\n find(predicate: (value: T, index: number) => unknown): T | undefined;\n\n readonly [Symbol.toStringTag]: string;\n }\n\n // Global `IteratorConstructor` interface that can be augmented by polyfills\n interface IteratorConstructor extends IteratorObjectConstructor {\n /**\n * Creates a native iterator from an iterator or iterable object.\n * Returns its input if the input already inherits from the built-in Iterator class.\n * @param value An iterator or iterable object to convert a native iterator.\n */\n from<T>(value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>): IteratorObject<T, undefined, unknown>;\n }\n\n var Iterator: IteratorConstructor;\n}\n",
@@ -95,8 +95,7 @@ function isSameImports(a, b) {
95
95
 
96
96
  // src/lsp/typescript/setup.ts
97
97
  import { cache } from "../../cache.mjs";
98
- import { ErrorNotFound } from "../../workspace.mjs";
99
- import * as ls from "../language-service.mjs";
98
+ import * as client from "../client.mjs";
100
99
  var worker = null;
101
100
  async function setup(monaco, languageId, languageSettings, formattingOptions, workspace) {
102
101
  if (!worker) {
@@ -105,10 +104,10 @@ async function setup(monaco, languageId, languageSettings, formattingOptions, wo
105
104
  if (worker instanceof Promise) {
106
105
  worker = await worker;
107
106
  }
108
- ls.registerBasicFeatures(languageId, worker, [".", "/", '"', "'", "<"], workspace);
109
- ls.registerAutoComplete(languageId, worker, [">", "/"]);
110
- ls.registerSignatureHelp(languageId, worker, ["(", ","]);
111
- ls.registerCodeAction(languageId, worker);
107
+ client.registerBasicFeatures(languageId, worker, [".", "/", '"', "'", "<"], workspace);
108
+ client.registerAutoComplete(languageId, worker, [">", "/"]);
109
+ client.registerSignatureHelp(languageId, worker, ["(", ","]);
110
+ client.registerCodeAction(languageId, worker);
112
111
  }
113
112
  async function createWorker(monaco, workspace, languageSettings, formattingOptions) {
114
113
  const fs = workspace?.fs;
@@ -168,7 +167,7 @@ async function createWorker(monaco, workspace, languageSettings, formattingOptio
168
167
  },
169
168
  importMap,
170
169
  types: typesStore.types,
171
- workspace: !!workspace
170
+ fs: workspace ? await client.walkFS(workspace.fs, "/") : void 0
172
171
  };
173
172
  const worker2 = monaco.editor.createWebWorker({
174
173
  worker: getWorker(createData),
@@ -181,7 +180,7 @@ async function createWorker(monaco, workspace, languageSettings, formattingOptio
181
180
  try {
182
181
  await workspace._openTextDocument(uri);
183
182
  } catch (error) {
184
- if (error instanceof ErrorNotFound) {
183
+ if (isFsNotFoundError(error)) {
185
184
  return false;
186
185
  }
187
186
  throw error;
@@ -282,10 +281,10 @@ function createWebWorker() {
282
281
  if (workerUrl.origin !== location.origin) {
283
282
  return new Worker(
284
283
  URL.createObjectURL(new Blob([`import "${workerUrl.href}"`], { type: "application/javascript" })),
285
- { type: "module" }
284
+ { type: "module", name: "typescript-worker" }
286
285
  );
287
286
  }
288
- return new Worker(new URL("./worker.mjs", import.meta.url), { type: "module" });
287
+ return new Worker(workerUrl, { type: "module", name: "typescript-worker" });
289
288
  }
290
289
  function getWorker(createData) {
291
290
  const worker2 = createWebWorker();
@@ -385,8 +384,7 @@ async function loadCompilerOptions(workspace) {
385
384
  compilerOptions.$src = "file:///tsconfig.json";
386
385
  Object.assign(compilerOptions, tsconfig.compilerOptions);
387
386
  } catch (error) {
388
- if (error instanceof ErrorNotFound) {
389
- } else {
387
+ if (!isFsNotFoundError(error)) {
390
388
  console.error(error);
391
389
  }
392
390
  }
@@ -407,14 +405,16 @@ async function loadImportMap(workspace, validate) {
407
405
  return validate(importMap2);
408
406
  }
409
407
  } catch (error) {
410
- if (error instanceof ErrorNotFound) {
411
- } else {
408
+ if (!isFsNotFoundError(error)) {
412
409
  console.error("Failed to parse import map from index.html:", error.message);
413
410
  }
414
411
  }
415
412
  const importMap = createBlankImportMap();
416
413
  return validate(importMap);
417
414
  }
415
+ function isFsNotFoundError(error) {
416
+ return error instanceof Error && error.FS_ERROR === "NOT_FOUND";
417
+ }
418
418
  function parseJsonc(text) {
419
419
  try {
420
420
  return JSON.parse(text);
@@ -1466,21 +1466,36 @@ function getWellformedEdit(textEdit) {
1466
1466
 
1467
1467
  // src/lsp/worker-base.ts
1468
1468
  var WorkerBase = class {
1469
- constructor(_ctx, _createData, _createLanguageDocument) {
1470
- this._ctx = _ctx;
1471
- this._createData = _createData;
1472
- this._createLanguageDocument = _createLanguageDocument;
1473
- }
1474
- #documentCache = /* @__PURE__ */ new Map();
1469
+ #ctx;
1475
1470
  #fs;
1471
+ #documentCache = /* @__PURE__ */ new Map();
1472
+ #createLanguageDocument;
1473
+ constructor(ctx, createData, createLanguageDocument) {
1474
+ this.#ctx = ctx;
1475
+ if (createData.fs) {
1476
+ const dirs = /* @__PURE__ */ new Set(["/"]);
1477
+ this.#fs = new Map(createData.fs.map((path) => {
1478
+ const dir = path.slice(0, path.lastIndexOf("/"));
1479
+ if (dir) {
1480
+ dirs.add(dir);
1481
+ }
1482
+ return ["file://" + path, 1];
1483
+ }));
1484
+ for (const dir of dirs) {
1485
+ this.#fs.set("file://" + dir, 2);
1486
+ }
1487
+ createData.fs.length = 0;
1488
+ }
1489
+ this.#createLanguageDocument = createLanguageDocument;
1490
+ }
1476
1491
  get hasFileSystemProvider() {
1477
- return !!this._createData.workspace;
1492
+ return !!this.#fs;
1478
1493
  }
1479
1494
  get host() {
1480
- return this._ctx.host;
1495
+ return this.#ctx.host;
1481
1496
  }
1482
1497
  getMirrorModels() {
1483
- return this._ctx.getMirrorModels();
1498
+ return this.#ctx.getMirrorModels();
1484
1499
  }
1485
1500
  hasModel(fileName) {
1486
1501
  const models = this.getMirrorModels();
@@ -1521,10 +1536,10 @@ var WorkerBase = class {
1521
1536
  if (cached && cached[0] === version && cached[2]) {
1522
1537
  return cached[2];
1523
1538
  }
1524
- if (!this._createLanguageDocument) {
1539
+ if (!this.#createLanguageDocument) {
1525
1540
  throw new Error("createLanguageDocument is not provided");
1526
1541
  }
1527
- const languageDocument = this._createLanguageDocument(document2);
1542
+ const languageDocument = this.#createLanguageDocument(document2);
1528
1543
  this.#documentCache.set(uri, [version, document2, languageDocument]);
1529
1544
  return languageDocument;
1530
1545
  }
@@ -1535,10 +1550,12 @@ var WorkerBase = class {
1535
1550
  if (path.startsWith(uri)) {
1536
1551
  const name = path.slice(uri.length);
1537
1552
  if (!name.includes("/")) {
1538
- if (type === 2) {
1539
- entries.push([name, 2 /* Directory */]);
1540
- } else if (!extensions || extensions.some((ext) => name.endsWith(ext))) {
1541
- entries.push([name, 1 /* File */]);
1553
+ if (type === 1) {
1554
+ if (!extensions || extensions.some((ext) => name.endsWith(ext))) {
1555
+ entries.push([name, 1]);
1556
+ }
1557
+ } else if (type === 2) {
1558
+ entries.push([name, 2]);
1542
1559
  }
1543
1560
  }
1544
1561
  }
@@ -1547,8 +1564,8 @@ var WorkerBase = class {
1547
1564
  return entries;
1548
1565
  }
1549
1566
  getFileSystemProvider() {
1550
- if (this.hasFileSystemProvider) {
1551
- const host = this._ctx.host;
1567
+ if (this.#fs) {
1568
+ const host = this.#ctx.host;
1552
1569
  return {
1553
1570
  readDirectory: (uri) => {
1554
1571
  return Promise.resolve(this.readDir(uri));
@@ -1565,29 +1582,27 @@ var WorkerBase = class {
1565
1582
  }
1566
1583
  // resolveReference implementes the `DocumentContext` interface
1567
1584
  resolveReference(ref, baseUrl) {
1568
- const url = new URL(ref, baseUrl);
1569
- const href = url.href;
1570
- if (url.protocol === "file:" && url.pathname !== "/" && this.#fs && !this.#fs.has(href.endsWith("/") ? href.slice(0, -1) : href)) {
1585
+ const { protocol, pathname, href } = new URL(ref, baseUrl);
1586
+ if (protocol === "file:" && pathname !== "/" && this.#fs && !this.#fs.has(href.endsWith("/") ? href.slice(0, -1) : href)) {
1571
1587
  return void 0;
1572
1588
  }
1573
1589
  return href;
1574
1590
  }
1575
1591
  // #region methods used by the host
1576
- async removeDocumentCache(uri) {
1592
+ async releaseDocument(uri) {
1577
1593
  this.#documentCache.delete(uri);
1578
1594
  }
1579
1595
  async fsNotify(kind, path, type) {
1580
- const url = "file://" + path;
1581
- const entries = this.#fs ?? (this.#fs = /* @__PURE__ */ new Map());
1596
+ const fs = this.#fs ?? (this.#fs = /* @__PURE__ */ new Map());
1582
1597
  if (kind === "create") {
1583
1598
  if (type) {
1584
- entries.set(url, type);
1599
+ fs.set(path, type);
1585
1600
  }
1586
1601
  } else if (kind === "remove") {
1587
- if (entries.get(url) === 1 /* File */) {
1588
- this.#documentCache.delete(url);
1602
+ if (fs.get(path) === 1) {
1603
+ this.#documentCache.delete(path);
1589
1604
  }
1590
- entries.delete(url);
1605
+ fs.delete(path);
1591
1606
  }
1592
1607
  }
1593
1608
  // #endregion
@@ -1639,14 +1654,14 @@ var TypeScriptWorker = class extends WorkerBase {
1639
1654
  const dirname = path.slice("file:///node_modules/".length);
1640
1655
  return Object.keys(this.#importMap.imports).filter((key) => key !== "@jsxRuntime" && (dirname.length === 0 || key.startsWith(dirname))).map((key) => dirname.length > 0 ? key.slice(dirname.length) : key).filter((key) => key !== "/" && key.includes("/")).map((key) => key.split("/")[0]);
1641
1656
  }
1642
- return this.readDir(path).filter(([_, type]) => type === 2 /* Directory */).map(([name, _]) => name);
1657
+ return this.readDir(path).filter(([_, type]) => type === 2).map(([name, _]) => name);
1643
1658
  }
1644
1659
  readDirectory(path, extensions, exclude, include, depth) {
1645
1660
  if (path.startsWith("file:///node_modules/")) {
1646
1661
  const dirname = path.slice("file:///node_modules/".length);
1647
1662
  return Object.keys(this.#importMap.imports).filter((key) => key !== "@jsxRuntime" && (dirname.length === 0 || key.startsWith(dirname))).map((key) => dirname.length > 0 ? key.slice(dirname.length) : key).filter((key) => !key.includes("/"));
1648
1663
  }
1649
- return this.readDir(path, extensions).filter(([_, type]) => type === 1 /* File */).map(([name, _]) => name);
1664
+ return this.readDir(path, extensions).filter(([_, type]) => type === 1).map(([name, _]) => name);
1650
1665
  }
1651
1666
  fileExists(filename) {
1652
1667
  if (filename.startsWith("/node_modules/")) return false;
@@ -2298,7 +2313,7 @@ var TypeScriptWorker = class extends WorkerBase {
2298
2313
  if (types) {
2299
2314
  for (const uri of Object.keys(this.#types)) {
2300
2315
  if (!(uri in types)) {
2301
- this.removeDocumentCache(uri);
2316
+ this.releaseDocument(uri);
2302
2317
  }
2303
2318
  }
2304
2319
  this.#types = types;