DefinitelyTyped/types/gridstack/gridstack-tests.ts
Micha J 6342dd5bf0 Update index.d.ts for gridstack (#35161)
* Update index.d.ts

Added missing jsdoc documentation for addWidget().
Also allow parameter id of addWidget() to be a string.
Removed unneccessary whitespaces.

* Documentation refinement of addWidget() function

Refined the documentation (mainly to force rebuild on GitHub as the build system had trouble after the last commit)

* Removed dt-header, altered documentation header

Removed dt-header.
Added version number and formated contributer list.
Removed unneccessary documentation header in gridstack-test.ts.
2019-05-15 09:10:46 -07:00

22 lines
765 B
TypeScript

/// <reference types="jquery"/>
var options: IGridstackOptions = {
float: true
};
var element: JQuery = $(document).gridstack(options);
var gridstack: GridStack = $(document).data("gridstack");
var gsFromElement: GridStack = element.data("gridstack");
if (gridstack !== gsFromElement) throw Error('These should match!');
gridstack.addWidget("test", 1, 2, 3, 4, true);
gridstack.addWidget(document.createElement('div'), 1, 2, 3, 4, true);
gridstack.addWidget($(document.createElement('div')), 1, 2, 3, 4, true);
gridstack.makeWidget($(document.createElement('div')));
gridstack.batchUpdate();
gridstack.cellHeight();;
gridstack.cellHeight(2);
gridstack.cellWidth();
gridstack.getCellFromPixel(<MousePosition>{ left:20, top: 20 });
gridstack.removeAll(false);