UNPKG

8.89 kBTypeScriptView Raw
1/// <reference types="jquery" />
2
3export interface BootstrapTableIcons {
4 toggleOff?: string;
5 clearSearch?: string;
6 detailOpen?: string;
7 search?: string;
8 fullscreen?: string;
9 columns?: string;
10 detailClose?: string;
11 refresh?: string;
12 paginationSwitchDown?: string;
13 paginationSwitchUp?: string;
14 toggleOn?: string;
15 autoRefresh?: string;
16}
17
18export interface BootstrapTableEvents {
19 'refresh.bs.table': string;
20 'load-error.bs.table': string;
21 'click-row.bs.table': string;
22 'dbl-click-row.bs.table': string;
23 'post-body.bs.table': string;
24 'collapse-row.bs.table': string;
25 'reset-view.bs.table': string;
26 'click-cell.bs.table': string;
27 'check-all.bs.table': string;
28 'post-footer.bs.table': string;
29 'uncheck.bs.table': string;
30 'check-some.bs.table': string;
31 'refresh-options.bs.table': string;
32 'pre-body.bs.table': string;
33 'uncheck-some.bs.table': string;
34 'expand-row.bs.table': string;
35 'all.bs.table': string;
36 'uncheck-all.bs.table': string;
37 'column-switch.bs.table': string;
38 'column-switch-all.bs.table': string;
39 'check.bs.table': string;
40 'search.bs.table': string;
41 'load-success.bs.table': string;
42 'dbl-click-cell.bs.table': string;
43 'page-change.bs.table': string;
44 'post-header.bs.table': string;
45 'toggle.bs.table': string;
46 'sort.bs.table': string;
47 'scroll-body.bs.table': string;
48}
49
50export interface BootstrapTableColumn {
51 sortName?: any;
52 widthUnit?: string;
53 sorter?: any;
54 searchFormatter?: boolean;
55 titleTooltip?: any;
56 falign?: any;
57 title?: any;
58 align?: any;
59 radio?: boolean;
60 colspan?: any;
61 showSelectTitle?: boolean;
62 rowspan?: any;
63 checkbox?: boolean;
64 halign?: any;
65 switchable?: boolean;
66 class?: any;
67 escape?: boolean;
68 events?: BootstrapTableEvents;
69 order?: string;
70 visible?: boolean;
71 detailFormatter?: any;
72 valign?: any;
73 sortable?: boolean;
74 cellStyle?: any;
75 searchable?: boolean;
76 footerFormatter?: any;
77 formatter?: any;
78 checkboxEnabled?: boolean;
79 field?: any;
80 width?: any;
81 clickToSelect?: boolean;
82 searchHighlightFormatter?: boolean;
83 cardVisible?: boolean;
84}
85
86export interface BootstrapTableLocale {
87 formatPaginationSwitchDown?: () => string;
88
89 formatColumns?: () => string;
90
91 formatAllRows?: () => string;
92
93 formatLoadingMessage?: () => string;
94
95 formatSRPaginationPreText?: () => string;
96
97 formatPaginationSwitch?: () => string;
98
99 formatDetailPagination?: (totalRows: number) => string;
100
101 formatNoMatches?: () => string;
102
103 formatSRPaginationNextText?: () => string;
104
105 formatSearch?: () => string;
106
107 formatFullscreen?: () => string;
108
109 formatShowingRows?: (
110 pageFrom: number,
111 pageTo: number,
112 totalRows: number,
113 totalNotFiltered: number
114 ) => string;
115
116 formatSRPaginationPageText?: (page: number) => string;
117
118 formatClearSearch?: () => string;
119
120 formatPaginationSwitchUp?: () => string;
121
122 formatToggle?: () => string;
123
124 formatToggleOff?: () => string;
125
126 formatColumnsToggleAll?: () => string;
127
128 formatRefresh?: () => string;
129
130 formatToggleOn?: () => string;
131
132 formatRecordsPerPage(pageNumber: number): string;
133}
134
135export interface BootstrapAjaxParams {
136 cache: boolean;
137 data: {
138 search: string;
139 offset: number;
140 limit: number;
141 sort?: any;
142 order?: any;
143 };
144 dataType: string;
145 type: string;
146 contentType: string;
147 error: (jqXHR: JQueryXHR) => any;
148 success: (results: any, textStatus?: string, jqXHR?: JQueryXHR) => any;
149}
150
151export interface BootstrapTableOptions {
152 onCheck?: (row: any, $element: JQuery<HTMLElement>) => boolean | void;
153 loadingFontSize?: string;
154 onDblClickCell?: (
155 field: string,
156 value: any,
157 row: any,
158 $element: JQuery<HTMLElement>
159 ) => boolean | void;
160 rowStyle?: (row: any, index: number) => {};
161 showColumnsToggleAll?: boolean;
162 footerStyle?: (column: BootstrapTableColumn) => {};
163 onUncheck?: (row: any, $element: JQuery<HTMLElement>) => boolean | void;
164 pageSize?: number;
165 footerField?: string;
166 showFullscreen?: boolean;
167 sortStable?: boolean;
168 searchAlign?: string;
169 ajax?: (params: BootstrapAjaxParams) => any;
170 onAll?: (name: string, args: any) => boolean | void;
171 onClickRow?: (
172 row: any,
173 $element: JQuery<HTMLElement>,
174 field: string
175 ) => boolean | void;
176 ajaxOptions?: {};
177 onCheckSome?: (rows: any[]) => boolean | void;
178 customSort?: any;
179 iconSize?: any;
180 onCollapseRow?: (
181 index: number,
182 row: any,
183 detailView: any
184 ) => boolean | void;
185 searchHighlight?: boolean;
186 height?: any;
187 onUncheckSome?: (rows: any[]) => boolean | void;
188 onToggle?: (cardView: boolean) => boolean | void;
189 ignoreClickToSelectOn?: ({ tagName }?: { tagName: any }) => any;
190 cache?: boolean;
191 method?: string;
192 onColumnSwitch?: (field: string, checked: boolean) => boolean | void;
193 searchSelector?: boolean;
194 strictSearch?: boolean;
195 multipleSelectRow?: boolean;
196 onLoadError?: (status: string, jqXHR: JQuery.jqXHR) => boolean | void;
197 buttonsToolbar?: any;
198 paginationVAlign?: string;
199 showColumnsSearch?: boolean;
200 queryParamsType?: string;
201 sortOrder?: any;
202 paginationDetailHAlign?: string;
203 customSearch?: any;
204 visibleSearch?: boolean;
205 showButtonText?: boolean;
206 sortName?: any;
207 columns?: BootstrapTableColumn[];
208 onScrollBody?: () => boolean | void;
209 iconsPrefix?: string;
210 onPostBody?: () => boolean | void;
211 search?: boolean;
212 searchOnEnterKey?: boolean;
213 searchText?: string;
214 responseHandler?: (res: any) => any;
215 toolbarAlign?: string;
216 paginationParts?: string[];
217 cardView?: boolean;
218 showSearchButton?: boolean;
219 escape?: boolean;
220 searchTimeOut?: number;
221 buttonsAlign?: string;
222 buttonsOrder?: string[];
223 detailFormatter?: (
224 index: number,
225 row: any,
226 $element: JQuery<HTMLElement>
227 ) => string;
228 onDblClickRow?: (
229 row: any,
230 $element: JQuery<HTMLElement>,
231 field: string
232 ) => boolean | void;
233 paginationNextText?: string;
234 buttonsPrefix?: string;
235 loadingTemplate?: (loadingMessage: string) => string;
236 theadClasses?: string;
237 onLoadSuccess?: (
238 data: any,
239 status: string,
240 jqXHR: JQuery.jqXHR
241 ) => boolean | void;
242 url?: any;
243 toolbar?: any;
244 onPostHeader?: () => boolean | void;
245 sidePagination?: string;
246 clickToSelect?: boolean;
247 virtualScrollItemHeight?: any;
248 rowAttributes?: (row: any, index: number) => {};
249 dataField?: string;
250 idField?: string;
251 onSort?: (name: string, order: number) => boolean | void;
252 pageNumber?: number;
253 data?: any[];
254 totalNotFilteredField?: string;
255 undefinedText?: string;
256 onSearch?: (text: string) => boolean | void;
257 onPageChange?: (number: number, size: number) => boolean | void;
258 paginationUseIntermediate?: boolean;
259 searchAccentNeutralise?: boolean;
260 singleSelect?: boolean;
261 showButtonIcons?: boolean;
262 showPaginationSwitch?: boolean;
263 onPreBody?: (data: any) => boolean | void;
264 detailFilter?: (index: number, row: any) => boolean | void;
265 detailViewByClick?: boolean;
266 totalField?: string;
267 contentType?: string;
268 showColumns?: boolean;
269 totalNotFiltered?: number;
270 checkboxHeader?: boolean;
271 onRefresh?: (params: any[]) => boolean | void;
272 dataType?: string;
273 paginationPreText?: string;
274 showToggle?: boolean;
275 detailView?: boolean;
276 serverSort?: boolean;
277 totalRows?: number;
278 silentSort?: boolean;
279 onPostFooter?: () => boolean | void;
280 selectItemName?: string;
281 detailViewIcon?: boolean;
282 detailViewAlign?: string;
283 minimumCountColumns?: number;
284 uniqueId?: any;
285 onResetView?: () => boolean | void;
286 paginationHAlign?: string;
287 sortClass?: any;
288 pagination?: boolean;
289 queryParams?: (params: any) => any;
290 paginationSuccessivelySize?: number;
291 classes?: string;
292 rememberOrder?: boolean;
293 paginationPagesBySide?: number;
294 trimOnSearch?: boolean;
295 showRefresh?: boolean;
296 locale?: BootstrapTableLocale;
297 onCheckAll?: (rowsAfter: any[], rowsBefore: any[]) => boolean | void;
298 showFooter?: boolean;
299 headerStyle?: (column: BootstrapTableColumn) => {};
300 maintainMetaData?: boolean;
301 onRefreshOptions?: (options: BootstrapTableOptions) => boolean | void;
302 showExtendedPagination?: boolean;
303 smartDisplay?: boolean;
304 paginationLoop?: boolean;
305 virtualScroll?: boolean;
306 sortReset?: boolean;
307 filterOptions?: { filterAlgorithm: string };
308 onUncheckAll?: (rowsAfter: any[], rowsBefore: any[]) => boolean | void;
309 showSearchClearButton?: boolean;
310 buttons?: {};
311 showHeader?: boolean;
312 onClickCell?: (
313 field: string,
314 value: any,
315 row: any,
316 $element: JQuery<HTMLElement>
317 ) => boolean | void;
318 sortable?: boolean;
319 icons?: BootstrapTableIcons;
320 onExpandRow?: (
321 index: number,
322 row: any,
323 $detail: JQuery<HTMLElement>
324 ) => boolean | void;
325 buttonsClass?: string;
326 pageList?: number[];
327}
328
329declare global {
330 interface JQuery {
331 bootstrapTable(options: BootstrapTableOptions): JQuery;
332
333 bootstrapTable(method: string, ...parameters: any[]): JQuery | any;
334 }
335}