Skip to content

Commit

Permalink
update ts and fix #1440
Browse files Browse the repository at this point in the history
  • Loading branch information
sc1f committed Jun 9, 2021
1 parent 99a9d9b commit 06ea336
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/perspective/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ declare module "@finos/perspective" {
num_rows(): Promise<number>;
on_delete(callback: Function): void;
on_update(callback: UpdateCallback, options?: {mode?: string}): void;
remove_update(callback: UpdateCallback): void;
remove_delete(callback: Function): void;
schema(): Promise<Schema>;
expression_schema(): Promise<Schema>;
to_arrow(options?: SerializeConfig & {data_slice: any}): Promise<ArrayBuffer>;
Expand All @@ -107,9 +109,15 @@ declare module "@finos/perspective" {

export type TableData = string | Array<object> | {[key: string]: Array<object>} | {[key: string]: string} | ArrayBuffer;

export interface ExpressionError {
error_message: string;
line: number;
column: number;
}

export type ValidatedExpressions = {
expression_schema: Schema;
errors: {[key: string]: string};
errors: {[key: string]: ExpressionError};
};

export type TableOptions = {
Expand Down Expand Up @@ -137,8 +145,11 @@ declare module "@finos/perspective" {
schema(): Promise<Schema>;
size(): Promise<number>;
update(data: TableData, options?: {port_id?: number}): void;
remove(data: Array<any>, options?: {port_id?: number}): void;
view(config?: ViewConfig): Promise<View>;
make_port(): number;
get_index(): Promise<string | null>;
get_limit(): Promise<number | null>;
};

/**** perspective ****/
Expand Down

0 comments on commit 06ea336

Please sign in to comment.