diff --git a/ace-ext.d.ts b/ace-ext.d.ts index b55a070346f..3d69867334f 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -792,7 +792,7 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.33.0"; + version: "1.34.2"; }; edit: (el: string | (HTMLElement & { env?: any; @@ -804,7 +804,7 @@ declare module "ace-code/src/ext/textarea" { EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.33.0"; + version: "1.34.2"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index ede44f9b2a9..5ddf22be919 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -432,6 +432,7 @@ export namespace Ace { enableMultiselect: boolean; enableKeyboardAccessibility: boolean; enableCodeLens: boolean; + textInputAriaLabel: string; } interface EventsBase { diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 56068a19339..18189a11237 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -58,7 +58,7 @@ declare module "ace-code/src/lib/deep_copy" { } declare module "ace-code/src/lib/lang" { export function last(a: any): any; - export function stringReverse(string: any): any; + export function stringReverse(string: string): string; export function stringRepeat(string: any, count: any): string; export function stringTrimLeft(string: any): any; export function stringTrimRight(string: any): any; diff --git a/ace-modules.d.ts b/ace-modules.d.ts index f480678281d..7da597e29bc 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -449,7 +449,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.33.0"; + version: "1.34.2"; }; export = _exports; import AppConfig_1 = require("ace-code/src/lib/app_config"); @@ -4831,7 +4831,8 @@ declare module "ace-code/src/background_tokenizer" { /**@type {false|number}*/ running: false | number; lines: any[]; - states: any[]; + /**@type {string[]|string[][]}*/ + states: string[] | string[][]; currentLine: number; tokenizer: import("ace-code/src/tokenizer").Tokenizer; /** @@ -4873,9 +4874,9 @@ declare module "ace-code/src/background_tokenizer" { /** * Returns the state of tokenization at the end of a row. * @param {Number} row The row to get state at - * @returns {string} + * @returns {string | string[]} **/ - getState(row: number): string; + getState(row: number): string | string[]; cleanup(): void; } export type Document = import("ace-code/src/document").Document; @@ -5241,10 +5242,10 @@ declare module "ace-code/src/edit_session" { /** * {:BackgroundTokenizer.getState} * @param {Number} row The row to start at - * @returns {string} + * @returns {string | string[]} * @related BackgroundTokenizer.getState **/ - getState(row: number): string; + getState(row: number): string | string[]; /** * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. * @param {Number} row The row to start at diff --git a/ace.d.ts b/ace.d.ts index 6107574fc59..85f7d26a0ed 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -676,7 +676,7 @@ declare module "ace-code" { openingBracketBlock(session: EditSession, bracket: string, row: number, column: number, typeRe?: RegExp): Range | undefined; closingBracketBlock(session: EditSession, bracket: string, row: number, column: number, typeRe?: RegExp): Range | undefined; } - type BehaviorAction = (state: string, action: string, editor: Editor, session: EditSession, text: string | Range) => ({ + type BehaviorAction = (state: string | string[], action: string, editor: Editor, session: EditSession, text: string | Range) => ({ text: string; selection: number[]; } | Range) & { @@ -716,18 +716,18 @@ declare module "ace-code" { transformAction: BehaviorAction; path?: string; getTokenizer(): Tokenizer; - toggleCommentLines(state: any, session: EditSession, startRow: number, endRow: number): void; - toggleBlockComment(state: any, session: EditSession, range: Range, cursor: Point): void; - getNextLineIndent(state: any, line: string, tab: string): string; - checkOutdent(state: any, line: string, input: string): boolean; - autoOutdent(state: any, doc: EditSession, row: number): void; + toggleCommentLines(state: string | string[], session: EditSession, startRow: number, endRow: number): void; + toggleBlockComment(state: string | string[], session: EditSession, range: Range, cursor: Point): void; + getNextLineIndent(state: string | string[], line: string, tab: string): string; + checkOutdent(state: string | string[], line: string, input: string): boolean; + autoOutdent(state: string | string[], doc: EditSession, row: number): void; // TODO implement WorkerClient types createWorker(session: EditSession): any; createModeDelegates(mapping: { [key: string]: string; }): void; getKeywords(append?: boolean): Array; - getCompletions(state: string, session: EditSession, pos: Point, prefix: string): Completion[]; + getCompletions(state: string | string[], session: EditSession, pos: Point, prefix: string): Completion[]; } interface OptionsBase { [key: string]: any; @@ -981,7 +981,7 @@ declare module "ace-code" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.33.0"; + version: "1.34.2"; }; export function edit(el: string | (HTMLElement & { env?: any; @@ -998,6 +998,6 @@ declare module "ace-code" { import UndoManager = UndoManager_2.UndoManager; import Renderer_1 = require("ace-code/src/virtual_renderer"); import Renderer = Renderer_1.VirtualRenderer; - export var version: "1.33.0"; + export var version: "1.34.2"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/src/editor.js b/src/editor.js index bfc4e93a145..5afdbc7fe73 100644 --- a/src/editor.js +++ b/src/editor.js @@ -260,9 +260,7 @@ class Editor { getKeyboardHandler() { return this.keyBinding.getKeyboardHandler(); } - - - + /** * Sets a new editsession to use. This method also emits the `'changeSession'` event. * @param {EditSession} [session] The new session to use diff --git a/src/lib/lang.js b/src/lib/lang.js index dfb7c6d0d43..b447c27570f 100644 --- a/src/lib/lang.js +++ b/src/lib/lang.js @@ -4,6 +4,8 @@ exports.last = function(a) { return a[a.length - 1]; }; + +/** @param {string} string */ exports.stringReverse = function(string) { return string.split("").reverse().join(""); };