I am writing an api where I hear a bunch of data from websocket.
I have implemented a callback where every time on.message
of websocket is triggered.
I trigger the callback. Since data I get back is does not have a specific type, that is
each message is different in structure, I can not define a typescript interface.
I also do not want to use “any”. What are my options
type OnMessageCallbackFunction = (message: any) => void;
This is not something I want.
What other options do one has for generic types. I know it is just a syntactical thing and I can easily get away with “any”