modern-monaco 0.2.2 → 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.
- package/README.md +1 -1
- package/dist/core.mjs +37 -40
- package/dist/editor-core.mjs +48099 -46106
- package/dist/editor-worker.mjs +308 -441
- package/dist/index.mjs +11 -9
- package/dist/lsp/client.mjs +14 -1
- package/dist/lsp/css/setup.mjs +1 -2
- package/dist/lsp/css/worker.mjs +39 -42
- package/dist/lsp/html/setup.mjs +1 -2
- package/dist/lsp/html/worker.mjs +52 -59
- package/dist/lsp/json/setup.mjs +1 -2
- package/dist/lsp/json/worker.mjs +654 -62
- package/dist/lsp/typescript/libs.mjs +1 -1
- package/dist/lsp/typescript/setup.mjs +7 -7
- package/dist/shiki-wasm.mjs +1 -1
- package/dist/shiki.mjs +40 -22
- package/dist/util.mjs +9 -0
- package/dist/workspace.mjs +15 -27
- package/package.json +10 -10
- package/types/index.d.ts +5 -5
- package/types/monaco.d.ts +147 -122
- package/types/textmate.d.ts +1 -1
- package/types/workspace.d.ts +1 -1
|
@@ -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,7 +95,6 @@ function isSameImports(a, b) {
|
|
|
95
95
|
|
|
96
96
|
// src/lsp/typescript/setup.ts
|
|
97
97
|
import { cache } from "../../cache.mjs";
|
|
98
|
-
import { ErrorNotFound, walk } from "../../workspace.mjs";
|
|
99
98
|
import * as client from "../client.mjs";
|
|
100
99
|
var worker = null;
|
|
101
100
|
async function setup(monaco, languageId, languageSettings, formattingOptions, workspace) {
|
|
@@ -168,7 +167,7 @@ async function createWorker(monaco, workspace, languageSettings, formattingOptio
|
|
|
168
167
|
},
|
|
169
168
|
importMap,
|
|
170
169
|
types: typesStore.types,
|
|
171
|
-
fs: workspace ? await
|
|
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
|
|
183
|
+
if (isFsNotFoundError(error)) {
|
|
185
184
|
return false;
|
|
186
185
|
}
|
|
187
186
|
throw error;
|
|
@@ -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
|
|
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
|
|
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);
|