From bcb9de30af34e0c799f74034fdf086501b278d7b Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 24 Jul 2015 14:30:05 -0700 Subject: [PATCH 1/4] [CodeMirror] add missing `css?` property on TextMarkerOptions --- codemirror/codemirror.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 5fc335ed6..d4e3f4937 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -779,8 +779,8 @@ declare module CodeMirror { /** Like inclusiveLeft , but for the right side. */ inclusiveRight?: boolean; - /** Atomic ranges act as a single unit when cursor movement is concerned � i.e. it is impossible to place the cursor inside of them. - In atomic ranges, inclusiveLeft and inclusiveRight have a different meaning � they will prevent the cursor from being placed + /** Atomic ranges act as a single unit when cursor movement is concerned — i.e. it is impossible to place the cursor inside of them. + In atomic ranges, inclusiveLeft and inclusiveRight have a different meaning — they will prevent the cursor from being placed respectively directly before and directly after the range. */ atomic?: boolean; @@ -813,6 +813,9 @@ declare module CodeMirror { /** When the target document is linked to other documents, you can set shared to true to make the marker appear in all documents. By default, a marker appears only in its target document. */ shared?: boolean; + + /** A string of CSS to be applied to the covered text. For example "color: #fe3". */ + css?: string; } interface StringStream { From 63e1e0c2b4e7e2555dea4136fc01b5c1568312fb Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 24 Jul 2015 15:10:00 -0700 Subject: [PATCH 2/4] Add other missing attributes. --- codemirror/codemirror.d.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index d4e3f4937..e20cc59ad 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -791,10 +791,16 @@ declare module CodeMirror { This is mostly useful for text - replacement widgets that need to 'snap open' when the user tries to edit them. The "clear" event fired on the range handle can be used to be notified when this happens. */ clearOnEnter?: boolean; + + /** Determines whether the mark is automatically cleared when it becomes empty. Default is true. */ + clearWhenEmpty: boolean; /** Use a given node to display this range.Implies both collapsed and atomic. The given DOM node must be an inline element(as opposed to a block element). */ replacedWith?: HTMLElement; + + /** When replacedWith is given, this determines whether the editor will capture mouse and drag events occurring in this widget. Default is false—the events will be left alone for the default browser handler, or specific handlers on the widget, to capture. */ + handleMouseEvents: boolean; /** A read - only span can, as long as it is not cleared, not be modified except by calling setValue to reset the whole document. Note: adding a read - only span currently clears the undo history of the editor, @@ -809,13 +815,16 @@ declare module CodeMirror { /** Equivalent to startStyle, but for the rightmost span. */ endStyle?: string; + + /** A string of CSS to be applied to the covered text. For example "color: #fe3". */ + css?: string; + + /** When given, will give the nodes created for this span a HTML title attribute with the given value. */ + title: string; /** When the target document is linked to other documents, you can set shared to true to make the marker appear in all documents. By default, a marker appears only in its target document. */ shared?: boolean; - - /** A string of CSS to be applied to the covered text. For example "color: #fe3". */ - css?: string; } interface StringStream { From e6764f406becf64bbfccd348653abb75d6c60afb Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 24 Jul 2015 15:12:41 -0700 Subject: [PATCH 3/4] wrap explanation --- codemirror/codemirror.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index e20cc59ad..cd067fac5 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -799,7 +799,10 @@ declare module CodeMirror { The given DOM node must be an inline element(as opposed to a block element). */ replacedWith?: HTMLElement; - /** When replacedWith is given, this determines whether the editor will capture mouse and drag events occurring in this widget. Default is false—the events will be left alone for the default browser handler, or specific handlers on the widget, to capture. */ + /** When replacedWith is given, this determines whether the editor will + * capture mouse and drag events occurring in this widget. Default is + * false—the events will be left alone for the default browser handler, + * or specific handlers on the widget, to capture. */ handleMouseEvents: boolean; /** A read - only span can, as long as it is not cleared, not be modified except by calling setValue to reset the whole document. From e5f0425b9782e04534565280a18f7e95d5ad10aa Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 24 Jul 2015 15:14:02 -0700 Subject: [PATCH 4/4] these are actually optionals --- codemirror/codemirror.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index cd067fac5..babaa57ec 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -793,7 +793,7 @@ declare module CodeMirror { clearOnEnter?: boolean; /** Determines whether the mark is automatically cleared when it becomes empty. Default is true. */ - clearWhenEmpty: boolean; + clearWhenEmpty?: boolean; /** Use a given node to display this range.Implies both collapsed and atomic. The given DOM node must be an inline element(as opposed to a block element). */ @@ -803,7 +803,7 @@ declare module CodeMirror { * capture mouse and drag events occurring in this widget. Default is * false—the events will be left alone for the default browser handler, * or specific handlers on the widget, to capture. */ - handleMouseEvents: boolean; + handleMouseEvents?: boolean; /** A read - only span can, as long as it is not cleared, not be modified except by calling setValue to reset the whole document. Note: adding a read - only span currently clears the undo history of the editor, @@ -823,7 +823,7 @@ declare module CodeMirror { css?: string; /** When given, will give the nodes created for this span a HTML title attribute with the given value. */ - title: string; + title?: string; /** When the target document is linked to other documents, you can set shared to true to make the marker appear in all documents. By default, a marker appears only in its target document. */