Documentation / JsonSerializer
JsonSerializer
Classes
JsonSerializer
Represents a serializer for JSON.
Constructors
new JsonSerializer()
new JsonSerializer():
JsonSerializer
Returns
Properties
DerivedTypeIdProperty
readonlystaticDerivedTypeIdProperty:string="_derivedTypeId"
Defined in
Methods
deserialize()
staticdeserialize<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()
staticdeserializeArray<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()
staticdeserializeArrayFromInstance<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()
staticdeserializeFromInstance<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()
staticserialize(value):string
Serialize with strong type information.
Parameters
value
any
The value to serialize.
Returns
string
A JSON string.