/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Position } from './core/position.js';6import { Selection } from './core/selection.js';78/**9* Describes the reason the cursor has changed its position.10*/11export const enum CursorChangeReason {12/**13* Unknown or not set.14*/15NotSet = 0,16/**17* A `model.setValue()` was called.18*/19ContentFlush = 1,20/**21* The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.22*/23RecoverFromMarkers = 2,24/**25* There was an explicit user gesture.26*/27Explicit = 3,28/**29* There was a Paste.30*/31Paste = 4,32/**33* There was an Undo.34*/35Undo = 5,36/**37* There was a Redo.38*/39Redo = 6,40}41/**42* An event describing that the cursor position has changed.43*/44export interface ICursorPositionChangedEvent {45/**46* Primary cursor's position.47*/48readonly position: Position;49/**50* Secondary cursors' position.51*/52readonly secondaryPositions: Position[];53/**54* Reason.55*/56readonly reason: CursorChangeReason;57/**58* Source of the call that caused the event.59*/60readonly source: string;61}62/**63* An event describing that the cursor selection has changed.64*/65export interface ICursorSelectionChangedEvent {66/**67* The primary selection.68*/69readonly selection: Selection;70/**71* The secondary selections.72*/73readonly secondarySelections: Selection[];74/**75* The model version id.76*/77readonly modelVersionId: number;78/**79* The old selections.80*/81readonly oldSelections: Selection[] | null;82/**83* The model version id the that `oldSelections` refer to.84*/85readonly oldModelVersionId: number;86/**87* Source of the call that caused the event.88*/89readonly source: string;90/**91* Reason.92*/93readonly reason: CursorChangeReason;94}959697