Skip to content

Commit 5c3e479

Browse files
committed
Merge pull request DefinitelyTyped#6630 from sixinli/fix_cm_showhint
`state` property belongs to CodeMirror.Editor, not CodeMorrir.Doc
2 parents c3ab375 + ced9f3b commit 5c3e479

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

codemirror/codemirror-showhint.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ declare module CodeMirror {
4141
off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
4242
}
4343

44-
/** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/
4544
interface Doc {
46-
state: any;
4745
showHint: (options: ShowHintOptions) => void;
4846
}
4947

codemirror/codemirror.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ declare module CodeMirror {
390390
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. */
391391
on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
392392
off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
393+
394+
/** Expose the state object, so that the Editor.state.completionActive property is reachable*/
395+
state: any;
393396
}
394397

395398
interface EditorFromTextArea extends Editor {
@@ -589,6 +592,8 @@ declare module CodeMirror {
589592
/** The reverse of posFromIndex. */
590593
indexFromPos(object: CodeMirror.Position): number;
591594

595+
/** Expose the state object, so that the Doc.state.completionActive property is reachable*/
596+
state: any;
592597
}
593598

594599
interface LineHandle {

0 commit comments

Comments
 (0)