import { BehaviorConfig, TerraDrawModeBehavior } from "./base.behavior"; import { FeatureId } from "../extend"; import { GeoJSONStoreFeatures, GeoJSONStoreGeometries, JSONObject, JSON } from "../store/store"; import { Polygon, Position, LineString, Point } from "geojson"; import { Actions, GuidancePointProperties, UpdateTypes, Validation } from "../common"; type MutateFeatureBehaviorOptions = { validate: Validation | undefined; }; export declare const Mutations: { readonly InsertBefore: "insert-before"; readonly InsertAfter: "insert-after"; readonly Update: "update"; readonly Delete: "delete"; readonly Replace: "replace"; }; type InsertBeforeMutation = { type: typeof Mutations.InsertBefore; index: number; coordinate: Position; }; type InsertAfterMutation = { type: typeof Mutations.InsertAfter; index: number; coordinate: Position; }; type UpdateMutation = { type: typeof Mutations.Update; index: number; coordinate: Position; }; type DeleteMutation = { type: typeof Mutations.Delete; index: number; }; export type ReplaceMutation = { type: typeof Mutations.Replace; coordinates: ReplacedGeometry["coordinates"]; }; export type CoordinateMutation = InsertBeforeMutation | InsertAfterMutation | UpdateMutation | DeleteMutation; type ValidProperties = Record; type FinishContext = { updateType: UpdateTypes.Finish; action: Actions; }; type MutateContext = FinishContext | { updateType: UpdateTypes.Commit | UpdateTypes.Provisional; }; export type UpdateGeometry = { featureId: FeatureId; coordinateMutations?: ReplaceMutation | CoordinateMutation[]; propertyMutations?: ValidProperties; context: MutateContext; }; export declare class MutateFeatureBehavior extends TerraDrawModeBehavior { constructor(config: BehaviorConfig, options: MutateFeatureBehaviorOptions); private options; createPoint({ coordinates, properties, context, }: { coordinates: Position; properties: JSONObject; context?: FinishContext; }): (GeoJSONStoreFeatures<{ type: "Point"; coordinates: Position; }> & { id: FeatureId; }) | undefined; createLineString({ coordinates, properties, }: { coordinates: LineString["coordinates"]; properties: JSONObject; }): GeoJSONStoreFeatures<{ type: "LineString"; coordinates: Position[]; }> & { id: FeatureId; }; createPolygon({ coordinates, properties, }: { coordinates: Polygon["coordinates"][0]; properties: JSONObject; }): GeoJSONStoreFeatures<{ type: "Polygon"; coordinates: Position[][]; }> & { id: FeatureId; }; createGuidancePoint({ coordinate, type, }: { coordinate: Position; type: GuidancePointProperties; }): FeatureId; createGuidancePoints({ coordinates, type, additionalProperties, }: { coordinates: Position[]; type: GuidancePointProperties; additionalProperties?: (index: number) => JSONObject; }): FeatureId[]; updatePoint({ featureId, coordinateMutations, propertyMutations, context, }: UpdateGeometry): GeoJSONStoreFeatures | null; updatePolygon({ featureId, coordinateMutations, context, propertyMutations, }: UpdateGeometry): GeoJSONStoreFeatures | null; updateLineString({ featureId, coordinateMutations, context, propertyMutations, }: UpdateGeometry): GeoJSONStoreFeatures | null; deleteFeatureIfPresent(featureId: FeatureId | undefined): void; deleteFeaturesIfPresent(featureIds: FeatureId[]): void; setDeselected(featureIds: FeatureId[]): void; setSelected(featureId: FeatureId): void; updateGuidancePoints(guidancePoints: { featureId: FeatureId; coordinate: Position; }[]): void; private handleCreateFeature; private handleMutateFeature; private mutateFeature; private applyCoordinateMutations; private isReplaceMutation; private createFeatureWithGeometry; private validateGeometryWithUpdateType; private buildFeatureWithGeometry; private createFeatures; private updateFeatureGeometries; private updateFeatureProperties; } export {};