Search
Preparing search index...
The search index is not available
@osmium/coder
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
@osmium/coder
Serializer
Class Serializer
Hierarchy
Serializer
Index
Constructors
constructor
Properties
coder
compression
Length
Threshold
options
schemes
version
Methods
deserialize
make
Packet
register
Schema
serialize
unregister
Schema
use
Constructors
constructor
new
Serializer
(
coder
?:
DataCoder
, options
?:
SerializerPacketOptions
)
:
Serializer
Parameters
Optional
coder:
DataCoder
options:
SerializerPacketOptions
= ...
Returns
Serializer
Properties
coder
coder
:
DataCoder
Private
compression
Length
Threshold
compression
Length
Threshold
:
number
= 1024
Private
Readonly
options
options
:
SerializerPacketOptions
Private
schemes
schemes
:
SerializerSchemes
= {}
Readonly
version
version
:
number
= 3
Methods
deserialize
deserialize
<
T
>
(
buf
:
Buffer
|
Uint8Array
)
:
T
Type parameters
T
Parameters
buf:
Buffer
|
Uint8Array
Returns
T
Private
make
Packet
make
Packet
(
config
:
SerializerPacketOptions
, data
:
Buffer
|
Uint8Array
, schema
?:
null
|
number
)
:
Buffer
Parameters
config:
SerializerPacketOptions
data:
Buffer
|
Uint8Array
schema:
null
|
number
= null
Returns
Buffer
register
Schema
register
Schema
<
T
>
(
id
:
number
, fields
:
T
)
:
void
Type parameters
T
Parameters
id:
number
fields:
T
Returns
void
serialize
serialize
<
T
>
(
payload
:
T
, schemaIdOrSchemaObject
?:
SerializerSchemaIdOrSchemaObject
)
:
Buffer
Type parameters
T
:
object
=
{}
Parameters
payload:
T
schemaIdOrSchemaObject:
SerializerSchemaIdOrSchemaObject
= null
Returns
Buffer
unregister
Schema
unregister
Schema
(
id
:
number
)
:
void
Parameters
id:
number
Returns
void
use
use
(
id
:
number
, detector
:
Function
, encode
:
(
arg
:
any
)
=>
any
, decode
:
(
arg
:
any
)
=>
any
)
:
void
Parameters
id:
number
detector:
Function
encode:
(
arg
:
any
)
=>
any
(
arg
:
any
)
:
any
Parameters
arg:
any
Returns
any
decode:
(
arg
:
any
)
=>
any
(
arg
:
any
)
:
any
Parameters
arg:
any
Returns
any
Returns
void
Exports
Internals
Externals
o
Tools
Serializer
constructor
coder
compression
Length
Threshold
options
schemes
version
deserialize
make
Packet
register
Schema
serialize
unregister
Schema
use
Generated using
TypeDoc