export interface ComponentRef { current: T; (val: T): void; } export function createRef(): ComponentRef { //tslint:disable:no-unnecessary-local-variable const f: any = (function (x: T) { f.current = x; }); return f; }