I just upgraded my code to Typescript 0.9, updated the DefinitelyTyped definitions of Jquery, JqueryUI, Knockout, Knockout.Mapping and Knockout.Validation.
The code seemingly compiles, I see the correct output js files.
Yet VS underlines EVERY use of the obs(value: T)
setter on KnockoutObservable<T>
and KnockoutObservableArray<T>
, saying I provided invalid type.
Error 27 Supplied parameters do not match any signature of call target.
Error 28 Could not select overload for 'call' expression.
I have about a 100 of these errors. When I try to type one in, the intellisense offers (): T
and (value: bool):void
for every type - yes, it's bool regardless of the T I specified. Is it a VS, a compiler or a WebEssentials bug? How do I make the ~100 errors disappear?
EDIT (visual evidence):
lot.TimeOnServer
is a KnockoutObservable<number>
, data.TimeOnServer
is a number
.
Yes, I have restarted vs+windows. The error persisted.
I was having this same issue. I haven't investigated why this is happening, but in my project after commenting out the last interface in knockout.validation.d.ts the errors go away. This will break your call to isValid for validation though.
interface KnockoutSubscribableFunctions {
isValid: KnockoutComputed<boolean>;
isValidating: KnockoutObservable<boolean>;
rules: KnockoutObservableArray<KnockoutValidationRule>;
}
I added the following to get back the isValid function
interface KnockoutObservableBase {
isValid: KnockoutComputed<boolean>;
isValidating: KnockoutObservable<boolean>;
rules: KnockoutObservableArray<KnockoutValidationRule>;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With