@nhtio/encoder
A portable cross-environment encoder / decoder for complex and structured data
Interfaces
| Interface | Description |
|---|---|
| CustomEncodable | A class that opts in to custom encoding/decoding. |
Type Aliases
| Type Alias | Description |
|---|---|
| Encodable | Defines all the types which can be be encoded |
| EncodablePrimitive | Defines the union of all encodable primitive types. |
| EncodableTypedArray | Defines a union for all the encodable typed arrays. |
Variables
| Variable | Description |
|---|---|
| DECODE_METHOD | Static method: reconstruct an instance from an Encodable snapshot |
| ENCODE_METHOD | Instance method: serialize the object into an Encodable snapshot |
| version | The current version of the package. |
Functions
| Function | Description |
|---|---|
| decode | Decodes a compressed base64 string back into a value |
| encode | Encodes a value into a compressed base64 string |
| registerClass | Register a class so the decoder can reconstruct it from a snapshot. The class must have a static [DECODE_METHOD] that accepts an Encodable snapshot and returns an instance of the class. |