Pinsave/counterstrike
1
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="es2015.symbol" />20/// <reference lib="es2015.symbol.wellknown" />21 22interface SharedArrayBuffer {23 /**24 * Read-only. The length of the ArrayBuffer (in bytes).25 */26 readonly byteLength: number;27 28 /**29 * Returns a section of an SharedArrayBuffer.30 */31 slice(begin?: number, end?: number): SharedArrayBuffer;32 readonly [Symbol.toStringTag]: "SharedArrayBuffer";33}34 35interface SharedArrayBufferConstructor {36 readonly prototype: SharedArrayBuffer;37 new (byteLength?: number): SharedArrayBuffer;38 readonly [Symbol.species]: SharedArrayBufferConstructor;39}40declare var SharedArrayBuffer: SharedArrayBufferConstructor;41 42interface ArrayBufferTypes {43 SharedArrayBuffer: SharedArrayBuffer;44}45 46interface Atomics {47 /**48 * Adds a value to the value at the given position in the array, returning the original value.49 * Until this atomic operation completes, any other read or write operation against the array50 * will block.51 */52 add(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;53 54 /**55 * Stores the bitwise AND of a value with the value at the given position in the array,56 * returning the original value. Until this atomic operation completes, any other read or57 * write operation against the array will block.58 */59 and(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;60 61 /**62 * Replaces the value at the given position in the array if the original value equals the given63 * expected value, returning the original value. Until this atomic operation completes, any64 * other read or write operation against the array will block.65 */66 compareExchange(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, expectedValue: number, replacementValue: number): number;67 68 /**69 * Replaces the value at the given position in the array, returning the original value. Until70 * this atomic operation completes, any other read or write operation against the array will71 * block.72 */73 exchange(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;74 75 /**76 * Returns a value indicating whether high-performance algorithms can use atomic operations77 * (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed78 * array.79 */80 isLockFree(size: number): boolean;81 82 /**83 * Returns the value at the given position in the array. Until this atomic operation completes,84 * any other read or write operation against the array will block.85 */86 load(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number): number;87 88 /**89 * Stores the bitwise OR of a value with the value at the given position in the array,90 * returning the original value. Until this atomic operation completes, any other read or write91 * operation against the array will block.92 */93 or(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;94 95 /**96 * Stores a value at the given position in the array, returning the new value. Until this97 * atomic operation completes, any other read or write operation against the array will block.98 */99 store(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;100 101 /**102 * Subtracts a value from the value at the given position in the array, returning the original103 * value. Until this atomic operation completes, any other read or write operation against the104 * array will block.105 */106 sub(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;107 108 /**109 * If the value at the given position in the array is equal to the provided value, the current110 * agent is put to sleep causing execution to suspend until the timeout expires (returning111 * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns112 * `"not-equal"`.113 */114 wait(typedArray: Int32Array<ArrayBufferLike>, index: number, value: number, timeout?: number): "ok" | "not-equal" | "timed-out";115 116 /**117 * Wakes up sleeping agents that are waiting on the given index of the array, returning the118 * number of agents that were awoken.119 * @param typedArray A shared Int32Array<ArrayBufferLike>.120 * @param index The position in the typedArray to wake up on.121 * @param count The number of sleeping agents to notify. Defaults to +Infinity.122 */123 notify(typedArray: Int32Array<ArrayBufferLike>, index: number, count?: number): number;124 125 /**126 * Stores the bitwise XOR of a value with the value at the given position in the array,127 * returning the original value. Until this atomic operation completes, any other read or write128 * operation against the array will block.129 */130 xor(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;131 132 readonly [Symbol.toStringTag]: "Atomics";133}134 135declare var Atomics: Atomics;136 