From bf8e60395f29fc7beb2e3af526d5e7562ceca894 Mon Sep 17 00:00:00 2001 From: Philip Bulley Date: Fri, 28 Mar 2014 17:06:58 +0000 Subject: [PATCH 1/3] append() / before() support for ZeptoCollection arg zepto.d.ts defines `append()` and `before()` methods for string, HTMLElement and HTMLElement[], but Zepto also supports ZeptoCollection. Added method overloads supporting ZeptoCollection. --- zepto/zepto.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index eb217e5b9..10c1ff6d5 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -444,6 +444,11 @@ interface ZeptoCollection { **/ after(content: HTMLElement): ZeptoCollection; + /** + * @see ZeptoCollection.after + **/ + after(content: HTMLElement[]): ZeptoCollection; + /** * @see ZeptoCollection.after **/ @@ -465,6 +470,11 @@ interface ZeptoCollection { * @see ZeptoCollection.append **/ append(content: HTMLElement[]): ZeptoCollection; + + /** + * @see ZeptoCollection.append + **/ + append(content: ZeptoCollection): ZeptoCollection; /** * Append elements from the current collection to the target element. This is like append, but with reversed operands. @@ -526,6 +536,11 @@ interface ZeptoCollection { * @see ZeptoCollection.before **/ before(content: HTMLElement[]): ZeptoCollection; + + /** + * @see ZeptoCollection.before + **/ + before(content: ZeptoCollection): ZeptoCollection; /** * Get immediate children of each element in the current collection. If selector is given, filter the results to only include ones matching the CSS selector. From 0c88531646cc82c975ffec791e1003590deda5eb Mon Sep 17 00:00:00 2001 From: Philip Bulley Date: Fri, 28 Mar 2014 17:24:42 +0000 Subject: [PATCH 2/3] after() allows ZeptoCollection arg --- zepto/zepto.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index 10c1ff6d5..bc08565c2 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -452,7 +452,7 @@ interface ZeptoCollection { /** * @see ZeptoCollection.after **/ - after(content: HTMLElement[]): ZeptoCollection; + after(content: ZeptoCollection): ZeptoCollection; /** * Append content to the DOM inside each individual element in the collection. The content can be an HTML string, a DOM node or an array of nodes. From c625577cb7a84eb5c4850ccce71e06149e1fc7fd Mon Sep 17 00:00:00 2001 From: Philip Bulley Date: Fri, 28 Mar 2014 17:29:14 +0000 Subject: [PATCH 3/3] prepend() allows ZeptoCollection arg --- zepto/zepto.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index bc08565c2..3608ade9f 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -963,6 +963,12 @@ interface ZeptoCollection { **/ prepend(content: HTMLElement[]): ZeptoCollection; + /** + * @see ZeptoCollection.prepend + * @param content + **/ + prepend(content: ZeptoCollection): ZeptoCollection; + /** * Prepend elements of the current collection inside each of the target elements. This is like prepend, only with reversed operands. * @param content