I've run into several cases where one library extends another library, particularly in my uses with React and Redux.
As an example, say I was using a JS library that exported a function that could be defined like this:
function dispatch(action:IAction):void;
interface IAction {
type: string;
}
And I use another JS library that enhances the dispatch
function to allow callbacks, which could be defined like this:
function dispatch(action:IAction | IActionCallback):void;
interface IActionCallback {
(dispatch:IDispatch):void;
}
The problem is that the second library augments the first library. How can this be properly expressed in typings? Or can it be?