From 2da880babcbdd0f13ec2ab8d3dca444ecc4ecfd7 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Thu, 1 Jun 2017 16:22:57 -0400 Subject: [PATCH] [jquery-match-height] Add static members. --- types/jquery-match-height/index.d.ts | 29 ++++++++++++------- .../jquery-match-height-tests.ts | 4 +-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/types/jquery-match-height/index.d.ts b/types/jquery-match-height/index.d.ts index 0d25344e65..e63fb30d4d 100644 --- a/types/jquery-match-height/index.d.ts +++ b/types/jquery-match-height/index.d.ts @@ -5,9 +5,24 @@ /// -// We cannot add the jQuery.fn definitions of the plugin until this -// issue is resolved -// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/12685 +interface JQueryMatchHeight { + _throttle: number; + _maintainScroll: boolean; + _groups: any[]; + + /** + * Set all selected elements to the height of the tallest. + * If the items are on multiple rows, the items of each row will be set to the tallest of that row. + * + * @param options + */ + (options?: JQueryMatchHeight.Options): JQuery; + _update(): void; + _rows($item: JQuery): any[]; + _beforeUpdate(event: JQueryEventObject, groups: any[]): any; + _afterUpdate(event: JQueryEventObject, groups: any[]): any; + _apply(elements: any, options: any): void; +} declare namespace JQueryMatchHeight { interface Options { @@ -19,11 +34,5 @@ declare namespace JQueryMatchHeight { } interface JQuery { - /** - * Set all selected elements to the height of the tallest. - * If the items are on multiple rows, the items of each row will be set to the tallest of that row. - * - * @param options - */ - matchHeight(options?: JQueryMatchHeight.Options): JQuery; + matchHeight: JQueryMatchHeight; } diff --git a/types/jquery-match-height/jquery-match-height-tests.ts b/types/jquery-match-height/jquery-match-height-tests.ts index d26f29fa9a..97467573b0 100644 --- a/types/jquery-match-height/jquery-match-height-tests.ts +++ b/types/jquery-match-height/jquery-match-height-tests.ts @@ -16,12 +16,12 @@ $.fn.matchHeight._rows($('.containers')); $('.containers').matchHeight({ remove: true }); // tslint:disable-next-line no-used-variable -$.fn.matchHeight._beforeUpdate = (event: any, groups: any) => { +$.fn.matchHeight._beforeUpdate = (event, groups) => { // do something before any updates are applied }; // tslint:disable-next-line no-used-variable -$.fn.matchHeight._afterUpdate = (event: any, groups: any) => { +$.fn.matchHeight._afterUpdate = (event, groups) => { // do something after all updates are applied };