From 30528a61d9a96efec9f4e214d79d1bd8e20df305 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 25 Dec 2016 06:35:55 +1030 Subject: [PATCH] added the documented lineAtHeight function (#13287) --- codemirror/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codemirror/index.d.ts b/codemirror/index.d.ts index 83c45e93ab..4af27f5f12 100644 --- a/codemirror/index.d.ts +++ b/codemirror/index.d.ts @@ -178,6 +178,13 @@ declare namespace CodeMirror { class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */ removeLineClass(line: any, where: string, class_: string): CodeMirror.LineHandle; + /** + * Compute the line at the given pixel height. + * + * `mode` is the relative element to use to compute this line - defaults to 'page' if not specified + */ + lineAtHeight(height: number, mode?: 'window' | 'page' | 'local'): number + /** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */ lineInfo(line: any): { line: any;