1 | export interface Serializer<Msg = JsonSerializable, Input = any> {
|
2 | deserialize(message: Msg): Input;
|
3 | serialize(input: Input): Msg;
|
4 | }
|
5 | export interface SerializerImplementation<Msg = JsonSerializable, Input = any> {
|
6 | deserialize(message: Msg, defaultDeserialize: ((msg: Msg) => Input)): Input;
|
7 | serialize(input: Input, defaultSerialize: ((inp: Input) => Msg)): Msg;
|
8 | }
|
9 | export declare function extendSerializer<MessageType, InputType = any>(extend: Serializer<MessageType, InputType>, implementation: SerializerImplementation<MessageType, InputType>): Serializer<MessageType, InputType>;
|
10 | declare type JsonSerializablePrimitive = string | number | boolean | null;
|
11 | declare type JsonSerializableObject = {
|
12 | [key: string]: JsonSerializablePrimitive | JsonSerializablePrimitive[] | JsonSerializableObject | JsonSerializableObject[] | undefined;
|
13 | };
|
14 | export declare type JsonSerializable = JsonSerializablePrimitive | JsonSerializablePrimitive[] | JsonSerializableObject | JsonSerializableObject[];
|
15 | export declare const DefaultSerializer: Serializer<JsonSerializable>;
|
16 | export {};
|
17 |
|
\ | No newline at end of file |