From c2f0d06c2ad46a2ed74d35f62a1d3c778c1e36d5 Mon Sep 17 00:00:00 2001 From: laureysruben Date: Wed, 28 Jun 2017 10:51:57 +0200 Subject: [PATCH 1/2] Update to Jquery.foundation method typing As it is, the typing makes it impossible to use big parts of the api. I changed to using spread to define a parameter array of type any to support the entire api. Because the amount and type of parameters may change depending on the first string parameter (method), it is impossible to define the api more strict. --- types/foundation-sites/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/foundation-sites/index.d.ts b/types/foundation-sites/index.d.ts index 0bafdd6ae1..7209a9060f 100644 --- a/types/foundation-sites/index.d.ts +++ b/types/foundation-sites/index.d.ts @@ -447,7 +447,7 @@ declare namespace FoundationSites { } interface JQuery { - foundation(method?:string|Array) : JQuery; + foundation(method?: string, ...args: any[]): JQuery; } declare var Foundation:FoundationSites.FoundationSitesStatic; From 17a93fdfede55f1716b23370b6db732559534f85 Mon Sep 17 00:00:00 2001 From: laureysruben Date: Wed, 12 Jul 2017 16:52:34 +0200 Subject: [PATCH 2/2] Update foundation-sites tests Updated the tests to reflect the actual foundation-sites api. --- types/foundation-sites/foundation-sites-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/foundation-sites/foundation-sites-tests.ts b/types/foundation-sites/foundation-sites-tests.ts index 2e90071c7d..574f2b7b76 100644 --- a/types/foundation-sites/foundation-sites-tests.ts +++ b/types/foundation-sites/foundation-sites-tests.ts @@ -1,6 +1,6 @@ $(document).foundation(); $(document).foundation('method5'); -$(document).foundation(['method', 'method2']); +$(document).foundation('method', 'method2'); Foundation.Abide($('.selector')); Foundation.Abide($('.selector'), {});