| 25 | * @type {SerializerContext<TObject>} |
| 26 | */ |
| 27 | export class SerializerContext<TObject> |
| 28 | { |
| 29 | /** |
| 30 | * Serializer context root. |
| 31 | * |
| 32 | * This is a value passed to the root serializer. |
| 33 | * |
| 34 | * @type {any} |
| 35 | */ |
| 36 | public readonly $: any; |
| 37 | |
| 38 | /** |
| 39 | * Reference map. |
| 40 | * |
| 41 | * Used to preserve object references. |
| 42 | * |
| 43 | * @type {Map<ReferenceKey, ReferenceValue>} |
| 44 | */ |
| 45 | public readonly referenceMap: Map<ReferenceKey, ReferenceValue>; |
| 46 | |
| 47 | /** |
| 48 | * Reference callback map. |
| 49 | * |
| 50 | * Used to assign object references in a later time due to circular dependency. |
| 51 | * |
| 52 | * @type {Map<ReferenceKey, Array<ReferenceCallback>>} |
| 53 | */ |
| 54 | public readonly referenceCallbackMap: Map<ReferenceKey, Array<ReferenceCallback>>; |
| 55 | |
| 56 | /** |
| 57 | * Parent serializer context. |
| 58 | * |
| 59 | * Present when any serializer defines child context. |
| 60 | * |
| 61 | * @type {Optional<SerializerContext<any>>} |
| 62 | */ |
| 63 | public readonly parentSerializerContext: Optional<SerializerContext<any>>; |
| 64 | |
| 65 | /** |
| 66 | * Json path key. |
| 67 | * |
| 68 | * @type {any} |
| 69 | */ |
| 70 | public jsonPathKey: any; |
| 71 | |
| 72 | /** |
| 73 | * Type state. |
| 74 | * |
| 75 | * @type {TypeState<TObject>} |
| 76 | */ |
| 77 | public typeState: TypeState<TObject>; |
| 78 | |
| 79 | /** |
| 80 | * Property state. |
| 81 | * |
| 82 | * @type {TypeState<TObject>} |
| 83 | */ |
| 84 | public genericMetadatas: ReadonlyArray<GenericMetadata<any>>; |
nothing calls this directly
no outgoing calls
no test coverage detected