-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.ts
53 lines (48 loc) · 972 Bytes
/
type.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* @module
*
* Type types.
*/
import type { Endian, EndianClass } from './endian.ts';
import type { MembersClass } from './members.ts';
import type { ArrayBufferReal, BufferView } from './native.ts';
/**
* Type.
*/
export interface Type extends Endian, BufferView {
/**
* Type class.
*/
readonly constructor: TypeClass;
}
/**
* Type class.
*/
export interface TypeClass<T extends Type = Type>
extends EndianClass, MembersClass {
/**
* Type prototype.
*/
readonly prototype: T;
/**
* Instance size in bytes.
*/
readonly BYTE_LENGTH: number;
}
/**
* Type constructor.
*/
export interface TypeConstructor<T extends Type = Type> extends TypeClass<T> {
/**
* Create instance for buffer.
*
* @param buffer Buffer data.
* @param byteOffset Byte offset into buffer.
* @param littleEndian Host endian, little endian, big endian.
*/
new (
buffer: ArrayBufferReal,
byteOffset?: number,
littleEndian?: boolean | null,
): T;
}