forked from kriszyp/msgpackr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunpack.d.ts
53 lines (52 loc) · 1.67 KB
/
unpack.d.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
export enum FLOAT32_OPTIONS {
NEVER = 0,
ALWAYS = 1,
DECIMAL_ROUND = 3,
DECIMAL_FIT = 4
}
export interface Options {
useFloat32?: FLOAT32_OPTIONS
useRecords?: boolean
structures?: {}[]
moreTypes?: boolean
structuredClone?: boolean
mapsAsObjects?: boolean
variableMapSize?: boolean
copyBuffers?: boolean
bundleStrings?: boolean
useTimestamp32?: boolean
largeBigIntToFloat?: boolean
encodeUndefinedAsNil?: boolean
maxSharedStructures?: number
maxOwnStructures?: number
int64AsNumber?: boolean
shouldShareStructure?: (keys: string[]) => boolean
getStructures?(): {}[]
saveStructures?(structures: {}[]): boolean | void
onInvalidDate?: () => any
}
interface Extension {
Class: Function
type: number
pack?(value: any): Buffer | Uint8Array
unpack?(messagePack: Buffer | Uint8Array): any
read?(datum: any): any
write?(instance: any): any
}
export class Unpackr {
constructor(options?: Options)
unpack(messagePack: Buffer | Uint8Array): any
decode(messagePack: Buffer | Uint8Array): any
unpackMultiple(messagePack: Buffer | Uint8Array): any[]
unpackMultiple(messagePack: Buffer | Uint8Array, forEach: (value: any) => any): void
}
export class Decoder extends Unpackr {}
export function unpack(messagePack: Buffer | Uint8Array): any
export function unpackMultiple(messagePack: Buffer | Uint8Array): any[]
export function unpackMultiple(messagePack: Buffer | Uint8Array, forEach: (value: any) => any): void
export function decode(messagePack: Buffer | Uint8Array): any
export function addExtension(extension: Extension): void
export function clearSource(): void
export function roundFloat32(float32Number: number): number
export const C1: {}
export let isNativeAccelerationEnabled: boolean