1 | import type { ITypedArray } from './Buffer';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export declare class ViewableBuffer {
|
7 | size: number;
|
8 |
|
9 | rawBinaryData: ArrayBuffer;
|
10 |
|
11 | uint32View: Uint32Array;
|
12 |
|
13 | float32View: Float32Array;
|
14 | private _int8View;
|
15 | private _uint8View;
|
16 | private _int16View;
|
17 | private _uint16View;
|
18 | private _int32View;
|
19 | |
20 |
|
21 |
|
22 | constructor(length: number);
|
23 | /**
|
24 | * @param arrayBuffer - The source array buffer.
|
25 | */
|
26 | constructor(arrayBuffer: ArrayBuffer);
|
27 | /** View on the raw binary data as a `Int8Array`. */
|
28 | get int8View(): Int8Array;
|
29 | /** View on the raw binary data as a `Uint8Array`. */
|
30 | get uint8View(): Uint8Array;
|
31 | /** View on the raw binary data as a `Int16Array`. */
|
32 | get int16View(): Int16Array;
|
33 | /** View on the raw binary data as a `Uint16Array`. */
|
34 | get uint16View(): Uint16Array;
|
35 | /** View on the raw binary data as a `Int32Array`. */
|
36 | get int32View(): Int32Array;
|
37 | /**
|
38 | * Returns the view of the given type.
|
39 | * @param type - One of `int8`, `uint8`, `int16`,
|
40 | * `uint16`, `int32`, `uint32`, and `float32`.
|
41 | * @returns - typed array of given type
|
42 | */
|
43 | view(type: string): ITypedArray;
|
44 | /** Destroys all buffer references. Do not use after calling this. */
|
45 | destroy(): void;
|
46 | static sizeOf(type: string): number;
|
47 | }
|