import type Graphic from "../../Graphic.js";
import type Collection from "../../core/Collection.js";
import type SharedTemplateMetadata from "../../editing/sharedTemplates/SharedTemplateMetadata.js";
import type FeatureTemplate from "../../layers/support/FeatureTemplate.js";
import type SelectionManager from "../../views/SelectionManager.js";
import type SketchLabelOptions from "../../views/interactive/sketch/SketchLabelOptions.js";
import type SketchTooltipOptions from "../../views/interactive/sketch/SketchTooltipOptions.js";
import type SketchValueOptions from "../../views/interactive/sketch/SketchValueOptions.js";
import type SnappingOptions from "../../views/interactive/snapping/SnappingOptions.js";
import type AttachmentsViewModel from "../Attachments/AttachmentsViewModel.js";
import type BatchAttributeFormViewModel from "../BatchAttributeForm/BatchAttributeFormViewModel.js";
import type CreateFeaturesWorkflow from "./CreateFeaturesWorkflow.js";
import type UpdateWorkflow from "./UpdateWorkflow.js";
import type EditorItem from "./support/EditorItem.js";
import type FeatureFormViewModel from "../FeatureForm/FeatureFormViewModel.js";
import type FeatureTemplatesViewModel from "../FeatureTemplates/FeatureTemplatesViewModel.js";
import type SketchViewModel from "../Sketch/SketchViewModel.js";
import type { EventedAccessor } from "../../core/Evented.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { CreationInfo, EditorLayerUnion, EditorSketchCreateEvent, EditorSketchUpdateEvent, FailedOperation, FeatureInfo, LayerInfo, SplitFeatureWorkflowStep, State, SplitterGeometryType, SplitterGeometry } from "./types.js";
import type { AttachmentsViewModelProperties } from "../Attachments/AttachmentsViewModel.js";
import type { FeatureTemplatesViewModelProperties } from "../FeatureTemplates/FeatureTemplatesViewModel.js";
import type { SketchLabelOptionsProperties } from "../../views/interactive/sketch/SketchLabelOptions.js";
import type { SnappingOptionsProperties } from "../../views/interactive/snapping/SnappingOptions.js";
import type { SketchTooltipOptionsProperties } from "../../views/interactive/sketch/SketchTooltipOptions.js";
import type { SketchValueOptionsProperties } from "../../views/interactive/sketch/SketchValueOptions.js";

export interface EditorViewModelProperties extends Partial<Pick<EditorViewModel, "layerInfos" | "selectionManager" | "syncViewSelection" | "useLegacyCreateTools" | "view">> {
  /** The [AttachmentsViewModel][AttachmentsViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/AttachmentsViewModel/) for supporting the editor widget. Attachment editing is enabled by default if the layer has support for it. */
  attachmentsViewModel?: AttachmentsViewModelProperties;
  /**
   * The [FeatureTemplatesViewModel][FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/FeatureTemplatesViewModel/)
   * for supporting the editor widget.
   */
  featureTemplatesViewModel?: FeatureTemplatesViewModelProperties;
  /**
   * Options to configure the labels shown next to each segment of the geometry being created or updated.
   *
   * > [!WARNING]
   * >
   * > **Known Limitation**
   * >
   * > Sketch labels are currently only supported when working with a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @since 4.24
   */
  labelOptions?: SketchLabelOptionsProperties;
  /**
   * The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/) for sketching. It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#selfEnabled) and [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureEnabled) snapping.
   *
   * @since 4.19
   */
  snappingOptions?: SnappingOptionsProperties;
  /**
   * Options to configure the tooltip shown next to the cursor when creating or updating graphics.
   *
   * @since 4.24
   */
  tooltipOptions?: SketchTooltipOptionsProperties;
  /**
   * Options to configure how values are displayed and input when creating or updating graphics.
   *
   * @since 4.29
   */
  valueOptions?: SketchValueOptionsProperties;
}

