UNPKG

@arcgis/map-components

Version:
40 lines (39 loc) 1.95 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> import { GenericController } from '@arcgis/lumina/controllers'; import { Nil } from '@arcgis/components-utils'; import { default as MapView } from '@arcgis/core/views/MapView'; import { default as SceneView } from '@arcgis/core/views/SceneView'; import { default as LinkChartView } from '@arcgis/core/views/LinkChartView'; import { ArcgisReferenceElement } from '../utils/component-utils'; import { PropertyValues } from 'lit'; import { LitElement, EventEmitter } from '@arcgis/lumina'; type View = LinkChartView | MapView | SceneView; type ViewControllerRequires<ViewType extends View> = LitElement & ViewControllerUses<ViewType>; export interface ViewControllerUses<ViewType extends View> { view?: Nil | ViewType; position: __esri.UIPosition; referenceElement?: ArcgisReferenceElement | string; arcgisReady: EventEmitter; el: HTMLElement & { childElem?: HTMLElement & { ownedBy?: HTMLElement; }; view?: Nil | ViewType; }; } /** * Creates a controller which adds a `view` property to the component and connects the component to that view, both when * the view is provided directly or linked via the `referenceElement` property. The controller also handles emitting the * `arcgisViewReady` event and removing the component from the view's UI when the component is disconnected. */ export declare const useView: <ViewType extends View = View>(component: ViewControllerRequires<ViewType>) => ViewType | undefined; export declare class ViewController<ViewType extends View = View> extends GenericController<ViewType | undefined, ViewControllerRequires<ViewType>> { #private; constructor(component: ViewControllerRequires<ViewType>); hostConnected(): void; hostLoad(): void; hostLoaded(): void; hostDisconnected(): void; hostUpdate(changes: PropertyValues<ViewControllerUses<View>>): void; } export {};