Skip to content

Instantly share code, notes, and snippets.

@salami-art
Created March 14, 2018 09:33
Show Gist options
  • Save salami-art/c773c8ee1d916ef1f654426247caf3df to your computer and use it in GitHub Desktop.
Save salami-art/c773c8ee1d916ef1f654426247caf3df to your computer and use it in GitHub Desktop.
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