export interface EditorViewModelEvents {
  /**
   * Fires when a user starts drawing a feature, is actively drawing a feature, and completes drawing a feature.
   *
   * @since 4.29
   * @example
   * // Listen to Editor's create event.
   * editor.on("sketch-create", function(evt) {
   *   const { graphic, tool } = evt.detail;
   *
   *   // Check if the tool used is a 'polyline'
   *   if (tool === "polyline") {
   *     // Set the active polyline symbol to white while drawing
   *     graphic.symbol.color = "#ffffff";
   *   }
   * });
   */
  "sketch-create": EditorSketchCreateEvent;
  /**
   * Fires when a user starts updating a feature's geometry, is actively updating a feature's geometry, and completes updating a feature's geometry.
   *
   * @since 4.29
   * @example
   * // Listen to Editor's update event.
   * editor.on("sketch-update", function(evt) {
   *   const { tool, graphics } = evt.detail;
   *
   *   // Check if the layer's geometryType is a 'polyline'
   *   if (evt.layer?.geometryType === "polyline") {
   *     // For every feature, update the line symbol
   *     // width to emphasize the feature being updated
   *     graphics.forEach((graphic) => graphic.symbol.width = 5);
   *   }
   * });
   */
  "sketch-update": EditorSketchUpdateEvent;
}

/**
 * Provides the logic for the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
 *
 * @since 4.11
 * @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget
 * @see [Editor component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/)
 * @see [Workflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/Workflow/)
 * @see [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/)
 * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
 * @see [CreateFeaturesWorkflowData](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflowData/)
 * @see [UpdateWorkflowData](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflowData/)
 * @see [SnappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SnappingControls/)
 * @see [SketchLabelOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchLabelOptions/)
 * @see [SketchTooltipOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchTooltipOptions/)
 * @see [SketchValueOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchValueOptions/)
 * @see [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/)
 * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
 * @see [Sample - Edit features with the Editor widget](https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-basic/)
 * @see [Sample - Edit features in 3D with the Editor widget](https://developers.arcgis.com/javascript/latest/sample-code/editor-3d/)
 * @see [Sample - Editor widget with configurations](https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/)
 * @see [Sample - Popup with edit action](https://developers.arcgis.com/javascript/latest/sample-code/popup-editaction/)
 * @example
 * const editor = new Editor({
 *   viewModel: { // autocasts as new EditorViewModel
 *     layerInfos: [{
 *       layer: featureLayer,
 *       deleteEnabled: false // disables deleting features
 *     }]
 *   }
 * });
 */
