]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: fix Typescript jQuery foundation method definition #11193 11274/head
authorNicolas Coden <nicolas@ncoden.fr>
Wed, 16 May 2018 21:03:38 +0000 (23:03 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Wed, 16 May 2018 21:03:38 +0000 (23:03 +0200)
Foundation public methods does not all take a jQuery element as first parameter. They can actually take anything and the jQuery interface does not allow to know by the method definition to which plugin the method belong (and what are its arguments types). So the only solution seems to accept anything.

See https://github.com/zurb/foundation-sites/pull/11199#discussion_r183766940
Closes https://github.com/zurb/foundation-sites/issues/11193

js/typescript/foundation.d.ts

index a0e6e063bcc54023f52ed4d0050d0ba0b7fbb41b..67af00a220b03e7b9bf96fd2f40e9a24aad78d0c 100644 (file)
@@ -486,7 +486,7 @@ declare module FoundationSites {
 }
 
 interface JQuery {
-  foundation(method?: string|Array<any>, $element?: JQuery): JQuery;
+  foundation(method?: string | Array<any>, ...args: any[]): JQuery;
 }
 
 declare var Foundation: FoundationSites.FoundationSitesStatic;