import { cast } from '@deepkit/type'; class User { firstName: string = ''; lastName: string = ''; getFullName() { return this.firstName + ' ' + this.lastName; } } const user = cast<User>({ firstName: 'Peter', lastName: 'Mayer' }); console.log(user.getFullName()); //Peter Mayer console.log(user instanceof User); //true