You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Underlying `ArrayBuffer` (or `SharedArrayBuffer`) associated with a memory instance.
3792
+
*/
3793
+
buffer: ArrayBuffer;
3794
+
3795
+
/**
3796
+
* Increases the size of the memory instance by a specified number of WebAssembly pages (i.e., 64KiB).
3797
+
*
3798
+
* ## Notes
3799
+
*
3800
+
* - Upon increasing the size, the previous `ArrayBuffer` is detached, thus invalidating any typed arrays which were views over the previous `ArrayBuffer`.
3801
+
* - Detachment means that the previous `ArrayBuffer` byte length becomes zero, and it no longer has bytes accessible to JavaScript.
3802
+
* - `ArrayBuffer` detachment applies even when `delta` is zero.
3803
+
* - Detachment only applies for non-shared memory instances. For a shared memory instance, the initial buffer (which is a `SharedArrayBuffer`) will not become detached and, instead, its length will not be updated.
3804
+
* - Accesses to the `buffer` property after growing a `SharedArrayBuffer` will yield a larger `SharedArrayBuffer` which may access a larger span of memory than the buffer before growing memory.
3805
+
* - Every `SharedArrayBuffer` accessed via the `buffer` property will always refer to the start of the same memory address range and thus manipulate the same data.
3806
+
*
3807
+
* @param delta - number of WebAssembly pages (i.e., 64KiB) by which to grow the underlying memory
3808
+
* @returns size of the previous `ArrayBuffer` (or `SharedArrayBuffer`)
3809
+
*/
3810
+
grow(delta: number): number;
3811
+
}
3812
+
3813
+
/**
3814
+
* WebAssembly module wrapper interface.
3815
+
*/
3816
+
interfaceModuleWrapper{
3817
+
/**
3818
+
* WebAssembly binary code.
3819
+
*/
3820
+
binary: Uint8Array;
3821
+
3822
+
/**
3823
+
* WebAssembly memory.
3824
+
*/
3825
+
memory: Memory|null;
3826
+
3827
+
/**
3828
+
* WebAssembly memory buffer as a Uint8Array.
3829
+
*/
3830
+
buffer: Uint8Array|null;
3831
+
3832
+
/**
3833
+
* WebAssembly memory buffer as a DataView.
3834
+
*/
3835
+
view: DataView|null;
3836
+
3837
+
/**
3838
+
* "Raw" WebAssembly module exports.
3839
+
*/
3840
+
exports: Object|null;
3841
+
3842
+
/**
3843
+
* Asynchronously initializes a WebAssembly module instance.
3844
+
*
3845
+
* @returns promise which resolves upon initializing a WebAssembly module instance
3846
+
*/
3847
+
initialize(): Promise<ModuleWrapper>;
3848
+
3849
+
/**
3850
+
* Asynchronously initializes a WebAssembly module instance.
3851
+
*
3852
+
* @param clbk - callback to invoke upon initializing a WebAssembly module
* Synchronously initializes a WebAssembly module instance.
3858
+
*
3859
+
* @returns module wrapper instance
3860
+
*/
3861
+
initializeSync(): ModuleWrapper;
3862
+
3863
+
/**
3864
+
* Reallocates the underlying WebAssembly memory instance to a specified number of bytes.
3865
+
*
3866
+
* ## Notes
3867
+
*
3868
+
* - WebAssembly memory can only **grow**, not shrink. Hence, if provided a number of bytes which is less than or equal to the size of the current memory, the function does nothing.
3869
+
* - When non-shared memory is resized, the underlying the `ArrayBuffer` is detached, consequently invalidating any associated typed array views. Before resizing non-shared memory, ensure that associated typed array views no longer need byte access and can be garbage collected.
3870
+
*
3871
+
* @param nbytes - memory size (in bytes)
3872
+
* @returns boolean indicating whether the resize operation was successful
3873
+
*/
3874
+
realloc(nbytes: number): boolean;
3875
+
3876
+
/**
3877
+
* Returns a boolean indicating whether the underlying WebAssembly memory instance has the capacity to store a provided list of values starting from a specified byte offset.
3878
+
*
3879
+
* @param byteOffset - byte offset at which to start writing values
3880
+
* @param values - input array containing values to write
3881
+
* @returns boolean indicating whether the underlying WebAssembly memory instance has enough capacity
* Writes values to the underlying WebAssembly memory instance.
3895
+
*
3896
+
* ## Notes
3897
+
*
3898
+
* - The function infers element size (i.e., number of bytes per element) from the data type of the input array. For example, if provided a `Float32Array`, the function writes each element as a single-precision floating-point number to the underlying WebAssembly memory instance.
3899
+
* - In order to write elements as a different data type, you need to perform an explicit cast **before** calling this method. For example, in order to write single-precision floating-point numbers contained in a `Float32Array` as signed 32-bit integers, you must first convert the `Float32Array` to an `Int32Array` before passing the values to this method.
3900
+
* - If provided an array having an unknown or "generic" data type, elements are written as double-precision floating-point numbers.
3901
+
*
3902
+
* @param byteOffset - byte offset at which to start writing values
3903
+
* @param values - input array containing values to write
* Reads values from the underlying WebAssembly memory instance.
3910
+
*
3911
+
* ## Notes
3912
+
*
3913
+
* - The function infers element size (i.e., number of bytes per element) from the data type of the output array. For example, if provided a `Float32Array`, the function reads each element as a single-precision floating-point number from the underlying WebAssembly memory instance.
3914
+
* - In order to read elements as a different data type, you need to perform an explicit cast **after** calling this method. For example, in order to read single-precision floating-point numbers contained in a `Float32Array` as signed 32-bit integers, you must convert the `Float32Array` to an `Int32Array` after reading memory values using this method.
3915
+
* - If provided an output array having an unknown or "generic" data type, elements are read as double-precision floating-point numbers.
3916
+
*
3917
+
* @param byteOffset - byte offset at which to start reading values
0 commit comments