Documentation / JsonSerializer
JsonSerializer
Classes
JsonSerializer
Represents a serializer for JSON.
Constructors
new JsonSerializer()
new JsonSerializer():
JsonSerializer
Returns
Properties
DerivedTypeIdProperty
readonly
static
DerivedTypeIdProperty:string
="_derivedTypeId"
Defined in
Methods
deserialize()
static
deserialize<TResult
>(targetType
,json
):TResult
Deserialize a JSON string to the specific type.
Type Parameters
• TResult extends object
Parameters
targetType
Constructor
<TResult
>
Type to deserialize to.
json
string
Actual JSON to deserialize.
Returns
TResult
An instance of the target type.
Defined in
deserializeArray()
static
deserializeArray<TResult
>(targetType
,json
):TResult
[]
Deserialize a array JSON string to an array of the specific instance type.
Type Parameters
• TResult extends object
Parameters
targetType
Constructor
<TResult
>
Type to deserialize to.
json
string
Actual JSON to deserialize.
Returns
TResult
[]
An array of instances of the target type.
Defined in
deserializeArrayFromInstance()
static
deserializeArrayFromInstance<TResult
>(targetType
,instances
):TResult
[]
Deserialize an array of any instances to an array of specific instance types.
Type Parameters
• TResult extends object
Parameters
targetType
Constructor
<TResult
>
Type to deserialize to.
instances
any
Actual instances to deserialize.
Returns
TResult
[]
An array of instances of the target type.
Defined in
deserializeFromInstance()
static
deserializeFromInstance<TResult
>(targetType
,instance
):TResult
Deserialize an any instance to a specific instance type.
Type Parameters
• TResult extends object
Parameters
targetType
Constructor
<TResult
>
Type to deserialize to.
instance
any
Actual instance to deserialize.
Returns
TResult
An instance of the target type.
Defined in
serialize()
static
serialize(value
):string
Serialize with strong type information.
Parameters
value
any
The value to serialize.
Returns
string
A JSON string.