From a029b45c6db83de4b58baed4611fb804ee721ae1 Mon Sep 17 00:00:00 2001 From: Sixin Li Date: Thu, 5 Nov 2015 15:54:34 -0500 Subject: [PATCH 1/2] `state` properties belongs to CodeMirror.Editor, not CodeMorrir.Doc --- codemirror/codemirror-showhint.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codemirror/codemirror-showhint.d.ts b/codemirror/codemirror-showhint.d.ts index 48a904a3b..9573f95bc 100644 --- a/codemirror/codemirror-showhint.d.ts +++ b/codemirror/codemirror-showhint.d.ts @@ -39,11 +39,11 @@ declare module CodeMirror { /** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */ on(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void; off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void; + /** Extend CodeMirror.Editor with a state object, so that the Editor.state.completionActive property is reachable*/ + state: any; } - /** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/ interface Doc { - state: any; showHint: (options: ShowHintOptions) => void; } From ced9f3bb50955947e4ae2e4b9d736602f9f3a4a8 Mon Sep 17 00:00:00 2001 From: Sixin Li Date: Wed, 11 Nov 2015 23:52:19 -0500 Subject: [PATCH 2/2] move `state` from codemirror-showhint.d.ts to codemirror.d.ts --- codemirror/codemirror-showhint.d.ts | 2 -- codemirror/codemirror.d.ts | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/codemirror/codemirror-showhint.d.ts b/codemirror/codemirror-showhint.d.ts index 9573f95bc..8b620a414 100644 --- a/codemirror/codemirror-showhint.d.ts +++ b/codemirror/codemirror-showhint.d.ts @@ -39,8 +39,6 @@ declare module CodeMirror { /** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */ on(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void; off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void; - /** Extend CodeMirror.Editor with a state object, so that the Editor.state.completionActive property is reachable*/ - state: any; } interface Doc { diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 2ca58c702..3fb29e425 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -390,6 +390,9 @@ declare module CodeMirror { The handler may mess with the style of the resulting element, or add event handlers, but should not try to change the state of the editor. */ on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; + + /** Expose the state object, so that the Editor.state.completionActive property is reachable*/ + state: any; } interface EditorFromTextArea extends Editor { @@ -589,6 +592,8 @@ declare module CodeMirror { /** The reverse of posFromIndex. */ indexFromPos(object: CodeMirror.Position): number; + /** Expose the state object, so that the Doc.state.completionActive property is reachable*/ + state: any; } interface LineHandle {