CoolFace
Apppublic

Pinsave/counterstrike

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
lib.es2024.sharedmemory.d.ts69 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,10MERCHANTABLITY 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 no-default-lib="true"/>18 19/// <reference lib="es2020.bigint" />20 21interface Atomics {22    /**23     * A non-blocking, asynchronous version of wait which is usable on the main thread.24     * Waits asynchronously on a shared memory location and returns a Promise25     * @param typedArray A shared Int32Array or BigInt64Array.26     * @param index The position in the typedArray to wait on.27     * @param value The expected value to test.28     * @param [timeout] The expected value to test.29     */30    waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };31 32    /**33     * A non-blocking, asynchronous version of wait which is usable on the main thread.34     * Waits asynchronously on a shared memory location and returns a Promise35     * @param typedArray A shared Int32Array or BigInt64Array.36     * @param index The position in the typedArray to wait on.37     * @param value The expected value to test.38     * @param [timeout] The expected value to test.39     */40    waitAsync(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };41}42 43interface SharedArrayBuffer {44    /**45     * Returns true if this SharedArrayBuffer can be grown.46     *47     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/growable)48     */49    get growable(): boolean;50 51    /**52     * If this SharedArrayBuffer is growable, returns the maximum byte length given during construction; returns the byte length if not.53     *54     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/maxByteLength)55     */56    get maxByteLength(): number;57 58    /**59     * Grows the SharedArrayBuffer to the specified size (in bytes).60     *61     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/grow)62     */63    grow(newByteLength?: number): void;64}65 66interface SharedArrayBufferConstructor {67    new (byteLength: number, options?: { maxByteLength?: number; }): SharedArrayBuffer;68}69