mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Merge commit 'upstream/master~600' into merge_7_25
This commit is contained in:
@@ -12,9 +12,9 @@ var options = <IGridstackOptions> {
|
||||
};
|
||||
var gridstack:GridStack = $(document).gridstack(options);
|
||||
|
||||
gridstack.add_widget("test", 1, 2, 3, 4, true);
|
||||
gridstack.batch_update();
|
||||
gridstack.cell_height();;
|
||||
gridstack.cell_height(2);
|
||||
gridstack.cell_width();
|
||||
gridstack.get_cell_from_pixel(<MousePosition>{ left:20, top: 20 });
|
||||
gridstack.addWidget("test", 1, 2, 3, 4, true);
|
||||
gridstack.batchUpdate();
|
||||
gridstack.cellHeight();;
|
||||
gridstack.cellHeight(2);
|
||||
gridstack.cellWidth();
|
||||
gridstack.getCellFromPixel(<MousePosition>{ left:20, top: 20 });
|
||||
|
||||
52
gridstack/index.d.ts
vendored
52
gridstack/index.d.ts
vendored
@@ -11,35 +11,35 @@ interface GridStack {
|
||||
/**
|
||||
* Creates new widget and returns it.
|
||||
*
|
||||
* Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check.
|
||||
* Widget will be always placed even if result height is more than actual grid height. You need to use willItFit method before calling addWidget for additional check.
|
||||
*
|
||||
* @param {string} el widget to add
|
||||
* @param {number} x widget position x
|
||||
* @param {number} y widget position y
|
||||
* @param {number} width widget dimension width
|
||||
* @param {number} height widget dimension height
|
||||
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
*/
|
||||
add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery
|
||||
addWidget(el: string, x: number, y: number, width: number, height: number, autoPosition: boolean): JQuery
|
||||
/**
|
||||
* Initializes batch updates. You will see no changes until commit method is called.
|
||||
*/
|
||||
batch_update():void
|
||||
batchUpdate():void
|
||||
/**
|
||||
* Gets current cell height.
|
||||
*/
|
||||
cell_height():number
|
||||
cellHeight():number
|
||||
/**
|
||||
* Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often.
|
||||
* @param {number} val the cell height
|
||||
*/
|
||||
cell_height(val:number):void
|
||||
cellHeight(val:number):void
|
||||
/**
|
||||
* Gets current cell width.
|
||||
*/
|
||||
cell_width():number
|
||||
cellWidth():number
|
||||
/**
|
||||
* Finishes batch updates. Updates DOM nodes. You must call it after batch_update.
|
||||
* Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate.
|
||||
*/
|
||||
commit():void
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ interface GridStack {
|
||||
* Get the position of the cell under a pixel on screen.
|
||||
* @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties
|
||||
*/
|
||||
get_cell_from_pixel(position: MousePosition): CellPosition,
|
||||
getCellFromPixel(position: MousePosition): CellPosition,
|
||||
/*
|
||||
* Checks if specified area is empty.
|
||||
* @param {number} x the position x.
|
||||
@@ -66,7 +66,7 @@ interface GridStack {
|
||||
* @param {number} width the width of to check
|
||||
* @param {number} height the height of to check
|
||||
*/
|
||||
is_area_empty(x: number, y: number, width: number, height: number): void
|
||||
isAreaEmpty(x: number, y: number, width: number, height: number): void
|
||||
/*
|
||||
* Locks/unlocks widget.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
@@ -78,13 +78,13 @@ interface GridStack {
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
* @param {number} val A numeric value of the number of columns
|
||||
*/
|
||||
min_width(el: HTMLElement, val: number): void
|
||||
minWidth(el: HTMLElement, val: number): void
|
||||
/*
|
||||
* Set the minHeight for a widget.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
* @param {number} val A numeric value of the number of rows
|
||||
*/
|
||||
min_height(el: HTMLElement, val: number): void
|
||||
minHeight(el: HTMLElement, val: number): void
|
||||
/*
|
||||
* Enables/Disables moving.
|
||||
* @param {HTMLElement} el widget to modify.
|
||||
@@ -102,13 +102,13 @@ interface GridStack {
|
||||
/**
|
||||
* Removes widget from the grid.
|
||||
* @param {HTMLElement} el widget to modify
|
||||
* @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true).
|
||||
* @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true).
|
||||
*/
|
||||
remove_widget(el: HTMLElement, detach_node?: boolean): void
|
||||
removeWidget(el: HTMLElement, detachNode?: boolean): void
|
||||
/**
|
||||
* Removes all widgets from the grid.
|
||||
*/
|
||||
remove_all(): void
|
||||
removeAll(): void
|
||||
/**
|
||||
* Changes widget size
|
||||
* @param {HTMLElement} el widget to modify
|
||||
@@ -124,9 +124,9 @@ interface GridStack {
|
||||
resizable(el: HTMLElement, val: boolean): void
|
||||
/**
|
||||
* Toggle the grid static state. Also toggle the grid-stack-static class.
|
||||
* @param {boolean} static_value if true the grid become static.
|
||||
* @param {boolean} staticValue if true the grid become static.
|
||||
*/
|
||||
set_static(static_value: boolean): void
|
||||
setStatic(staticValue: boolean): void
|
||||
/**
|
||||
* Updates widget position/size.
|
||||
* @param {HTMLElement} el widget to modify
|
||||
@@ -142,9 +142,9 @@ interface GridStack {
|
||||
* @param {number} y new position y. If value is null or undefined it will be ignored.
|
||||
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
|
||||
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
|
||||
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
|
||||
*/
|
||||
will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean
|
||||
willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean
|
||||
|
||||
|
||||
}
|
||||
@@ -181,7 +181,7 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* if true the resizing handles are shown even if the user is not hovering over the widget (default: false)
|
||||
*/
|
||||
always_show_resize_handle: boolean;
|
||||
alwaysShowResizeHandle: boolean;
|
||||
/**
|
||||
* turns animation on (default: true)
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* one cell height (default: 60)
|
||||
*/
|
||||
cell_height: number;
|
||||
cellHeight: number;
|
||||
/**
|
||||
* allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' })
|
||||
*/
|
||||
@@ -213,15 +213,15 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* widget class (default: 'grid-stack-item')
|
||||
*/
|
||||
item_class: string;
|
||||
itemClass: string;
|
||||
/**
|
||||
* minimal width.If window width is less, grid will be shown in one - column mode (default: 768)
|
||||
*/
|
||||
min_width: number;
|
||||
minWidth: number;
|
||||
/**
|
||||
* class for placeholder (default: 'grid-stack-placeholder')
|
||||
*/
|
||||
placeholder_class: string;
|
||||
placeholderClass: string;
|
||||
/**
|
||||
* allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' })
|
||||
*/
|
||||
@@ -229,11 +229,11 @@ interface IGridstackOptions {
|
||||
/**
|
||||
* makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container.
|
||||
*/
|
||||
static_grid: boolean;
|
||||
staticGrid: boolean;
|
||||
/**
|
||||
* vertical gap size (default: 20)
|
||||
*/
|
||||
vertical_margin: number;
|
||||
verticalMargin: number;
|
||||
/**
|
||||
* amount of columns (default: 12)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user