/** * Official Type definitions for the LemonadeJS plugins * https://lemonadejs.net * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped */ declare function List(el: HTMLElement, options?: List.Options): List.Instance; declare namespace List { interface Item { [key: string]: any; } interface Options { /** The data that will be displayed on the grid based on the columns attribute. */ data?: Item[]; /** Total number of records. When set, pagination uses this instead of data.length (for remote/server-side pagination). */ total?: number; /** Enable the pagination and define the number of items per page. */ pagination?: number; /** Enable the search. Default: false */ search?: boolean; /** The HTML template of every item */ template: string; /** Called before search is executed. Use to prepare custom flags or params. */ onbeforesearch?: (self: Instance) => void /** Called when a search happens. Use to fetch remote data. */ onsearch?: (self: Instance) => void /** Called when the user changes the page. Use to fetch remote data for new page. */ onchangepage?: (self: Instance) => void } interface Page { /** Page index (0-based). */ title: number; /** Display value for the page button. */ value: string | number; /** Whether this page is currently selected. */ selected?: boolean; } interface Instance { /** Array Change the state of data. */ data: Item[]; /** Total number of records (for server-side pagination). */ total: number; /** Number Change the page index. */ page: number; /** Number Enable pagination. */ pagination: number; /** Boolean Enable search. */ search: boolean; /** Filter the content based on the text. */ input: string; /** Current result set being displayed. */ result: Item[]; /** Array of page objects for pagination controls. */ pages: Page[]; /** Navigate to a specific page. */ setPage: (page: number | { target: { title: string } }) => void; /** Message to display when no results. */ message?: string; } } export default List;