From 3a35d23702820bb9c6d322a5698cd6fbcb8f57eb Mon Sep 17 00:00:00 2001 From: Radu Woinaroski Date: Sun, 10 Jan 2016 21:32:56 +0100 Subject: [PATCH] fixed CodeMirror.TextMarker.find() return type Added CodeMirror.Range type Changed CodeMirror.TextMarker.find() to return CodeMirror.Range instead of CodeMirror.Position (which was wrong). --- codemirror/codemirror.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 2ca58c702..1df15739b 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -601,7 +601,7 @@ declare module CodeMirror { /** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or undefined if the marker is no longer in the document. */ - find(): CodeMirror.Position; + find(): CodeMirror.Range; /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; @@ -645,7 +645,12 @@ declare module CodeMirror { new (line: number, ch: number): Position; (line: number, ch: number): Position; } - + + interface Range{ + from: CodeMirror.Position; + to: CodeMirror.Position; + } + interface Position { ch: number; line: number; @@ -795,9 +800,9 @@ declare module CodeMirror { viewportMargin?: number; /** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */ - lint?: boolean | LintOptions; - - /** Optional value to be used in conduction with CodeMirror’s placeholder add-on. */ + lint?: boolean | LintOptions; + + /** Optional value to be used in conduction with CodeMirror’s placeholder add-on. */ placeholder?: string; }