import { Delete, i8, u8, i16, u16, i32, u32, ptr, f32, f64 } from "../../static/types"; import { HeapPtr } from '../mem/heap-ptr'; import { PHANTOM_RAW_ARRAY_TAG } from './raw-array-tag'; /** * Represents `RawArray` allocated on heap. */ export declare class HeapArray implements Delete { readonly ptr: HeapPtr; [PHANTOM_RAW_ARRAY_TAG]: TItem; getRawPtr(): ptr; private constructor(); delete(): void; /** * Allocates array of `i8` (1-byte signed integer) on heap. * * @param jsArray Javascript array of `i8` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocI8(jsArray: readonly i8[] | Int8Array): HeapArray; /** * Allocates array of `u8` (1-byte unsigned integer) on heap. * * @param jsArray Javascript array of `u8` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocU8(jsArray: readonly u8[] | Uint8Array | Uint8ClampedArray): HeapArray; /** * Allocates array of `i16` (2-byte signed integer) on heap. * * @param jsArray Javascript array of `i16` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocI16(jsArray: readonly i16[] | Int16Array): HeapArray; /** * Allocates array of `u16` (2-byte unsigned integer) on heap. * * @param jsArray Javascript array of `u16` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocU16(jsArray: readonly u16[] | Uint16Array): HeapArray; /** * Allocates array of `i32` (4-byte signed integer) on heap. * * @param jsArray Javascript array of `i32` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocI32(jsArray: readonly i32[] | Int32Array): HeapArray; /** * Allocates array of `u32` (4-byte unsigned integer) on heap. * * @param jsArray Javascript array of `u32` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocU32(jsArray: readonly u32[] | Uint32Array): HeapArray; /** * Allocates array of `ptr` (4-byte pointer) on heap. * * @param jsArray Javascript array of `ptr` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocPtr(jsArray: readonly ptr[] | Int32Array): HeapArray>; /** * Allocates array of `f32` (4-byte single precision floating point number) on heap. * * @param jsArray Javascript array of `f32` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocF32(jsArray: readonly f32[] | Float32Array): HeapArray; /** * Allocates array of `f64` (8-byte double precision floating point number) on heap. * * @param jsArray Javascript array of `f64` to copy to heap. * * @returns HeapArray that governs created memory block, you must manually * call `.delete()` on it once you are done using it. */ static allocF64(jsArray: readonly f64[] | Float64Array): HeapArray; } //# sourceMappingURL=heap-array.d.ts.map