mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 19:51:47 +00:00
Add ArrayBuffer.isView and rework Array.isArray (#431)
This commit is contained in:
4
std/assembly/index.d.ts
vendored
4
std/assembly/index.d.ts
vendored
@ -493,10 +493,14 @@ declare class ArrayBuffer {
|
||||
readonly byteLength: i32;
|
||||
/** Unsafe pointer to the start of the data in memory. */
|
||||
readonly data: usize;
|
||||
/** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/
|
||||
static isView<T>(value: T): bool;
|
||||
/** Constructs a new array buffer of the given length in bytes. */
|
||||
constructor(length: i32, unsafe?: bool);
|
||||
/** Returns a copy of this array buffer's bytes from begin, inclusive, up to end, exclusive. */
|
||||
slice(begin?: i32, end?: i32): ArrayBuffer;
|
||||
/** Returns a string representation of ArrayBuffer. */
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform's endianness. */
|
||||
|
Reference in New Issue
Block a user