You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of type: "string", type: "number", etc we should add support for using built-in constructors with Type like:
var VM = can.DefineMap.extend({
prop: String
});
More Types
Also, we should add additional types. This is not a definitive list, just some things that have been requested and others that exist in other languages:
float
integer
character
Set
enum / union
tuple
Strict Types
We could also create strict types that would throw errors if set to a value of a different type. This might look something like:
This may also be called MustString or something like that... we can bikeshed on naming later.
Required Values
Tangentially related to Types, people have also asked for support for requiredproperties. While expanding the Type behavior, we would also add support for this.
The text was updated successfully, but these errors were encountered:
phillipskevin
changed the title
Proposal: expand Type functionality
Proposal: Expanded Types and Required Properties
Nov 3, 2017
tldr
To make
can-define
more useful and add some long-requested functionality, we will:prop: String
Type
sType
srequired
propertiesDetails
Allow shorthand with built-in Constructors
Instead of
type: "string"
,type: "number"
, etc we should add support for using built-in constructors withType
like:More Types
Also, we should add additional types. This is not a definitive list, just some things that have been requested and others that exist in other languages:
Strict Types
We could also create strict types that would throw errors if set to a value of a different type. This might look something like:
This may also be called
MustString
or something like that... we can bikeshed on naming later.Required Values
Tangentially related to Types, people have also asked for support for required properties. While expanding the Type behavior, we would also add support for this.
The text was updated successfully, but these errors were encountered: