mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[CodeMirror] Add more addon types and some missing function
This commit is contained in:
parent
c106c03ac1
commit
46e9987231
47
types/codemirror/addon/edit/closebrackets.d.ts
vendored
Normal file
47
types/codemirror/addon/edit/closebrackets.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_closebrackets
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface AutoCloseBrackets {
|
||||
/**
|
||||
* String containing pairs of matching characters.
|
||||
*/
|
||||
pairs?: string;
|
||||
|
||||
/**
|
||||
* If the next character is in the string, opening a bracket should be auto-closed.
|
||||
*/
|
||||
closeBefore?: string;
|
||||
|
||||
/**
|
||||
* String containing chars that could do a triple quote.
|
||||
*/
|
||||
triples?: string;
|
||||
|
||||
/**
|
||||
* explode should be a similar string that gives the pairs of characters that, when enter is pressed between them, should have the second character also moved to its own line.
|
||||
*/
|
||||
explode?: string;
|
||||
|
||||
/**
|
||||
* By default, if the active mode has a closeBrackets property, that overrides the configuration given in the option.
|
||||
* But you can add an override property with a truthy value to override mode-specific configuration.
|
||||
*/
|
||||
override?: boolean;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* Will auto-close brackets and quotes when typed.
|
||||
* By default, it'll auto-close ()[]{}''"", but you can pass it a string similar to that (containing pairs of matching characters),
|
||||
* or an object with pairs and optionally explode properties to customize it.
|
||||
*/
|
||||
autoCloseBrackets?: AutoCloseBrackets | string;
|
||||
}
|
||||
}
|
||||
51
types/codemirror/addon/edit/closetag.d.ts
vendored
Normal file
51
types/codemirror/addon/edit/closetag.d.ts
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_closetag
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface CommandActions {
|
||||
closeTag(cm: CodeMirror.Editor): void;
|
||||
}
|
||||
|
||||
interface AutoCloseTags {
|
||||
/**
|
||||
* Whether to autoclose when the '/' of a closing tag is typed. (default true)
|
||||
*/
|
||||
whenClosing?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to autoclose the tag when the final '>' of an opening tag is typed. (default true)
|
||||
*/
|
||||
whenOpening?: boolean;
|
||||
|
||||
/**
|
||||
* An array of tag names that should not be autoclosed. (default is empty tags for HTML, none for XML)
|
||||
*/
|
||||
dontCloseTags?: Array<string>;
|
||||
|
||||
/**
|
||||
* An array of tag names that should, when opened, cause a
|
||||
* blank line to be added inside the tag, and the blank line and
|
||||
* closing line to be indented. (default is block tags for HTML, none for XML)
|
||||
*/
|
||||
indentTags?: Array<string>;
|
||||
|
||||
/**
|
||||
* An array of XML tag names that should be autoclosed with '/>'. (default is none)
|
||||
*/
|
||||
emptyTags: Array<string>;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* Will auto-close XML tags when '>' or '/' is typed.
|
||||
* Depends on the fold/xml-fold.js addon.
|
||||
*/
|
||||
autoCloseTags?: AutoCloseTags | boolean;
|
||||
}
|
||||
}
|
||||
42
types/codemirror/addon/edit/matchbrackets.d.ts
vendored
Normal file
42
types/codemirror/addon/edit/matchbrackets.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/marijnh/CodeMirror
|
||||
// Definitions by: Sixin Li <https://github.com/sixinli>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_matchbrackets
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface MatchBrackets {
|
||||
/**
|
||||
* Only use the character after the start position, never the one before it.
|
||||
*/
|
||||
afterCursor?: boolean;
|
||||
|
||||
/**
|
||||
* Causes only matches where both brackets are at the same side of the start position to be considered.
|
||||
*/
|
||||
strict?: boolean;
|
||||
|
||||
/**
|
||||
* Stop after scanning this amount of lines without a successful match. Defaults to 1000.
|
||||
*/
|
||||
maxScanLines?: number;
|
||||
|
||||
/**
|
||||
* Ignore lines longer than this. Defaults to 10000.
|
||||
*/
|
||||
maxScanLineLength?: number;
|
||||
|
||||
/**
|
||||
* Don't highlight a bracket in a line longer than this. Defaults to 1000.
|
||||
*/
|
||||
maxHighlightLineLength?: number;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
// When set to true or an options object, causes matching brackets to be highlighted whenever the cursor is next to them.
|
||||
matchBrackets?: MatchBrackets | boolean;
|
||||
}
|
||||
}
|
||||
32
types/codemirror/addon/edit/matchtags.d.ts
vendored
Normal file
32
types/codemirror/addon/edit/matchtags.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_matchtags
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface CommandActions {
|
||||
/**
|
||||
* You can bind a key to in order to jump to the tag matching the one under the cursor.
|
||||
*/
|
||||
toMatchingTag(cm: CodeMirror.Editor): void;
|
||||
}
|
||||
|
||||
interface MatchTags {
|
||||
/**
|
||||
* Highlight both matching tags.
|
||||
*/
|
||||
bothTags?: boolean;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* When enabled will cause the tags around the cursor to be highlighted (using the CodeMirror-matchingtag class).
|
||||
* Depends on the addon/fold/xml-fold.js addon.
|
||||
*/
|
||||
matchTags?: MatchTags | boolean;
|
||||
}
|
||||
}
|
||||
17
types/codemirror/addon/scroll/scrollpastend.d.ts
vendored
Normal file
17
types/codemirror/addon/scroll/scrollpastend.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://github.com/codemirror/CodeMirror/blob/master/addon/scroll/scrollpastend.js
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* When the end of the file is reached it allows you to keep scrolling so that your last few lines of code are not stuck at the bottom of the editor.
|
||||
*/
|
||||
scrollPastEnd?: boolean;
|
||||
}
|
||||
}
|
||||
55
types/codemirror/addon/search/match-highlighter.d.ts
vendored
Normal file
55
types/codemirror/addon/search/match-highlighter.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_match-highlighter
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface HighlightSelectionMatches {
|
||||
/**
|
||||
* Minimum amount of selected characters that triggers a highlight (default 2).
|
||||
*/
|
||||
minChars?: number;
|
||||
|
||||
/**
|
||||
* The style to be used to highlight the matches (default "matchhighlight", which will correspond to CSS class cm-matchhighlight).
|
||||
*/
|
||||
style?: string;
|
||||
|
||||
/**
|
||||
* Controls whether whitespace is trimmed from the selection.
|
||||
*/
|
||||
trim?: boolean;
|
||||
|
||||
/**
|
||||
* Can be set to true or to a regexp matching the characters that make up a word.
|
||||
*/
|
||||
showToken?: boolean | RegExp;
|
||||
|
||||
/**
|
||||
* Used to specify how much time to wait, in milliseconds, before highlighting the matches.
|
||||
*/
|
||||
delay: 100,
|
||||
|
||||
/**
|
||||
* If wordsOnly is enabled, the matches will be highlighted only if the selected text is a word.
|
||||
*/
|
||||
wordsOnly?: boolean;
|
||||
|
||||
/**
|
||||
* If annotateScrollbar is enabled, the occurences will be highlighted on the scrollbar via the matchesonscrollbar addon.
|
||||
*/
|
||||
annotateScrollbar?: boolean;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* Adds a highlightSelectionMatches option that can be enabled to highlight all instances of a currently selected word.
|
||||
* When enabled, it causes the current word to be highlighted when nothing is selected (defaults to off).
|
||||
*/
|
||||
highlightSelectionMatches?: HighlightSelectionMatches | boolean;
|
||||
}
|
||||
}
|
||||
25
types/codemirror/addon/selection/active-line.d.ts
vendored
Normal file
25
types/codemirror/addon/selection/active-line.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/codemirror/CodeMirror
|
||||
// Definitions by: ficristo <https://github.com/ficristo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#active-line
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface StyleActiveLine {
|
||||
/**
|
||||
* Controls whether single-line selections, or just cursor selections, are styled. Defaults to false (only cursor selections).
|
||||
*/
|
||||
nonEmpty: boolean;
|
||||
}
|
||||
|
||||
interface EditorConfiguration {
|
||||
/**
|
||||
* When enabled gives the wrapper of the line that contains the cursor the class CodeMirror-activeline,
|
||||
* adds a background with the class CodeMirror-activeline-background, and adds the class CodeMirror-activeline-gutter to the line's gutter space is enabled.
|
||||
*/
|
||||
styleActiveLine?: StyleActiveLine | boolean;
|
||||
}
|
||||
}
|
||||
15
types/codemirror/codemirror-matchbrackets.d.ts
vendored
15
types/codemirror/codemirror-matchbrackets.d.ts
vendored
@ -1,15 +0,0 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/marijnh/CodeMirror
|
||||
// Definitions by: Sixin Li <https://github.com/sixinli>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_matchbrackets
|
||||
|
||||
import * as CodeMirror from "codemirror";
|
||||
|
||||
declare module "codemirror" {
|
||||
interface EditorConfiguration {
|
||||
// when set to true, causes matching brackets to be highlighted whenever the cursor is next to them
|
||||
matchBrackets?: boolean;
|
||||
}
|
||||
}
|
||||
79
types/codemirror/index.d.ts
vendored
79
types/codemirror/index.d.ts
vendored
@ -17,12 +17,22 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co
|
||||
declare namespace CodeMirror {
|
||||
export var Doc : CodeMirror.DocConstructor;
|
||||
export var Pos: CodeMirror.PositionConstructor;
|
||||
export var StringStream: CodeMirror.StringStreamConstructor;
|
||||
export var Pass: {toString(): "CodeMirror.PASS"};
|
||||
|
||||
/** Find the column position at a given string index using a given tabsize. */
|
||||
function countColumn(line: string, index: number | null, tabSize: number): number;
|
||||
function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea;
|
||||
|
||||
/** Split a string by new line. */
|
||||
function splitLines(text: string): Array<string>;
|
||||
|
||||
/** Check if a char is part of an alphabet. */
|
||||
function isWordChar(ch: string): boolean;
|
||||
|
||||
/** Call startState of the mode if available, otherwise return true */
|
||||
function startState(mode: CodeMirror.Mode<any>, a1?: any, a2?: any): any | boolean;
|
||||
|
||||
/** Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise. */
|
||||
function cmpPos(a: Position, b: Position): number;
|
||||
|
||||
@ -283,7 +293,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Scrolls the given element into view. pos is a { left , top , right , bottom } object, in editor-local coordinates.
|
||||
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
|
||||
scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number): void;
|
||||
scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin?: number): void;
|
||||
|
||||
/** Scrolls the given element into view. pos is a { line, ch } object, in editor-local coordinates.
|
||||
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
|
||||
@ -291,19 +301,19 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Scrolls the given element into view. pos is a { from, to } object, in editor-local coordinates.
|
||||
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
|
||||
scrollIntoView(pos: { from: CodeMirror.Position, to: CodeMirror.Position }, margin: number): void;
|
||||
scrollIntoView(pos: { from: CodeMirror.Position, to: CodeMirror.Position }, margin?: number): void;
|
||||
|
||||
/** Returns an { left , top , bottom } object containing the coordinates of the cursor position.
|
||||
If mode is "local", they will be relative to the top-left corner of the editable document.
|
||||
If it is "page" or not given, they are relative to the top-left corner of the page.
|
||||
where is a boolean indicating whether you want the start(true) or the end(false) of the selection. */
|
||||
cursorCoords(where: boolean, mode?: CoordsMode): { left: number; top: number; bottom: number; };
|
||||
cursorCoords(where?: boolean, mode?: CoordsMode): { left: number; top: number; bottom: number; };
|
||||
|
||||
/** Returns an { left , top , bottom } object containing the coordinates of the cursor position.
|
||||
If mode is "local", they will be relative to the top-left corner of the editable document.
|
||||
If it is "page" or not given, they are relative to the top-left corner of the page.
|
||||
where specifies the precise position at which you want to measure. */
|
||||
cursorCoords(where: CodeMirror.Position, mode?: CoordsMode): { left: number; top: number; bottom: number; };
|
||||
cursorCoords(where?: CodeMirror.Position | null, mode?: CoordsMode): { left: number; top: number; bottom: number; };
|
||||
|
||||
/** Returns the position and dimensions of an arbitrary character. pos should be a { line , ch } object.
|
||||
If mode is "local", they will be relative to the top-left corner of the editable document.
|
||||
@ -375,6 +385,10 @@ declare namespace CodeMirror {
|
||||
/** Tells you whether the editor's content can be edited by the user. */
|
||||
isReadOnly(): boolean;
|
||||
|
||||
/** Switches between overwrite and normal insert mode (when not given an argument),
|
||||
or sets the overwrite mode to a specific state (when given an argument). */
|
||||
toggleOverwrite(value?: boolean): void;
|
||||
|
||||
/** Runs the command with the given name on the editor. */
|
||||
execCommand(name: string): void;
|
||||
|
||||
@ -465,6 +479,9 @@ declare namespace CodeMirror {
|
||||
on(eventName: DOMEvent, handler: (instance: CodeMirror.Editor, event: Event) => void ): void;
|
||||
off(eventName: DOMEvent, handler: (instance: CodeMirror.Editor, event: Event) => void ): void;
|
||||
|
||||
/** Fires when the overwrite flag is flipped. */
|
||||
on(eventName: "overwriteToggle", handler: (instance: CodeMirror.Editor, overwrite: boolean) => void): void;
|
||||
|
||||
/** Expose the state object, so that the Editor.state.completionActive property is reachable*/
|
||||
state: any;
|
||||
}
|
||||
@ -677,6 +694,9 @@ declare namespace CodeMirror {
|
||||
Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */
|
||||
addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget;
|
||||
|
||||
/** Remove the line widget */
|
||||
removeLineWidget(widget: CodeMirror.LineWidget): void;
|
||||
|
||||
/** Gets the mode object for the editor. Note that this is distinct from getOption("mode"), which gives you the mode specification,
|
||||
rather than the resolved, instantiated mode object. */
|
||||
getMode(): any;
|
||||
@ -800,6 +820,8 @@ declare namespace CodeMirror {
|
||||
sticky?: string;
|
||||
}
|
||||
|
||||
type InputStyle = "textarea" | "contenteditable";
|
||||
|
||||
interface EditorConfiguration {
|
||||
/** string| The starting value of the editor. Can be a string, or a document object. */
|
||||
value?: any;
|
||||
@ -875,12 +897,29 @@ declare namespace CodeMirror {
|
||||
*/
|
||||
scrollbarStyle?: string;
|
||||
|
||||
/**
|
||||
* When fixedGutter is on, and there is a horizontal scrollbar, by default the gutter will be visible to the left of this scrollbar.
|
||||
* If this option is set to true, it will be covered by an element with class CodeMirror-gutter-filler.
|
||||
*/
|
||||
coverGutterNextToScrollbar?: boolean;
|
||||
|
||||
/**
|
||||
* Selects the way CodeMirror handles input and focus.
|
||||
* The core library defines the "textarea" and "contenteditable" input models.
|
||||
* On mobile browsers, the default is "contenteditable". On desktop browsers, the default is "textarea".
|
||||
* Support for IME and screen readers is better in the "contenteditable" model.
|
||||
*/
|
||||
inputStyle?: InputStyle;
|
||||
|
||||
/** boolean|string. This disables editing of the editor content by the user. If the special value "nocursor" is given (instead of simply true), focusing of the editor is also disallowed. */
|
||||
readOnly?: any;
|
||||
|
||||
/**Whether the cursor should be drawn when a selection is active. Defaults to false. */
|
||||
showCursorWhenSelecting?: boolean;
|
||||
|
||||
/** When enabled, which is the default, doing copy or cut when there is no selection will copy or cut the whole lines that have cursors on them. */
|
||||
lineWiseCopyCut?: boolean;
|
||||
|
||||
/** The maximum number of undo levels that the editor stores. Defaults to 40. */
|
||||
undoDepth?: number;
|
||||
|
||||
@ -918,6 +957,12 @@ declare namespace CodeMirror {
|
||||
/** Half - period in milliseconds used for cursor blinking. The default blink rate is 530ms. */
|
||||
cursorBlinkRate?: number;
|
||||
|
||||
/**
|
||||
* How much extra space to always keep above and below the cursor when
|
||||
* approaching the top or bottom of the visible view in a scrollable document. Default is 0.
|
||||
*/
|
||||
cursorScrollMargin?: number;
|
||||
|
||||
/** Determines the height of the cursor. Default is 1 , meaning it spans the whole height of the line.
|
||||
For some fonts (and by some tastes) a smaller height (for example 0.85),
|
||||
which causes the cursor to not reach all the way to the bottom of the line, looks better */
|
||||
@ -1020,6 +1065,10 @@ declare namespace CodeMirror {
|
||||
shared?: boolean;
|
||||
}
|
||||
|
||||
interface StringStreamConstructor {
|
||||
new (text: string): StringStream;
|
||||
}
|
||||
|
||||
interface StringStream {
|
||||
lastColumnPos: number;
|
||||
lastColumnValue: number;
|
||||
@ -1135,6 +1184,8 @@ declare namespace CodeMirror {
|
||||
* advances it past a token, and returns a style for that token. More advanced modes can also handle indentation for the language.
|
||||
*/
|
||||
interface Mode<T> {
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* This function should read one token from the stream it is given as an argument, optionally update its state,
|
||||
* and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces.
|
||||
@ -1222,6 +1273,26 @@ declare namespace CodeMirror {
|
||||
*/
|
||||
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>;
|
||||
|
||||
interface ModeMap {
|
||||
[modeName: string]: ModeFactory<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps mode names to their constructors
|
||||
*/
|
||||
var modes: ModeMap;
|
||||
|
||||
function defineMIME(mime: string, modeSpec: any): void;
|
||||
|
||||
interface MimeModeMap {
|
||||
[mimeName: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps MIME types to mode specs.
|
||||
*/
|
||||
var mimeModes: MimeModeMap;
|
||||
|
||||
interface CommandActions {
|
||||
/** Select the whole content of the editor. */
|
||||
selectAll(cm: CodeMirror.Editor): void;
|
||||
|
||||
6
types/codemirror/test/addon/edit/closebrackets.ts
Normal file
6
types/codemirror/test/addon/edit/closebrackets.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
autoCloseBrackets: "()[]{}''\"\""
|
||||
});
|
||||
6
types/codemirror/test/addon/edit/closetag.ts
Normal file
6
types/codemirror/test/addon/edit/closetag.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
autoCloseTags: true
|
||||
});
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, { matchBrackets: true });
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
matchBrackets: true
|
||||
});
|
||||
6
types/codemirror/test/addon/edit/matchtags.ts
Normal file
6
types/codemirror/test/addon/edit/matchtags.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
matchTags: { bothTags: true}
|
||||
});
|
||||
6
types/codemirror/test/addon/scroll/scrollpastend.ts
Normal file
6
types/codemirror/test/addon/scroll/scrollpastend.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
scrollPastEnd: true
|
||||
});
|
||||
6
types/codemirror/test/addon/search/match-highlighter.ts
Normal file
6
types/codemirror/test/addon/search/match-highlighter.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
highlightSelectionMatches: true
|
||||
});
|
||||
6
types/codemirror/test/addon/selection/active-line.ts
Normal file
6
types/codemirror/test/addon/selection/active-line.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
|
||||
styleActiveLine: true
|
||||
});
|
||||
@ -102,3 +102,5 @@ htmlElement1.remove();
|
||||
htmlElement2.remove();
|
||||
|
||||
CodeMirror.commands.newlineAndIndent(myCodeMirror);
|
||||
|
||||
let stringStream = new CodeMirror.StringStream("var myEditor;");
|
||||
|
||||
@ -20,19 +20,31 @@
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"codemirror-comment.d.ts",
|
||||
"codemirror-matchbrackets.d.ts",
|
||||
"codemirror-panel.d.ts",
|
||||
"codemirror-runmode.d.ts",
|
||||
"codemirror-showhint.d.ts",
|
||||
"codemirror-tern.d.ts",
|
||||
"searchcursor.d.ts",
|
||||
"addon/edit/closebrackets.d.ts",
|
||||
"addon/edit/closetag.d.ts",
|
||||
"addon/edit/matchbrackets.d.ts",
|
||||
"addon/edit/matchtags.d.ts",
|
||||
"addon/scroll/scrollpastend.d.ts",
|
||||
"addon/search/match-highlighter.d.ts",
|
||||
"addon/selection/active-line.d.ts",
|
||||
"test/comment.ts",
|
||||
"test/index.ts",
|
||||
"test/matchbrackets.ts",
|
||||
"test/panel.ts",
|
||||
"test/runmode.ts",
|
||||
"test/searchcursor.ts",
|
||||
"test/showhint.ts",
|
||||
"test/tern.ts"
|
||||
"test/tern.ts",
|
||||
"test/addon/edit/closebrackets.ts",
|
||||
"test/addon/edit/closetag.ts",
|
||||
"test/addon/edit/matchbrackets.ts",
|
||||
"test/addon/edit/matchtags.ts",
|
||||
"test/addon/scroll/scrollpastend.ts",
|
||||
"test/addon/search/match-highlighter.ts",
|
||||
"test/addon/selection/active-line.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user