Is there a way to design an interface with this structure?
export interface GenericType<T> {
(data: T): void;
hasLimit?: boolean;
}
The question now arises, how do I provide an object that adheres to this interface?
One solution could be altering the interface to:
export interface GenericType<T> {
callback: (data: T) => void;
hasLimit?: boolean;
}
Then, provide an object matching the structure using:
methodname({callback, true})
But how can I pass an object with the boolean parameter without modifying the interface?