UNPKG

1.81 kBTypeScriptView Raw
1import { Client } from '../client';
2import { Column, ColumnArray } from './column';
3import { View } from './view';
4import { Row, RowArray } from './row';
5import { ColumnConfig, EventCallback, FilterFn, SortFn } from '../types';
6import { Cell, CellArray } from './cell';
7import { UpdateCellInput, ViewInput } from './input.interface';
8import { Subscription } from 'rxjs';
9export declare class Table {
10 private _client;
11 workspaceId: string;
12 coreId: string;
13 id: string;
14 name: string;
15 views: Map<string, View>;
16 constructor(client: Client, workspaceId: string, coreId: string, id: string, name: string, views?: Map<string, View>);
17 onViewAdded(cb: EventCallback): Subscription;
18 onColumnAdded(cb: EventCallback): Subscription;
19 onRowAdded(cb: EventCallback): Subscription;
20 onCellUpdated(cb: EventCallback): Subscription;
21 on(cb: EventCallback): Subscription;
22 getCells(): CellArray;
23 addView(input: ViewInput): Promise<View>;
24 addRow(): Promise<Row>;
25 addColumn(columnConfig: ColumnConfig): Promise<Column>;
26 view(id: string): View;
27 updateCell(input: UpdateCellInput): Promise<Cell>;
28 addRows(number: number): Promise<RowArray>;
29 addColumns(input: ColumnConfig[]): Promise<ColumnArray>;
30 updateCells(input: UpdateCellInput[]): Promise<CellArray>;
31}
32export declare class TableArray {
33 private _client;
34 tables: Table[];
35 constructor(client: Client, tables: Table[]);
36 select(maxSize?: number | FilterFn, filter?: FilterFn): TableArray;
37 sort(sortFn: SortFn): TableArray;
38 onViewAdded(cb: EventCallback): Subscription[];
39 onColumnAdded(cb: EventCallback): Subscription[];
40 onRowAdded(cb: EventCallback): Subscription[];
41 onCellUpdated(cb: EventCallback): Subscription[];
42 on(cb: EventCallback): Subscription[];
43}