Skip to content

Latest commit

 

History

History
628 lines (385 loc) · 12 KB

API.md

File metadata and controls

628 lines (385 loc) · 12 KB

API Docs for paketto

Table of contents

Classes

Type Aliases

Functions

Type Aliases

DeserializerFunction

Ƭ DeserializerFunction<T>: (buf: Uint8Array, offset: number) => { offset: number ; value: T }

Type parameters

Name
T

Type declaration

▸ (buf, offset): Object

Parameters
Name Type
buf Uint8Array
offset number
Returns

Object

Name Type
offset number
value T

Defined in

DeserializerFunction.ts:1


SerializerFunction

Ƭ SerializerFunction<T>: (buf: Uint8Array, value: T, offset: number) => number

Type parameters

Name
T

Type declaration

▸ (buf, value, offset): number

Parameters
Name Type
buf Uint8Array
value T
offset number
Returns

number

Defined in

SerializerFunction.ts:1

Functions

addBuiltInSerializers

addBuiltInSerializers(instance): void

Registers built-in custom serializers.

The following types are added: Array, Uint8Array, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array, Float32Array, Set, Map, Date

Arrays or objects can be serialized if they contain only registered types or primitives.

Parameters

Name Type Description
instance PakettoInstance The Paketto instance to add the serializers to

Returns

void

Defined in

BuiltInSerializers.ts:31


deserializeBoolean

deserializeBoolean(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value boolean

Defined in

PrimitiveSerializers.ts:150


deserializeFloat32

deserializeFloat32(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:91


deserializeFloat64

deserializeFloat64(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:109


deserializeInt16

deserializeInt16(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:42


deserializeInt32

deserializeInt32(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:73


deserializeInt8

deserializeInt8(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:17


deserializeString

deserializeString(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value string

Defined in

PrimitiveSerializers.ts:126


deserializeUInt16

deserializeUInt16(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:31


deserializeUInt32

deserializeUInt32(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:58


deserializeUInt8

deserializeUInt8(buf, offset?): Object

Parameters

Name Type Default value
buf Uint8Array undefined
offset number 0

Returns

Object

Name Type
offset number
value number

Defined in

PrimitiveSerializers.ts:6


paketto

paketto(): PakettoInstance

Returns

PakettoInstance

Defined in

Paketto.ts:234


serializeBoolean

serializeBoolean(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value boolean undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:142


serializeFloat32

serializeFloat32(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:81


serializeFloat64

serializeFloat64(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:99


serializeInt16

serializeInt16(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:38


serializeInt32

serializeInt32(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:69


serializeInt8

serializeInt8(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:13


serializeString

serializeString(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value string undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:117


serializeUInt16

serializeUInt16(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:25


serializeUInt32

serializeUInt32(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:50


serializeUInt8

serializeUInt8(buf, value, offset?): number

Parameters

Name Type Default value
buf Uint8Array undefined
value number undefined
offset number 0

Returns

number

Defined in

PrimitiveSerializers.ts:1