[jquery-match-height] Add static members.

This commit is contained in:
Leonard Thieu 2017-06-01 16:22:57 -04:00
parent f858c2af73
commit 2da880babc
2 changed files with 21 additions and 12 deletions

View File

@ -5,9 +5,24 @@
/// <reference types="jquery"/>
// 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;
}

View File

@ -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
};