class Foo implements IFoo { func(x: string | number) { if (typeof x === 'string') { x.toLowerCase(); } else { // deal with numbers if needed console.log(x); } } }