@arcgis/map-components
Version:
ArcGIS Map Components
123 lines (121 loc) • 6.4 kB
TypeScript
/// <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 GraphicsLayer } from '@arcgis/core/layers/GraphicsLayer.js';
import { default as Sketch } from '@arcgis/core/widgets/Sketch.js';
import { PublicLitElement as LitElement, ToElement, TargetedEvent } from '@arcgis/lumina';
import { ArcgisReferenceElement } from '../../utils/component-utils';
declare const useSketchWidget: (component: import('@arcgis/components-controllers').StencilLifecycles & {
manager: import('@arcgis/components-controllers').ControllerManager;
el: HTMLElement;
autoDestroyDisabled?: boolean;
destroy?: () => Promise<void>;
} & Pick<Sketch, never> & {
reactiveUtils?: typeof __esri.reactiveUtils;
state?: "ready" | "disabled" | "active" | undefined;
viewModel?: __esri.SketchViewModel | undefined;
icon: Nil | string;
label: Nil | string;
referenceElement: ArcgisReferenceElement | Nil | string;
position: __esri.UIPosition;
arcgisReady: import('@arcgis/components-controllers').EventEmitter;
arcgisPropertyChange: import('@arcgis/components-controllers').EventEmitter<{
name: string;
}> | undefined;
el: HTMLElement & {
childElem?: HTMLElement & {
ownedBy?: HTMLElement;
};
view?: __esri.MapView | __esri.SceneView | Nil;
};
autoDestroyDisabled: boolean;
destroy: () => Promise<void>;
}, options?: {
editConstructorProperties(props: __esri.SketchProperties | undefined): __esri.SketchProperties | Promise<__esri.SketchProperties | undefined> | undefined;
} | undefined) => Sketch;
/** Sketch component provides a simple UI for creating and updating graphics on a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html).
*/
export declare class ArcgisSketch extends LitElement {
readonly activeTool: nullish | "point" | "multipoint" | "polygon" | "polyline" | "mesh" | "rectangle" | "move" | "circle" | "reshape" | "transform" | "freehandPolyline" | "freehandPolygon" | "rectangle-selection" | "lasso-selection" | "custom-selection";
/**
* 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;
availableCreateTools: nullish | ("point" | "multipoint" | "polygon" | "polyline" | "mesh" | "rectangle" | "circle" | "freehandPolyline" | "freehandPolygon")[];
readonly createGraphic: nullish | __esri.Graphic;
creationMode: "update" | "single" | "continuous";
defaultCreateOptions: __esri.SketchDefaultCreateOptions;
/**
* By default, sketch will auto-create a new graphics layer if none was
* provided. Set this prop to true to disable this behavior.
*/
defaultGraphicsLayerDisabled: boolean;
defaultUpdateOptions: __esri.SketchDefaultUpdateOptions;
hideCreateToolsCircle: boolean;
hideCreateToolsPoint: boolean;
hideCreateToolsPolygon: boolean;
hideCreateToolsPolyline: boolean;
hideCreateToolsRectangle: boolean;
hideDuplicateButton: boolean;
hideDeleteButton: boolean;
hideSelectionCountLabel: boolean;
hideLabelsToggle: boolean;
hideSelectionToolsLassoSelection: boolean;
hideSelectionToolsRectangleSelection: boolean;
hideSettingsMenu: boolean;
hideSnappingControls: boolean;
hideSnappingControlsElementsEnabledToggle: boolean;
hideSnappingControlsElementsFeatureEnabledToggle: boolean;
hideSnappingControlsElementsLayerList: boolean;
hideSnappingControlsElementsSelfEnabledToggle: boolean;
hideTooltipsToggle: boolean;
hideUndoRedoMenu: boolean;
/**
* Icon which represents the component.
* Typically used when the component is controlled by another component (e.g. by the Expand component).
* Search [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) for possible values.
*/
icon: string;
/** The component's default label. */
label: string;
labelOptions: __esri.SketchLabelOptions;
layer: GraphicsLayer;
layout: "vertical" | "horizontal";
pointSymbol: __esri.SimpleMarkerSymbol | __esri.PictureMarkerSymbol | __esri.PointSymbol3D | __esri.TextSymbol | __esri.CIMSymbol | __esri.WebStyleSymbol;
polygonSymbol: __esri.CIMSymbol | __esri.SimpleFillSymbol | __esri.PolygonSymbol3D;
polylineSymbol: __esri.SimpleLineSymbol | __esri.CIMSymbol | __esri.LineSymbol3D;
position: __esri.UIPosition;
referenceElement: ArcgisReferenceElement | Nil | string;
scale: "s" | "l" | "m";
toolbarKind: "floating" | "docked";
showSnappingControlsElementsHeader: boolean;
snappingOptions: __esri.SnappingOptions;
readonly state: "ready" | "disabled" | "active";
tooltipOptions: __esri.SketchTooltipOptions;
readonly updateGraphics: __esri.Collection<__esri.Graphic>;
cancel(): Promise<void>;
complete(): Promise<void>;
create(tool: "circle" | "point" | "polygon" | "polyline" | "rectangle", createOptions?: __esri.SketchViewModelCreateCreateOptions): Promise<void>;
delete(): Promise<void>;
/** Permanently destroy the component */
destroy(): Promise<void>;
duplicate(): Promise<void>;
redo(): Promise<void>;
triggerUpdate(graphic: __esri.Graphic | __esri.Graphic[], updateOptions?: __esri.SketchViewModelUpdateUpdateOptions): Promise<void>;
undo(): Promise<void>;
readonly arcgisCreate: TargetedEvent<this, __esri.SketchCreateEvent>;
readonly arcgisDelete: TargetedEvent<this, __esri.SketchDeleteEvent>;
readonly arcgisPropertyChange: TargetedEvent<this, {
name: "state";
}>;
readonly arcgisReady: TargetedEvent<this, undefined>;
readonly arcgisRedo: TargetedEvent<this, __esri.SketchRedoEvent>;
readonly arcgisUndo: TargetedEvent<this, __esri.SketchUndoEvent>;
readonly arcgisUpdate: TargetedEvent<this, __esri.SketchUpdateEvent>;
}
export {};