Closed gaperton closed 6 years ago
This task seems to be an important step for TS/ES API unification. Need to make sure that @type decorator will be ad-hoc polymorphic with the different behavior for different types.
An optional Type.injectAsProp( targetProto, name )
seems to be a good choice. Then, the spec itself can be produced with Type.injectAsProp.bind( options )
Consider an alternative approach. Extract the type from the attribute, and then
@attr.toJSON( false ).changeEvents( false ) name : Type;
Also, though it's unrelated, hide the internals of the Record and Collection members under the protected
directive. Resolve any internal errors with casting values to any
(or the special private interface).
Fixed in 2.1.1
1) Instead of .has, try something like
attr( Number ).value( 5 )
. 2) Investigate making it the valid decorator at every given moment of time. So, it will look like@attr( Number ).value( 5 )
instead of@attr( Number.has.value( 5 ) )
.Though this issue seems to be minor, it's, in fact, the pretty big deal when working with typescript (no other option there than to use decorator). It will provide the nicer way working with ES7 as well.
Need to think about names. With
type
, it can be used everywhere and the syntax seems to be superior.An internal structure of ChainableAttributeSpec will look like this: