UNPKG

@arcgis/map-components

Version:
70 lines (69 loc) 3.59 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> import { Nil } from '@arcgis/components-utils'; import { EventEmitter } from '@arcgis/components-controllers'; import { ArcgisMap } from '../components/arcgis-map/customElement.js'; import { ArcgisScene } from '../components/arcgis-scene/customElement.js'; import { ArcgisExpand } from '../components/arcgis-expand/customElement.js'; import { ArcgisPlacement } from '../components/arcgis-placement/customElement.js'; import { ArcgisLinkChart } from '../components/arcgis-link-chart/customElement.js'; export type ArcgisReferenceElement = ArcgisLinkChart | ArcgisMap | ArcgisScene; export type ArcgisParentElement = ArcgisExpand | ArcgisPlacement | ArcgisReferenceElement; interface BaseComponentElement { referenceElement: ArcgisReferenceElement | Nil | string; view?: __esri.LinkChartView | __esri.MapView | __esri.SceneView | Nil; position?: __esri.UIPosition; } export interface WidgetElement extends BaseComponentElement { el: HTMLElement & { childElem?: HTMLElement; }; widget: any; _watchHandles: __esri.WatchHandle[]; } /** * A type that represents either wrapped widget or a native map component. Used * in places where both need to be accepted. */ export type WidgetOrMapComponent = Pick<WidgetElement, "position" | "referenceElement" | "view"> & { el: HTMLElement & { view?: __esri.LinkChartView | __esri.MapView | __esri.SceneView | Nil; parent?: ArcgisParentElement; childElem?: HTMLElement & { ownedBy?: HTMLElement; }; }; icon?: Nil | string; widget?: WidgetElement["widget"]; }; /** @deprecated Use this.manager.onLifecycle() instead */ export declare function addHandles(element: WidgetElement, handle: __esri.WatchHandle | __esri.WatchHandle[]): void; /** * Find applicable arcgis-map, arcgis-scene, arcgis-expand or arcgis-placement * for the current component and attach to it * * @remarks * If the view property was set by the user directly (for backwards * comparability with MapView/SceneView), attachToParent() will return undefined * as attachToParent() is looking for component parents only. * If the view property was provided, the developer takes over the * responsibility of calling view.ui.add() */ export declare function attachToParent(component: WidgetOrMapComponent): ArcgisParentElement | undefined; /** * Defines a view prop on the component's el and emits arcgisReady once that * prop is set by attachToParent() * * @deprecated Use useWidget or useViewModel instead */ export declare function defineViewProperty(component: WidgetOrMapComponent & { arcgisReady: EventEmitter; }): void; export declare function isNullOrEmptyString(value: nullish | string): boolean; export declare function isValidInteger(value: nullish | number): boolean; export declare function areCamerasEqual(camera: __esri.Camera, camera2: __esri.Camera | Nil): boolean; export declare function isNotSameViewpoint(viewpoint?: __esri.Viewpoint, viewpoint2?: __esri.Viewpoint): boolean; export declare function parseCenter(newValue: __esri.MapView["center"] | Nil | number[] | string, view?: Pick<__esri.MapView, "center">): __esri.Point | undefined; export declare function parsePoint(currentValue: __esri.Point | Nil, newValue: __esri.Point | Nil | number[] | string): __esri.Point | undefined; /** @deprecated Use useWidget or useViewModel instead */ export declare function referenceElementHelper(component: WidgetOrMapComponent, refElement: ArcgisReferenceElement | Nil | string): Promise<void>; export {};