CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
lib.es2024.sharedmemory.d.ts67 linesDownload Raw Back to lib
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17/// <reference lib="es2020.bigint" />18 19interface Atomics {20    /**21     * A non-blocking, asynchronous version of wait which is usable on the main thread.22     * Waits asynchronously on a shared memory location and returns a Promise23     * @param typedArray A shared Int32Array or BigInt64Array.24     * @param index The position in the typedArray to wait on.25     * @param value The expected value to test.26     * @param [timeout] The expected value to test.27     */28    waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };29 30    /**31     * A non-blocking, asynchronous version of wait which is usable on the main thread.32     * Waits asynchronously on a shared memory location and returns a Promise33     * @param typedArray A shared Int32Array or BigInt64Array.34     * @param index The position in the typedArray to wait on.35     * @param value The expected value to test.36     * @param [timeout] The expected value to test.37     */38    waitAsync(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };39}40 41interface SharedArrayBuffer {42    /**43     * Returns true if this SharedArrayBuffer can be grown.44     *45     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/growable)46     */47    get growable(): boolean;48 49    /**50     * If this SharedArrayBuffer is growable, returns the maximum byte length given during construction; returns the byte length if not.51     *52     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/maxByteLength)53     */54    get maxByteLength(): number;55 56    /**57     * Grows the SharedArrayBuffer to the specified size (in bytes).58     *59     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/grow)60     */61    grow(newByteLength?: number): void;62}63 64interface SharedArrayBufferConstructor {65    new (byteLength: number, options?: { maxByteLength?: number; }): SharedArrayBuffer;66}67