From 3a68c5be79ecd6adbdc0b7cd8d04eefe00b0df69 Mon Sep 17 00:00:00 2001 From: Sixin Li Date: Tue, 22 Sep 2015 21:44:24 -0400 Subject: [PATCH] add missing scrollIntoView() typings --- codemirror/codemirror.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 0f548a3fa9..01d0fafc41 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -228,6 +228,14 @@ declare module CodeMirror { The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number): void; + /** Scrolls the given element into view. pos is a { line, ch } object, in editor-local coordinates. + The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ + scrollIntoView(pos: { line: number, ch: number }, margin?: number): void; + + /** Scrolls the given element into view. pos is a { from, to } object, in editor-local coordinates. + The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */ + scrollIntoView(pos: { from: CodeMirror.Position, to: CodeMirror.Position }, margin: number): void; + /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. If mode is "local" , they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the top-left corner of the page.