import type * as psp from "@perspective-dev/client"; import type * as psp_viewer from "@perspective-dev/viewer"; export { PerspectiveWorkspace, addViewer, genId } from "./workspace"; export { PerspectiveViewerWidget } from "./workspace/widget"; export * from "./extensions"; import { PerspectiveWorkspaceConfig } from "./workspace"; export { PerspectiveWorkspaceConfig }; /** * A Custom Element for coordinating a set of `` light DOM * children. `` is built on Lumino.js to allow a more * app-like experience than ``, providing * these features additionally: * * - Docking, arranging, tabbing and max/min-ing of ``s. * - Trivial `` duplication. * - Global Filter sidebar, for using selection state of a pivot table to filter * siblings. * - Total persistence/serializable state and child state. * - Easy sharing/ownership of `Table()` among different ``. * - A cool DOM-reactive API. * * There are a few ways to use this Custom Element. In plain HTML, you can * express your initial view simply: * * ```html * * ``` * * You can also use the DOM API in Javascript: * * ```javascript * const workspace = document.createElement("perspective-workspace"); * document.body.appendChild(workspace); * ``` * * This will yield a ` with the default layout. To load * a `Table()`, add it to `tables` via the `Map()` API where it will be * auto-wired into all matching ``s immediately: * * ```javascript * workspace.tables.set("superstore", await worker.table(my_data)); * ``` * * */ export declare class HTMLPerspectiveWorkspaceElement extends HTMLElement { private workspace?; private _resize_observer?; constructor(); /*************************************************************************** * * Public * */ /** * Persists this `` to a token `Object`. This object * is JSON serializable and describes the state of the Workspace and it's * child `` elements. Some important keys: * * - `viewers`: The serialized state of `` children, * named by `slot`. * - `detail`: The main layout. * - `master`: The contents of the Global Filter sidebar. * * While the `table` attribute is persisted for each `perspective-viewer`, * `Table`s themselves must be added to the `tables` property `Map()` * separately. * * @return {Object} A configuration token, compatible with * `restore(config)`. * @example * // Save this layout to local storage * const workspace = document.querySelector("perspective-workspace"); * localStorage.set("CONFIG", JSON.stringify(workspace.save())); */ save(): Promise; /** * Restore this `` to a previous state captured by * `save()`. Calling this method will completely rewrite this element's * `innerHTML`, but may reuse `` children depending * on the `slot` attribute names. However, it should always be possible * to recreate any given state from within the UI itself, as the attributes * on `` itself create immutable views. * * While the `table` attribute is set for each `perspective-viewer`, * `Table`s themselves must be added to the `tables` property `Map()` * separately. * @param {Object} config A configuration token, as returned by `save()`. * @example * // Restore this layout from local storage * const workspace = document.querySelector("perspective-workspace"); * workspace.restore(JSON.parse(localStorage.get("CONFIG")); * * // Add `Table` separately. * workspace.tables.set("superstore", await worker.table(data)); */ restore(layout: PerspectiveWorkspaceConfig): Promise; clear(): Promise; /** * Await all asynchronous tasks for all viewers in this workspace. This is * useful to make sure asynchonous side effects of synchronous methods calls * are applied. */ flush(): Promise; /** * Add a new viewer to the workspace for a given `ViewerConfigUpdateExt`. * @param config */ addViewer(config: psp_viewer.ViewerConfigUpdate): Promise; load(client: psp.Client | Promise): Promise; /** * Invalidate this component's dimensions and recalculate. */ resize(): Promise; /** * Set whether this workspace element should auto-size itself via a * `ResizeObserver`. */ setAutoSize(is_auto_size: boolean): void; connectedCallback(): void; /*************************************************************************** * * Private * */ private _light_dom_changed; private _register_light_dom_listener; }