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 e0605c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 13 additions & 2 deletions packages/perspective/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ 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>;
to_arrow(options?: SerializeConfig): Promise<ArrayBuffer>;
to_columns(options?: SerializeConfig): Promise<Array<object>>;
to_csv(options?: SerializeConfig & {config: object}): Promise<string>;
to_json(options?: SerializeConfig): Promise<Array<object>>;
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
3 changes: 0 additions & 3 deletions packages/perspective/src/js/perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,6 @@ export default function(Module) {
*
* @param {Object} [options] An optional configuration object.
*
* @param {*} options.data_slice A data slice object from which to
* serialize.
*
* @param {number} options.start_row The starting row index from which to
* serialize.
* @param {number} options.end_row The ending row index from which to
Expand Down

0 comments on commit e0605c8

Please sign in to comment.