export default class EditorViewModel extends EventedAccessor {
  /**
   * @deprecated
   * Do not directly reference this property.
   * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
   */
  "@eventTypes": EditorViewModelEvents;
  constructor(properties?: EditorViewModelProperties);
  /**
   * A property indicating the current active workflow. This is either
   * [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/), [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/), or [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/).
   *
   * @see [Sample - Popup with edit action](https://developers.arcgis.com/javascript/latest/sample-code/popup-editaction/)
   */
  get activeWorkflow(): CreateFeaturesWorkflow | UpdateWorkflow | null | undefined;
  /** The [AttachmentsViewModel][AttachmentsViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/AttachmentsViewModel/) for supporting the editor widget. Attachment editing is enabled by default if the layer has support for it. */
  get attachmentsViewModel(): AttachmentsViewModel;
  set attachmentsViewModel(value: AttachmentsViewModelProperties);
  /** Convenience property that indicates at least one layer supports a `create-features` workflow. */
  get canCreate(): boolean;
  /**
   * Convenience property that indicates at least one layer supports a `update` workflow.
   * This includes the ability to delete features and modify attachments and/or related records.
   */
  get canUpdate(): boolean;
  /**
   * A predominantly read-only collection of [editor items](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/support/EditorItem/) that corresponds to the feature being updated.
   *
   * @since 4.29
   */
  get editorItems(): Collection<EditorItem>;
  /**
   * An array of objects containing information specific to any failed editing operations.
   * In addition to the error(s), options to `retry()` or `cancel()` are provided.
   */
  get failures(): FailedOperation[];
  /**
   * The [FeatureFormViewModel][FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/)
   * for supporting the editor widget.
   */
  get featureFormViewModel(): FeatureFormViewModel | null | undefined;
  /**
   * The [FeatureTemplatesViewModel][FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/FeatureTemplatesViewModel/)
   * for supporting the editor widget.
   */
  get featureTemplatesViewModel(): FeatureTemplatesViewModel;
  set featureTemplatesViewModel(value: FeatureTemplatesViewModelProperties);
  /**
   * The form's view model used to support the Editor widget.
   *  This can be either the [BatchAttributeFormViewModel][BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/)
   * or the [FeatureFormViewModel][FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/) and is dependent on the active workflow.
   *
   * @since 4.33
   */
  get formViewModel(): BatchAttributeFormViewModel | FeatureFormViewModel | null | undefined;
  /**
   * Use this property to determine if the next generation geometry creation
   * has been disabled. This can happen when
   * [useLegacyCreateTools](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#useLegacyCreateTools) is true,
   * or Editor is used with a non-2D (`arcgis-map`) view.
   *
   * @deprecated
   * @since 5.0
   */
  get isUsingLegacyCreateTools(): boolean;
  /**
   * Options to configure the labels shown next to each segment of the geometry being created or updated.
   *
   * > [!WARNING]
   * >
   * > **Known Limitation**
   * >
   * > Sketch labels are currently only supported when working with a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   *
   * @since 4.24
   */
  get labelOptions(): SketchLabelOptions;
  set labelOptions(value: SketchLabelOptionsProperties);
  /**
   * An array of editing configurations for individual layers.
   *
   * For example, if you have an editable feature layer but do not want
   * the end user to do any type of editing, you can limit this by
   * setting the `enabled` property to `false`.
   *
   * @example
   * const editorViewModel = new EditorViewModel({
   *   layerInfos: [{
   *     layer: featureLayer, // pass in the feature layer,
   *     formTemplate:  { // autocasts to FormTemplate
   *       elements: [
   *         { // autocasts to FieldElement
   *           type: "field",
   *           fieldName: "fulladdr",
   *           label: "Full Address"
   *         }
   *       ]
   *     },
   *     enabled: true, // default is true, set to false to disable editing functionality
   *     addEnabled: true, // default is true, set to false to disable the ability to add a new feature
   *     updateEnabled: false // default is true, set to false to disable the ability to edit an existing feature
   *     deleteEnabled: false // default is true, set to false to disable the ability to delete features
   *   }]
   * });
   */
  accessor layerInfos: LayerInfo[] | null | undefined;
  /**
   * Use this property to supply a custom selection manager that overrides the default selection manager. This property is ignored if [syncViewSelection](#syncViewSelection) is `true`.
   * This is useful when applications want to share selection sets between components, without relying on the view's selection manager.
   *
   * @since 5.0
   * @beta
   */
  accessor selectionManager: SelectionManager | null | undefined;
  /**
   * The [SketchViewModel][SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/)
   * for supporting the editor widget.
   */
  get sketchViewModel(): SketchViewModel | null | undefined;
  /**
   * The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/) for sketching. It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#selfEnabled) and [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureEnabled) snapping.
   *
   * @since 4.19
   */
  get snappingOptions(): SnappingOptions;
  set snappingOptions(value: SnappingOptionsProperties);
  /**
   * The widget's state. Possible values are in the table below.
   *
   * Value | Description
   * ------|------------
   * ready | Dependencies are met and has valid property values.
   * disabled | Dependencies are missing and cannot provide valid inputs.
   * editing-existing-feature | The Editor is currently editing an existing feature.
   * awaiting-update-feature-candidate | The period when the application is awaiting the user's input after clicking update and multiple features are returned. Specify the feature to update.
   * awaiting-feature-creation-info | This is the first step in the `create-features` workflow. A [CreationInfo](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/types/#CreationInfo) is required.
   * awaiting-feature-to-update | This is the first step in the `update` workflow. A [feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) is required.
   * awaiting-feature-to-create | The waiting period for when a feature is created before attribute/geometry edits can be performed.
   * adding-attachment | If currently `editing-existing-feature` and adding an attachment to an existing feature.
   * editing-attachment | If currently `editing-existing-feature` and updating an existing attachment to an existing feature.
   * creating-features | The Editor is currently creating multiple features.
   * viewing-selection-list | The Editor is displaying its selection list and not editing any features.
   */
  get state(): State;
  /** Indicates if there is at least one edit request being processed. */
  get syncing(): boolean;
  /**
   * Indicates whether the Editor should sync with the view's [selection manager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/).
   * Enabling this does not automatically inherit the [selection sources](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/#sources) from the [SelectionManager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/), (e.g. which layers or graphics collections the view listens to for selections). If you need specific selection sources, configure them separately via [SelectionManager.sources](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/#sources).
   *
   * Setting this property takes precedence over the [selectionManager](#selectionManager) property.
   *
   * @default false
   * @since 5.0
   * @beta
   */
  accessor syncViewSelection: boolean;
  /**
   * Options to configure the tooltip shown next to the cursor when creating or updating graphics.
   *
   * @since 4.24
   */
  get tooltipOptions(): SketchTooltipOptions;
  set tooltipOptions(value: SketchTooltipOptionsProperties);
  /**
   * Starting at version 5.0, Editor is transitioning to a next generation geometry
   * creation experience. This new experience provides advanced curve creation tools
   * and allows multiple tools to be used in combination to define a single geometry.
   *
   * As of 5.0, this experience is only available in 2D (e.g., [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/), [`arcgis-map`](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-map)).
   *
   * This property is available to allow 2D applications to temporarily
   * opt out of this experience.
   *
   * > [!CAUTION]
   * >
   * > This option will be removed in an upcoming release.
   *
   * @deprecated
   * @since 5.0
   */
  accessor useLegacyCreateTools: boolean;
  /**
   * Options to configure how values are displayed and input when creating or updating graphics.
   *
   * @since 4.29
   */
  get valueOptions(): SketchValueOptions;
  set valueOptions(value: SketchValueOptionsProperties);
  /**
   * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
   * This view provides the editable layers for the Editor widget and is required when instantiating the widget.
   */
  accessor view: MapViewOrSceneView | null | undefined;
  /**
   * Cancels any active selection operation.
   *
   * @since 5.0
   */
  cancelSelectionTool(): void;
  /**
   * Cancels any active workflow.
   *
   * @returns Resolves once the workflow is canceled.
   */
  cancelWorkflow(): Promise<void>;
  /**
   * This is applicable if there is an active update workflow with an active
   * child workflow. This method deletes the utility network association
   * involved with the active child workflow's feature.
   *
   * @returns Resolves once the active
   * [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) is deleted.
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   */
  deleteAssociationFromWorkflow(): Promise<void>;
  /**
   * This is applicable if there is an active update workflow with an active
   * child workflow. In this case, this method deletes the feature associated
   * with the active child workflow.
   *
   * @deprecated since version 4.33. Use [deleteFeatures()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#deleteFeatures) instead.
   * @returns Resolves once the active [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) is deleted.
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   */
  deleteFeatureFromWorkflow(): Promise<void>;
  /**
   * If the active workflow is an
   * [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) or
   * [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/), this method
   * deletes the feature(s) associated with the workflow.
   *
   * @returns Resolves once the features have been deleted.
   * @since 4.33
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   * @see [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/)
   */
  deleteFeatures(): Promise<void>;
  /**
   * Get all of the editing templates associated with a given layer. The items
   * in the resulting array will be
   * [SharedTemplateMetadata](https://developers.arcgis.com/javascript/latest/references/core/editing/sharedTemplates/SharedTemplateMetadata/) objects
   * if there are any shared templates defined for the layer; otherwise, they
   * will be standard [FeatureTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureTemplate/)
   * objects.
   *
   * @param layer - The layer whose templates should be retrieved.
   * @returns An array of templates associated with the layer.
   * @since 4.32
   */
  getTemplatesForLayer(layer: EditorLayerUnion): (FeatureTemplate | SharedTemplateMetadata)[];
  /**
   * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) by displaying the panel where feature creation begins. This method
   * takes a [CreateFeaturesCreationInfo](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#CreateFeaturesCreationInfo) object containing the layer(s) and template(s) to use.
   *
   * @param creationInfo - An object containing
   * information needed to create a new feature using the Editor widget. This object
   * provides the feature template and layer for creating a new feature.
   * @returns Resolves when the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) initiates
   * and displays the panel where feature creation begins.
   * @since 4.23
   */
  startCreateFeaturesWorkflowAtFeatureCreation(creationInfo: Required<Pick<CreationInfo, "layer" | "template">> & Partial<Pick<CreationInfo, "maxFeatures">>): Promise<void>;
  /**
   * This method starts the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) at the "creating-features" step with the provided feature.
   *
   * > [!WARNING]
   * >
   * > Any CreateFeaturesWorkflow instance generated by this method will only support creating a single feature per operation, (ie. batch creation is disabled).
   *
   * @param params - Parameters object containing an `initialFeature` to use in the associated CreateFeaturesWorkflow.
   * @returns Resolves once the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) initiates and displays the panel where additional edits can be made to the provided feature.
   * @since 4.28
   * @see [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/)
   */
  startCreateFeaturesWorkflowAtFeatureEdit(params: EditorViewModelStartCreateFeaturesWorkflowAtFeatureEditParameters): Promise<void>;
  /**
   * Initiates the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/) panel.
   *
   * @returns Resolves when the [CreateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/CreateFeaturesWorkflow/) is initiated
   * and displays the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTemplates/) panel.
   * @since 4.23
   */
  startCreateFeaturesWorkflowAtFeatureTypeSelection(): Promise<void>;
  /**
   * Starts a [MergeFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/MergeFeaturesWorkflow/) for the
   * specified features. All features must belong to the same layer.
   *
   * @param features - The features to be merged. These can be supplied
   * either as an array of [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) instances or as a single
   * [FeatureInfo](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/types/#FeatureInfo) object specifying a layer
   * and the object IDs of the features.
   * @param options - Options for the merge features workflow.
   * @since 4.34
   */
  startMergeFeaturesWorkflow(features: Graphic[] | FeatureInfo, options?: EditorViewModelStartMergeFeaturesWorkflowOptions): Promise<void>;
  /**
   * Starts a split feature workflow for the given feature.
   *
   * @param feature - The feature to be split.
   * @param options - Options for the split feature workflow.
   * @returns Resolves once the [SplitFeatureWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/SplitFeatureWorkflow/) has been initialized and is active.
   * @since 4.34
   */
  startSplitFeatureWorkflow(feature: Graphic, options?: EditorViewModelStartSplitFeatureWorkflowOptions): Promise<void>;
  /**
   * Starts an [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/) using
   * the provided features.
   *
   * @param features - The features to be updated. These can be supplied
   * either as an array of [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) instances or as a single
   * [FeatureInfo](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/types/#FeatureInfo) object specifying a layer
   * and the object IDs of the features.
   * @returns Resolves once the
   * [UpdateFeaturesWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateFeaturesWorkflow/) is initiated.
   * @since 4.33
   */
  startUpdateFeaturesWorkflow(features: Graphic[] | FeatureInfo): Promise<void>;
  /**
   * Starts the update workflow at the feature geometry and attribute editing panel.
   *
   * @param feature - The feature to be updated.
   * @returns Resolves once the [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) initiates the
   * feature geometry and attribute editing panel.
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   */
  startUpdateWorkflowAtFeatureEdit(feature: Graphic): Promise<void>;
  /**
   * Starts the `update` workflow using the current selected feature.
   *
   * @returns Resolves once the [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) is initiated
   * using the current selected feature.
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   */
  startUpdateWorkflowAtFeatureSelection(): Promise<void>;
  /**
   * Starts the Editor workflow where it waits for multiple features
   * to be selected.
   *
   * @param candidates - The selected feature candidates.
   * @returns Resolves once the [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/) is initiated
   * as it waits for multiple features to be selected.
   * @see [UpdateWorkflow](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/UpdateWorkflow/)
   */
  startUpdateWorkflowAtMultipleFeatureSelection(candidates: Graphic[]): Promise<void>;
  /** Toggles the `UpdateWorkflow`. */
  toggleUpdateWorkflow(): Promise<void>;
}

export interface EditorViewModelStartCreateFeaturesWorkflowAtFeatureEditParameters {
  /** The initial feature used when you begin creating features. */
  initialFeature: Graphic;
}

export interface EditorViewModelStartMergeFeaturesWorkflowOptions {
  /**
   * The feature that the other
   * features will be merged into. This feature will have its geometry updated
   * with the merged geometry. The other features will be deleted.
   */
  keyFeature?: Graphic;
}

export interface EditorViewModelStartSplitFeatureWorkflowOptions {
  /** The step to start the workflow at. */
  startAt?: SplitFeatureWorkflowStep;
  /** The preferred Sketch tool to use for drawing the splitter geometry. */
  defaultSplitterGeometryType?: SplitterGeometryType;
  /** The geometry with which to split the input geometry. This is required in order to start the workflow at the "reviewing-features" step. Otherwise, it is ignored. */
  splitterGeometry?: SplitterGeometry;
}