mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add jquery-match-height typings
This commit is contained in:
29
types/jquery-match-height/index.d.ts
vendored
Normal file
29
types/jquery-match-height/index.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Type definitions for jquery-match-height v0.7.2
|
||||
// Project: https://github.com/liabru/jquery-match-height
|
||||
// Definitions by: Andrea Briganti <https://github.com/kbytesys/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <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
|
||||
|
||||
declare namespace JQueryMatchHeight {
|
||||
interface Options {
|
||||
byRow?: boolean,
|
||||
property?: string,
|
||||
target?: string,
|
||||
remove?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
36
types/jquery-match-height/jquery-match-height-tests.ts
Normal file
36
types/jquery-match-height/jquery-match-height-tests.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/* from documentation at https://github.com/liabru/jquery-match-height */
|
||||
|
||||
$(document).ready(() => {
|
||||
$(".containers").matchHeight();
|
||||
$(".containers").matchHeight({
|
||||
byRow: true,
|
||||
property: "height",
|
||||
target: null,
|
||||
remove: true}
|
||||
);
|
||||
});
|
||||
|
||||
$.fn.matchHeight._update();
|
||||
|
||||
$.fn.matchHeight._rows($('.containers'));
|
||||
|
||||
$('.containers').matchHeight({ remove: true });
|
||||
|
||||
$.fn.matchHeight._beforeUpdate = function(event: any, groups: any) {
|
||||
// do something before any updates are applied
|
||||
};
|
||||
|
||||
$.fn.matchHeight._afterUpdate = function(event: any, groups: any) {
|
||||
// do something after all updates are applied
|
||||
};
|
||||
|
||||
let elements = $('.containers');
|
||||
let options = {byRow: true};
|
||||
|
||||
$.fn.matchHeight._apply(elements, options);
|
||||
|
||||
$.fn.matchHeight._throttle = 80;
|
||||
|
||||
$.fn.matchHeight._maintainScroll = true;
|
||||
|
||||
$.fn.matchHeight._groups
|
||||
23
types/jquery-match-height/tsconfig.json
Normal file
23
types/jquery-match-height/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-match-height-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user