Typescript String Or Function