@honed/table 0.12.0 → 0.13.0

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/dist/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { Binding } from '@honed/action';
2
2
  import { BulkOperation } from '@honed/action';
3
3
  import { BulkSelection } from '@honed/action';
4
- import { Executable } from '@honed/action';
5
4
  import { HonedRefine } from '@honed/refine';
6
5
  import { InlineOperation } from '@honed/action';
7
- import { MaybeEndpoint } from '@honed/action';
8
- import { MaybeId } from '@honed/action';
9
6
  import { PageOperation } from '@honed/action';
10
7
  import { PageOperationData } from '@honed/action';
11
8
  import { RecordBinding } from '@honed/action';
@@ -55,7 +52,6 @@ export declare interface HonedColumn<T extends Record<string, any> = Record<stri
55
52
  }
56
53
 
57
54
  export declare interface HonedTable<T extends Record<string, any> = Record<string, any>, K extends Paginate = "length-aware"> extends HonedRefine {
58
- id: Exclude<MaybeId, undefined>;
59
55
  meta: Record<string, any> | null;
60
56
  emptyState: EmptyState | null;
61
57
  views: View[];
@@ -76,8 +72,12 @@ export declare interface HonedTable<T extends Record<string, any> = Record<strin
76
72
  columns: HonedColumn<T>[];
77
73
  records: TableRecord<T>[];
78
74
  inline: boolean;
79
- bulk: Executable<BulkOperation>[];
80
- page: Executable<PageOperation>[];
75
+ bulk: (BulkOperation & {
76
+ execute: (options?: VisitOptions) => void;
77
+ })[];
78
+ page: (PageOperation & {
79
+ execute: (options?: VisitOptions) => void;
80
+ })[];
81
81
  pages: PageOption[];
82
82
  currentPage: PageOption | undefined;
83
83
  paginator: PaginateMap[K];
@@ -142,25 +142,22 @@ export declare interface SimplePaginate extends CursorPaginate {
142
142
  }
143
143
 
144
144
  export declare interface Table<T extends Record<string, any> = Record<string, any>, K extends Paginate = "length-aware"> extends Refine {
145
- id: MaybeId;
146
- endpoint: MaybeEndpoint;
147
- key: string;
148
- column?: string;
149
- record?: string;
150
- page?: string;
145
+ _column_key?: string;
146
+ _record_key?: string;
147
+ _page_key?: string;
148
+ toggleable: boolean;
151
149
  records: Array<TableEntry<T> & {
152
150
  operations: InlineOperation[];
153
151
  }>;
154
152
  paginate: PaginateMap[K];
155
153
  columns: Column<T>[];
156
154
  pages: PageOption[];
157
- toggleable: boolean;
158
155
  operations: {
159
156
  inline: boolean;
160
157
  bulk: BulkOperation[];
161
158
  page: PageOperation[];
162
159
  };
163
- emptyState?: EmptyState;
160
+ state?: EmptyState;
164
161
  views?: View[];
165
162
  meta: Record<string, any>;
166
163
  }
@@ -173,6 +170,7 @@ export declare type TableEntry<T extends Record<string, any> = Record<string, an
173
170
  f: boolean;
174
171
  };
175
172
  } & {
173
+ _key: Identifier;
176
174
  class: string | null;
177
175
  };
178
176
 
@@ -183,19 +181,20 @@ export declare interface TableOptions<T extends Record<string, any> = Record<str
183
181
  recordOperations?: Record<string, (record: TableEntry<T>) => void>;
184
182
  }
185
183
 
186
- export declare interface TableRecord<T extends Record<string, any> = Record<string, any>> {
187
- operations: Executable<InlineOperation>[];
188
- class: string | null;
184
+ export declare type TableRecord<T extends Record<string, any> = Record<string, any>> = TableEntry<T> & {
185
+ operations: (InlineOperation & {
186
+ execute: (options?: VisitOptions) => void;
187
+ })[];
188
+ selected: boolean;
189
189
  default: (options?: VisitOptions) => void;
190
190
  select: () => void;
191
191
  deselect: () => void;
192
192
  toggle: () => void;
193
- selected: boolean;
194
193
  bind: () => RecordBinding<Identifier>;
195
- entry: (column: HonedColumn<T> | string) => TableEntry<T>[keyof T] | null;
196
- value: (column: HonedColumn<T> | string) => TableEntry<T>[keyof T]["v"] | null;
197
- extra: (column: HonedColumn<T> | string) => TableEntry<T>[keyof T]["e"] | null;
198
- }
194
+ entry: (column: Column<T> | string) => TableEntry<T>[keyof T] | null;
195
+ value: (column: Column<T> | string) => TableEntry<T>[keyof T]["v"] | null;
196
+ extra: (column: Column<T> | string) => TableEntry<T>[keyof T]["e"] | null;
197
+ };
199
198
 
200
199
  export declare type UseTable = typeof useTable;
201
200