README
Property Manager Decorator
ECMAScript / TypeScript decorator for class-style Property Manager components.
This library fully depends on the Property Manager, so please read its README before using this library.
Features:
- Inherited properties with class.
- Assign properties from a plain object.
- Clone object.
- Compare object whether is the same.
- Export properties to a plain object.
- Declare properties with type and default value.
- Suports
arrayOf
property with type - Suports property with
template
(the property value is determined by the template content):template
{string | (this) => string}:- the template string, eg,
'${author}-${uuid()}'
- or customize template function,
function() {return this.author + '-' + uuid()}
- the template string, eg,
imports
: {Object} the optional functions could be used in the template string.- NOTE: the template property is readonly by default. You can make it writealbe. Once a new value has been written, the template will be no useful unless the new value is null or undefined.
- Suports
The rules of the properties:
- Exported attributes means they are the
JSON.stringify(aObj)
attributes only. - The
non-enumerable
attributes can not be exported and assigned. - The enumerable attributes beginning with '