A set of options to use when decorating the class.
Note: Can only be used on class properties.
This annotation creates a new _serializeMap
property on the class prototype and adds all decorated properties to this map.
The Serializer will use this map to serialize and deserialize from/to json objects.
@Serialize()
class MyClass extends Serializable {
@SerializeProperty()
simpleProperty:string;
}
@Serialize()
class MyClass extends Serializable {
@SerializeProperty({
map: 'someMapping',
root: 'someObject'
})
simpleProperty:string;
}
A set of options to use when decorating a property.
Generated using TypeDoc
Serialize decorators
How it works
This annotation will add the implementation for Serializable.serialize and Serializable.deserialize methods on the class prototype. The current implementation will use the Serializer.serialize and Serializer.deserialize methods.
Example
Simple decorator
@Serialize() class MyClass extends Serializable {}
Decorator with options
@Serialize({ root: 'someRootObject' }) class MyClass extends Serializable {}