mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-28 16:32:15 +00:00
getArrayView typings
This commit is contained in:
parent
968192f99b
commit
d32391055d
17
lib/loader/index.d.ts
vendored
17
lib/loader/index.d.ts
vendored
@ -11,6 +11,17 @@ interface ImportsObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TypedArray
|
||||||
|
= Int8Array
|
||||||
|
| Uint8Array
|
||||||
|
| Uint8ClampedArray
|
||||||
|
| Int16Array
|
||||||
|
| Uint16Array
|
||||||
|
| Int32Array
|
||||||
|
| Uint32Array
|
||||||
|
| Float32Array
|
||||||
|
| Float64Array;
|
||||||
|
|
||||||
/** Utility mixed in by the loader. */
|
/** Utility mixed in by the loader. */
|
||||||
interface ASUtil {
|
interface ASUtil {
|
||||||
/** An 8-bit signed integer view on the memory. */
|
/** An 8-bit signed integer view on the memory. */
|
||||||
@ -35,12 +46,14 @@ interface ASUtil {
|
|||||||
readonly F64: Float64Array;
|
readonly F64: Float64Array;
|
||||||
/** Allocates a new string in the module's memory and returns a reference (pointer) to it. */
|
/** Allocates a new string in the module's memory and returns a reference (pointer) to it. */
|
||||||
__allocString(str: string): number;
|
__allocString(str: string): number;
|
||||||
/** Gets the value of a string from the module's memory. */
|
/** Reads (copies) the value of a string from the module's memory. */
|
||||||
__getString(ref: number): string;
|
__getString(ref: number): string;
|
||||||
/** Allocates a new array in the module's memory and returns a reference (pointer) to it. */
|
/** Allocates a new array in the module's memory and returns a reference (pointer) to it. */
|
||||||
__allocArray(id: number, values: number[]): number;
|
__allocArray(id: number, values: number[]): number;
|
||||||
/** Gets the values of an array from the module's memory. */
|
/** Reads (copies) the values of an array from the module's memory. */
|
||||||
__getArray(ref: number): number[];
|
__getArray(ref: number): number[];
|
||||||
|
/** Gets a view on the values of an array in the module's memory. */
|
||||||
|
__getArrayView(ref: number): TypedArray;
|
||||||
/** Retains a reference externally, making sure that it doesn't become collected prematurely. Returns the reference. */
|
/** Retains a reference externally, making sure that it doesn't become collected prematurely. Returns the reference. */
|
||||||
__retain(ref: number): number;
|
__retain(ref: number): number;
|
||||||
/** Releases a previously retained reference to an object, allowing the runtime to collect it once its reference count reaches zero. */
|
/** Releases a previously retained reference to an object, allowing the runtime to collect it once its reference count reaches zero. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user