Created
March 14, 2018 09:33
-
-
Save salami-art/c773c8ee1d916ef1f654426247caf3df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class MyCustomType { | |
... | |
} | |
export class MyCustomTypeManager { | |
public list: Array<(data: string) => MyCustomType>; | |
public new(input : string, settings? : Object) { | |
return new MyCustomType(input, settings); | |
} | |
public getByName(name) { | |
return this.list[name]; // compiler thinks this return value is an Array<(data: string) => MyCustomType> | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment