interface IData {
firstName: string;
lastName: string;
}
interface IDemo {
Events: {
GetItem: (callback: (data: IData) => void) => void;
}
}
const item = {
Events: {
GetItem: //mock function
}
}
if (item is of type IDemo)
In the above scenario, I have IDemo interface that takes in an object of Events, which in turn has an object called GetItem - a function.
I want to check if const item is of type IDemo. How can I achieve this?