-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathindex.d.ts
More file actions
76 lines (66 loc) · 2.36 KB
/
index.d.ts
File metadata and controls
76 lines (66 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import React from "react";
import {Table, View} from "@finos/perspective";
export interface HTMLPerspectiveViewerElement extends PerspectiveViewerOptions, HTMLElement {
load(data: Table): void;
delete(): Promise<void>;
flush(): Promise<void>;
getEditPort(): Promise<number>;
toggleConfig(): Promise<void>;
download(flat: boolean): Promise<any>;
copy(flat: boolean): Promise<void>;
save(): Promise<PerspectiveViewerOptions>;
restore(x: PerspectiveViewerOptions): Promise<void>;
reset(): void;
notifyResize(): void;
restyleElement(): void;
readonly table?: Table;
readonly view?: View;
}
export type Filters = Array<[string, string, string]>;
export type Sort = Array<[string, string] | string>;
export type Expressions = string[];
export type Aggregates = {[column_name: string]: string};
export type Pivots = string[];
export type Columns = string[];
export interface PerspectiveViewerOptions {
plugin?: string;
columns?: Columns;
"row-pivots"?: Pivots;
"column-pivots"?: Pivots;
aggregates?: Aggregates;
filters?: Filters;
sort?: Sort;
expressions?: Expressions;
plugin_config?: object;
editable?: boolean;
selectable?: boolean;
}
interface PerspectiveViewerHTMLAttributes extends Pick<PerspectiveViewerOptions, "editable" | "plugin" | "selectable"> {
aggregates?: string;
expressions?: string;
"row-pivots"?: string;
"column-pivots"?: string;
filters?: string;
sort?: string;
columns?: string;
}
interface ReactPerspectiveViewerHTMLAttributes<T> extends PerspectiveViewerHTMLAttributes, React.HTMLAttributes<T> {}
type PerspectiveElement = {class?: string} & React.DetailedHTMLProps<ReactPerspectiveViewerHTMLAttributes<HTMLPerspectiveViewerElement>, HTMLPerspectiveViewerElement>;
declare global {
namespace JSX {
interface IntrinsicElements {
"perspective-viewer": PerspectiveElement;
}
}
interface Document {
createElement(tagName: "perspective-viewer", options?: ElementCreationOptions): HTMLPerspectiveViewerElement;
}
}