node_modules/@uirouter/core/lib/vanilla/baseLocationService.d.ts(43,5): error TS2416: Property
'onChange' in type 'BaseLocationServices' is not assignable to the same property in base type
'LocationServices'.
Type '(cb: EventListener) => () => Function[]' is not assignable to type '(callback: Function) =>
Function'.
Types of parameters 'cb' and 'callback' are incompatible.
Type 'Function' is not assignable to type 'EventListener'.
Type 'Function' provides no match for the signature '(evt: Event): void'.
>> 1 non-emit-preventing type warning
>> Error: tsc return code: 2
There seems to be an incompatibility with the onChange method on LocationServices, which implements the UrlService.onChange signature of (callback: Function) => Function;
Was able to resolve this by adding the required overload, which satisfies the LocationServices interface:
onChange(cb: Function): Function;
I'm not sure if this is a sound fix, but it worked for me.
My version of UI-Router is: 1.0.20
tsconfig.json compiler options:
Typescript v3.1.3 reports:
There seems to be an incompatibility with the onChange method on LocationServices, which implements the UrlService.onChange signature of
(callback: Function) => Function;
Was able to resolve this by adding the required overload, which satisfies the LocationServices interface:
onChange(cb: Function): Function;
I'm not sure if this is a sound fix, but it worked for me.