UNPKG

@arcgis/map-components

Version:
116 lines (114 loc) 4.61 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/components-controllers'; import { Nil } from '@arcgis/components-utils'; import { default as HomeViewModel } from '@arcgis/core/widgets/Home/HomeViewModel.js'; import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useHomeViewModel: (component: import('@arcgis/components-controllers').StencilLifecycles & { manager: import('@arcgis/components-controllers').ControllerManager; el: HTMLElement; autoDestroyDisabled?: boolean; destroy?: () => Promise<void>; } & Pick<HomeViewModel, never> & { reactiveUtils?: typeof __esri.reactiveUtils; state?: "ready" | "disabled" | "going-home" | undefined; icon: Nil | string; label: Nil | string; referenceElement: ArcgisReferenceElement | Nil | string; arcgisReady: import('@arcgis/components-controllers').EventEmitter; position: __esri.UIPosition; arcgisPropertyChange: import('@arcgis/components-controllers').EventEmitter<{ name: string; }> | undefined; el: HTMLElement & { childElem?: HTMLElement & { ownedBy?: HTMLElement; }; view?: __esri.MapView | __esri.SceneView | undefined; }; autoDestroyDisabled: boolean; destroy: () => Promise<void>; }, options?: { editConstructorProperties(props: unknown): unknown; } | undefined) => HomeViewModel; /** * Home component is a button that switches the view to its * initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * or a previously defined `viewpoint`. */ export declare class ArcgisHome extends LitElement { private messages; /** * If true, the component will not be destroyed automatically when it is * disconnected from the document. This is useful when you want to move the * component to a different place on the page, or temporarily hide it. If this * is set, make sure to call the \`destroy\` method when you are done to prevent * memory leaks. */ autoDestroyDisabled: boolean; goToOverride: nullish | __esri.GoToOverride; /** * Icon displayed in the component's button. * * @see [Calcite Icon Search](https://developers.arcgis.com/calcite-design-system/icons/) */ icon: Nil | string; /** The component's default label. */ label: Nil | string; /** Replace localized message strings with your own strings. */ messageOverrides?: typeof this.messages._overrides; position: __esri.UIPosition; referenceElement: ArcgisReferenceElement | Nil | string; /** * The current state of the component. */ readonly state: "ready" | "disabled" | "going-home"; /** * The esri/Viewpoint, or point of view, to zoom to when * going home. The initial value is determined a few different ways: * * If no esri/views/View is provided, the value is `null`. * If the esri/views/View is ready, but the esri/Viewpoint is not defined, the initial * value of the esri/Viewpoint is determined when the esri/views/View became ready. * If the esri/views/View is ready and the esri/Viewpoint is defined by the user, the initial viewpoint value is the user-defined esri/Viewpoint. * * @example * // Creates a viewpoint centered on the extent of a polygon geometry * let vp = new Viewpoint({ * targetGeometry: geom.extent * }); * * // Sets the model's viewpoint to the Viewpoint based on a polygon geometry * home.viewpoint = vp; */ viewpoint: __esri.Viewpoint | nullish; /** * This function provides the ability to interrupt and cancel the process * of navigating the view back to the view's initial extent. * * @since 4.9 */ cancelGo(): Promise<void>; /** Permanently destroy the component */ destroy(): Promise<void>; /** * Animates the view to the initial Viewpoint of the view or the * value of `viewpoint` */ go(): Promise<void>; /** * Fires when the go() method is called. * * @example * home.addEventListener("go", (event) => { * console.log("updating viewpoint"); * }); */ readonly arcgisGo: TargetedEvent<this, __esri.HomeViewModelGoEvent>; readonly arcgisPropertyChange: TargetedEvent<this, { name: "state"; }>; readonly arcgisReady: TargetedEvent<this, undefined>; } export {};