UNPKG

8.86 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 formatToggleOff?: () => string;
123
124 formatColumnsToggleAll?: () => string;
125
126 formatRefresh?: () => string;
127
128 formatToggleOn?: () => string;
129
130 formatRecordsPerPage(pageNumber: number): string;
131}
132
133export interface BootstrapAjaxParams {
134 cache: boolean;
135 data: {
136 search: string;
137 offset: number;
138 limit: number;
139 sort?: any;
140 order?: any;
141 };
142 dataType: string;
143 type: string;
144 contentType: string;
145 error: (jqXHR: JQueryXHR) => any;
146 success: (results: any, textStatus?: string, jqXHR?: JQueryXHR) => any;
147}
148
149export interface BootstrapTableOptions {
150 onCheck?: (row: any, $element: JQuery<HTMLElement>) => boolean | void;
151 loadingFontSize?: string;
152 onDblClickCell?: (
153 field: string,
154 value: any,
155 row: any,
156 $element: JQuery<HTMLElement>
157 ) => boolean | void;
158 rowStyle?: (row: any, index: number) => {};
159 showColumnsToggleAll?: boolean;
160 footerStyle?: (column: BootstrapTableColumn) => {};
161 onUncheck?: (row: any, $element: JQuery<HTMLElement>) => boolean | void;
162 pageSize?: number;
163 footerField?: string;
164 showFullscreen?: boolean;
165 sortStable?: boolean;
166 searchAlign?: string;
167 ajax?: (params: BootstrapAjaxParams) => any;
168 onAll?: (name: string, args: any) => boolean | void;
169 onClickRow?: (
170 row: any,
171 $element: JQuery<HTMLElement>,
172 field: string
173 ) => boolean | void;
174 ajaxOptions?: {};
175 onCheckSome?: (rows: any[]) => boolean | void;
176 customSort?: any;
177 iconSize?: any;
178 onCollapseRow?: (
179 index: number,
180 row: any,
181 detailView: any
182 ) => boolean | void;
183 searchHighlight?: boolean;
184 height?: any;
185 onUncheckSome?: (rows: any[]) => boolean | void;
186 onToggle?: (cardView: boolean) => boolean | void;
187 ignoreClickToSelectOn?: ({ tagName }?: { tagName: any }) => any;
188 cache?: boolean;
189 method?: string;
190 onColumnSwitch?: (field: string, checked: boolean) => boolean | void;
191 searchSelector?: boolean;
192 strictSearch?: boolean;
193 multipleSelectRow?: boolean;
194 onLoadError?: (status: string, jqXHR: JQuery.jqXHR) => boolean | void;
195 buttonsToolbar?: any;
196 paginationVAlign?: string;
197 showColumnsSearch?: boolean;
198 queryParamsType?: string;
199 sortOrder?: any;
200 paginationDetailHAlign?: string;
201 customSearch?: any;
202 visibleSearch?: boolean;
203 showButtonText?: boolean;
204 sortName?: any;
205 columns?: BootstrapTableColumn[];
206 onScrollBody?: () => boolean | void;
207 iconsPrefix?: string;
208 onPostBody?: () => boolean | void;
209 search?: boolean;
210 searchOnEnterKey?: boolean;
211 searchText?: string;
212 responseHandler?: (res: any) => any;
213 toolbarAlign?: string;
214 paginationParts?: string[];
215 cardView?: boolean;
216 showSearchButton?: boolean;
217 escape?: boolean;
218 searchTimeOut?: number;
219 buttonsAlign?: string;
220 buttonsOrder?: string[];
221 detailFormatter?: (
222 index: number,
223 row: any,
224 $element: JQuery<HTMLElement>
225 ) => string;
226 onDblClickRow?: (
227 row: any,
228 $element: JQuery<HTMLElement>,
229 field: string
230 ) => boolean | void;
231 paginationNextText?: string;
232 buttonsPrefix?: string;
233 loadingTemplate?: (loadingMessage: string) => string;
234 theadClasses?: string;
235 onLoadSuccess?: (
236 data: any,
237 status: string,
238 jqXHR: JQuery.jqXHR
239 ) => boolean | void;
240 url?: any;
241 toolbar?: any;
242 onPostHeader?: () => boolean | void;
243 sidePagination?: string;
244 clickToSelect?: boolean;
245 virtualScrollItemHeight?: any;
246 rowAttributes?: (row: any, index: number) => {};
247 dataField?: string;
248 idField?: string;
249 onSort?: (name: string, order: number) => boolean | void;
250 pageNumber?: number;
251 data?: any[];
252 totalNotFilteredField?: string;
253 undefinedText?: string;
254 onSearch?: (text: string) => boolean | void;
255 onPageChange?: (number: number, size: number) => boolean | void;
256 paginationUseIntermediate?: boolean;
257 searchAccentNeutralise?: boolean;
258 singleSelect?: boolean;
259 showButtonIcons?: boolean;
260 showPaginationSwitch?: boolean;
261 onPreBody?: (data: any) => boolean | void;
262 detailFilter?: (index: number, row: any) => boolean | void;
263 detailViewByClick?: boolean;
264 totalField?: string;
265 contentType?: string;
266 showColumns?: boolean;
267 totalNotFiltered?: number;
268 checkboxHeader?: boolean;
269 onRefresh?: (params: any[]) => boolean | void;
270 dataType?: string;
271 paginationPreText?: string;
272 showToggle?: boolean;
273 detailView?: boolean;
274 serverSort?: boolean;
275 totalRows?: number;
276 silentSort?: boolean;
277 onPostFooter?: () => boolean | void;
278 selectItemName?: string;
279 detailViewIcon?: boolean;
280 detailViewAlign?: string;
281 minimumCountColumns?: number;
282 uniqueId?: any;
283 onResetView?: () => boolean | void;
284 paginationHAlign?: string;
285 sortClass?: any;
286 pagination?: boolean;
287 queryParams?: (params: any) => any;
288 paginationSuccessivelySize?: number;
289 classes?: string;
290 rememberOrder?: boolean;
291 paginationPagesBySide?: number;
292 trimOnSearch?: boolean;
293 showRefresh?: boolean;
294 locale?: BootstrapTableLocale;
295 onCheckAll?: (rowsAfter: any[], rowsBefore: any[]) => boolean | void;
296 showFooter?: boolean;
297 headerStyle?: (column: BootstrapTableColumn) => {};
298 maintainMetaData?: boolean;
299 onRefreshOptions?: (options: BootstrapTableOptions) => boolean | void;
300 showExtendedPagination?: boolean;
301 smartDisplay?: boolean;
302 paginationLoop?: boolean;
303 virtualScroll?: boolean;
304 sortReset?: boolean;
305 filterOptions?: { filterAlgorithm: string };
306 onUncheckAll?: (rowsAfter: any[], rowsBefore: any[]) => boolean | void;
307 showSearchClearButton?: boolean;
308 buttons?: {};
309 showHeader?: boolean;
310 onClickCell?: (
311 field: string,
312 value: any,
313 row: any,
314 $element: JQuery<HTMLElement>
315 ) => boolean | void;
316 sortable?: boolean;
317 icons?: BootstrapTableIcons;
318 onExpandRow?: (
319 index: number,
320 row: any,
321 $detail: JQuery<HTMLElement>
322 ) => boolean | void;
323 buttonsClass?: string;
324 pageList?: number[];
325}
326
327declare global {
328 interface JQuery {
329 bootstrapTable(options: BootstrapTableOptions): JQuery;
330
331 bootstrapTable(method: string, ...parameters: any[]): JQuery | any;
332 }
333}