2018-07-12 14:11:31 +02:00
|
|
|
/**
|
|
|
|
* Interface tells models to offer a 'deserialize' function
|
|
|
|
*
|
|
|
|
* Also nested objects and arrays have have to be handled.
|
2018-09-04 11:33:28 +02:00
|
|
|
* @example
|
|
|
|
* ``` ts
|
|
|
|
* const myUser = new User();
|
|
|
|
* myUser.deserialize(jsonData);
|
|
|
|
* ```
|
2018-07-12 14:11:31 +02:00
|
|
|
*/
|
|
|
|
export interface Deserializable {
|
|
|
|
/**
|
|
|
|
* should be used to assign JSON values to the object itself.
|
|
|
|
* @param input
|
|
|
|
*/
|
2018-09-04 11:33:28 +02:00
|
|
|
deserialize(input: any): void;
|
2018-07-12 14:11:31 +02:00
|
|
|
}
|