WIP

WIP

WIP

WIP

WIP

WIP: Remove trailing newlines

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP: All tests pass

WIP

WIP

WIP
This commit is contained in:
Andy Hanson
2016-11-28 11:16:06 -08:00
parent cd4debea25
commit 89fa98a712
1473 changed files with 77478 additions and 76346 deletions
+29 -29
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface JQuery {
gridstack (options: IGridstackOptions):GridStack
gridstack (options: IGridstackOptions): GridStack;
}
interface GridStack {
@@ -20,45 +20,45 @@ interface GridStack {
* @param {number} height widget dimension height
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
*/
addWidget(el: string, x: number, y: number, width: number, height: number, autoPosition: 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.
*/
batchUpdate():void
batchUpdate(): void;
/**
* Gets current cell height.
*/
cellHeight():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
*/
cellHeight(val:number):void
cellHeight(val: number): void;
/**
* Gets current cell width.
*/
cellWidth():number
cellWidth(): number;
/**
* Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate.
*/
commit():void
commit(): void;
/**
* Destroys a grid instance.
*/
destroy(): void
destroy(): void;
/*
* Disables widgets moving/resizing.
*/
disable(): void
disable(): void;
/*
* Enables widgets moving/resizing.
*/
enable(): void
enable(): void;
/*
* 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
*/
getCellFromPixel(position: MousePosition): CellPosition,
getCellFromPixel(position: MousePosition): CellPosition;
/*
* Checks if specified area is empty.
* @param {number} x the position x.
@@ -66,31 +66,31 @@ interface GridStack {
* @param {number} width the width of to check
* @param {number} height the height of to check
*/
isAreaEmpty(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.
* @param {boolean} val if true widget will be locked.
*/
locked(el: HTMLElement, val: boolean): void
locked(el: HTMLElement, val: boolean): void;
/*
* Set the minWidth for a widget.
* @param {HTMLElement} el widget to modify.
* @param {number} val A numeric value of the number of columns
*/
minWidth(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
*/
minHeight(el: HTMLElement, val: number): void
minHeight(el: HTMLElement, val: number): void;
/*
* Enables/Disables moving.
* @param {HTMLElement} el widget to modify.
* @param {number} val if true widget will be draggable.
*/
movable(el: HTMLElement, val: boolean): void
movable(el: HTMLElement, val: boolean): void;
/**
* Changes widget position
* @param {HTMLElement} el widget to modify
@@ -98,35 +98,35 @@ interface GridStack {
* @param {number} y new position y. If value is null or undefined it will be ignored.
*
*/
move(el: HTMLElement, x: number, y: number): void
move(el: HTMLElement, x: number, y: number): void;
/**
* Removes widget from the grid.
* @param {HTMLElement} el widget to modify
* @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true).
*/
removeWidget(el: HTMLElement, detachNode?: boolean): void
removeWidget(el: HTMLElement, detachNode?: boolean): void;
/**
* Removes all widgets from the grid.
*/
removeAll(): void
removeAll(): void;
/**
* Changes widget size
* @param {HTMLElement} el widget to modify
* @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.
*/
resize(el: HTMLElement, width: number, height: number): void
resize(el: HTMLElement, width: number, height: number): void;
/**
* Enables/Disables resizing.
* @param {HTMLElement} el widget to modify
* @param {boolean} val if true widget will be resizable.
*/
resizable(el: HTMLElement, val: boolean): void
resizable(el: HTMLElement, val: boolean): void;
/**
* Toggle the grid static state. Also toggle the grid-stack-static class.
* @param {boolean} staticValue if true the grid become static.
*/
setStatic(staticValue: boolean): void
setStatic(staticValue: boolean): void;
/**
* Updates widget position/size.
* @param {HTMLElement} el widget to modify
@@ -135,7 +135,7 @@ interface GridStack {
* @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.
*/
update(el: HTMLElement, x: number, y: number, width: number, height: number): void
update(el: HTMLElement, x: number, y: number, width: number, height: number): void;
/**
* Returns true if the height of the grid will be less the vertical constraint. Always returns true if grid doesn't have height constraint.
* @param {number} x new position x. If value is null or undefined it will be ignored.
@@ -144,7 +144,7 @@ interface GridStack {
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
* @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position
*/
willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean
willItFit(x: number, y: number, width: number, height: number, autoPosition: boolean): boolean;
}
@@ -152,15 +152,15 @@ interface GridStack {
* Defines the coordiantes of a object
*/
interface MousePosition {
top: number,
left:number,
top: number;
left: number;
}
/**
* Defines the position of a cell inside the grid
*/
interface CellPosition {
x: number,
y:number
x: number;
y: number;
}
declare namespace GridStackUI {
interface Utils {
@@ -170,7 +170,7 @@ declare namespace GridStackUI {
*@param dir 1 for asc, -1 for desc (optional)
*@param width width of the grid. If undefined the width will be calculated automatically (optional).
**/
sort(nodes: HTMLElement[], dir: number, width: number): void
sort(nodes: HTMLElement[], dir: number, width: number): void;
}
}
/**