| | |
| | | "use strict"; |
| | | |
| | | /** |
| | | * Defines the serializer middleware type used by this module. |
| | | * @template T, K, C |
| | | * @typedef {import("./SerializerMiddleware")<T, K, C>} SerializerMiddleware |
| | | */ |
| | | |
| | | /** |
| | | * Represents Serializer. |
| | | * @template DeserializedValue |
| | | * @template SerializedValue |
| | | * @template Context |
| | | */ |
| | | class Serializer { |
| | | /** |
| | | * Creates an instance of Serializer. |
| | | * @param {SerializerMiddleware<EXPECTED_ANY, EXPECTED_ANY, EXPECTED_ANY>[]} middlewares serializer middlewares |
| | | * @param {Context=} context context |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Serializes this instance into the provided serializer context. |
| | | * @template ExtendedContext |
| | | * @param {DeserializedValue | Promise<DeserializedValue>} obj object |
| | | * @param {Context & ExtendedContext} context context object |
| | |
| | | } |
| | | |
| | | /** |
| | | * Restores this instance from the provided deserializer context. |
| | | * @template ExtendedContext |
| | | * @param {SerializedValue | Promise<SerializedValue>} value value |
| | | * @param {Context & ExtendedContext} context object |