You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Get the value of style properties for the first element in the set of matched elements. * * @param propertyName A CSS property. */css(propertyName: string): string;/** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A value to set for the property. */css(propertyName: string,value: string|number): JQuery;/** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */css(propertyName: string,value: (index: number,value: string)=>string|number): JQuery;/** * Set one or more CSS properties for the set of matched elements. * * @param properties An object of property-value pairs to set. */css(properties: Object): JQuery;
sort the overloadings by the number of arguments desc
Bad
declarefunctionf(a: string): number;declarefunctionf(a: string,b: string): stringf('a','b').trim()// <= error property `trim`. Property not found in Number
Good
declarefunctionf(a: string,b: string): stringdeclarefunctionf(a: string): number;f('a','b').trim()// <= ok
Option 1 seems to do the trick. I understand why Flow does this (kind of), but wouldn't it make more sense to need to explicitly define rest parameters rather than "block" them as above? It seems to defeat the purpose of strict typing and other specifications.
Given this code defined in a library:
And this code leveraging that method:
I get the error:
property addClass Property not found in String
Since there is two arguments being passed, there's no good reason it should choose an overload that only has one parameter.
The text was updated successfully, but these errors were encountered: