UNPKG

@vertigis/viewer-spec

Version:

VertiGIS Viewer Specification

116 lines (115 loc) 3.66 kB
import type { Command } from "../Command.js"; import { CommandRegistry } from "../CommandRegistry.js"; import type { Event } from "../Event.js"; import { EventRegistry } from "../EventRegistry.js"; import type { Model } from "../common.js"; /** * Arguments for the "panel.anchor-host-panel" command. */ export interface AnchorHostPanelArgs { /** * The offset from the side of the screen. */ offsetWidth: number; /** * The offset from the top or bottom of the screen. */ offsetHeight: number; /** * The component to anchor to. */ anchorComponent: ComponentBase; } /** * Arguments for the "panel.snap-host-panel" command. */ export interface SnapHostPanelArgs { /** * The position to snap to. */ snapPosition?: SnapPosition; /** * Snap to the last position set by the user. */ userSet?: boolean; } /** * A snapping position. */ export type SnapPosition = "hidden" | "middle" | "top" | "collapsed"; /** * Corresponds to `VertiGIS.Mobile.Composition.Layout.ComponentBase` in the * VertiGIS.Mobile SDK. */ export interface ComponentBase { } export declare class PanelCommands extends CommandRegistry { protected readonly _prefix = "panel"; /** * Displays the specified component in the host panel (a view that slides * out from the side of the screen). The component input parameter is * required, and if you don't provide it, or pass in a component that is * already hosted elsewhere in the application, you will get an exception. * Mobile only. * * @mobileOnly */ get openHostPanel(): Command<ComponentBase>; /** * Closes the host panel. If a component is specified, the panel is only * closed if the specified component is currently open in the host panel. If * no component is specified (input null), then the host panel will always * be closed. Mobile only. * * @mobileOnly */ get closeHostPanel(): Command<ComponentBase>; /** * Anchors the host panel so that content will open with a certain offset * from the left or right side of the application (depending on if provided * anchor component is on the left or right side of the app). Mobile only. * * @mobileOnly */ get anchorHostPanel(): Command<AnchorHostPanelArgs>; /** * Snaps the host panel to a particular position (eg. Middle, top, or * hidden). For use only with the horizontal taskbar on mobile phones, where * the taskbar panel content slides up from the bottom. Mobile only. * * @mobileOnly */ get snapHostPanel(): Command<SnapHostPanelArgs>; /** * Closes the popout window for a panel and restores the original layout. * Web only. * * @webOnly */ get popIn(): Command<Model["id"] | Model>; /** * Removes a panel from the main layout and opens it in a new popout window. * Web only. * * @webOnly */ get popOut(): Command<Model["id"] | Model>; } export declare class PanelEvents extends EventRegistry { protected readonly _prefix = "panel"; /** * Raised when the component that is currently being displayed by the host * panel is changed. Argument is the id of the component. Mobile only. * * @mobileOnly */ get hostPanelComponentChanged(): Event<string>; /** * Raised when the component that is currently being displayed by the host * panel is about to change. Argument is the id of the component. Mobile * only. * * @mobileOnly */ get hostPanelComponentChanging(): Event<string>; }