@@ -64,7 +64,7 @@ export interface IViewZone {
6464 /**
6565 * An optional dom node for the view zone that will be placed in the margin area.
6666 */
67- marginDomNode ?: HTMLElement ;
67+ marginDomNode ?: HTMLElement | null ;
6868 /**
6969 * Callback which gives the relative top of the view zone as it appears (taking scrolling into account).
7070 */
@@ -121,12 +121,12 @@ export interface IContentWidgetPosition {
121121 * Desired position for the content widget.
122122 * `preference` will also affect the placement.
123123 */
124- position : IPosition ;
124+ position : IPosition | null ;
125125 /**
126126 * Optionally, a range can be provided to further
127127 * define the position of the content widget.
128128 */
129- range ?: IRange ;
129+ range ?: IRange | null ;
130130 /**
131131 * Placement preference for position, in order of preference.
132132 */
@@ -154,7 +154,7 @@ export interface IContentWidget {
154154 * Get the placement of the content widget.
155155 * If null is returned, the content widget will be placed off screen.
156156 */
157- getPosition ( ) : IContentWidgetPosition ;
157+ getPosition ( ) : IContentWidgetPosition | null ;
158158}
159159
160160/**
@@ -201,7 +201,7 @@ export interface IOverlayWidget {
201201 * Get the placement of the overlay widget.
202202 * If null is returned, the overlay widget is responsible to place itself.
203203 */
204- getPosition ( ) : IOverlayWidgetPosition ;
204+ getPosition ( ) : IOverlayWidgetPosition | null ;
205205}
206206
207207/**
@@ -751,6 +751,74 @@ export interface ICodeEditor extends editorCommon.IEditor {
751751 * Apply the same font settings as the editor to `target`.
752752 */
753753 applyFontInfo ( target : HTMLElement ) : void ;
754+
755+ /**
756+ * Check if the current instance has a model attached.
757+ * @internal
758+ */
759+ hasModel ( ) : this is IActiveCodeEditor ;
760+ }
761+
762+ /**
763+ * @internal
764+ */
765+ export interface IActiveCodeEditor extends ICodeEditor {
766+ /**
767+ * Returns the primary position of the cursor.
768+ */
769+ getPosition ( ) : Position ;
770+
771+ /**
772+ * Returns the primary selection of the editor.
773+ */
774+ getSelection ( ) : Selection ;
775+
776+ /**
777+ * Returns all the selections of the editor.
778+ */
779+ getSelections ( ) : Selection [ ] ;
780+
781+ /**
782+ * Saves current view state of the editor in a serializable object.
783+ */
784+ saveViewState ( ) : editorCommon . ICodeEditorViewState ;
785+
786+ /**
787+ * Type the getModel() of IEditor.
788+ */
789+ getModel ( ) : ITextModel ;
790+
791+ /**
792+ * @internal
793+ */
794+ _getCursors ( ) : ICursors ;
795+
796+ /**
797+ * Get all the decorations on a line (filtering out decorations from other editors).
798+ */
799+ getLineDecorations ( lineNumber : number ) : IModelDecoration [ ] ;
800+
801+ /**
802+ * Returns the editor's dom node
803+ */
804+ getDomNode ( ) : HTMLElement ;
805+
806+ /**
807+ * Get the hit test target at coordinates `clientX` and `clientY`.
808+ * The coordinates are relative to the top-left of the viewport.
809+ *
810+ * @returns Hit test target or null if the coordinates fall outside the editor or the editor has no model.
811+ */
812+ getTargetAtClientPoint ( clientX : number , clientY : number ) : IMouseTarget ;
813+
814+ /**
815+ * Get the visible position for `position`.
816+ * The result position takes scrolling into account and is relative to the top left corner of the editor.
817+ * Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor.
818+ * Explanation 2: the results of this method will not change if the container of the editor gets repositioned.
819+ * Warning: the results of this method are innacurate for positions that are outside the current editor viewport.
820+ */
821+ getScrolledVisiblePosition ( position : IPosition ) : { top : number ; left : number ; height : number ; } ;
754822}
755823
756824/**
@@ -830,19 +898,19 @@ export interface IDiffEditor extends editorCommon.IEditor {
830898 /**
831899 * Get the computed diff information.
832900 */
833- getLineChanges ( ) : editorCommon . ILineChange [ ] ;
901+ getLineChanges ( ) : editorCommon . ILineChange [ ] | null ;
834902
835903 /**
836904 * Get information based on computed diff about a line number from the original model.
837905 * If the diff computation is not finished or the model is missing, will return null.
838906 */
839- getDiffLineInformationForOriginal ( lineNumber : number ) : IDiffLineInformation ;
907+ getDiffLineInformationForOriginal ( lineNumber : number ) : IDiffLineInformation | null ;
840908
841909 /**
842910 * Get information based on computed diff about a line number from the modified model.
843911 * If the diff computation is not finished or the model is missing, will return null.
844912 */
845- getDiffLineInformationForModified ( lineNumber : number ) : IDiffLineInformation ;
913+ getDiffLineInformationForModified ( lineNumber : number ) : IDiffLineInformation | null ;
846914}
847915
848916/**
0 commit comments