diff --git a/knockout.kogrid/knockout.kogrid-tests.ts b/knockout.kogrid/knockout.kogrid-tests.ts new file mode 100644 index 000000000..94c061156 --- /dev/null +++ b/knockout.kogrid/knockout.kogrid-tests.ts @@ -0,0 +1,34 @@ +/// +/// + +module KoGridTests +{ + export interface IGridItem { + name: string; + } + + export class Tests { + public items: KnockoutObservableArray; + public selectedItems: KnockoutObservableArray; + public gridOptionsAlarms: kg.GridOptions; + + constructor() { + this.items = ko.observableArray(); + this.selectedItems = ko.observableArray(); + this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); + } + + public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { + var result = { + data: dataArray, + displaySelectionCheckbox: false, + footerVisible: false, + multiSelect: false, + showColumnMenu: false, + plugins: null, + selectedItems: selectedItems + }; + return result; + } + } +} \ No newline at end of file diff --git a/knockout.kogrid/ko-grid.d.ts b/knockout.kogrid/ko-grid.d.ts index 01a7f7d17..f07401806 100644 --- a/knockout.kogrid/ko-grid.d.ts +++ b/knockout.kogrid/ko-grid.d.ts @@ -4,11 +4,12 @@ // These are very definitely preliminary. Please feel free to improve. +/// declare module kg { export interface DomUtilityService { - UpdateGridLayout(grid: Grid); - BuildStyles(grid: Grid); + UpdateGridLayout(grid: Grid): void; + BuildStyles(grid: Grid): void; } var domUtilityService: DomUtilityService; @@ -23,7 +24,7 @@ declare module kg { } export interface SelectionService { - setSelection(row: Row, selected: boolean); + setSelection(row: Row, selected: boolean): void; multi: boolean; lastClickedRow: Row; } @@ -42,7 +43,7 @@ declare module kg { export interface GridOptions { /** Callback for when you want to validate something after selection. */ - afterSelectionChange?(row: Row); + afterSelectionChange?(row: Row): void; /** Callback if you want to inspect something before selection, return false if you want to cancel the selection. return true otherwise.