There is such an interface
export interface DataTransport { hand: Card[]; table: Card[]; status: boolean; score: number; round: number; finish: string; log: Log; } trying to check like that
private isDefined() { return this.data.hand !== undefined && this.data.table !== undefined; } I know that you can somehow through instanceof or something else but there should be a normal solution.
this.socket.on('info',(data: HeartsInterface.DataTransport) => { if(this.isDefined()){ console.log('BINGO'); } });