/** * Official Type definitions for the LemonadeJS plugins * https://lemonadejs.net * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped */ declare function Datagrid(el: HTMLElement, options?: Datagrid.Options): Datagrid.Instance; declare namespace Datagrid { interface Column { /** Column header */ title?: string; /** Column data path */ name?: string; /** Default text align */ align?: string; /** Column with */ width?: string; /** Render */ render?: () => void; /** Wrap the text */ wrap?: Boolean; } interface Item { [key: string]: any; } interface Options { /** The data that will be displayed on the grid based on the columns attribute. */ data: Item[]; /** Each object represents a column of data to be displayed. The key 'name' refers to the data object key. */ columns: Column[]; /** Enable the pagination and define the number of items per page. */ pagination?: number; /** Enable the search. Default: false */ search?: boolean; /** The grid is editable. Default: false */ editable?: boolean; /** Specifies the URL for fetching the data. */ url?: string; /** Enable the remote functionality. Default: false */ remote?: boolean; /** Enable the resizable functionality. Default: false */ resizable?: boolean; /** Enable the zebra style. Default: false */ zebra?: boolean; /** Called when a search happens. */ onsearch?: (self: object) => void /** Called when the user changes the page. */ onchangepage?: (self: object) => void /** Called when cell data is changed. */ onupdate?: (self: object, obj: object) => void } interface Instance { /** Array Change the state of data. */ data: Item[]; /** Number Change the page index. */ page: number; /** Number Enable pagination. */ pagination: number; /** Boolean Enable search. */ search: boolean; /** Function(sortBy: String, sortAsc: Boolean) Sort the data. */ sort: (sortBy: string, sortAsc: boolean) => void; /** Function(x: Number | String, y: Number, value: String) Set the value of a cell. */ setValue: (x: number | string, y: number, value: string) => void; } } export default Datagrid;