I want to implement an interface with a list of functions and attributes, few functions required to work on callback mode. For example
interface Writer{
readData : (fileLocation: string) => void;
generatData: (fileLocation: string) => void;
}
I would like to execute generateData function and notify after job is done. For example
const WriterInstance:Writer ={
generateData("C:/workspace" , ()=>{
console.log("work is done");
});
readData("C:/workspace/file1.text" , ()=>{
console.log("work is done");
})
}
I am totally misunderstanding the syntax & invocation of callbacks in the interface. If anyone explains with example then it will be great.