Closed
Description
JsonNode type
add a type for JsonNode
that consists of the correct types supported by the JSON Notation standard
Note: if updated please follow the Obsoleted by:
tag in the header:
Motivation
To properly type our strategic directions.
ToJsonStrategy
and FromJsonStrategy
make use of any
, by providing this type we can set up directional strategies.
Design Detail
The supported RFC types should be |
(Unioned) into a JsonNode
type
/** Functions used when hydrating data */
export type FromJsonStrategy = (value: any) => any;
/** Functions used when dehydrating data */
export type ToJsonStrategy = (value: any) => any;
Becomes
/** Functions used when hydrating data */
export type FromJsonStrategy<T> = (value: JsonNode) => T;
/** Functions used when dehydrating data */
export type ToJsonStrategy <T>= (value: T) => JsonNode;