musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Need optional fields for @type #124

Closed iccir closed 6 years ago

iccir commented 7 years ago

@type should support optional fields for object types.

iccir commented 7 years ago

Example syntax:

@type TypeWithOptionalProperties = {
    requiredA: String,
    requiredB: String,

    optionalA?: String,
    optionalB?: String
};
iccir commented 7 years ago

Also functions?

@type TheCallback = function(optionalA: String): void;