- addBuiltInSerializers
- deserializeBoolean
- deserializeFloat32
- deserializeFloat64
- deserializeInt16
- deserializeInt32
- deserializeInt8
- deserializeString
- deserializeUInt16
- deserializeUInt32
- deserializeUInt8
- paketto
- serializeBoolean
- serializeFloat32
- serializeFloat64
- serializeInt16
- serializeInt32
- serializeInt8
- serializeString
- serializeUInt16
- serializeUInt32
- serializeUInt8
Ƭ DeserializerFunction<T
>: (buf
: Uint8Array
, offset
: number
) => { offset
: number
; value
: T
}
Name |
---|
T |
▸ (buf
, offset
): Object
Name | Type |
---|---|
buf |
Uint8Array |
offset |
number |
Object
Name | Type |
---|---|
offset |
number |
value |
T |
Ƭ SerializerFunction<T
>: (buf
: Uint8Array
, value
: T
, offset
: number
) => number
Name |
---|
T |
▸ (buf
, value
, offset
): number
Name | Type |
---|---|
buf |
Uint8Array |
value |
T |
offset |
number |
number
▸ 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.
Name | Type | Description |
---|---|---|
instance |
PakettoInstance |
The Paketto instance to add the serializers to |
void
▸ deserializeBoolean(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
boolean |
▸ deserializeFloat32(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeFloat64(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeInt16(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeInt32(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeInt8(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeString(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
string |
▸ deserializeUInt16(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeUInt32(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ deserializeUInt8(buf
, offset?
): Object
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
offset |
number |
0 |
Object
Name | Type |
---|---|
offset |
number |
value |
number |
▸ paketto(): PakettoInstance
▸ serializeBoolean(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
boolean |
undefined |
offset |
number |
0 |
number
▸ serializeFloat32(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeFloat64(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeInt16(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeInt32(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeInt8(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeString(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
string |
undefined |
offset |
number |
0 |
number
▸ serializeUInt16(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeUInt32(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number
▸ serializeUInt8(buf
, value
, offset?
): number
Name | Type | Default value |
---|---|---|
buf |
Uint8Array |
undefined |
value |
number |
undefined |
offset |
number |
0 |
number