fasetto
4/16/2018 - 10:30 AM

TypeScript intersection sample.

TypeScript intersection sample.

interface IStudent {
    id: string;
    age: number;
}

interface IWorker {
    companyId: string;
}

type A = IStudent & IWorker;

let x: A;

x.age = 5;
x.companyId = 'CID5241';
x.id = 'ID3241';