Class: SchemaStore<Entries>
Type Parameters
Type Parameter | Default type |
---|---|
Entries extends object | object |
Constructors
new SchemaStore()
new SchemaStore<
Entries
>(defaultMaximumArrayLength
:number
):SchemaStore
<Entries
>
Creates a new schema store
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
defaultMaximumArrayLength | number | 100 | The default maximum array length for schemas |
Returns
SchemaStore
<Entries
>
Defined in
Properties
#schemas
Defined in
defaultMaximumArrayLength
defaultMaximumArrayLength:
number
The default maximum array length for schemas
Defined in
Methods
[iterator]()
[iterator]():
IterableIterator
<{ [K in string | number | symbol]: readonly [K & number, Entries[K]] }[keyofEntries
]>
Iterates over the stores's schema entries.
Returns
IterableIterator
<{ [K in string | number | symbol]: readonly [K & number, Entries[K]] }[keyof Entries
]>
An iterator for the stores's schema entries
Defined in
add()
add<
Id
,SchemaType
>(schema
:Schema
<Id
,SchemaType
>):Merge
<Entries
,Id
,Schema
<Id
,SchemaType
>>
Adds a schema to the store
Type Parameters
Type Parameter |
---|
Id extends number |
SchemaType extends object |
Parameters
Parameter | Type | Description |
---|---|---|
schema | Schema <Id , SchemaType > | The schema to add to the store |
Returns
Merge
<Entries
, Id
, Schema
<Id
, SchemaType
>>
The modified store
Remarks
An error will be thrown if a schema with the same id already exists in the store.
Defined in
deserialize()
deserialize(
buffer
:string
|UnalignedUint16Array
):DeserializationResult
<Entries
>
Deserializes a buffer
Parameters
Parameter | Type | Description |
---|---|---|
buffer | string | UnalignedUint16Array | The buffer to deserialize |
Returns
DeserializationResult
<Entries
>
The resolved value, including the id of the schema used for deserialization