@infinite-table/infinite-react 0.0.1-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,1977 @@
1
+ /// <reference types="react" />
2
+ declare module "components/types/ScrollPosition" {
3
+ export interface ScrollPosition {
4
+ scrollTop: number;
5
+ scrollLeft: number;
6
+ }
7
+ export type OnScrollFn = (scrollPosition: ScrollPosition) => void;
8
+ export type SetScrollPosition = OnScrollFn;
9
+ }
10
+ declare module "utils/multisort/sortTypes" {
11
+ const sortTypes: {
12
+ [key: string]: (first: any, second: any) => number;
13
+ };
14
+ export default sortTypes;
15
+ }
16
+ declare module "utils/multisort/index" {
17
+ export type SortDir = 1 | -1;
18
+ export type MultisortInfo<T> = {
19
+ /**
20
+ * The sorting direction
21
+ */
22
+ dir: SortDir;
23
+ /**
24
+ * a property whose value to use for sorting on the array items
25
+ */
26
+ field?: keyof T;
27
+ /**
28
+ * for now 'string' and 'number' are known types, meaning they have
29
+ * sort functions already implemented
30
+ */
31
+ type?: string;
32
+ fn?: (a: any, b: any) => number;
33
+ };
34
+ export interface MultisortFn<T> {
35
+ (sortInfo: MultisortInfo<T>[], array: T[]): T[];
36
+ knownTypes: {
37
+ [key: string]: (first: T, second: T) => number;
38
+ };
39
+ }
40
+ export const multisort: {
41
+ <T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
42
+ knownTypes: {
43
+ [key: string]: (first: any, second: any) => number;
44
+ };
45
+ };
46
+ const getSortFunctions: <T>(sortInfo: MultisortInfo<T>[]) => (((first: T, second: T) => number) | undefined)[];
47
+ const getMultisortFunction: <T>(sortInfo: MultisortInfo<T>[], get?: ((item: any) => T) | undefined) => (first: T, second: T) => number;
48
+ export { getMultisortFunction, getSortFunctions };
49
+ }
50
+ declare module "components/hooks/useOnce" {
51
+ export function once<ReturnType>(fn: () => ReturnType): () => ReturnType;
52
+ export function useOnce<ReturnType>(fn: () => ReturnType): ReturnType;
53
+ }
54
+ declare module "components/types/VoidFn" {
55
+ export type VoidFn = () => void;
56
+ }
57
+ declare module "utils/sortAscending" {
58
+ export const sortAscending: (a: number, b: number) => number;
59
+ }
60
+ declare module "utils/DeepMap" {
61
+ import { VoidFn } from "components/types/VoidFn";
62
+ type Pair<KeyType, ValueType> = {
63
+ value?: ValueType;
64
+ map?: Map<KeyType, Pair<KeyType, ValueType>>;
65
+ revision?: number;
66
+ };
67
+ export type DeepMapVisitFn<KeyType, ValueType> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn) => void;
68
+ export class DeepMap<KeyType, ValueType> {
69
+ private map;
70
+ private length;
71
+ private revision;
72
+ constructor(initial?: [KeyType[], ValueType][]);
73
+ set(keys: KeyType[] & {
74
+ length: Omit<number, 0>;
75
+ }, value: ValueType): this;
76
+ get(keys: KeyType[]): ValueType | undefined;
77
+ get size(): number;
78
+ clear(): void;
79
+ delete(keys: KeyType[]): boolean;
80
+ has(keys: KeyType[]): boolean;
81
+ private visitKey;
82
+ visit: (fn: DeepMapVisitFn<KeyType, ValueType>) => void;
83
+ visitDepthFirst: (fn: (value: ValueType, keys: KeyType[], indexInGroup: number, next?: VoidFn | undefined) => void) => void;
84
+ private visitWithNext;
85
+ private getArray;
86
+ values(): Generator<ValueType, void, unknown>;
87
+ keys(): Generator<KeyType[], void, unknown>;
88
+ entries(): Generator<[KeyType[], ValueType], void, unknown>;
89
+ topDownEntries(): [KeyType[], ValueType][];
90
+ topDownKeys(): KeyType[][];
91
+ topDownValues(): ValueType[];
92
+ private sortedIterator;
93
+ }
94
+ }
95
+ declare module "utils/debug" {
96
+ export interface LogFn {
97
+ (...args: any[]): LogFn;
98
+ extend: (channelName: string) => LogFn;
99
+ }
100
+ export const dbg: (channelName: string) => LogFn;
101
+ export const err: (channelName: string) => LogFn;
102
+ export class Logger {
103
+ debug: LogFn;
104
+ error: LogFn;
105
+ constructor(channelName: string);
106
+ }
107
+ }
108
+ declare module "utils/toUpperFirst" {
109
+ export const toUpperFirst: (s: string) => string;
110
+ export default toUpperFirst;
111
+ }
112
+ declare module "components/utils/isControlledValue" {
113
+ export function isControlledValue(value: any): boolean;
114
+ }
115
+ declare module "components/utils/isControlled" {
116
+ export function isControlled<V extends keyof T, T>(propName: V, props: T): boolean;
117
+ }
118
+ declare module "components/hooks/useLatest" {
119
+ export const useLatest: <T>(value: T) => () => T;
120
+ }
121
+ declare module "components/hooks/usePrevious" {
122
+ export const usePrevious: <T>(value: T, initialValue?: T | undefined) => T;
123
+ }
124
+ declare module "components/hooks/useComponentState" {
125
+ import * as React from 'react';
126
+ export const notifyChange: (props: any, propName: string, newValue: any) => void;
127
+ export function getComponentStateContext<T>(): React.Context<T>;
128
+ type ComponentStateContext<T_STATE, T_ACTIONS> = {
129
+ getComponentState: () => T_STATE;
130
+ componentState: T_STATE;
131
+ componentActions: T_ACTIONS;
132
+ updateStateProperty: <T extends keyof T_STATE>(propertyName: T, propertyValue: T_STATE[T]) => void;
133
+ };
134
+ type ComponentStateGeneratedActions<T_STATE> = {
135
+ [k in keyof T_STATE]: T_STATE[k] | React.SetStateAction<T_STATE[k]>;
136
+ };
137
+ export type ComponentStateActions<T_STATE, T_ACTIONS = {}> = ComponentStateGeneratedActions<T_STATE> & T_ACTIONS;
138
+ type ComponentStateRootConfig<T_PROPS, T_STATE, T_READONLY_STATE = {}, T_ACTIONS = {}, T_PARENT_STATE = {}> = {
139
+ getInitialState: (params: {
140
+ props: T_PROPS;
141
+ parentState: T_PARENT_STATE | null;
142
+ }) => T_STATE;
143
+ concludeReducer?: (params: {
144
+ previousState: T_STATE;
145
+ state: T_STATE;
146
+ updated: Partial<T_STATE> | null;
147
+ parentState: T_PARENT_STATE | null;
148
+ }) => T_STATE;
149
+ getReducerActions?: (dispatch: React.Dispatch<any>) => T_ACTIONS;
150
+ deriveReadOnlyState?: (params: {
151
+ props: T_PROPS;
152
+ state: T_STATE;
153
+ updated: Partial<T_STATE> | null;
154
+ parentState: T_PARENT_STATE | null;
155
+ }) => T_READONLY_STATE;
156
+ getParentState?: () => T_PARENT_STATE;
157
+ onControlledPropertyChange?: (name: string, newValue: any, oldValue: any) => void | ((value: any, oldValue: any) => any);
158
+ };
159
+ export function getComponentStateRoot<T_PROPS, T_STATE extends object, T_READONLY_STATE extends object = {}, T_ACTIONS = {}, T_PARENT_STATE = {}>(config: ComponentStateRootConfig<T_PROPS, T_STATE, T_READONLY_STATE, T_ACTIONS, T_PARENT_STATE>): React.NamedExoticComponent<T_PROPS & {
160
+ children: React.ReactNode;
161
+ }>;
162
+ export function useComponentState<T_STATE, T_READONLY_STATE = {}, T_ACTIONS = {}>(): ComponentStateContext<T_STATE & T_READONLY_STATE, ComponentStateActions<T_STATE, T_ACTIONS>>;
163
+ }
164
+ declare module "components/DataSource/types" {
165
+ import * as React from 'react';
166
+ import { MultisortInfo } from "utils/multisort/index";
167
+ import { DeepMap } from "utils/DeepMap";
168
+ import { AggregationReducer, DeepMapGroupValueType, GroupBy, GroupKeyType, PivotBy } from "utils/groupAndPivot/index";
169
+ import { InfiniteTableColumn, InfiniteTableColumnGroup, InfiniteTableEnhancedData } from "components/InfiniteTable/index";
170
+ import { ComponentStateActions } from "components/hooks/useComponentState";
171
+ import { GroupRowsState } from "components/DataSource/GroupRowsState";
172
+ import { InfiniteTablePropPivotTotalColumnPosition } from "components/InfiniteTable/types/InfiniteTableState";
173
+ export interface DataSourceDataInfo<T> {
174
+ originalDataArray: T[];
175
+ }
176
+ export type DataSourceSingleSortInfo<T> = MultisortInfo<T> & {
177
+ field?: keyof T;
178
+ id?: string;
179
+ };
180
+ export type DataSourceGroupRowsBy<T> = GroupBy<T, any>;
181
+ export type DataSourcePivotBy<T> = PivotBy<T, any>;
182
+ export type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
183
+ export type DataSourceData<T> = T[] | Promise<T[] | {
184
+ data: T[];
185
+ }> | (() => T[] | Promise<T[] | {
186
+ data: T[];
187
+ }>);
188
+ export type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
189
+ export type DataSourceExpandedAndCollapsedGroupRows<KeyType> = {
190
+ expandedRows: DataSourceGroupRowsList<KeyType>;
191
+ collapsedRows: DataSourceGroupRowsList<KeyType>;
192
+ };
193
+ export type DataSourcePropGroupRowsBy<T> = DataSourceGroupRowsBy<T>[];
194
+ export type DataSourcePropPivotBy<T> = DataSourcePivotBy<T>[];
195
+ export interface DataSourceProps<T> {
196
+ children: React.ReactNode | ((contextData: DataSourceComponentState<T>) => React.ReactNode);
197
+ primaryKey: keyof T;
198
+ fields?: (keyof T)[];
199
+ data: DataSourceData<T>;
200
+ loading?: boolean;
201
+ defaultLoading?: boolean;
202
+ onLoadingChange?: (loading: boolean) => void;
203
+ pivotBy?: DataSourcePropPivotBy<T>;
204
+ defaultPivotBy?: DataSourcePropPivotBy<T>;
205
+ onPivotByChange?: (pivotBy: DataSourcePropPivotBy<T>) => void;
206
+ groupRowsBy?: DataSourcePropGroupRowsBy<T>;
207
+ defaultGroupRowsBy?: DataSourcePropGroupRowsBy<T>;
208
+ onGroupRowsByChange?: (groupBy: DataSourcePropGroupRowsBy<T>) => void;
209
+ groupRowsState?: GroupRowsState;
210
+ defaultGroupRowsState?: GroupRowsState;
211
+ onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
212
+ sortInfo?: DataSourceSortInfo<T>;
213
+ defaultSortInfo?: DataSourceSortInfo<T>;
214
+ onSortInfoChange?: (sortInfo: DataSourceSortInfo<T>) => void;
215
+ }
216
+ export interface DataSourceState<T> extends DataSourceDataInfo<T> {
217
+ data: DataSourceData<T>;
218
+ loading: boolean;
219
+ sortInfo?: DataSourceSortInfo<T>;
220
+ dataArray: InfiniteTableEnhancedData<T>[];
221
+ groupRowsBy: DataSourcePropGroupRowsBy<T>;
222
+ pivotBy?: DataSourcePropPivotBy<T>;
223
+ pivotColumns?: Map<string, InfiniteTableColumn<T>>;
224
+ pivotColumnGroups?: Map<string, InfiniteTableColumnGroup>;
225
+ aggregationReducers?: AggregationReducer<T, any>[];
226
+ groupRowsState: GroupRowsState;
227
+ sortedAt: number;
228
+ groupedAt: number;
229
+ updatedAt: number;
230
+ reducedAt: number;
231
+ pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
232
+ }
233
+ export interface DataSourceReadOnlyState<T> {
234
+ multiSort: boolean;
235
+ sortInfo: DataSourceSingleSortInfo<T>[];
236
+ primaryKey: keyof T;
237
+ groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
238
+ lastSortDataArray?: T[];
239
+ postSortDataArray?: T[];
240
+ lastGroupDataArray?: InfiniteTableEnhancedData<T>[];
241
+ postGroupDataArray?: InfiniteTableEnhancedData<T>[];
242
+ }
243
+ export interface DataSourceComponentState<T> extends Omit<DataSourceState<T>, 'sortInfo'>, DataSourceReadOnlyState<T> {
244
+ }
245
+ export type DataSourceComponentActions<T> = ComponentStateActions<DataSourceState<T>>;
246
+ export interface DataSourceContextValue<T> {
247
+ getState: () => DataSourceComponentState<T>;
248
+ componentState: DataSourceComponentState<T>;
249
+ componentActions: DataSourceComponentActions<T>;
250
+ }
251
+ export enum DataSourceActionType {
252
+ INIT = "INIT"
253
+ }
254
+ export interface DataSourceAction<T> {
255
+ type: DataSourceActionType;
256
+ payload: T;
257
+ }
258
+ export interface DataSourceReducer<T> {
259
+ (state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
260
+ }
261
+ }
262
+ declare module "components/DataSource/DataSourceContext" {
263
+ import * as React from 'react';
264
+ import { DataSourceContextValue } from "components/DataSource/types";
265
+ export function getDataSourceContext<T>(): React.Context<DataSourceContextValue<T>>;
266
+ }
267
+ declare module "components/DataSource/publicHooks/useDataSource" {
268
+ import { DataSourceComponentState, DataSourceContextValue } from "components/DataSource/types";
269
+ export function useDataSource<T>(): DataSourceComponentState<T>;
270
+ export function useDataSourceContextValue<T>(): DataSourceContextValue<T>;
271
+ }
272
+ declare module "components/DataSource/privateHooks/buildDataSourceDataInfo" {
273
+ import { DataSourceDataInfo } from "components/DataSource/types";
274
+ export function buildDataSourceDataInfo<T>(dataParam: T[] | {
275
+ data: T[];
276
+ }): DataSourceDataInfo<T>;
277
+ }
278
+ declare module "components/DataSource/privateHooks/loadDataAsync" {
279
+ import { DataSourceData, DataSourceDataInfo } from "components/DataSource/types";
280
+ export function loadDataAsync<T>(data: DataSourceData<T>): Promise<DataSourceDataInfo<T>>;
281
+ }
282
+ declare module "components/DataSource/privateHooks/useLoadData" {
283
+ export function useLoadData<T>(): void;
284
+ }
285
+ declare module "components/DataSource/state/normalizeSortInfo" {
286
+ import { DataSourceSingleSortInfo, DataSourceSortInfo } from "components/DataSource/types";
287
+ export const normalizeSortInfo: <T>(sortInfo?: DataSourceSortInfo<T> | undefined) => DataSourceSingleSortInfo<T>[];
288
+ }
289
+ declare module "components/DataSource/state/getInitialState" {
290
+ import { DataSourceProps, DataSourceReadOnlyState, DataSourceState } from "components/DataSource/types";
291
+ export function getInitialState<T>(params: {
292
+ props: DataSourceProps<T>;
293
+ }): DataSourceState<T>;
294
+ export function deriveReadOnlyState<T extends any>(params: {
295
+ props: DataSourceProps<T>;
296
+ state: DataSourceState<T>;
297
+ updated: Partial<DataSourceState<T>> | null;
298
+ }): DataSourceReadOnlyState<T>;
299
+ }
300
+ declare module "components/DataSource/state/reducer" {
301
+ import type { DataSourceState, DataSourceReadOnlyState } from "components/DataSource/types";
302
+ export function concludeReducer<T>(params: {
303
+ previousState: DataSourceState<T> & DataSourceReadOnlyState<T>;
304
+ state: DataSourceState<T> & DataSourceReadOnlyState<T>;
305
+ updated: Partial<DataSourceState<T> & DataSourceReadOnlyState<T>> | null;
306
+ }): DataSourceState<T> & DataSourceReadOnlyState<T>;
307
+ }
308
+ declare module "components/DataSource/index" {
309
+ import { DataSourceProps } from "components/DataSource/types";
310
+ import { useDataSource } from "components/DataSource/publicHooks/useDataSource";
311
+ import { GroupRowsState } from "components/DataSource/GroupRowsState";
312
+ function DataSource<T>(props: DataSourceProps<T>): JSX.Element;
313
+ export { useDataSource, DataSource, GroupRowsState };
314
+ export * from "components/DataSource/types";
315
+ }
316
+ declare module "components/DataSource/GroupRowsState" {
317
+ import { DataSourceExpandedAndCollapsedGroupRows } from "components/DataSource/index";
318
+ export class GroupRowsState<KeyType extends any = any> {
319
+ private expandedMap?;
320
+ private collapsedMap?;
321
+ private collapsedAll;
322
+ private expandedAll;
323
+ private initialState;
324
+ constructor(state: DataSourceExpandedAndCollapsedGroupRows<KeyType> | GroupRowsState<KeyType>);
325
+ getState(): DataSourceExpandedAndCollapsedGroupRows<KeyType>;
326
+ destroy(): void;
327
+ private update;
328
+ areAllCollapsed(): boolean;
329
+ areAllExpanded(): boolean;
330
+ collapseAll(): void;
331
+ expandAll(): void;
332
+ isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
333
+ isGroupRowCollapsed(keys: KeyType[]): boolean;
334
+ setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
335
+ collapseGroupRow(keys: KeyType[]): void;
336
+ expandGroupRow(keys: KeyType[]): void;
337
+ toggleGroupRow(keys: KeyType[]): void;
338
+ }
339
+ }
340
+ declare module "components/types/Renderable" {
341
+ import * as React from 'react';
342
+ export type Renderable = React.ReactNode | string | number | null;
343
+ }
344
+ declare module "components/InfiniteTable/types/Utility" {
345
+ export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
346
+ export type RequireOnlyOneProperty<T, Keys extends keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
347
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
348
+ }[Keys];
349
+ export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
350
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
351
+ }[Keys];
352
+ export type DiscriminatedUnion<A, B> = (A & {
353
+ [K in keyof B]?: undefined;
354
+ }) | (B & {
355
+ [K in keyof A]?: undefined;
356
+ });
357
+ export type AllPropertiesOrNone<DATA_TYPE> = DATA_TYPE | {
358
+ [KEY in keyof DATA_TYPE]?: never;
359
+ };
360
+ }
361
+ declare module "components/InfiniteTable/types/InfiniteTableColumn" {
362
+ import type { Renderable } from "components/types/Renderable";
363
+ import type { DataSourceComponentState, DataSourcePivotBy, DataSourceSingleSortInfo } from "components/DataSource/types";
364
+ import type { DiscriminatedUnion, RequireAtLeastOne } from "components/InfiniteTable/types/Utility";
365
+ import type { InfiniteTableEnhancedData } from "components/InfiniteTable/types/index";
366
+ import { CSSProperties } from 'react';
367
+ export type { DiscriminatedUnion, RequireAtLeastOne };
368
+ export type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
369
+ export interface InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> {
370
+ value: string | number | Renderable;
371
+ data: DATA_TYPE | null;
372
+ enhancedData: InfiniteTableEnhancedData<DATA_TYPE>;
373
+ rowIndex: number;
374
+ column: COL_TYPE;
375
+ toggleCurrentGroupRow: () => void;
376
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
377
+ groupRowsBy: DataSourceComponentState<DATA_TYPE>['groupRowsBy'];
378
+ }
379
+ export interface InfiniteTableColumnHeaderRenderParams<T> {
380
+ column: InfiniteTableComputedColumn<T>;
381
+ columnSortInfo: DataSourceSingleSortInfo<T> | null | undefined;
382
+ }
383
+ export type InfiniteTableColumnPinned = 'start' | 'end' | false;
384
+ export type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = ({ value, rowIndex, column, data, toggleGroupRow, toggleCurrentGroupRow, enhancedData, groupRowsBy: groupBy, }: InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE>) => Renderable | null;
385
+ export type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderRenderParams<T>) => Renderable;
386
+ export type InfiniteTableColumnWithField<T> = {
387
+ field: keyof T;
388
+ };
389
+ export type InfiniteTableColumnWithRender<T> = {
390
+ render: InfiniteTableColumnRenderFunction<T>;
391
+ };
392
+ export type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
393
+ export type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
394
+ export type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
395
+ type InfiniteTableColumnWithFlex = {
396
+ flex?: number;
397
+ defaultFlex?: number;
398
+ };
399
+ type InfiniteTableColumnWithWidth = {
400
+ width?: number;
401
+ defaultWidth?: number;
402
+ };
403
+ export type InfiniteTableColumnWithSize = DiscriminatedUnion<InfiniteTableColumnWithFlex, InfiniteTableColumnWithWidth>;
404
+ export type InfiniteTableColumnTypes = 'string' | 'number' | 'date';
405
+ export type InfiniteTableColumnWithRenderOrFieldOrValueGetter<T> = RequireAtLeastOne<{
406
+ field?: keyof T;
407
+ render?: InfiniteTableColumnRenderFunction<T>;
408
+ valueGetter?: InfiniteTableColumnValueGetter<T>;
409
+ }, 'render' | 'field' | 'valueGetter'>;
410
+ export type InfiniteTableColumnStyleFnParams<T> = {
411
+ data: T | null;
412
+ value: Renderable;
413
+ enhancedData: InfiniteTableEnhancedData<T>;
414
+ column: InfiniteTableColumn<T>;
415
+ };
416
+ export type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
417
+ export type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
418
+ export type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
419
+ export type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
420
+ export type InfiniteTableColumnValueGetterParams<T> = {
421
+ data: T | null;
422
+ enhancedData: InfiniteTableEnhancedData<T>;
423
+ };
424
+ export type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = Renderable> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
425
+ export type InfiniteTableBaseColumn<T> = {
426
+ maxWidth?: number;
427
+ minWidth?: number;
428
+ sortable?: boolean;
429
+ draggable?: boolean;
430
+ align?: InfiniteTableColumnAlign;
431
+ verticalAlign?: InfiniteTableColumnVerticalAlign;
432
+ columnGroup?: string;
433
+ header?: InfiniteTableColumnHeader<T>;
434
+ name?: Renderable;
435
+ cssEllipsis?: boolean;
436
+ headerCssEllipsis?: boolean;
437
+ type?: InfiniteTableColumnTypes;
438
+ style?: InfiniteTableColumnStyle<T>;
439
+ className?: InfiniteTableColumnClassName<T>;
440
+ valueGetter?: InfiniteTableColumnValueGetter<T>;
441
+ };
442
+ export type InfiniteTableColumn<T> = {} & InfiniteTableBaseColumn<T> & InfiniteTableColumnWithRenderOrFieldOrValueGetter<T> & InfiniteTableColumnWithSize;
443
+ export type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
444
+ groupByField?: string | string[];
445
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
446
+ };
447
+ export type InfiniteTablePivotColumn<T> = InfiniteTableColumn<T> & {
448
+ pivotBy?: DataSourcePivotBy<T>[];
449
+ pivotColumn?: true;
450
+ pivotTotalColumn?: true;
451
+ pivotGroupKeys?: any[];
452
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
453
+ };
454
+ type InfiniteTableComputedColumnBase<T> = {
455
+ computedWidth: number;
456
+ computedOffset: number;
457
+ computedPinningOffset: number;
458
+ computedAbsoluteOffset: number;
459
+ computedSortable: boolean;
460
+ computedSortInfo: DataSourceSingleSortInfo<T> | null;
461
+ computedSorted: boolean;
462
+ computedSortedAsc: boolean;
463
+ computedSortedDesc: boolean;
464
+ computedSortIndex: number;
465
+ computedVisibleIndex: number;
466
+ computedMultiSort: boolean;
467
+ computedPinned: InfiniteTableColumnPinned;
468
+ computedDraggable: boolean;
469
+ computedFirstInCategory: boolean;
470
+ computedLastInCategory: boolean;
471
+ computedFirst: boolean;
472
+ computedLast: boolean;
473
+ toggleSort: () => void;
474
+ id: string;
475
+ };
476
+ export type InfiniteTableComputedColumn<T> = InfiniteTableColumn<T> & InfiniteTableComputedColumnBase<T> & InfiniteTablePivotColumn<T> & InfiniteTableGeneratedGroupColumn<T>;
477
+ }
478
+ declare module "utils/groupAndPivot/index" {
479
+ import { DataSourcePivotBy } from "@infinite-table/infinite-react";
480
+ import { GroupRowsState } from "components/DataSource/GroupRowsState";
481
+ import { InfiniteTablePivotColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
482
+ import { InfiniteTableGroupColumnBase, InfiniteTablePropColumnGroups, InfiniteTablePropColumns } from "components/InfiniteTable/types/InfiniteTableProps";
483
+ import { InfiniteTablePropPivotTotalColumnPosition } from "components/InfiniteTable/types/InfiniteTableState";
484
+ import { DeepMap } from "utils/DeepMap";
485
+ export type AggregationReducer<T, AggregationResultType> = {
486
+ initialValue: AggregationResultType;
487
+ getter: (data: T) => any;
488
+ reducer: (accumulator: any, value: any, data: T) => AggregationResultType | any;
489
+ done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType;
490
+ };
491
+ export interface InfiniteTableEnhancedData<T> {
492
+ id: any;
493
+ data: T | null;
494
+ groupData?: T[];
495
+ value?: any;
496
+ isGroupRow?: boolean;
497
+ collapsed: boolean;
498
+ groupNesting?: number;
499
+ groupKeys?: any[];
500
+ parentGroupKeys?: any[];
501
+ indexInGroup: number;
502
+ indexInAll: number;
503
+ groupCount?: number;
504
+ groupBy?: (keyof T)[];
505
+ pivotValuesMap?: PivotValuesDeepMap<T, any>;
506
+ reducerResults?: any[];
507
+ }
508
+ export interface InfiniteTableEnhancedGroupData<T> extends InfiniteTableEnhancedData<T> {
509
+ data: null;
510
+ groupData: T[];
511
+ value: any;
512
+ isGroupRow: true;
513
+ groupNesting: number;
514
+ groupKeys?: any[];
515
+ groupCount: number;
516
+ groupBy: (keyof T)[];
517
+ pivotValuesMap?: PivotValuesDeepMap<T, any>;
518
+ }
519
+ export type GroupKeyType<T extends any = any> = T;
520
+ type PivotReducerResults<T = any> = T[];
521
+ type PivotGroupValueType<DataType, KeyType> = {
522
+ reducerResults: PivotReducerResults<KeyType>;
523
+ items: DataType[];
524
+ };
525
+ export type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
526
+ export type DeepMapGroupValueType<DataType, KeyType> = {
527
+ items: DataType[];
528
+ reducerResults: any[];
529
+ pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
530
+ };
531
+ export type GroupBy<DataType, KeyType> = {
532
+ field: keyof DataType;
533
+ toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
534
+ column?: InfiniteTableGroupColumnBase<DataType>;
535
+ };
536
+ export type PivotBy<DataType, KeyType> = GroupBy<DataType, KeyType>;
537
+ type GroupParams<DataType, KeyType> = {
538
+ groupBy: GroupBy<DataType, KeyType>[];
539
+ defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
540
+ pivot?: PivotBy<DataType, KeyType>[];
541
+ reducers?: AggregationReducer<DataType, any>[];
542
+ };
543
+ export type DataGroupResult<DataType, KeyType extends any> = {
544
+ deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
545
+ groupParams: GroupParams<DataType, KeyType>;
546
+ initialData: DataType[];
547
+ reducerResults?: any[];
548
+ topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
549
+ pivot?: PivotBy<DataType, KeyType>[];
550
+ };
551
+ export function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
552
+ export function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
553
+ export function enhancedFlatten<DataType, KeyType = any>(groupResult: DataGroupResult<DataType, KeyType>, toPrimaryKey: (data: DataType) => any, groupRowsState?: GroupRowsState): {
554
+ data: InfiniteTableEnhancedData<DataType>[];
555
+ };
556
+ export type ComputedColumnsAndGroups<DataType> = {
557
+ columns: InfiniteTablePropColumns<DataType, InfiniteTablePivotColumn<DataType>>;
558
+ columnGroups: InfiniteTablePropColumnGroups;
559
+ };
560
+ export function getPivotColumnsAndColumnGroups<DataType, KeyType = any>(deepMap: DeepMap<KeyType, boolean>, pivotBy: DataSourcePivotBy<DataType>[], pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition): ComputedColumnsAndGroups<DataType>;
561
+ }
562
+ declare module "components/InfiniteTable/types/InfiniteTableProps" {
563
+ import * as React from 'react';
564
+ import { AggregationReducer, InfiniteTableEnhancedData } from "utils/groupAndPivot/index";
565
+ import { DataSourceGroupRowsBy, DataSourcePropGroupRowsBy, DataSourcePropPivotBy } from "components/DataSource/index";
566
+ import { Renderable } from "components/types/Renderable";
567
+ import type { InfiniteTableBaseColumn, InfiniteTableColumn, InfiniteTableColumnRenderFunction, InfiniteTableColumnWithSize, InfiniteTableComputedColumn, InfiniteTableGeneratedGroupColumn, InfiniteTablePivotColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
568
+ import { InfiniteTablePropPivotTotalColumnPosition } from "components/InfiniteTable/types/InfiniteTableState";
569
+ export type InfiniteTablePropColumnOrderNormalized = string[];
570
+ export type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
571
+ export type InfiniteTablePropColumnVisibility = Map<string, false>;
572
+ export type InfiniteTablePropColumnPinning = Map<string, true | 'start' | 'end'>;
573
+ export type InfiniteTableRowStyleFnParams<T> = {
574
+ data: T | null;
575
+ enhancedData: InfiniteTableEnhancedData<T>;
576
+ rowIndex: number;
577
+ groupRowsBy?: (keyof T)[];
578
+ };
579
+ export type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React.CSSProperties;
580
+ export type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
581
+ export type InfiniteTablePropRowStyle<T> = React.CSSProperties | InfiniteTableRowStyleFn<T>;
582
+ export type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
583
+ export type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter'> & {
584
+ getter?: AggregationReducer<T, AggregationResultType>['getter'];
585
+ };
586
+ export type InfiniteTablePropColumnAggregations<T> = Map<string, InfiniteTableColumnAggregator<T, any>>;
587
+ export type InfiniteTableImperativeApi<T> = {
588
+ setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
589
+ setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
590
+ setColumnAggregations: (columnAggregations: InfiniteTablePropColumnAggregations<T>) => void;
591
+ x?: T;
592
+ };
593
+ export type InfiniteTablePropVirtualizeColumns<T> = boolean | ((columns: InfiniteTableComputedColumn<T>[]) => boolean);
594
+ export type InfiniteTableInternalProps<T> = {
595
+ rowHeight: number;
596
+ ___t?: T;
597
+ };
598
+ export type InfiniteTablePropColumns<T, ColumnType = InfiniteTableColumn<T>> = Map<string, ColumnType>;
599
+ export type InfiniteTableGeneratedColumns<T> = Map<string, InfiniteTableGeneratedGroupColumn<T>>;
600
+ export type InfiniteTablePropColumnGroups = Map<string, InfiniteTableColumnGroup>;
601
+ /**
602
+ * the keys is an array of strings: first string in the array is the column group id, next strings are the ids of all columns in the group
603
+ * the value is the id of the column to leave as visible
604
+ */
605
+ export type InfiniteTablePropCollapsedColumnGroups = Map<string[], string>;
606
+ export type InfiniteTableColumnGroupHeaderRenderParams = {
607
+ columnGroup: InfiniteTableComputedColumnGroup;
608
+ };
609
+ export type InfiniteTableColumnGroupHeaderRenderFunction = (params: InfiniteTableColumnGroupHeaderRenderParams) => Renderable;
610
+ export type InfiniteTableColumnGroup = {
611
+ columnGroup?: string;
612
+ header?: Renderable | InfiniteTableColumnGroupHeaderRenderFunction;
613
+ };
614
+ export type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
615
+ id: string;
616
+ groupOffset: number;
617
+ computedWidth: number;
618
+ uniqueGroupId: string[];
619
+ columns: string[];
620
+ depth: number;
621
+ };
622
+ export type GroupColumnGetterOptions<T> = {
623
+ groupIndex?: number;
624
+ groupCount: number;
625
+ groupBy?: DataSourceGroupRowsBy<T>;
626
+ groupRowsBy: DataSourceGroupRowsBy<T>[];
627
+ };
628
+ export type PivotColumnGetterOptions<T> = {
629
+ column: InfiniteTablePivotColumn<T>;
630
+ groupRowsBy: DataSourcePropGroupRowsBy<T>;
631
+ pivotBy: DataSourcePropPivotBy<T>;
632
+ };
633
+ export type InfiniteTablePropGroupRenderStrategy = 'single-column' | 'multi-column';
634
+ export type InfiniteTableGroupColumnBase<T> = InfiniteTableBaseColumn<T> & InfiniteTableColumnWithSize & {
635
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
636
+ };
637
+ export type InfiniteTablePivotColumnBase<T> = InfiniteTableColumn<T> & InfiniteTableColumnWithSize & {
638
+ renderValue?: InfiniteTableColumnRenderFunction<T>;
639
+ };
640
+ export type InfiniteTablePropGroupColumn<T> = InfiniteTableGroupColumnBase<T> | ((options: GroupColumnGetterOptions<T>, toggleGroupRow: (groupKeys: any[]) => void) => InfiniteTableGroupColumnBase<T>);
641
+ export type InfiniteTablePropPivotColumn<T> = InfiniteTablePivotColumnBase<T> | ((options: PivotColumnGetterOptions<T>) => InfiniteTablePivotColumnBase<T>);
642
+ export type InfiniteTablePropPivotRowLabelsColumn<T> = InfiniteTablePropPivotColumn<T>;
643
+ export type InfiniteTableProps<T> = {
644
+ columns: InfiniteTablePropColumns<T>;
645
+ pivotColumns?: InfiniteTablePropColumns<T, InfiniteTablePivotColumn<T>>;
646
+ pivotColumn?: Partial<InfiniteTablePropPivotColumn<T>>;
647
+ pivotRowLabelsColumn?: Partial<InfiniteTablePropPivotRowLabelsColumn<T>>;
648
+ pivotTotalColumnPosition?: InfiniteTablePropPivotTotalColumnPosition;
649
+ groupColumn?: Partial<InfiniteTablePropGroupColumn<T>>;
650
+ groupRenderStrategy?: InfiniteTablePropGroupRenderStrategy;
651
+ columnVisibility?: InfiniteTablePropColumnVisibility;
652
+ defaultColumnVisibility?: InfiniteTablePropColumnVisibility;
653
+ columnPinning?: InfiniteTablePropColumnPinning;
654
+ defaultColumnPinning?: InfiniteTablePropColumnPinning;
655
+ defaultColumnAggregations?: InfiniteTablePropColumnAggregations<T>;
656
+ columnAggregations?: InfiniteTablePropColumnAggregations<T>;
657
+ pivotColumnGroups?: InfiniteTablePropColumnGroups;
658
+ columnGroups?: InfiniteTablePropColumnGroups;
659
+ defaultColumnGroups?: InfiniteTablePropColumnGroups;
660
+ defaultCollapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
661
+ collapsedColumnGroups?: InfiniteTablePropCollapsedColumnGroups;
662
+ onColumnVisibilityChange?: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
663
+ rowHeight: number | string;
664
+ rowStyle?: InfiniteTablePropRowStyle<T>;
665
+ rowClassName?: InfiniteTablePropRowClassName<T>;
666
+ headerHeight: number | string;
667
+ domProps?: React.HTMLProps<HTMLDivElement>;
668
+ showZebraRows?: boolean;
669
+ sortable?: boolean;
670
+ draggableColumns?: boolean;
671
+ header?: boolean;
672
+ columnDefaultWidth?: number;
673
+ columnMinWidth?: number;
674
+ columnMaxWidth?: number;
675
+ virtualizeColumns?: InfiniteTablePropVirtualizeColumns<T>;
676
+ virtualizeRows?: boolean;
677
+ defaultColumnOrder?: InfiniteTablePropColumnOrder;
678
+ columnOrder?: InfiniteTablePropColumnOrder;
679
+ onColumnOrderChange?: (columnOrder: InfiniteTablePropColumnOrder) => void;
680
+ onReady?: (api: InfiniteTableImperativeApi<T>) => void;
681
+ rowProps?: React.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React.HTMLProps<HTMLDivElement>);
682
+ licenseKey?: string;
683
+ };
684
+ }
685
+ declare module "components/types/Size" {
686
+ export interface Size {
687
+ width: number;
688
+ height: number;
689
+ }
690
+ export type OnResizeFn = (size: {
691
+ width: number;
692
+ height: number;
693
+ }) => void;
694
+ }
695
+ declare module "components/types/SubscriptionCallback" {
696
+ import { VoidFn } from "components/types/VoidFn";
697
+ export type SubscriptionCallbackOnChangeFn<T> = (node: T | null) => void;
698
+ export interface SubscriptionCallback<T> {
699
+ (node: T): void;
700
+ get: () => T | null;
701
+ destroy: VoidFn;
702
+ onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
703
+ }
704
+ }
705
+ declare module "components/InfiniteTable/types/InfiniteTableState" {
706
+ import type { ScrollPosition } from "components/types/ScrollPosition";
707
+ import type { InfiniteTableColumnGroup, InfiniteTableGeneratedColumns, InfiniteTablePropCollapsedColumnGroups, InfiniteTablePropColumnAggregations, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnVisibility, InfiniteTablePropGroupRenderStrategy, InfiniteTableProps } from "components/InfiniteTable/types/InfiniteTableProps";
708
+ import { Size } from "components/types/Size";
709
+ import { ComponentStateActions } from "components/hooks/useComponentState";
710
+ import { MutableRefObject } from 'react';
711
+ import { SubscriptionCallback } from "components/types/SubscriptionCallback";
712
+ export interface InfiniteTableState<T> {
713
+ domRef: MutableRefObject<HTMLDivElement | null>;
714
+ bodyDOMRef: MutableRefObject<HTMLDivElement | null>;
715
+ portalDOMRef: MutableRefObject<HTMLDivElement | null>;
716
+ bodySizeRef: MutableRefObject<Size | null>;
717
+ onRowHeightChange: SubscriptionCallback<number>;
718
+ onHeaderHeightChange: SubscriptionCallback<number>;
719
+ rowHeight: number;
720
+ headerHeight: number;
721
+ columnShifts: null | number[];
722
+ draggingColumnId: null | string;
723
+ bodySize: Size;
724
+ scrollPosition: ScrollPosition;
725
+ columnOrder: InfiniteTablePropColumnOrder;
726
+ columnVisibility: InfiniteTablePropColumnVisibility;
727
+ columnPinning: InfiniteTablePropColumnPinning;
728
+ columnAggregations: InfiniteTablePropColumnAggregations<T>;
729
+ columnGroups: InfiniteTablePropColumnGroups;
730
+ collapsedColumnGroups: InfiniteTablePropCollapsedColumnGroups;
731
+ columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
732
+ columnGroupsMaxDepth: number;
733
+ columns: InfiniteTableProps<T>['columns'];
734
+ pivotColumns: InfiniteTableProps<T>['pivotColumns'];
735
+ computedPivotColumns: InfiniteTableProps<T>['pivotColumns'];
736
+ pivotColumnGroups?: InfiniteTablePropColumnGroups;
737
+ computedColumnGroups: InfiniteTablePropColumnGroups;
738
+ generatedColumns: InfiniteTableGeneratedColumns<T>;
739
+ x?: T;
740
+ }
741
+ export type InfiniteTableComputedColumnGroup = InfiniteTableColumnGroup & {
742
+ depth: number;
743
+ };
744
+ export type InfiniteTableColumnGroupsDepthsMap = Map<string, number>;
745
+ export interface InfiniteTableComponentState<T> extends InfiniteTableState<T>, InfiniteTableReadOnlyState<T> {
746
+ }
747
+ export type InfiniteTablePropPivotTotalColumnPosition = false | 'start' | 'end';
748
+ export interface InfiniteTableReadOnlyState<T> {
749
+ groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
750
+ pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
751
+ onReady: InfiniteTableProps<T>['onReady'];
752
+ rowProps: InfiniteTableProps<T>['rowProps'];
753
+ rowStyle: InfiniteTableProps<T>['rowStyle'];
754
+ rowClassName: InfiniteTableProps<T>['rowClassName'];
755
+ groupColumn: InfiniteTableProps<T>['groupColumn'];
756
+ pivotColumn: InfiniteTableProps<T>['pivotColumn'];
757
+ pivotRowLabelsColumn: InfiniteTableProps<T>['pivotRowLabelsColumn'];
758
+ showZebraRows: InfiniteTableProps<T>['showZebraRows'];
759
+ header: InfiniteTableProps<T>['header'];
760
+ columnMinWidth: InfiniteTableProps<T>['columnMinWidth'];
761
+ columnMaxWidth: InfiniteTableProps<T>['columnMaxWidth'];
762
+ columnDefaultWidth: InfiniteTableProps<T>['columnDefaultWidth'];
763
+ sortable: InfiniteTableProps<T>['sortable'];
764
+ virtualizeColumns: InfiniteTableProps<T>['virtualizeColumns'];
765
+ virtualizeHeader: boolean;
766
+ licenseKey: string;
767
+ domProps: InfiniteTableProps<T>['domProps'];
768
+ draggableColumns: boolean;
769
+ columnGroupsDepthsMap: InfiniteTableColumnGroupsDepthsMap;
770
+ columnGroupsMaxDepth: number;
771
+ computedColumnGroups: InfiniteTablePropColumnGroups;
772
+ rowHeightCSSVar: string;
773
+ headerHeightCSSVar: string;
774
+ }
775
+ export type InfiniteTableComponentActions<T> = ComponentStateActions<InfiniteTableState<T>>;
776
+ }
777
+ declare module "components/InfiniteTable/types/InfiniteTableActionType" {
778
+ export enum InfiniteTableActionType {
779
+ SET_COLUMN_SIZE = 0,
780
+ SET_SCROLL_POSITION = 1,
781
+ SET_BODY_SIZE = 2,
782
+ SET_COLUMN_ORDER = 3,
783
+ SET_COLUMN_VISIBILITY = 4,
784
+ SET_COLUMN_SHIFTS = 5,
785
+ SET_COLUMN_PINNING = 6,
786
+ SET_COLUMN_AGGREGATIONS = 7,
787
+ SET_DRAGGING_COLUMN_ID = 8
788
+ }
789
+ }
790
+ declare module "components/InfiniteTable/types/InfiniteTableAction" {
791
+ import { InfiniteTableActionType } from "components/InfiniteTable/types/InfiniteTableActionType";
792
+ export type InfiniteTableAction = {
793
+ type: InfiniteTableActionType;
794
+ payload?: any;
795
+ };
796
+ }
797
+ declare module "components/InfiniteTable/types/InfiniteTableComputedValues" {
798
+ import type { InfiniteTableComputedColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
799
+ import type { InfiniteTablePropColumnOrderNormalized, InfiniteTablePropColumnVisibility } from "components/InfiniteTable/types/InfiniteTableProps";
800
+ export interface InfiniteTableComputedValues<T> {
801
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
802
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
803
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
804
+ computedVisibleColumns: InfiniteTableComputedColumn<T>[];
805
+ computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
806
+ computedColumnVisibility: InfiniteTablePropColumnVisibility;
807
+ computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
808
+ computedPinnedStartColumnsWidth: number;
809
+ computedPinnedEndColumnsWidth: number;
810
+ computedUnpinnedColumnsWidth: number;
811
+ computedUnpinnedOffset: number;
812
+ computedPinnedEndOffset: number;
813
+ computedRemainingSpace: number;
814
+ unpinnedColumnRenderCount: number;
815
+ columnRenderStartIndex: number;
816
+ }
817
+ }
818
+ declare module "components/InfiniteTable/types/InfiniteTableContextValue" {
819
+ import { InfiniteTableComponentActions, InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
820
+ import { InfiniteTableComputedValues } from "components/InfiniteTable/types/InfiniteTableComputedValues";
821
+ export interface InfiniteTableContextValue<T> {
822
+ componentState: InfiniteTableComponentState<T>;
823
+ componentActions: InfiniteTableComponentActions<T>;
824
+ computed: InfiniteTableComputedValues<T>;
825
+ getComputed: () => InfiniteTableComputedValues<T>;
826
+ getState: () => InfiniteTableComponentState<T>;
827
+ }
828
+ }
829
+ declare module "components/InfiniteTable/types/index" {
830
+ import type { InfiniteTableState } from "components/InfiniteTable/types/InfiniteTableState";
831
+ import type { InfiniteTableAction } from "components/InfiniteTable/types/InfiniteTableAction";
832
+ import type { InfiniteTableActionType } from "components/InfiniteTable/types/InfiniteTableActionType";
833
+ import type { InfiniteTableProps, InfiniteTableImperativeApi, InfiniteTablePropColumnOrder, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnAggregator, InfiniteTableColumnGroup, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnAggregations, InfiniteTablePropColumnGroups, InfiniteTablePropRowStyle, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, InfiniteTablePropRowClassName, InfiniteTablePropColumns } from "components/InfiniteTable/types/InfiniteTableProps";
834
+ import type { InfiniteTableColumn, InfiniteTableComputedColumn, InfiniteTableColumnRenderParams } from "components/InfiniteTable/types/InfiniteTableColumn";
835
+ import type { InfiniteTableComputedValues } from "components/InfiniteTable/types/InfiniteTableComputedValues";
836
+ import type { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
837
+ import type { InfiniteTableEnhancedData } from "utils/groupAndPivot/index";
838
+ export type { InfiniteTableColumnAggregator, InfiniteTableComputedValues, InfiniteTablePropColumns, InfiniteTableEnhancedData, InfiniteTablePropColumnOrder, InfiniteTablePropColumnVisibility, InfiniteTablePropColumnPinning, InfiniteTableColumnGroup, InfiniteTableColumn, InfiniteTableComputedColumn, InfiniteTableColumnRenderParams, InfiniteTableContextValue, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropColumnAggregations, InfiniteTablePropColumnGroups, InfiniteTableState, InfiniteTableAction, InfiniteTableProps, InfiniteTableImperativeApi, InfiniteTableActionType, InfiniteTablePropRowStyle, InfiniteTablePropRowClassName, InfiniteTableRowStyleFn, InfiniteTableRowClassNameFn, };
839
+ }
840
+ declare module "utils/join" {
841
+ const join: (...args: (string | number | void | null)[]) => string;
842
+ export { join };
843
+ }
844
+ declare module "components/InfiniteTable/internalProps" {
845
+ export const rootClassName = "ITable";
846
+ export const internalProps: {
847
+ rootClassName: string;
848
+ };
849
+ }
850
+ declare module "components/InfiniteTable/InfiniteTableContext" {
851
+ import { InfiniteTableContextValue } from "components/InfiniteTable/types/InfiniteTableContextValue";
852
+ export function getInfiniteTableContext<T>(): React.Context<InfiniteTableContextValue<T>>;
853
+ }
854
+ declare module "components/utils/buildSubscriptionCallback" {
855
+ import { SubscriptionCallback } from "components/types/SubscriptionCallback";
856
+ export function buildSubscriptionCallback<T>(): SubscriptionCallback<T>;
857
+ }
858
+ declare module "components/InfiniteTable/state/computeColumnGroupsDepths" {
859
+ import type { InfiniteTablePropColumnGroups } from "components/InfiniteTable/types/InfiniteTableProps";
860
+ import type { InfiniteTableColumnGroupsDepthsMap } from "components/InfiniteTable/types/InfiniteTableState";
861
+ export function computeColumnGroupsDepths(columnGroups: InfiniteTablePropColumnGroups): InfiniteTableColumnGroupsDepthsMap;
862
+ }
863
+ declare module "components/InfiniteTable/state/getInitialState" {
864
+ import { DataSourceState } from "components/DataSource/index";
865
+ import { InfiniteTableProps, InfiniteTableState } from "components/InfiniteTable/types/index";
866
+ import { InfiniteTableReadOnlyState } from "components/InfiniteTable/types/InfiniteTableState";
867
+ export function getInitialState<T>(params: {
868
+ props: InfiniteTableProps<T>;
869
+ parentState: DataSourceState<T>;
870
+ }): InfiniteTableState<T>;
871
+ export function deriveReadOnlyState<T>(params: {
872
+ props: InfiniteTableProps<T>;
873
+ state: InfiniteTableState<T>;
874
+ updated: Partial<InfiniteTableState<T>> | null;
875
+ parentState: DataSourceState<T>;
876
+ }): InfiniteTableReadOnlyState<T>;
877
+ }
878
+ declare module "components/ResizeObserver/index" {
879
+ import * as React from 'react';
880
+ import { OnResizeFn } from "components/types/Size";
881
+ interface ResizeObserverProps {
882
+ /**
883
+ * Specifies whether to call onResize after the initial render (on mount)
884
+ *
885
+ * @default true
886
+ */
887
+ notifyOnMount?: boolean;
888
+ /**
889
+ * If set to true, it will be attached using useLayoutEffect. If false, will be attached using useEffect
890
+ * @default false
891
+ */
892
+ earlyAttach?: boolean;
893
+ onResize: OnResizeFn;
894
+ }
895
+ export const setupResizeObserver: (node: HTMLElement, callback: OnResizeFn) => (() => void);
896
+ /**
897
+ * A hook that notifies you when a certain DOM element has changed it's size
898
+ *
899
+ * @param ref A React ref to a DOM element
900
+ * @param callback The function to be called when the element is resized.
901
+ */
902
+ export const useResizeObserver: (ref: React.MutableRefObject<HTMLElement | null>, callback: OnResizeFn, config?: {
903
+ earlyAttach: boolean;
904
+ }) => void;
905
+ const ReactResizeObserver: {
906
+ (props: ResizeObserverProps): JSX.Element;
907
+ defaultProps: {
908
+ notifyOnMount: boolean;
909
+ earlyAttach: boolean;
910
+ };
911
+ };
912
+ export default ReactResizeObserver;
913
+ }
914
+ declare module "components/InfiniteTable/hooks/useInfiniteTable" {
915
+ import type { InfiniteTableContextValue } from "components/InfiniteTable/types/index";
916
+ export const useInfiniteTable: <T>() => InfiniteTableContextValue<T>;
917
+ }
918
+ declare module "components/flexbox/index" {
919
+ import { RequireAtLeastOne } from "components/InfiniteTable/types/Utility";
920
+ type FlexItem = {
921
+ size?: number;
922
+ flex?: number;
923
+ maxSize?: number;
924
+ minSize?: number;
925
+ };
926
+ type FlexItemWithSizeOrFlex = RequireAtLeastOne<FlexItem, 'size' | 'flex'>;
927
+ type FlexComputeParams = {
928
+ availableSize: number;
929
+ minSize?: number;
930
+ maxSize?: number;
931
+ items: FlexItemWithSizeOrFlex[];
932
+ };
933
+ type SizedFlexItem = FlexItem & {
934
+ flexSize?: number;
935
+ computedSize?: number;
936
+ };
937
+ type FlexComputeResult = {
938
+ items: SizedFlexItem[];
939
+ flexSizes: number[];
940
+ computedSizes: number[];
941
+ remainingSize: number;
942
+ };
943
+ export const computeFlex: (params: FlexComputeParams) => FlexComputeResult;
944
+ }
945
+ declare module "components/InfiniteTable/utils/adjustColumnOrderForPinning" {
946
+ import { InfiniteTablePropColumnPinning } from "components/InfiniteTable/types/index";
947
+ import { InfiniteTablePropColumnOrderNormalized } from "components/InfiniteTable/types/InfiniteTableProps";
948
+ export const adjustColumnOrderForPinning: (columnOrder: InfiniteTablePropColumnOrderNormalized, columnPinning: InfiniteTablePropColumnPinning) => InfiniteTablePropColumnOrderNormalized;
949
+ }
950
+ declare module "components/InfiniteTable/utils/getComputedVisibleColumns" {
951
+ import type { InfiniteTableColumn, InfiniteTableComputedColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
952
+ import type { Size } from "components/types/Size";
953
+ import type { DataSourceSingleSortInfo } from "components/DataSource/types";
954
+ import type { InfiniteTableGeneratedColumns, InfiniteTablePropColumnOrder, InfiniteTablePropColumnOrderNormalized, InfiniteTablePropColumnPinning, InfiniteTablePropColumnVisibility } from "components/InfiniteTable/types/InfiniteTableProps";
955
+ export type SortInfoMap<T> = {
956
+ [key: string]: {
957
+ sortInfo: DataSourceSingleSortInfo<T>;
958
+ index: number;
959
+ };
960
+ };
961
+ export type GetComputedVisibleColumnsResult<T> = {
962
+ computedRemainingSpace: number;
963
+ computedPinnedStartColumnsWidth: number;
964
+ computedPinnedEndColumnsWidth: number;
965
+ computedUnpinnedColumnsWidth: number;
966
+ columnMinWidth?: number;
967
+ columnMaxWidth?: number;
968
+ columnDefaultWidth?: number;
969
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
970
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
971
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
972
+ computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
973
+ computedUnpinnedOffset: number;
974
+ computedPinnedEndOffset: number;
975
+ computedVisibleColumns: InfiniteTableComputedColumn<T>[];
976
+ computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
977
+ };
978
+ type GetComputedVisibleColumnsParam<T> = {
979
+ columns: Map<string, InfiniteTableColumn<T>>;
980
+ generatedColumns: InfiniteTableGeneratedColumns<T>;
981
+ bodySize: Size;
982
+ columnMinWidth?: number;
983
+ columnMaxWidth?: number;
984
+ columnDefaultWidth?: number;
985
+ sortable?: boolean;
986
+ multiSort: boolean;
987
+ sortInfo?: DataSourceSingleSortInfo<T>[];
988
+ setSortInfo: (sortInfo: DataSourceSingleSortInfo<T>[]) => void;
989
+ draggableColumns?: boolean;
990
+ columnOrder: InfiniteTablePropColumnOrder;
991
+ columnPinning: InfiniteTablePropColumnPinning;
992
+ columnVisibility: InfiniteTablePropColumnVisibility;
993
+ columnVisibilityAssumeVisible: boolean;
994
+ };
995
+ export const getComputedVisibleColumns: <T extends unknown>({ columns, generatedColumns, bodySize, columnMinWidth, columnMaxWidth, columnDefaultWidth, sortable, sortInfo, setSortInfo, multiSort, draggableColumns, columnOrder, columnPinning, columnVisibility, columnVisibilityAssumeVisible, }: GetComputedVisibleColumnsParam<T>) => GetComputedVisibleColumnsResult<T>;
996
+ }
997
+ declare module "components/hooks/useRerender" {
998
+ export const useRerender: () => [number, () => void];
999
+ }
1000
+ declare module "components/hooks/useInterceptedMap" {
1001
+ type InterceptedMapFns<K, V> = {
1002
+ set?: (k: K, v: V) => void;
1003
+ beforeClear?: (map: Map<K, V>) => void;
1004
+ clear?: () => void;
1005
+ delete?: (k: K) => void;
1006
+ };
1007
+ /**
1008
+ *
1009
+ * @param map Map to intercept
1010
+ * @param fns fns to inject
1011
+ * @returns a function to restore the map to initial methods
1012
+ */
1013
+ export function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>): () => void;
1014
+ export function useInterceptedMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>): void;
1015
+ }
1016
+ declare module "components/InfiniteTable/utils/rafFn" {
1017
+ export const rafFn: (fn: () => void) => () => void;
1018
+ }
1019
+ declare module "components/InfiniteTable/hooks/useRerenderOnKeyChange" {
1020
+ export const useRerenderOnKeyChange: <K extends unknown, V extends unknown>(map: Map<K, V>) => number;
1021
+ }
1022
+ declare module "components/InfiniteTable/hooks/useComputedVisibleColumns" {
1023
+ import type { DataSourceSingleSortInfo } from "components/DataSource/types";
1024
+ import type { InfiniteTableColumn } from "components/InfiniteTable/types/index";
1025
+ import type { InfiniteTableGeneratedColumns, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnVisibility } from "components/InfiniteTable/types/InfiniteTableProps";
1026
+ import type { Size } from "components/types/Size";
1027
+ import type { GetComputedVisibleColumnsResult } from "components/InfiniteTable/utils/getComputedVisibleColumns";
1028
+ type UseComputedVisibleColumnsParam<T> = {
1029
+ columns: Map<string, InfiniteTableColumn<T>>;
1030
+ generatedColumns: InfiniteTableGeneratedColumns<T>;
1031
+ bodySize: Size;
1032
+ columnMinWidth?: number;
1033
+ columnMaxWidth?: number;
1034
+ columnDefaultWidth?: number;
1035
+ sortable?: boolean;
1036
+ draggableColumns?: boolean;
1037
+ multiSort: boolean;
1038
+ sortInfo?: DataSourceSingleSortInfo<T>[];
1039
+ setSortInfo: (sortInfo: DataSourceSingleSortInfo<T>[]) => void;
1040
+ columnPinning: InfiniteTablePropColumnPinning;
1041
+ columnOrder: InfiniteTablePropColumnOrder;
1042
+ columnVisibility: InfiniteTablePropColumnVisibility;
1043
+ columnVisibilityAssumeVisible?: boolean;
1044
+ };
1045
+ type UseComputedVisibleColumnsResult<T> = {
1046
+ columns: UseComputedVisibleColumnsParam<T>['columns'];
1047
+ computedRemainingSpace: GetComputedVisibleColumnsResult<T>['computedRemainingSpace'];
1048
+ computedUnpinnedOffset: GetComputedVisibleColumnsResult<T>['computedUnpinnedOffset'];
1049
+ computedPinnedEndOffset: GetComputedVisibleColumnsResult<T>['computedPinnedEndOffset'];
1050
+ computedPinnedStartColumnsWidth: GetComputedVisibleColumnsResult<T>['computedPinnedStartColumnsWidth'];
1051
+ computedPinnedEndColumnsWidth: GetComputedVisibleColumnsResult<T>['computedPinnedEndColumnsWidth'];
1052
+ computedUnpinnedColumnsWidth: GetComputedVisibleColumnsResult<T>['computedUnpinnedColumnsWidth'];
1053
+ computedPinnedStartColumns: GetComputedVisibleColumnsResult<T>['computedPinnedStartColumns'];
1054
+ computedPinnedEndColumns: GetComputedVisibleColumnsResult<T>['computedPinnedEndColumns'];
1055
+ computedUnpinnedColumns: GetComputedVisibleColumnsResult<T>['computedUnpinnedColumns'];
1056
+ computedVisibleColumns: GetComputedVisibleColumnsResult<T>['computedVisibleColumns'];
1057
+ computedVisibleColumnsMap: GetComputedVisibleColumnsResult<T>['computedVisibleColumnsMap'];
1058
+ computedColumnOrder: GetComputedVisibleColumnsResult<T>['computedColumnOrder'];
1059
+ };
1060
+ export const useComputedVisibleColumns: <T extends unknown>({ columns, generatedColumns, bodySize, columnMinWidth, columnMaxWidth, columnDefaultWidth, sortable, draggableColumns, sortInfo, multiSort, setSortInfo, columnOrder, columnPinning, columnVisibility, columnVisibilityAssumeVisible, }: UseComputedVisibleColumnsParam<T>) => UseComputedVisibleColumnsResult<T>;
1061
+ }
1062
+ declare module "components/DataSource/publicHooks/useDataSourceActions" {
1063
+ import { DataSourceComponentActions } from "components/DataSource/types";
1064
+ export default function useDataSourceActions<T>(): DataSourceComponentActions<T>;
1065
+ }
1066
+ declare module "components/InfiniteTable/hooks/useColumnAggregations" {
1067
+ export function useColumnAggregations<T>(): void;
1068
+ }
1069
+ declare module "components/InfiniteTable/hooks/useColumnGroups" {
1070
+ export function useColumnGroups<T>(): void;
1071
+ }
1072
+ declare module "style/utilities" {
1073
+ export const ICSS: {
1074
+ variables: {
1075
+ space: [string, string, string, string, string, string, string, string, string, string, string];
1076
+ borderRadius: string;
1077
+ fontSize: [string, string, string, string, string, string, string, string];
1078
+ };
1079
+ alignItems: {
1080
+ center: string;
1081
+ stretch: string;
1082
+ };
1083
+ justifyContent: {
1084
+ center: string;
1085
+ 'flex-start': string;
1086
+ flexStart: string;
1087
+ 'flex-end': string;
1088
+ flexEnd: string;
1089
+ };
1090
+ overflow: {
1091
+ hidden: string;
1092
+ visible: string;
1093
+ auto: string;
1094
+ };
1095
+ overflowX: {
1096
+ hidden: string;
1097
+ visible: string;
1098
+ auto: string;
1099
+ };
1100
+ overflowY: {
1101
+ hidden: string;
1102
+ visible: string;
1103
+ auto: string;
1104
+ };
1105
+ cursor: {
1106
+ pointer: string;
1107
+ };
1108
+ height: {
1109
+ 0: string;
1110
+ '100%': string;
1111
+ };
1112
+ width: {
1113
+ 0: string;
1114
+ '100%': string;
1115
+ };
1116
+ top: {
1117
+ 0: string;
1118
+ '100%': string;
1119
+ };
1120
+ left: {
1121
+ 0: string;
1122
+ '100%': string;
1123
+ };
1124
+ transform: {
1125
+ translate3D000: string;
1126
+ };
1127
+ willChange: {
1128
+ transform: string;
1129
+ };
1130
+ position: {
1131
+ relative: string;
1132
+ absolute: string;
1133
+ fixed: string;
1134
+ };
1135
+ display: {
1136
+ flex: string;
1137
+ };
1138
+ flexFlow: {
1139
+ row: string;
1140
+ column: string;
1141
+ };
1142
+ whiteSpace: {
1143
+ nowrap: string;
1144
+ };
1145
+ textOverflow: {
1146
+ ellipsis: string;
1147
+ };
1148
+ userSelect: {
1149
+ none: string;
1150
+ };
1151
+ };
1152
+ }
1153
+ declare module "style/css" {
1154
+ export const cssEllipsisClassName: string;
1155
+ }
1156
+ declare module "components/InfiniteTable/components/icons/ExpanderIcon" {
1157
+ import * as React from 'react';
1158
+ type ExpanderIconProps = {
1159
+ size?: number;
1160
+ expanded?: boolean;
1161
+ defaultExpanded?: boolean;
1162
+ onChange?: (expanded: boolean) => void;
1163
+ style?: React.CSSProperties;
1164
+ className?: string;
1165
+ };
1166
+ export function ExpanderIcon(props: ExpanderIconProps): JSX.Element;
1167
+ }
1168
+ declare module "components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns" {
1169
+ import { DataSourcePropGroupRowsBy, DataSourcePropPivotBy } from "components/DataSource/index";
1170
+ import { InfiniteTableProps } from "components/InfiniteTable/types/index";
1171
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1172
+ export function getComputedPivotColumnsFromDataSourcePivotColumns<T>(pivotColumns: InfiniteTableProps<T>['pivotColumns'], params: {
1173
+ toggleGroupRow: (groupKeys: any[]) => void;
1174
+ pivotColumn: InfiniteTableProps<T>['pivotColumn'];
1175
+ pivotRowLabelsColumn: InfiniteTableProps<T>['pivotRowLabelsColumn'];
1176
+ pivotTotalColumnPosition: InfiniteTableComponentState<T>['pivotTotalColumnPosition'];
1177
+ pivotBy: DataSourcePropPivotBy<T>;
1178
+ groupRowsBy: DataSourcePropGroupRowsBy<T>;
1179
+ }): InfiniteTableProps<T>['pivotColumns'];
1180
+ }
1181
+ declare module "components/InfiniteTable/utils/getColumnForGroupBy" {
1182
+ import { DataSourceGroupRowsBy } from "components/DataSource/index";
1183
+ import { InfiniteTableGeneratedGroupColumn } from "components/InfiniteTable/types/InfiniteTableColumn";
1184
+ import { GroupColumnGetterOptions, InfiniteTablePropGroupColumn } from "components/InfiniteTable/types/InfiniteTableProps";
1185
+ export function getColumnForGroupBy<T>(options: GroupColumnGetterOptions<T> & {
1186
+ groupIndex: number;
1187
+ groupBy: DataSourceGroupRowsBy<T>;
1188
+ }, toggleGroupRow: (groupRowKeys: any[]) => void, groupColumnFromProps?: InfiniteTablePropGroupColumn<T>): InfiniteTableGeneratedGroupColumn<T>;
1189
+ export function getSingleGroupColumn<T>(options: GroupColumnGetterOptions<T>, toggleGroupRow: (groupRowKeys: any[]) => void, groupColumnFromProps?: InfiniteTablePropGroupColumn<T>): InfiniteTableGeneratedGroupColumn<T>;
1190
+ }
1191
+ declare module "components/InfiniteTable/hooks/useGeneratedGroupAndPivotColumns" {
1192
+ import { DataSourceGroupRowsBy } from "components/DataSource/index";
1193
+ import { InfiniteTableGeneratedColumns, InfiniteTablePropGroupRenderStrategy, InfiniteTableProps } from "components/InfiniteTable/types/InfiniteTableProps";
1194
+ export function useGeneratedGroupAndPivotColumns<T>(): void;
1195
+ export function getGeneratedGroupColumns<T>(params: {
1196
+ groupRowsBy: DataSourceGroupRowsBy<T>[];
1197
+ toggleGroupRow: (groupKeys: any[]) => void;
1198
+ groupColumn: InfiniteTableProps<T>['groupColumn'];
1199
+ groupRenderStrategy: InfiniteTablePropGroupRenderStrategy;
1200
+ pivotColumns: InfiniteTableProps<T>['pivotColumns'];
1201
+ }): InfiniteTableGeneratedColumns<T>;
1202
+ }
1203
+ declare module "components/InfiniteTable/hooks/useComputed" {
1204
+ import { InfiniteTableComputedValues } from "components/InfiniteTable/types/index";
1205
+ export function useComputed<T>(): InfiniteTableComputedValues<T>;
1206
+ }
1207
+ declare module "components/InfiniteTable/hooks/useInternalProps" {
1208
+ export const useInternalProps: () => {
1209
+ rootClassName: string;
1210
+ };
1211
+ export const getInternalProps: () => {
1212
+ rootClassName: string;
1213
+ };
1214
+ }
1215
+ declare module "components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody" {
1216
+ import * as React from 'react';
1217
+ export const InfiniteTableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
1218
+ }
1219
+ declare module "components/InfiniteTable/components/InfiniteTableBody/index" {
1220
+ export * from "components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody";
1221
+ }
1222
+ declare module "utils/getGlobal" {
1223
+ export function getGlobal<T extends Window>(): T;
1224
+ }
1225
+ declare module "components/utils/getScrollbarWidth" {
1226
+ export function getScrollbarWidth(): number;
1227
+ }
1228
+ declare module "components/VirtualBrain/index" {
1229
+ import { Logger } from "utils/debug";
1230
+ import { Size } from "components/types/Size";
1231
+ import type { OnScrollFn, ScrollPosition } from "components/types/ScrollPosition";
1232
+ type MainAxisOptions = 'vertical' | 'horizontal';
1233
+ export type VirtualBrainOptions = {
1234
+ mainAxis: MainAxisOptions;
1235
+ itemSize: MainAxisSize;
1236
+ count: number;
1237
+ name?: string;
1238
+ };
1239
+ export type MainAxisSize = number | ((itemIndex: number) => number);
1240
+ type OnRenderCountChangeFn = (renderCount: number) => void;
1241
+ type OnSizeChangeFn = (size: number) => void;
1242
+ export type GetItemPositionFn = (itemIndex: number) => number;
1243
+ export type RenderRange = {
1244
+ renderStartIndex: number;
1245
+ renderEndIndex: number;
1246
+ };
1247
+ export type OnRenderRangeChangeFn = (renderRange: RenderRange) => void;
1248
+ export class VirtualBrain extends Logger {
1249
+ private scrollPosition;
1250
+ private scrollPositionOnMainAxis;
1251
+ private itemSizeCache;
1252
+ private itemOffsetCache;
1253
+ private options;
1254
+ private totalSize;
1255
+ private onScrollFns;
1256
+ private onTotalSizeChangeFns;
1257
+ private onRenderCountChangeFns;
1258
+ private onRenderRangeChangeFns;
1259
+ name: string | undefined;
1260
+ private renderCount;
1261
+ private renderRange;
1262
+ private availableSize;
1263
+ constructor(options: VirtualBrainOptions);
1264
+ setAvailableSize: (size: Size) => void;
1265
+ getOptions(): VirtualBrainOptions;
1266
+ private updateRenderCount;
1267
+ private computeRenderCount;
1268
+ private setRenderCount;
1269
+ private updateRenderRange;
1270
+ getRenderStartIndex(): number;
1271
+ getRenderCount: () => number;
1272
+ setScrollPosition: (scrollPosition: ScrollPosition) => void;
1273
+ private notifyScrollChange;
1274
+ private notifyTotalSizeChange;
1275
+ private notifyRenderCountChange;
1276
+ private notifyRenderRangeChange;
1277
+ getRenderRange: () => RenderRange;
1278
+ private setRenderRange;
1279
+ private computeRenderRange;
1280
+ getScrollPosition: () => ScrollPosition;
1281
+ onScroll: (fn: OnScrollFn) => () => void;
1282
+ onTotalSizeChange: (fn: OnSizeChangeFn) => () => void;
1283
+ onRenderCountChange: (fn: OnRenderCountChangeFn) => () => void;
1284
+ onRenderRangeChange: (fn: OnRenderRangeChangeFn) => () => void;
1285
+ update: (newCount: VirtualBrainOptions['count'], newItemSize: VirtualBrainOptions['itemSize']) => void;
1286
+ private reset;
1287
+ private computeCacheFor;
1288
+ private getItemSizeCacheFor;
1289
+ getItemSize: (itemIndex: number) => number;
1290
+ getTotalSize: () => number;
1291
+ getItemAt: (scrollPos: number) => number;
1292
+ getItemOffsetFor: (itemIndex: number) => number;
1293
+ destroy: () => void;
1294
+ }
1295
+ }
1296
+ declare module "components/InfiniteTable/components/ScrollbarPlaceholder" {
1297
+ import * as React from 'react';
1298
+ function HorizontalScrollbarPlaceholderFn(props: {
1299
+ style: React.CSSProperties;
1300
+ }): JSX.Element | null;
1301
+ export const HorizontalScrollbarPlaceholder: React.MemoExoticComponent<typeof HorizontalScrollbarPlaceholderFn>;
1302
+ function VerticalScrollbarPlaceholderFn(props: {
1303
+ style: React.CSSProperties;
1304
+ }): JSX.Element | null;
1305
+ export const VerticalScrollbarPlaceholder: React.MemoExoticComponent<typeof VerticalScrollbarPlaceholderFn>;
1306
+ }
1307
+ declare module "components/InfiniteTable/hooks/useInfiniteTableState" {
1308
+ import { InfiniteTableState } from "components/InfiniteTable/types/index";
1309
+ export const useInfiniteTableState: <T>() => InfiniteTableState<T>;
1310
+ }
1311
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes" {
1312
+ import { CSSProperties } from 'react';
1313
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/index";
1314
+ import { Renderable } from "components/types/Renderable";
1315
+ import { OnResizeFn } from "components/types/Size";
1316
+ import { InfiniteTableEnhancedData } from "components/InfiniteTable/types/index";
1317
+ import { InfiniteTableToggleGroupRowFn } from "components/InfiniteTable/types/InfiniteTableColumn";
1318
+ export interface InfiniteTableCellProps<T> {
1319
+ column: InfiniteTableComputedColumn<T>;
1320
+ cssEllipsis?: boolean;
1321
+ children: Renderable;
1322
+ virtualized?: boolean;
1323
+ skipColumnShifting?: boolean;
1324
+ beforeChildren?: Renderable;
1325
+ afterChildren?: Renderable;
1326
+ offset?: number;
1327
+ offsetProperty?: 'left' | 'right';
1328
+ cssPosition?: CSSProperties['position'];
1329
+ domRef?: React.RefCallback<HTMLElement>;
1330
+ }
1331
+ export interface InfiniteTableColumnCellProps<T> extends Omit<InfiniteTableCellProps<T>, 'children'> {
1332
+ virtualized: boolean;
1333
+ enhancedData: InfiniteTableEnhancedData<T>;
1334
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1335
+ rowIndex: number;
1336
+ }
1337
+ export interface InfiniteTableHeaderCellProps<T> extends Omit<InfiniteTableCellProps<T>, 'children'> {
1338
+ columns: Map<string, InfiniteTableComputedColumn<T>>;
1339
+ headerHeight: number;
1340
+ onResize?: OnResizeFn;
1341
+ }
1342
+ }
1343
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell" {
1344
+ import * as React from 'react';
1345
+ import { InfiniteTableCellProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes";
1346
+ export const InfiniteTableCellClassName: string;
1347
+ function InfiniteTableCellFn<T>(props: InfiniteTableCellProps<T> & React.HTMLAttributes<HTMLElement>): JSX.Element;
1348
+ export const InfiniteTableCell: typeof InfiniteTableCellFn;
1349
+ }
1350
+ declare module "components/InfiniteTable/utils/moveXatY" {
1351
+ export const moveXatY: <T>(arr: T[], dragIndex: number, dropIndex: number) => T[];
1352
+ }
1353
+ declare module "components/InfiniteTable/hooks/useColumnPointerEvents" {
1354
+ import * as React from 'react';
1355
+ import { MutableRefObject } from 'react';
1356
+ import type { InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1357
+ type TopLeft = {
1358
+ left: number;
1359
+ top: number;
1360
+ };
1361
+ type TopLeftOrNull = TopLeft | null;
1362
+ export const useColumnPointerEvents: <T>({ columnId, domRef, columns, computedRemainingSpace, }: {
1363
+ computedRemainingSpace: number;
1364
+ columns: Map<string, InfiniteTableComputedColumn<T>>;
1365
+ columnId: string;
1366
+ domRef: React.MutableRefObject<HTMLElement | null>;
1367
+ }) => {
1368
+ onPointerUp: (e: any) => void;
1369
+ onPointerDown: (e: any) => void;
1370
+ dragging: boolean;
1371
+ proxyOffset: TopLeftOrNull;
1372
+ draggingDiff: TopLeft;
1373
+ };
1374
+ }
1375
+ declare module "components/InfiniteTable/hooks/useCellClassName" {
1376
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1377
+ export function useCellClassName<T>(column: InfiniteTableComputedColumn<T>, baseClasses: string[]): string;
1378
+ }
1379
+ declare module "components/InfiniteTable/components/icons/SortIcon" {
1380
+ import * as React from 'react';
1381
+ type SortIconProps = {
1382
+ direction: 1 | -1 | 0;
1383
+ size?: number;
1384
+ lineWidth?: number;
1385
+ lineStyle?: React.CSSProperties;
1386
+ style?: React.CSSProperties;
1387
+ className?: string;
1388
+ index?: number;
1389
+ };
1390
+ export function SortIcon(props: SortIconProps): JSX.Element | null;
1391
+ }
1392
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell" {
1393
+ import { InfiniteTableHeaderCellProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes";
1394
+ export function InfiniteTableHeaderCell<T>(props: InfiniteTableHeaderCellProps<T>): JSX.Element;
1395
+ }
1396
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes" {
1397
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/index";
1398
+ import { Renderable } from "components/types/Renderable";
1399
+ import { VirtualBrain } from "components/VirtualBrain/index";
1400
+ import { InfiniteTableComputedColumnGroup } from "components/InfiniteTable/types/InfiniteTableProps";
1401
+ export type InfiniteTableHeaderProps<T> = {
1402
+ repaintId?: string | number;
1403
+ brain: VirtualBrain;
1404
+ columns: InfiniteTableComputedColumn<T>[];
1405
+ totalWidth: number;
1406
+ };
1407
+ export type InfiniteTableHeaderGroupProps<T> = {
1408
+ columns: InfiniteTableComputedColumn<T>[];
1409
+ columnGroup: InfiniteTableComputedColumnGroup;
1410
+ children: Renderable;
1411
+ height: number;
1412
+ headerHeight: number;
1413
+ };
1414
+ export type InfiniteTableHeaderUnvirtualizedProps<T> = Omit<InfiniteTableHeaderProps<T>, 'repaintId' | 'brain'> & {
1415
+ brain?: VirtualBrain;
1416
+ scrollable?: boolean;
1417
+ };
1418
+ }
1419
+ declare module "components/RawList/types" {
1420
+ import type { RefCallback } from 'react';
1421
+ import type { Renderable } from "components/types/Renderable";
1422
+ import type { VirtualBrain } from "components/VirtualBrain/index";
1423
+ export type RenderItemParam = {
1424
+ domRef: RefCallback<HTMLElement>;
1425
+ itemIndex: number;
1426
+ itemSize: number;
1427
+ };
1428
+ export type RenderItem = (renderProps: RenderItemParam) => Renderable;
1429
+ export type RawListProps = {
1430
+ debugChannel?: string;
1431
+ renderItem: RenderItem;
1432
+ brain: VirtualBrain;
1433
+ repaintId?: string | number;
1434
+ };
1435
+ }
1436
+ declare module "components/RawList/MappedItems" {
1437
+ import { Logger } from "utils/debug";
1438
+ import { Renderable } from "components/types/Renderable";
1439
+ export class MappedItems extends Logger {
1440
+ private elementIndexToItemIndex;
1441
+ private itemIndexToElementIndex;
1442
+ private renderedElements;
1443
+ constructor(axis: string);
1444
+ init(): void;
1445
+ destroy(): void;
1446
+ getUnrenderedItems: (startIndex: number, endIndex: number) => number[];
1447
+ getElementsOutsideItemRange: (startIndex: number, endIndex: number) => number[];
1448
+ getFirstUnrenderedElementIndex: (endIndex: number, startFrom?: number) => number;
1449
+ getElementIndexForItem: (itemIndex: number) => number | null;
1450
+ isRenderedItem: (itemIndex: number) => boolean;
1451
+ isElementRendered: (elementIndex: number) => boolean;
1452
+ getItemRenderedAtElementIndex: (elementIndex: number) => number | null;
1453
+ getRenderedElement: (elementIndex: number) => Renderable;
1454
+ getRenderedElementAtItemIndex: (itemIndex: number) => Renderable;
1455
+ renderItemAtElement(itemIndex: number, elementIndex: number, renderNode?: Renderable): void;
1456
+ discardItem: (itemIndex: number) => void;
1457
+ discardElement: (elementIndex: number) => boolean;
1458
+ discardElementsStartingWith: (elementIndex: number, callback?: ((index: number) => void) | undefined) => boolean;
1459
+ }
1460
+ }
1461
+ declare module "components/RawList/AvoidReactDiff" {
1462
+ import * as React from 'react';
1463
+ import { Renderable } from "components/types/Renderable";
1464
+ import { SubscriptionCallback } from "components/types/SubscriptionCallback";
1465
+ export type AvoidReactDiffProps = {
1466
+ name?: string;
1467
+ updater: SubscriptionCallback<Renderable>;
1468
+ };
1469
+ function AvoidReactDiffFn(props: AvoidReactDiffProps): JSX.Element;
1470
+ export const AvoidReactDiff: React.MemoExoticComponent<typeof AvoidReactDiffFn>;
1471
+ }
1472
+ declare module "components/RawList/ReactVirtualRenderer" {
1473
+ import type { Renderable } from "components/types/Renderable";
1474
+ import type { RenderItem } from "components/RawList/types";
1475
+ import type { RenderRange } from "components/VirtualBrain/index";
1476
+ import { Logger } from "utils/debug";
1477
+ import { VirtualBrain } from "components/VirtualBrain/index";
1478
+ export class ReactVirtualRenderer extends Logger {
1479
+ private mappedItems;
1480
+ private destroyed;
1481
+ private itemDOMElements;
1482
+ private itemDOMRefs;
1483
+ private updaters;
1484
+ private onRender;
1485
+ private brain;
1486
+ private items;
1487
+ prevLength: number;
1488
+ constructor(brain: VirtualBrain, { onRender, channel, }: {
1489
+ onRender?: ReactVirtualRenderer['onRender'];
1490
+ channel?: string;
1491
+ });
1492
+ renderRange: (range: RenderRange, { renderItem, force, onRender, }: {
1493
+ renderItem: RenderItem;
1494
+ force: boolean;
1495
+ onRender?: ((items: Renderable[]) => void) | undefined;
1496
+ }) => Renderable[];
1497
+ private renderElement;
1498
+ private renderItemAtElement;
1499
+ private updateElementPosition;
1500
+ destroy: () => void;
1501
+ }
1502
+ }
1503
+ declare module "components/RawList/index" {
1504
+ import * as React from 'react';
1505
+ import { RawListProps } from "components/RawList/types";
1506
+ export const RawList: React.FC<RawListProps>;
1507
+ }
1508
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader" {
1509
+ import * as React from 'react';
1510
+ import type { InfiniteTableHeaderProps } from "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes";
1511
+ export const TableHeaderClassName: string;
1512
+ function InfiniteTableHeaderFn<T>(props: InfiniteTableHeaderProps<T> & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
1513
+ export const InfiniteTableHeader: typeof InfiniteTableHeaderFn;
1514
+ }
1515
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree" {
1516
+ import { InfiniteTableColumnGroup, InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1517
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1518
+ export type ColGroupTreeBaseItem = {
1519
+ id: string;
1520
+ groupOffset: number;
1521
+ depth: number;
1522
+ computedWidth: number;
1523
+ };
1524
+ export type ColGroupTreeColumnItem<T> = ColGroupTreeBaseItem & {
1525
+ type: 'column';
1526
+ ref: InfiniteTableComputedColumn<T>;
1527
+ };
1528
+ export type ColGroupTreeGroupItem<T> = ColGroupTreeBaseItem & {
1529
+ type: 'group';
1530
+ ref: InfiniteTableColumnGroup;
1531
+ uniqueGroupId: string[];
1532
+ children: ColGroupTreeItem<T>[];
1533
+ columnItems: ColGroupTreeColumnItem<T>[];
1534
+ };
1535
+ export type ColGroupTreeItem<T> = ColGroupTreeColumnItem<T> | ColGroupTreeGroupItem<T>;
1536
+ export function buildColumnAndGroupTree<T>(columns: InfiniteTableComputedColumn<T>[], columnGroups: InfiniteTableComponentState<T>['columnGroups'], columnGroupsDepthsMap: InfiniteTableComponentState<T>['columnGroupsDepthsMap']): ColGroupTreeItem<T>[];
1537
+ }
1538
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup" {
1539
+ import { InfiniteTableHeaderGroupProps } from "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes";
1540
+ export const TableHeaderGroupClassName: string;
1541
+ export function InfiniteTableHeaderGroup<T>(props: InfiniteTableHeaderGroupProps<T>): JSX.Element;
1542
+ }
1543
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups" {
1544
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1545
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1546
+ type BuildColumnHeaderGroupsConfig<T> = {
1547
+ columnGroups: InfiniteTableComponentState<T>['columnGroups'];
1548
+ columnGroupsDepthsMap: InfiniteTableComponentState<T>['columnGroupsDepthsMap'];
1549
+ columnGroupsMaxDepth: number;
1550
+ columns: InfiniteTableComputedColumn<T>[];
1551
+ headerHeight: number;
1552
+ allVisibleColumns: Map<string, InfiniteTableComputedColumn<T>>;
1553
+ };
1554
+ export function renderColumnHeaderGroups<T>(config: BuildColumnHeaderGroupsConfig<T>): JSX.Element[];
1555
+ }
1556
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized" {
1557
+ import * as React from 'react';
1558
+ import { InfiniteTableHeaderUnvirtualizedProps } from "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderTypes";
1559
+ export const TableHeaderClassName: string;
1560
+ function InfiniteTableHeaderUnvirtualizedFn<T>(props: InfiniteTableHeaderUnvirtualizedProps<T> & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
1561
+ export const InfiniteTableHeaderUnvirtualized: typeof InfiniteTableHeaderUnvirtualizedFn;
1562
+ }
1563
+ declare module "components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper" {
1564
+ import { VirtualBrain } from "components/VirtualBrain/index";
1565
+ export type TableHeaderWrapperProps = {
1566
+ brain: VirtualBrain;
1567
+ scrollbars: {
1568
+ vertical: boolean;
1569
+ horizontal: boolean;
1570
+ };
1571
+ repaintId?: number | string;
1572
+ };
1573
+ export function TableHeaderWrapper<T>(props: TableHeaderWrapperProps): JSX.Element;
1574
+ }
1575
+ declare module "components/hooks/useOnScroll" {
1576
+ import { RefObject } from 'react';
1577
+ type OnScroll = (scrollPosition: {
1578
+ scrollTop: number;
1579
+ scrollLeft: number;
1580
+ }) => void;
1581
+ export const useOnScroll: (domRef: RefObject<HTMLElement>, onScroll: OnScroll | undefined) => void;
1582
+ }
1583
+ declare module "components/VirtualScrollContainer/getScrollableClassName" {
1584
+ import { ICSS } from "style/utilities";
1585
+ export type Scrollable = boolean | keyof typeof ICSS['overflow'] | {
1586
+ vertical: boolean | keyof typeof ICSS['overflow'];
1587
+ horizontal: boolean | keyof typeof ICSS['overflow'];
1588
+ };
1589
+ export const getScrollableClassName: (scrollable: Scrollable) => string;
1590
+ }
1591
+ declare module "components/VirtualScrollContainer/index" {
1592
+ import * as React from 'react';
1593
+ import { CSSProperties } from 'react';
1594
+ import { Scrollable } from "components/VirtualScrollContainer/getScrollableClassName";
1595
+ import { Renderable } from "components/types/Renderable";
1596
+ export type { Scrollable };
1597
+ export interface VirtualScrollContainerProps {
1598
+ className?: string;
1599
+ style?: CSSProperties;
1600
+ children?: Renderable;
1601
+ scrollable?: Scrollable;
1602
+ onContainerScroll?: (scrollPos: {
1603
+ scrollTop: number;
1604
+ scrollLeft: number;
1605
+ }) => void;
1606
+ }
1607
+ export const VirtualScrollContainer: React.ForwardRefExoticComponent<VirtualScrollContainerProps & React.RefAttributes<HTMLDivElement>>;
1608
+ }
1609
+ declare module "components/VirtualList/SpacePlaceholder" {
1610
+ import * as React from 'react';
1611
+ interface SpacePlaceholderProps {
1612
+ width: number;
1613
+ height: number;
1614
+ count: number;
1615
+ }
1616
+ function SpacePlaceholderFn(props: SpacePlaceholderProps): JSX.Element;
1617
+ export const SpacePlaceholder: React.MemoExoticComponent<typeof SpacePlaceholderFn>;
1618
+ }
1619
+ declare module "components/VirtualList/types" {
1620
+ import type { MutableRefObject, RefCallback } from 'react';
1621
+ import type { Renderable } from "components/types/Renderable";
1622
+ import type { Scrollable } from "components/VirtualScrollContainer/index";
1623
+ import type { VirtualBrain } from "components/VirtualBrain/index";
1624
+ import type { RenderItem } from "components/RawList/types";
1625
+ export type OnContainerScrollFn = (scrollInfo: {
1626
+ scrollLeft: number;
1627
+ scrollTop: number;
1628
+ }) => void;
1629
+ interface BaseVirtualListProps {
1630
+ brain: VirtualBrain;
1631
+ count: number;
1632
+ sizeRef?: MutableRefObject<HTMLElement | null>;
1633
+ scrollable?: Scrollable;
1634
+ outerChildren?: Renderable;
1635
+ onContainerScroll?: OnContainerScrollFn;
1636
+ children?: Renderable;
1637
+ repaintId?: number | string;
1638
+ }
1639
+ export interface VirtualListProps extends BaseVirtualListProps {
1640
+ mainAxis: 'vertical' | 'horizontal';
1641
+ renderItem: RenderItem;
1642
+ itemMainAxisSize: number | ((itemIndex: number) => number);
1643
+ mainAxisSize?: number;
1644
+ itemCrossAxisSize?: number;
1645
+ }
1646
+ export type RowHeight = number | ((rowIndex: number) => number);
1647
+ export interface VirtualRowListProps extends BaseVirtualListProps {
1648
+ renderRow: RenderRow;
1649
+ rowHeight: RowHeight;
1650
+ rowWidth?: number;
1651
+ }
1652
+ export type RenderRowParam = {
1653
+ domRef: RefCallback<HTMLElement>;
1654
+ rowIndex: number;
1655
+ rowHeight: number;
1656
+ };
1657
+ export type RenderColumnParam = {
1658
+ domRef: RefCallback<HTMLElement>;
1659
+ columnIndex: number;
1660
+ columnWidth: number;
1661
+ };
1662
+ export type RenderRow = (renderProps: RenderRowParam) => Renderable;
1663
+ export type RenderColumn = (renderProps: RenderColumnParam) => Renderable;
1664
+ }
1665
+ declare module "components/VirtualList/VirtualList" {
1666
+ import { HTMLProps } from 'react';
1667
+ import type { VirtualListProps } from "components/VirtualList/types";
1668
+ export const VirtualList: (props: VirtualListProps & HTMLProps<HTMLDivElement>) => JSX.Element;
1669
+ }
1670
+ declare module "components/VirtualList/VirtualRowList" {
1671
+ import { HTMLProps } from 'react';
1672
+ import { VirtualRowListProps } from "components/VirtualList/types";
1673
+ export const VirtualRowList: (props: VirtualRowListProps & HTMLProps<HTMLDivElement>) => JSX.Element;
1674
+ }
1675
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes" {
1676
+ import type { VirtualBrain } from "components/VirtualBrain/index";
1677
+ import type { ScrollPosition } from "components/types/ScrollPosition";
1678
+ import type { InfiniteTableComputedColumn, InfiniteTableEnhancedData } from "components/InfiniteTable/types/index";
1679
+ import { InfiniteTableToggleGroupRowFn } from "components/InfiniteTable/types/InfiniteTableColumn";
1680
+ export interface InfiniteTableRowProps<T> {
1681
+ rowHeight: number;
1682
+ rowWidth: number;
1683
+ rowIndex: number;
1684
+ brain: VirtualBrain;
1685
+ domRef: React.RefCallback<HTMLElement>;
1686
+ enhancedData: InfiniteTableEnhancedData<T>;
1687
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1688
+ repaintId?: number | string;
1689
+ virtualizeColumns: boolean;
1690
+ showZebraRows?: boolean;
1691
+ columns: InfiniteTableComputedColumn<T>[];
1692
+ domProps?: React.HTMLAttributes<HTMLDivElement>;
1693
+ }
1694
+ export type InfiniteTableRowApi = {
1695
+ setScrollPosition: (scrollPosition: ScrollPosition) => void;
1696
+ };
1697
+ }
1698
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell" {
1699
+ import { InfiniteTableColumnCellProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCellTypes";
1700
+ function InfiniteTableColumnCellFn<T>(props: InfiniteTableColumnCellProps<T>): JSX.Element;
1701
+ export const InfiniteTableColumnCell: typeof InfiniteTableColumnCellFn;
1702
+ }
1703
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName" {
1704
+ export const InfiniteTableRowClassName: string;
1705
+ export const InfiniteTableRowClassName__hover: string;
1706
+ }
1707
+ declare module "components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps" {
1708
+ import { MutableRefObject, RefCallback } from 'react';
1709
+ import type { InfiniteTableRowProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes";
1710
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1711
+ export type TableRowHTMLAttributes = React.HTMLAttributes<HTMLDivElement> & {
1712
+ 'data-virtualize-columns': 'on' | 'off';
1713
+ 'data-row-index': number;
1714
+ 'data-row-id': string;
1715
+ ref: RefCallback<HTMLElement | null>;
1716
+ };
1717
+ export function useRowDOMProps<T>(props: InfiniteTableRowProps<T>, rowProps: InfiniteTableComponentState<T>['rowProps'], rowStyle: InfiniteTableComponentState<T>['rowStyle'], rowClassName: InfiniteTableComponentState<T>['rowClassName'], tableDOMRef: MutableRefObject<HTMLDivElement | null>): {
1718
+ domProps: TableRowHTMLAttributes;
1719
+ domRef: MutableRefObject<HTMLElement | null>;
1720
+ };
1721
+ }
1722
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow" {
1723
+ import * as React from 'react';
1724
+ import { InfiniteTableRowClassName } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName";
1725
+ import type { InfiniteTableRowProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes";
1726
+ function InfiniteTableRowFn<T>(props: InfiniteTableRowProps<T> & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
1727
+ export const InfiniteTableRow: typeof InfiniteTableRowFn;
1728
+ export { InfiniteTableRowClassName };
1729
+ }
1730
+ declare module "components/InfiniteTable/components/InfiniteTableRow/index" {
1731
+ export * from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow";
1732
+ }
1733
+ declare module "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized" {
1734
+ import type { InfiniteTableRowProps } from "components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowTypes";
1735
+ import { VirtualBrain } from "components/VirtualBrain/index";
1736
+ function TableRowUnvirtualizedFn<T>(props: InfiniteTableRowProps<T> & {
1737
+ brain: VirtualBrain | null | undefined;
1738
+ }): JSX.Element;
1739
+ export const TableRowUnvirtualized: typeof TableRowUnvirtualizedFn;
1740
+ }
1741
+ declare module "components/InfiniteTable/hooks/useUnpinnedRendering" {
1742
+ import type { VirtualBrain } from "components/VirtualBrain/index";
1743
+ import type { Size } from "components/types/Size";
1744
+ import type { InfiniteTableComputedColumn, InfiniteTableEnhancedData } from "components/InfiniteTable/types/index";
1745
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1746
+ import { InfiniteTableToggleGroupRowFn } from "components/InfiniteTable/types/InfiniteTableColumn";
1747
+ type UnpinnedRenderingParams<T> = {
1748
+ columnShifts: number[] | null;
1749
+ bodySize: Size;
1750
+ getData: () => InfiniteTableEnhancedData<T>[];
1751
+ rowHeight: number;
1752
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1753
+ repaintId: string | number;
1754
+ applyScrollHorizontal: ({ scrollLeft }: {
1755
+ scrollLeft: number;
1756
+ }) => void;
1757
+ verticalVirtualBrain: VirtualBrain;
1758
+ horizontalVirtualBrain: VirtualBrain;
1759
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
1760
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
1761
+ computedUnpinnedColumnsWidth: number;
1762
+ computedPinnedStartColumnsWidth: number;
1763
+ computedPinnedEndColumnsWidth: number;
1764
+ getState: () => InfiniteTableComponentState<T>;
1765
+ };
1766
+ export function useUnpinnedRendering<T>(params: UnpinnedRenderingParams<T>): JSX.Element | null;
1767
+ }
1768
+ declare module "components/InfiniteTable/hooks/useOnContainerScroll" {
1769
+ import { MutableRefObject } from 'react';
1770
+ import type { ScrollPosition } from "components/types/ScrollPosition";
1771
+ import { VirtualBrain } from "components/VirtualBrain/index";
1772
+ export const useOnContainerScroll: ({ verticalVirtualBrain, horizontalVirtualBrain, domRef, }: {
1773
+ verticalVirtualBrain: VirtualBrain;
1774
+ horizontalVirtualBrain: VirtualBrain;
1775
+ domRef: MutableRefObject<HTMLDivElement | null>;
1776
+ }) => {
1777
+ applyScrollHorizontal: ({ scrollLeft }: {
1778
+ scrollLeft: number;
1779
+ }) => void;
1780
+ applyScrollVertical: ({ scrollTop }: {
1781
+ scrollTop: number;
1782
+ }) => void;
1783
+ scrollPositionRef: MutableRefObject<ScrollPosition>;
1784
+ };
1785
+ }
1786
+ declare module "components/hooks/useOnMount" {
1787
+ import { RefObject } from 'react';
1788
+ export type OnMountProps = {
1789
+ onMount?: (node: HTMLElement) => void;
1790
+ onUnmount?: (node: HTMLElement) => void;
1791
+ };
1792
+ export function useOnMount(domRef: RefObject<HTMLElement>, props: OnMountProps): void;
1793
+ }
1794
+ declare module "components/VirtualList/RowListWithExternalScrolling" {
1795
+ import { CSSProperties } from 'react';
1796
+ import { VirtualBrain } from "components/VirtualBrain/index";
1797
+ import type { RenderRow } from "components/VirtualList/types";
1798
+ import type { ScrollPosition } from "components/types/ScrollPosition";
1799
+ import { OnMountProps } from "components/hooks/useOnMount";
1800
+ type RowListWithExternalScrollingListProps = {
1801
+ brain: VirtualBrain;
1802
+ renderRow: RenderRow;
1803
+ repaintId?: number | string;
1804
+ updateScroll?: (node: HTMLElement, scrollPosition: ScrollPosition) => void;
1805
+ style?: CSSProperties;
1806
+ className?: string;
1807
+ } & OnMountProps;
1808
+ export const RowListWithExternalScrolling: (props: RowListWithExternalScrollingListProps) => JSX.Element;
1809
+ }
1810
+ declare module "components/InfiniteTable/hooks/usePinnedRendering" {
1811
+ import { VirtualBrain } from "components/VirtualBrain/index";
1812
+ import { InfiniteTableComputedColumn, InfiniteTableEnhancedData } from "components/InfiniteTable/types/index";
1813
+ import type { Size } from "components/types/Size";
1814
+ import type { RenderRow } from "components/VirtualList/types";
1815
+ import { InfiniteTableComponentState } from "components/InfiniteTable/types/InfiniteTableState";
1816
+ import { InfiniteTableToggleGroupRowFn } from "components/InfiniteTable/types/InfiniteTableColumn";
1817
+ type UsePinnedParams<T> = {
1818
+ getState: () => InfiniteTableComponentState<T>;
1819
+ getData: () => InfiniteTableEnhancedData<T>[];
1820
+ bodySize: Size;
1821
+ repaintId: string | number;
1822
+ computedPinnedEndColumnsWidth: number;
1823
+ computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
1824
+ verticalVirtualBrain: VirtualBrain;
1825
+ scrollbars: {
1826
+ vertical: boolean;
1827
+ horizontal: boolean;
1828
+ };
1829
+ rowHeight: number;
1830
+ toggleGroupRow: InfiniteTableToggleGroupRowFn;
1831
+ computedPinnedStartColumnsWidth: number;
1832
+ computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
1833
+ };
1834
+ export function usePinnedEndRendering<T>(params: UsePinnedParams<T>): {
1835
+ renderRowPinnedEnd: RenderRow;
1836
+ pinnedEndList: JSX.Element | null;
1837
+ pinnedEndScrollbarPlaceholder: JSX.Element | null;
1838
+ };
1839
+ export function usePinnedStartRendering<T>(params: UsePinnedParams<T>): {
1840
+ renderRowPinnedStart: RenderRow;
1841
+ pinnedStartList: JSX.Element | null;
1842
+ pinnedStartScrollbarPlaceholder: JSX.Element | null;
1843
+ };
1844
+ }
1845
+ declare module "components/InfiniteTable/hooks/useColumnSizeFn" {
1846
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1847
+ /**
1848
+ * Returns a function that can be used to retrieve the width of an unpinned column, by the column index
1849
+ */
1850
+ export function useColumnSizeFn<T>(computedUnpinnedColumns: InfiniteTableComputedColumn<T>[]): (index: number) => number;
1851
+ }
1852
+ declare module "components/InfiniteTable/hooks/useYourBrain" {
1853
+ import { Size } from "components/types/Size";
1854
+ import { VirtualBrain } from "components/VirtualBrain/index";
1855
+ import { InfiniteTableComputedColumn } from "components/InfiniteTable/types/index";
1856
+ type UseYourBrainParam<T = any> = {
1857
+ computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
1858
+ computedPinnedStartColumnsWidth: number;
1859
+ computedPinnedEndColumnsWidth: number;
1860
+ dataArray: any[];
1861
+ rowHeight: number;
1862
+ bodySize: Size;
1863
+ };
1864
+ export function useYourBrain<T = any>(param: UseYourBrainParam<T>): {
1865
+ horizontalVirtualBrain: VirtualBrain;
1866
+ verticalVirtualBrain: VirtualBrain;
1867
+ };
1868
+ }
1869
+ declare module "utils/shallowEqualObjects" {
1870
+ export function shallowEqualObjects<T extends object | null>(objA: T, objB: T): boolean;
1871
+ }
1872
+ declare module "components/InfiniteTable/hooks/useListRendering" {
1873
+ import type { Ref } from 'react';
1874
+ import type { InfiniteTableComputedValues } from "components/InfiniteTable/types/index";
1875
+ import type { Size } from "components/types/Size";
1876
+ type ListRenderingParam<T> = {
1877
+ computed: InfiniteTableComputedValues<T>;
1878
+ domRef: Ref<HTMLElement>;
1879
+ bodySize: Size;
1880
+ columnShifts: number[] | null;
1881
+ getComputed: () => InfiniteTableComputedValues<T> | undefined;
1882
+ };
1883
+ import type { VirtualBrain } from "components/VirtualBrain/index";
1884
+ type ListRenderingResult = {
1885
+ scrollbars: {
1886
+ vertical: boolean;
1887
+ horizontal: boolean;
1888
+ };
1889
+ horizontalVirtualBrain: VirtualBrain;
1890
+ verticalVirtualBrain: VirtualBrain;
1891
+ applyScrollHorizontal: ({ scrollLeft }: {
1892
+ scrollLeft: number;
1893
+ }) => void;
1894
+ applyScrollVertical: ({ scrollTop }: {
1895
+ scrollTop: number;
1896
+ }) => void;
1897
+ pinnedStartList: JSX.Element | null;
1898
+ pinnedEndList: JSX.Element | null;
1899
+ pinnedStartScrollbarPlaceholder: JSX.Element | null;
1900
+ pinnedEndScrollbarPlaceholder: JSX.Element | null;
1901
+ centerList: JSX.Element | null;
1902
+ repaintId: number;
1903
+ reservedContentHeight: number;
1904
+ };
1905
+ export function useListRendering<T>(param: ListRenderingParam<T>): ListRenderingResult;
1906
+ }
1907
+ declare module "components/utils/decamelize" {
1908
+ export const decamelize: (input: string, options?: {
1909
+ separator: string;
1910
+ } | undefined) => string;
1911
+ }
1912
+ declare module "components/InfiniteTable/components/InfiniteTableLicenseFooter/index" {
1913
+ import * as React from 'react';
1914
+ export const InfiniteTableLicenseFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
1915
+ }
1916
+ declare module "components/InfiniteTable/hooks/useLicense/crc32" {
1917
+ export function crc32_compute_string(str: string, reversedPolynomial?: number): string;
1918
+ }
1919
+ declare module "components/InfiniteTable/hooks/useLicense/LicenseDetails" {
1920
+ export type LicenseDetails = {
1921
+ start: Date;
1922
+ end: Date;
1923
+ owner: string;
1924
+ distribution: boolean;
1925
+ trial: boolean;
1926
+ skipAirtable?: boolean;
1927
+ count?: number;
1928
+ timestamp?: number;
1929
+ ref: string;
1930
+ };
1931
+ }
1932
+ declare module "components/InfiniteTable/hooks/useLicense/decode" {
1933
+ import { LicenseDetails } from "components/InfiniteTable/hooks/useLicense/LicenseDetails";
1934
+ export const fieldsToLicenseDetails: (fields: {
1935
+ name: string;
1936
+ value: string;
1937
+ }[]) => LicenseDetails;
1938
+ export const logLicenseError: (lines: string[], fn?: (...line: string[]) => void) => void;
1939
+ export const isValidLicense: (licenseKey: string | undefined, packageInfo: {
1940
+ publishedAt: number;
1941
+ version: string;
1942
+ }, fn?: ((...args: string[]) => void) | undefined) => boolean;
1943
+ export const decode: (licenseKey: string) => LicenseDetails;
1944
+ }
1945
+ declare module "components/InfiniteTable/hooks/useLicense/useLicense" {
1946
+ export const useLicense: (licenseKey: string) => boolean;
1947
+ }
1948
+ declare module "components/CSSVariableWatch" {
1949
+ import * as React from 'react';
1950
+ type CSSVariableWatcherProps = {
1951
+ varName: string;
1952
+ onChange: (value: number) => void;
1953
+ };
1954
+ export const useCSSVariableWatch: (params: CSSVariableWatcherProps & {
1955
+ ref: React.MutableRefObject<HTMLElement | null>;
1956
+ }) => void;
1957
+ export const CSSVariableWatch: (props: CSSVariableWatcherProps) => JSX.Element;
1958
+ }
1959
+ declare module "components/InfiniteTable/index" {
1960
+ import * as React from 'react';
1961
+ import type { InfiniteTableProps } from "components/InfiniteTable/types/index";
1962
+ export const InfiniteTableClassName: string;
1963
+ export const InfiniteTableComponent: React.MemoExoticComponent<(<T>() => JSX.Element)>;
1964
+ export function InfiniteTable<T>(props: InfiniteTableProps<T>): JSX.Element;
1965
+ export namespace InfiniteTable {
1966
+ var defaultProps: {
1967
+ rowHeight: number;
1968
+ headerHeight: string;
1969
+ };
1970
+ }
1971
+ export * from "components/InfiniteTable/types/index";
1972
+ }
1973
+ declare module "@infinite-table/infinite-react" {
1974
+ export * from "components/InfiniteTable/index";
1975
+ export * from "components/DataSource/index";
1976
+ export { group, flatten } from "utils/groupAndPivot/index";
1977
+ }