In my library jQuery Terminal I have d.ts file for types and I have test.ts for testing the types, it's just usage of almost every pice of the API, and I'm executing tsc without emitting output files just to test the types.
I've updated typescript from 3.0 to 3.3 and now my types for functions are broken: the code look like this, this example is more complex one with array of string, object and function:
$('.term').terminal(["foo.php", obj_interpreter, function(command) {
this.echo(command);
}]);
I have types like this:
declare namespace JQueryTerminal {
type interpterFunction = (this: JQueryTerminal, command: string, term: JQueryTerminal) => any;
type terminalObjectFunction = (this: JQueryTerminal, ...args: (string | number | RegExp)[]) => (void | PromiseLike<echoValue>);
type Interpterer = string | interpterFunction | ObjectInterpreter;
type ObjectInterpreter = {
[key: string]: ObjectInterpreter | terminalObjectFunction;
}
...
type echoValue = string | string[] | (() => string | string[]);
...
}
interface JQuery<TElement = HTMLElement> {
terminal(interpreter?: TypeOrArray<JQueryTerminal.Interpterer>, options?: TerminalOptions): JQueryTerminal;
...
}
This was working fine in typescript 3.0, and I've had completion in Emacs tide for this.echo and command in function was acting like string even that in user code I didn't specify the types. Are types in user code now need to be set explicitly isn't this breaking change? Why this is happening?
For reference here is my broken travis build.