UNPKG

3.7 kBTypeScriptView Raw
1import { Observable } from 'rxjs';
2import { Metadata } from 'grpc';
3import { WorkspaceId, CreateWorkspaceInput, CoreId, AddCoreInput, AddTableInput, TableId, ColumnId, AddColumnInput, RowId, AddRowInput, UpdateCellInput, WorkspaceSubscriptionInput, EventPayload, ColumnConfigInput, WorkspacesResult, TableProjection, AddViewInput, ViewId, ViewDefinitionInput, GetTableInput, UpdateCoreInput, WorkspaceProjection, GetWorkspaceInput, GetCoreInput, CoreProjection, CoresResult, GetCoresInput, GetTablesInput, TablesResult, CellData, CellValueInput, UpdateCellActionInput, ForeignRowValue, ForeignRowVisibleNameValue, Attachment, Choice } from './proto/service_pb';
4import { TreeLabApiServiceClient } from './proto/service_grpc_pb';
5import { Resource, EventPayloadNew } from './types';
6export declare class Client {
7 private _serviceClient;
8 private _metadata;
9 constructor(client: TreeLabApiServiceClient, metadata: Metadata);
10 unaryCall<T, R>(call: Function, request: T): Promise<R>;
11 createWorkspaceInput(obj: CreateWorkspaceInput.AsObject): CreateWorkspaceInput;
12 addCoreInput(obj: AddCoreInput.AsObject): AddCoreInput;
13 updateCoreInput(obj: UpdateCoreInput.AsObject): UpdateCoreInput;
14 addTableInput(obj: AddTableInput.AsObject): AddTableInput;
15 viewDefinitionInput(obj: ViewDefinitionInput.AsObject): ViewDefinitionInput;
16 addViewInput(obj: AddViewInput.AsObject): AddViewInput;
17 choiceInput(obj: Choice.AsObject): Choice;
18 columnConfigInput(obj: ColumnConfigInput.AsObject): ColumnConfigInput;
19 addColumnInput(obj: AddColumnInput.AsObject): AddColumnInput;
20 addRowInput(obj: AddRowInput.AsObject): AddRowInput;
21 foreignRowVisibleNameValue(obj: ForeignRowVisibleNameValue.AsObject): ForeignRowVisibleNameValue;
22 foreignRowValue(obj: ForeignRowValue.AsObject): ForeignRowValue;
23 attachment(obj: Attachment.AsObject): Attachment;
24 cellData(obj: CellData.AsObject): CellData;
25 cellValueInput(obj: CellValueInput.AsObject): CellValueInput;
26 updateCellInput(obj: UpdateCellInput.AsObject): UpdateCellInput;
27 updateCellActionInput(obj: UpdateCellActionInput.AsObject): UpdateCellActionInput;
28 workspaceSubscriptionInput(obj: WorkspaceSubscriptionInput.AsObject): WorkspaceSubscriptionInput;
29 getTableInput(obj: GetTableInput.AsObject): GetTableInput;
30 getWorkspaceInput(obj: GetWorkspaceInput.AsObject): GetWorkspaceInput;
31 getCoreInput(obj: GetCoreInput.AsObject): GetCoreInput;
32 getCoresInput(obj: GetCoresInput.AsObject): GetCoresInput;
33 getTablesInput(obj: GetTablesInput.AsObject): GetTablesInput;
34 createWorkspace(input: CreateWorkspaceInput): Promise<WorkspaceId>;
35 addCore(input: AddCoreInput): Promise<CoreId>;
36 updateCore(input: UpdateCoreInput): Promise<CoreId>;
37 addTable(input: AddTableInput): Promise<TableId>;
38 addView(input: AddViewInput): Promise<ViewId>;
39 addColumn(input: AddColumnInput): Promise<ColumnId>;
40 addRow(input: AddRowInput): Promise<RowId>;
41 updateCell(input: UpdateCellInput): Promise<TableId>;
42 getWorkspaces(): Promise<WorkspacesResult>;
43 getWorkspace(input: GetWorkspaceInput): Promise<WorkspaceProjection>;
44 getCore(input: GetCoreInput): Promise<CoreProjection>;
45 getCores(input: GetCoresInput): Promise<CoresResult>;
46 getTable(input: GetTableInput): Promise<TableProjection>;
47 getTables(input: GetTablesInput): Promise<TablesResult>;
48 subscribeToWorkspace(input: WorkspaceSubscriptionInput): Observable<EventPayload>;
49 observeEvent(workspaceId: string, topic: string): Observable<EventPayloadNew>;
50 observeSpecifiedEvent({ workspaceId, coreId, tableId, rowId, columnId }: Resource, specifiedTopic: string): Observable<EventPayloadNew>;
51}