-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
TypeScript 1.8 is introducing a new syntax for string types:
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#string-literal-types
eg.:
interface AnimationOptions {
deltaX: number;
deltaY: number;
easing: "ease-in" | "ease-out" | "ease-in-out";
}
This could provide or extend the OneOf annotation.
Possibly some tools could infer more from this syntax as well.
Current syntax is as follow (https://github.com/angular/material2/blob/master/src/components/sidenav/sidenav.ts):
@Input() @OneOf(['over', 'push', 'side']) mode: string = 'over';
I think of something like:
@Input() @OneOf() mode: 'over'|'push'|'side' = 'over';
or even NG M2 could infer from the type the OneOf annotation is expected:
@Input() mode: 'over'|'push'|'side' = 'over';
Metadata
Metadata
Assignees
Labels
No labels