In typescript v0.9.5 this code compiled.
interface Array {
indexOfField : (propertyName: string, value: any) => number;
}
After upgrading to typescript 1.0, I get the following error:
(2,11): error TS2234: All declarations of an interface must have identical type parameters.
Line number 2:11 is the keyword Array.
How do I fix this?
The other definition of Array
is Array<T>
(with a type parameter) in lib.d.ts
. You need to declare yours as:
interface Array<T> {
indexOfField : (propertyName: string, value: any) => number;
}
in order to have the same number of type parameters.
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