That’s not how TypeScript works. You execute it after erasing the types.
constructor(public foo: string){}