From 0b1d155616bb69ce72507ac615ef9c61528a841e Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 14 Dec 2023 15:48:11 +0400 Subject: [PATCH 01/33] Update type definitions in various files and add a declaration generator --- ace-internal.d.ts | 58 ++--- src/ace.js | 5 +- src/editor.js | 2 +- src/ext/code_lens.js | 2 +- src/mode/behaviour.js | 4 +- src/mode/behaviour/cstyle.js | 3 +- src/mode/folding/fold_mode.js | 1 + src/mode/text.js | 21 +- tool/ace_declaration_generator.js | 363 ++++++++++++++++++++++++++++++ tsconfig.json | 1 + 10 files changed, 416 insertions(+), 44 deletions(-) create mode 100644 tool/ace_declaration_generator.js diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 4066f585241..f3a2585633a 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -464,22 +464,22 @@ export namespace Ace { * Emitted when the current mode changes. * @param e */ - "changeMode": (e) => void; + "changeMode": (e: any) => void; /** * Emitted when the wrap mode changes. * @param e */ - "changeWrapMode": (e) => void; + "changeWrapMode": (e: any) => void; /** * Emitted when the wrapping limit changes. * @param e */ - "changeWrapLimit": (e) => void; + "changeWrapLimit": (e: any) => void; /** * Emitted when a code fold is added or removed. * @param e */ - "changeFold": (e, session: EditSession) => void; + "changeFold": (e: any, session: EditSession) => void; /** * Emitted when the scroll top changes. * @param scrollTop The new scroll top value @@ -502,15 +502,15 @@ export namespace Ace { * @param e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. **/ "changeSession": (e: { oldSession: EditSession, session: EditSession }) => void; - "blur": (e) => void; + "blur": (e: any) => void; "mousedown": (e: MouseEvent) => void; - "mousemove": (e: MouseEvent & { scrollTop? }, editor?: Editor) => void; + "mousemove": (e: MouseEvent & { scrollTop?: any }, editor?: Editor) => void; "changeStatus": () => void; "keyboardActivity": () => void; "mousewheel": (e: MouseEvent) => void; "mouseup": (e: MouseEvent) => void; - "beforeEndOperation": (e) => void; - "nativecontextmenu": (e) => void; + "beforeEndOperation": (e: any) => void; + "nativecontextmenu": (e: any) => void; "destroy": () => void; "focus": () => void; /** @@ -521,7 +521,7 @@ export namespace Ace { /** * Emitted when text is pasted. **/ - "paste": (text: string, event) => void; + "paste": (text: string, event: any) => void; /** * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. * @param data Contains one property, `data`, which indicates the new selection style @@ -537,7 +537,7 @@ export namespace Ace { "show": () => void; "hide": () => void; "select": (hide: boolean) => void; - "changeHoverMarker": (e) => void; + "changeHoverMarker": (e: any) => void; } interface DocumentEvents { @@ -596,12 +596,12 @@ export namespace Ace { } interface TextEvents { - "changeCharacterSize": (e) => void; + "changeCharacterSize": (e: any) => void; } interface VirtualRendererEvents { - "afterRender": (e, renderer: VirtualRenderer) => void; - "beforeRender": (e, renderer: VirtualRenderer) => void; + "afterRender": (e: any, renderer: VirtualRenderer) => void; + "beforeRender": (e: any, renderer: VirtualRenderer) => void; } class EventEmitter { @@ -696,7 +696,7 @@ export namespace Ace { type KeyboardHandler = Partial & { attach?: (editor: Editor) => void; detach?: (editor: Editor) => void; - getStatusText?: (editor?: any, data?) => string; + getStatusText?: (editor?: any, data?: any) => string; } export interface MarkerLike { @@ -787,6 +787,8 @@ export namespace Ace { type BehaviorMap = Record>; interface Behaviour { + $behaviours: {[behaviour: string]: any} + add(name: string, action: string, callback: BehaviorAction): void; addBehaviours(behaviours: BehaviorMap): void; @@ -873,7 +875,7 @@ export namespace Ace { $createKeywordList(): string[]; - $delegator(method: string, args: IArguments, defaultHandler): any; + $delegator(method: string, args: IArguments, defaultHandler: any): any; } @@ -925,7 +927,7 @@ export namespace Ace { interface TextInput { resetSelection(): void; - setAriaOption(options?: { activeDescendant: string, role: string, setLabel }): void; + setAriaOption(options?: { activeDescendant: string, role: string, setLabel: any }): void; } type CompleterCallback = (error: any, completions: Completion[]) => void; @@ -979,18 +981,18 @@ export namespace Ace { * Adds the selection and cursor. * @param orientedRange A range containing a cursor **/ - addSelectionMarker: (orientedRange: Ace.Range & { marker? }) => Ace.Range & { marker? }, + addSelectionMarker: (orientedRange: Ace.Range & { marker?: any }) => Ace.Range & { marker?: any }, /** * Removes the selection marker. * @param range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. **/ - removeSelectionMarker: (range: Ace.Range & { marker? }) => void, - removeSelectionMarkers: (ranges: (Ace.Range & { marker? })[]) => void, - $onAddRange: (e) => void, - $onRemoveRange: (e) => void, - $onMultiSelect: (e) => void, - $onSingleSelect: (e) => void, - $onMultiSelectExec: (e) => void, + removeSelectionMarker: (range: Ace.Range & { marker?: any }) => void, + removeSelectionMarkers: (ranges: (Ace.Range & { marker?: any })[]) => void, + $onAddRange: (e: any) => void, + $onRemoveRange: (e: any) => void, + $onMultiSelect: (e: any) => void, + $onSingleSelect: (e: any) => void, + $onMultiSelectExec: (e: any) => void, /** * Executes a command for each selection range. * @param cmd The command to execute @@ -1002,7 +1004,7 @@ export namespace Ace { **/ exitMultiSelectMode: () => void, getSelectedText: () => string, - $checkMultiselectChange: (e, anchor: Ace.Anchor) => void, + $checkMultiselectChange: (e: any, anchor: Ace.Anchor) => void, /** * Finds and selects all the occurrences of `needle`. * @param needle The text to find @@ -1172,8 +1174,8 @@ export const config: Ace.Config; export function require(name: string): any; export function edit(el: string | (Element & { - env?; - value?; + env?: any; + value?: any; }), options?: Partial): Ace.Editor; export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession; @@ -1397,7 +1399,7 @@ declare module "./src/virtual_renderer" { } declare module "./src/snippets" { - export interface SnippetManager extends Ace.EventEmitter { + interface SnippetManager extends Ace.EventEmitter { } } diff --git a/src/ace.js b/src/ace.js index 86ea484a156..32f4e89f480 100644 --- a/src/ace.js +++ b/src/ace.js @@ -28,7 +28,7 @@ exports.config = require("./config"); /** * Embeds the Ace editor into the DOM, at the element provided by `el`. - * @param {String | HTMLElement & {env?, value?}} el Either the id of an element, or the element itself + * @param {String | HTMLElement & {env?: any, value?: any}} el Either the id of an element, or the element itself * @param {Object } [options] Options for the editor * @returns {Editor} **/ @@ -86,4 +86,5 @@ exports.Editor = Editor; exports.EditSession = EditSession; exports.UndoManager = UndoManager; exports.VirtualRenderer = Renderer; -exports.version = exports.config.version; +var version = exports.config.version; +exports.version = version; diff --git a/src/editor.js b/src/editor.js index fa99ddf95b9..a43203f5a10 100644 --- a/src/editor.js +++ b/src/editor.js @@ -52,7 +52,7 @@ class Editor { this.$toDestroy = []; var container = renderer.getContainerElement(); - /**@type {HTMLElement & {env?, value?}}*/ + /**@type {HTMLElement & {env?:any, value?:any}}*/ this.container = container; /**@type {VirtualRenderer}*/ this.renderer = renderer; diff --git a/src/ext/code_lens.js b/src/ext/code_lens.js index 7a2c89a1228..8dd77924654 100644 --- a/src/ext/code_lens.js +++ b/src/ext/code_lens.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../edit_session").EditSession} EditSession - * @typedef {import("../virtual_renderer").VirtualRenderer & {$textLayer: import("../layer/text").Text &{$lenses}}} VirtualRenderer + * @typedef {import("../virtual_renderer").VirtualRenderer & {$textLayer: import("../layer/text").Text &{$lenses: any}}} VirtualRenderer */ var LineWidgets = require("../line_widgets").LineWidgets; diff --git a/src/mode/behaviour.js b/src/mode/behaviour.js index 764843849e3..ba3e8a94378 100644 --- a/src/mode/behaviour.js +++ b/src/mode/behaviour.js @@ -1,9 +1,9 @@ "use strict"; /** - * @typedef {Behaviour & {[key: string]: any}} IBehaviour + * @typedef {import("../../ace-internal").Ace.Behaviour} AceBehaviour */ -/**@type {any}*/ +/**@type {(new() => Partial) & {prototype: AceBehaviour}}*/ var Behaviour; Behaviour = function() { this.$behaviours = {}; diff --git a/src/mode/behaviour/cstyle.js b/src/mode/behaviour/cstyle.js index 12f545ec428..b085cef04ea 100644 --- a/src/mode/behaviour/cstyle.js +++ b/src/mode/behaviour/cstyle.js @@ -47,11 +47,10 @@ var getWrapped = function(selection, selected, opening, closing) { }; /** * Creates a new Cstyle behaviour object with the specified options. - * @constructor * @param {Object} [options] - The options for the Cstyle behaviour object. * @param {boolean} [options.braces] - Whether to force braces auto-pairing. * @param {boolean} [options.closeDocComment] - enables automatic insertion of closing tags for documentation comments. - */ + * @type {(new(options?: {braces: boolean, closeDocComment: boolean}) => Partial) & {prototype: import("../../../ace-internal").Ace.Behaviour}}*/ var CstyleBehaviour; CstyleBehaviour = function(options) { options = options || {}; diff --git a/src/mode/folding/fold_mode.js b/src/mode/folding/fold_mode.js index 2a5b306b798..7cbbc82ce65 100644 --- a/src/mode/folding/fold_mode.js +++ b/src/mode/folding/fold_mode.js @@ -2,6 +2,7 @@ var Range = require("../../range").Range; +/**@type {(new() => Partial) & {prototype: import("../../../ace-internal").Ace.FoldMode}}*/ var FoldMode = exports.FoldMode = function() {}; (function() { diff --git a/src/mode/text.js b/src/mode/text.js index da1ce98c4bb..8e575896815 100644 --- a/src/mode/text.js +++ b/src/mode/text.js @@ -1,4 +1,7 @@ "use strict"; +/** + * @typedef {import("../../ace-internal").Ace.SyntaxMode} SyntaxMode + */ var config = require("../config"); var Tokenizer = require("../tokenizer").Tokenizer; @@ -10,6 +13,8 @@ var lang = require("../lib/lang"); var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; + +/**@type {(new() => Partial) & {prototype: SyntaxMode}}*/ var Mode; Mode = function() { this.HighlightRules = TextHighlightRules; @@ -23,7 +28,7 @@ Mode = function() { this.nonTokenRe = new RegExp("^(?:[^" + unicode.wordChars + "\\$_]|\\s])+", "g"); /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.getTokenizer = function() { if (!this.$tokenizer) { @@ -37,7 +42,7 @@ Mode = function() { this.blockComment = ""; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.toggleCommentLines = function(state, session, startRow, endRow) { var doc = session.doc; @@ -170,7 +175,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.toggleBlockComment = function(state, session, range, cursor) { var comment = this.blockComment; @@ -285,7 +290,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.$delegator = function(method, args, defaultHandler) { var state = args[0] || "start"; @@ -314,7 +319,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.transformAction = function(state, action, editor, session, param) { if (this.$behaviour) { @@ -331,7 +336,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.getKeywords = function(append) { // this is for autocompletion to pick up regexp'ed keywords @@ -365,7 +370,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.$createKeywordList = function() { if (!this.$highlightRules) @@ -374,7 +379,7 @@ Mode = function() { }; /** - * @this {import("../../ace-internal").Ace.SyntaxMode} + * @this {SyntaxMode} */ this.getCompletions = function(state, session, pos, prefix) { var keywords = this.$keywordList || this.$createKeywordList(); diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js new file mode 100644 index 00000000000..deceba57fce --- /dev/null +++ b/tool/ace_declaration_generator.js @@ -0,0 +1,363 @@ +const ts = require('typescript'); +const fs = require("fs"); +const path = require("path"); + +/** + * @param {string} directoryPath + */ +function getParsedConfigFromDirectory(directoryPath) { + const configPath = ts.findConfigFile(directoryPath, ts.sys.fileExists, 'tsconfig.json'); + if (!configPath) throw new Error("Could not find tsconfig.json"); + + const configFile = ts.readConfigFile(configPath, ts.sys.readFile); + const parseConfigHost = { + fileExists: ts.sys.fileExists, + readFile: ts.sys.readFile, + readDirectory: ts.sys.readDirectory, + useCaseSensitiveFileNames: true + }; + + return ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, directoryPath); +} + +/** + * @return {string} + */ +function generateInitialDeclaration() { + const baseDirectory = path.resolve(__dirname, '..'); + const parsedConfig = getParsedConfigFromDirectory(baseDirectory); + const defaultCompilerHost = ts.createCompilerHost({}); + let fileContent; + + const customCompilerHost = { + ...defaultCompilerHost, + writeFile: function (fileName, content) { + fileContent = content; + return; + } + }; + + const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options, customCompilerHost); + program.emit(); + return fileContent; +} + +/** + * @param {string} fileName + * @param {string} content + */ +function createCustomCompilerHost(fileName, content) { + const newSourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS); + + const defaultCompilerHost = ts.createCompilerHost({}); + return { + ...defaultCompilerHost, + getSourceFile: (name, languageVersion) => { + if (name === fileName) { + return newSourceFile; + } + return defaultCompilerHost.getSourceFile(name, languageVersion); + }, + fileExists: (name) => { + if (name === fileName) { + return true; + } + return defaultCompilerHost.fileExists(name); + }, + readFile: (name) => { + if (name === fileName) { + return content; + } + return defaultCompilerHost.readFile(name); + } + }; +} + +/** + * @param {string} content + * @param {string} aceNamespacePath + */ +function fixDeclaration(content, aceNamespacePath) { + const temporaryName = "temp.d.ts"; + const customCompilerHost = createCustomCompilerHost(temporaryName, content); + const program = ts.createProgram([temporaryName], { + noEmit: true + }, customCompilerHost); + + var checker = program.getTypeChecker(); + let interfaces = collectInterfaces(aceNamespacePath); + + /** + * @param {ts.TransformationContext} context + * @return {function(*): *} + */ + function transformer(context) { + return (sourceFile) => { + function visit(node) { + let updatedNode = node; + if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) { + // replace wrong generated modules + if (node.name.text.endsWith("lib/keys") || node.name.text.endsWith("linking")) { + let statements = []; + if (interfaces[node.name.text]) { + statements = interfaces[node.name.text]; + } + const newBody = ts.factory.createModuleBlock(statements); + updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); + } + else if (interfaces[node.name.text]) { + // add corresponding interfaces to support mixins (EventEmitter, OptionsProvider, etc.) + if (node.body && ts.isModuleBlock(node.body)) { + const newBody = ts.factory.createModuleBlock( + node.body.statements.concat(interfaces[node.name.text]).filter(statement => { + if (node.name.text.endsWith("autocomplete")) { + return !(ts.isModuleDeclaration(statement) && statement.name.text + === 'Autocomplete'); + } + return true; + })); + updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); + } + } + else if (node.name.text.endsWith("/config") || node.name.text.endsWith("textarea")) { + //TODO: should be better way to do this + //correct mixed exports (export function + export = _exports) + if (node.body && ts.isModuleBlock(node.body)) { + const newBody = ts.factory.createModuleBlock(node.body.statements.filter(statement => { + const exportsStatement = ts.isVariableStatement(statement) + && statement.declarationList.declarations[0].name.getText() == "_exports"; + return exportsStatement || ts.isExportAssignment(statement) + || ts.isImportEqualsDeclaration(statement); + })); + updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); + + } + } + else if (node.name.text.endsWith("static_highlight")) { + if (node.body && ts.isModuleBlock(node.body)) { + const newBody = ts.factory.createModuleBlock(node.body.statements.filter(statement => { + return !ts.isExportAssignment(statement); + })); + updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); + } + } + } + else if (ts.isInterfaceDeclaration(node) && node.heritageClauses) { + for (const clause of node.heritageClauses) { + if (clause.token === ts.SyntaxKind.ExtendsKeyword && clause.types.length === 0) { + if (node.members.length === 0) { + return; // remove entire interface declaration + } + // Remove the extends clause if it's empty + return context.factory.updateInterfaceDeclaration(node, node.modifiers, node.name, + node.typeParameters, [], node.members + ); + } + } + } + else if (ts.isClassDeclaration(node) && node.heritageClauses) { + let updatedHeritageClauses = []; + // remove inheritances from undefined types + for (let i = 0; i < node.heritageClauses.length; i++) { + let clause = node.heritageClauses[i]; + if (clause.token === ts.SyntaxKind.ExtendsKeyword) { + const updatedTypes = clause.types.filter(type => { + const symbol = checker.getSymbolAtLocation(type.expression); + if (symbol) { + const declaredType = checker.getDeclaredTypeOfSymbol(symbol); + + return declaredType.flags !== ts.TypeFlags.Undefined + && declaredType["intrinsicName"] !== "error"; + } + return true; // keep the type if the symbol can't be resolved + }); + if (updatedTypes.length === 0) { + continue; + } + var updatedHeritageClause = clause; + if (updatedTypes.length !== clause.types.length) { + updatedHeritageClause = context.factory.createHeritageClause( + ts.SyntaxKind.ExtendsKeyword, updatedTypes); + } + } + if (updatedHeritageClause) { + updatedHeritageClauses.push(updatedHeritageClause); + } + else { + updatedHeritageClauses.push(clause); + } + } + return context.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, + updatedHeritageClauses, node.members + ); + } + return ts.visitEachChild(updatedNode, visit, context); + } + + return ts.visitNode(sourceFile, visit); + }; + } + + const sourceCode = program.getSourceFile(temporaryName); + const result = ts.transform(sourceCode, [transformer]); + + const printer = ts.createPrinter(); + //TODO: + const outputName = aceNamespacePath.replace("ace-internal", "ace"); + + result.transformed.forEach(transformedFile => { + let output = printer.printFile(transformedFile); + + fs.writeFileSync(outputName, output); + }); + + result.dispose(); + + checkFinalDeclaration(outputName); +} + +/** + * @param {string} declarationName + */ +function checkFinalDeclaration(declarationName) { + const program = ts.createProgram([declarationName], { + noEmit: true + }); + const diagnostics = ts.getPreEmitDiagnostics(program); + + diagnostics.forEach(diagnostic => { + if (diagnostic.file) { + const { + line, + character + } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); + } + else { + console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); + } + }); +} + +/** + * @param {string} aceNamespacePath + */ +function collectInterfaces(aceNamespacePath) { + const program = ts.createProgram([aceNamespacePath], { + noEmit: true + }); + const sourceFile = program.getSourceFile(aceNamespacePath); + const result = {}; + const printer = ts.createPrinter(); + let packageName = "ace-code"; + + function visit(node) { + if (node && ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) { + let nodes = []; + if (node.body && ts.isModuleBlock(node.body)) { + ts.forEachChild(node.body, (child) => { + if (ts.isInterfaceDeclaration(child) || ts.isFunctionDeclaration(child)) nodes.push(child); + }); + } + if (nodes.length > 0) { + const interfaceStrings = nodes.map( + interfaceNode => printer.printNode(ts.EmitHint.Unspecified, interfaceNode, sourceFile)); + + let concatenatedInterfaceStrings = interfaceStrings.join('\n\n'); + let identifiers = concatenatedInterfaceStrings.match(/Ace\.[\w]+ 0) { + identifiers = [...new Set(identifiers)]; + let importAlias = ''; + identifiers.forEach(identifier => { + let typeName = identifier.replace("Ace.", ""); + + if (typeName.includes("<")) { + typeName = typeName + "T>"; + } + importAlias += "type " + typeName + " = import(\"" + packageName + "\").Ace." + typeName + + ";\n\n"; + }); + concatenatedInterfaceStrings = "namespace Ace {" + importAlias + "}" + concatenatedInterfaceStrings; + } + + const newSourceFile = ts.createSourceFile( + 'temp.d.ts', concatenatedInterfaceStrings, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS); + nodes = newSourceFile.statements; + } + result[node.name.text.replace("./", packageName + "/")] = nodes; + } + ts.forEachChild(node, visit); + } + + visit(sourceFile); + + return result; +} + +/** + * @param {string} aceNamespacePath + * @return {string} + */ +function cloneAceNamespace(aceNamespacePath) { + + const program = ts.createProgram([aceNamespacePath], { + noEmit: true + }); + const sourceFile = program.getSourceFile(aceNamespacePath); + const printer = ts.createPrinter(); + for (let i = 0; i < sourceFile.statements.length; i++) { + const node = sourceFile.statements[i]; + if (ts.isModuleDeclaration(node) && node.name.text == "Ace") { + let aceModule = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); + aceModule = aceModule.replace(/"\.\/src/g, "\"ace-code/src"); + aceModule = '\n' + aceModule + '\n'; + return aceModule; + } + } +} + +/** + * @param {string} aceNamespacePath + */ +function generateDeclaration(aceNamespacePath) { + aceNamespacePath = path.resolve(__dirname, aceNamespacePath); + let data = generateInitialDeclaration(); + let packageName = "ace-code"; + + let updatedContent = data.replace(/(declare module ")/g, "$1" + packageName + "/src/"); + updatedContent = "/// \n" + updatedContent; + + updatedContent = updatedContent.replace(/(require\(")/g, "$1" + packageName + "/src/"); + updatedContent = updatedContent.replace(/(import\(")[./]*ace(?:\-internal)?("\).Ace)/g, "$1" + packageName + "$2"); + updatedContent = updatedContent.replace(/(import\(")(?:[./]*)(?!(?:ace\-code))/g, "$1" + packageName + "/src/"); + updatedContent = updatedContent.replace(/ace\-(?:code|builds)(\/src)?\/ace(?:\-internal)?/g, packageName); + let aceModule = cloneAceNamespace(aceNamespacePath); + + updatedContent = updatedContent.replace(/(declare\s+module\s+"ace-(?:code|builds)"\s+{)/, "$1" + aceModule); + updatedContent = updatedContent.replace(/(?:export)?\snamespace(?!\sAce)/g, "export namespace"); + fixDeclaration(updatedContent, aceNamespacePath); +} + +/** + * @param {string} content + */ +function updateDeclarationModuleNames(content) { + let output = content.replace( + /ace\-code(?:\/src)?\/(mode|theme|ext|keybinding|snippets)\//g, "ace-builds/src-noconflict/$1-"); + output = output.replace(/ace\-code(?:\/src)?/g, "ace-builds-internal"); + output = output.replace(/ace\-code/g, "ace-builds"); + output = output + '\n' + "declare module 'ace-builds/webpack-resolver';\n" + + "declare module 'ace-builds/esm-resolver';"; + //TODO: modes/worker + return output; +} + + +if (!module.parent) { + generateDeclaration("../ace-internal.d.ts"); +} +else { + exports.generateDeclaration = generateDeclaration; + exports.updateDeclarationModuleNames = updateDeclarationModuleNames; +} diff --git a/tsconfig.json b/tsconfig.json index 2f50ebab64c..5d60a248705 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "src/keyboard/vscode.js", "src/mode", "./ace-internal.d.ts", + "./ace-modes.d.ts", "src/**/* *" ], "include": [ From a36f2224eed81d54632426fdc6ca01a39f4daa63 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 14 Dec 2023 15:57:17 +0400 Subject: [PATCH 02/33] Update TypeScript configuration for ACE declaration generator --- tool/ace_declaration_generator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index deceba57fce..815e1ed9f4e 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -221,7 +221,9 @@ function fixDeclaration(content, aceNamespacePath) { */ function checkFinalDeclaration(declarationName) { const program = ts.createProgram([declarationName], { - noEmit: true + noEmit: true, + target: "es2019", + lib: ["lib.es2019.d.ts", "lib.dom.d.ts"] }); const diagnostics = ts.getPreEmitDiagnostics(program); From 362f2387803ab136257dfea02af5c64657cd28a7 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 15 Dec 2023 19:17:56 +0400 Subject: [PATCH 03/33] correct types --- src/mode/behaviour.js | 4 - src/mode/behaviour/css.js | 2 +- src/mode/behaviour/cstyle.js | 2 +- src/mode/behaviour/html.js | 1 + src/mode/behaviour/liquid.js | 133 ++++++++++++++++------------------ src/mode/behaviour/xml.js | 1 + src/mode/behaviour/xquery.js | 47 ++++++------ src/mode/folding/fold_mode.js | 1 - src/mode/text.js | 2 +- 9 files changed, 94 insertions(+), 99 deletions(-) diff --git a/src/mode/behaviour.js b/src/mode/behaviour.js index ba3e8a94378..597f0d5531f 100644 --- a/src/mode/behaviour.js +++ b/src/mode/behaviour.js @@ -1,9 +1,5 @@ "use strict"; -/** - * @typedef {import("../../ace-internal").Ace.Behaviour} AceBehaviour - */ -/**@type {(new() => Partial) & {prototype: AceBehaviour}}*/ var Behaviour; Behaviour = function() { this.$behaviours = {}; diff --git a/src/mode/behaviour/css.js b/src/mode/behaviour/css.js index 90acc7653f1..39da652cc38 100644 --- a/src/mode/behaviour/css.js +++ b/src/mode/behaviour/css.js @@ -1,10 +1,10 @@ "use strict"; - var oop = require("../../lib/oop"); var Behaviour = require("../behaviour").Behaviour; var CstyleBehaviour = require("./cstyle").CstyleBehaviour; var TokenIterator = require("../../token_iterator").TokenIterator; +/**@type {(new() => Partial)}*/ var CssBehaviour = function () { this.inherit(CstyleBehaviour); diff --git a/src/mode/behaviour/cstyle.js b/src/mode/behaviour/cstyle.js index b085cef04ea..4b77aaabf89 100644 --- a/src/mode/behaviour/cstyle.js +++ b/src/mode/behaviour/cstyle.js @@ -50,7 +50,7 @@ var getWrapped = function(selection, selected, opening, closing) { * @param {Object} [options] - The options for the Cstyle behaviour object. * @param {boolean} [options.braces] - Whether to force braces auto-pairing. * @param {boolean} [options.closeDocComment] - enables automatic insertion of closing tags for documentation comments. - * @type {(new(options?: {braces: boolean, closeDocComment: boolean}) => Partial) & {prototype: import("../../../ace-internal").Ace.Behaviour}}*/ + */ var CstyleBehaviour; CstyleBehaviour = function(options) { options = options || {}; diff --git a/src/mode/behaviour/html.js b/src/mode/behaviour/html.js index 23c779cb7d3..da248493a3d 100644 --- a/src/mode/behaviour/html.js +++ b/src/mode/behaviour/html.js @@ -3,6 +3,7 @@ var oop = require("../../lib/oop"); var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; +/**@type {(new() => Partial)}*/ var HtmlBehaviour = function () { XmlBehaviour.call(this); diff --git a/src/mode/behaviour/liquid.js b/src/mode/behaviour/liquid.js index 750278235d0..75cfb0a8e33 100644 --- a/src/mode/behaviour/liquid.js +++ b/src/mode/behaviour/liquid.js @@ -1,88 +1,83 @@ "use strict"; - var oop = require("../../lib/oop"); - var Behaviour = require("../behaviour").Behaviour; - var XmlBehaviour = require("./xml").XmlBehaviour; - var TokenIterator = require("../../token_iterator").TokenIterator; - var lang = require("../../lib/lang"); +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var XmlBehaviour = require("./xml").XmlBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); - function is(token, type) { - return token && token.type.lastIndexOf(type + ".xml") > -1; - } +function is(token, type) { + return token && token.type.lastIndexOf(type + ".xml") > -1; +} - var LiquidBehaviour = function () { - XmlBehaviour.call(this); - this.add("autoBraceTagClosing","insertion", function (state, action, editor, session, text) { - if (text == '}') { - var position = editor.getSelectionRange().start; - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken() || iterator.stepBackward(); +/**@type {(new() => Partial)}*/ +var LiquidBehaviour = function () { + XmlBehaviour.call(this); + this.add("autoBraceTagClosing", "insertion", function (state, action, editor, session, text) { + if (text == '}') { + var position = editor.getSelectionRange().start; + var iterator = new TokenIterator(session, position.row, position.column); + var token = iterator.getCurrentToken() || iterator.stepBackward(); - // exit if we're not in a tag - if (!token || !( token.value.trim() === '%' || is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) - return; + // exit if we're not in a tag + if (!token || !(token.value.trim() === '%' || is(token, "tag-name") || is(token, "tag-whitespace") || is( + token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) return; - // exit if we're inside of a quoted attribute value - if (is(token, "reference.attribute-value")) - return; + // exit if we're inside of a quoted attribute value + if (is(token, "reference.attribute-value")) return; - if (is(token, "attribute-value")) { - var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length; - if (position.column < tokenEndColumn) - return; - if (position.column == tokenEndColumn) { - var nextToken = iterator.stepForward(); - // TODO also handle non-closed string at the end of the line - if (nextToken && is(nextToken, "attribute-value")) - return; - iterator.stepBackward(); - } + if (is(token, "attribute-value")) { + var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length; + if (position.column < tokenEndColumn) return; + if (position.column == tokenEndColumn) { + var nextToken = iterator.stepForward(); + // TODO also handle non-closed string at the end of the line + if (nextToken && is(nextToken, "attribute-value")) return; + iterator.stepBackward(); } - // exit if the tag is empty - if (/{%\s*%/.test(session.getLine(position.row))) return; - if (/^\s*}/.test(session.getLine(position.row).slice(position.column))) - return; + } + // exit if the tag is empty + if (/{%\s*%/.test(session.getLine(position.row))) return; + if (/^\s*}/.test(session.getLine(position.row).slice(position.column))) return; - // find tag name - while (!token.type != 'meta.tag.punctuation.tag-open') { - token = iterator.stepBackward(); - if (token.value == '{%') { - while(true) { - token = iterator.stepForward(); + // find tag name + while (!token.type != 'meta.tag.punctuation.tag-open') { + token = iterator.stepBackward(); + if (token.value == '{%') { + while (true) { + token = iterator.stepForward(); - if (token.type === 'meta.tag.punctuation.tag-open') { - break; - } else if (token.value.trim() == '%') { - token = null; - break; - } + if (token.type === 'meta.tag.punctuation.tag-open') { + break; + } + else if (token.value.trim() == '%') { + token = null; + break; } - break; } + break; } - if (!token ) return ; - var tokenRow = iterator.getCurrentTokenRow(); - var tokenColumn = iterator.getCurrentTokenColumn(); + } + if (!token) return; + var tokenRow = iterator.getCurrentTokenRow(); + var tokenColumn = iterator.getCurrentTokenColumn(); - // exit if the tag is ending - if (is(iterator.stepBackward(), "end-tag-open")) - return; + // exit if the tag is ending + if (is(iterator.stepBackward(), "end-tag-open")) return; - var element = token.value; - if (tokenRow == position.row) - element = element.substring(0, position.column - tokenColumn); + var element = token.value; + if (tokenRow == position.row) element = element.substring(0, position.column - tokenColumn); - if (this.voidElements.hasOwnProperty(element.toLowerCase())) - return; - return { - text: "}" + "{% end" + element + " %}", - selection: [1, 1] - }; - } - }); + if (this.voidElements.hasOwnProperty(element.toLowerCase())) return; + return { + text: "}" + "{% end" + element + " %}", + selection: [1, 1] + }; + } + }); - }; +}; - oop.inherits(LiquidBehaviour, Behaviour); +oop.inherits(LiquidBehaviour, Behaviour); - exports.LiquidBehaviour = LiquidBehaviour; +exports.LiquidBehaviour = LiquidBehaviour; diff --git a/src/mode/behaviour/xml.js b/src/mode/behaviour/xml.js index 3f54b85f0bd..9d94c76fe1a 100644 --- a/src/mode/behaviour/xml.js +++ b/src/mode/behaviour/xml.js @@ -9,6 +9,7 @@ function is(token, type) { return token && token.type.lastIndexOf(type + ".xml") > -1; } +/**@type {(new() => Partial)}*/ var XmlBehaviour = function () { this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { diff --git a/src/mode/behaviour/xquery.js b/src/mode/behaviour/xquery.js index 4d72f38269a..a7dfc855d2f 100644 --- a/src/mode/behaviour/xquery.js +++ b/src/mode/behaviour/xquery.js @@ -1,16 +1,16 @@ "use strict"; - var oop = require("../../lib/oop"); - var Behaviour = require('../behaviour').Behaviour; - var CstyleBehaviour = require('./cstyle').CstyleBehaviour; - var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; - var TokenIterator = require("../../token_iterator").TokenIterator; +var oop = require("../../lib/oop"); +var Behaviour = require('../behaviour').Behaviour; +var CstyleBehaviour = require('./cstyle').CstyleBehaviour; +var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; function hasType(token, type) { var hasType = true; var typeList = token.type.split('.'); var needleList = type.split('.'); - needleList.forEach(function(needle){ + needleList.forEach(function (needle) { if (typeList.indexOf(needle) == -1) { hasType = false; return false; @@ -18,13 +18,14 @@ function hasType(token, type) { }); return hasType; } - - var XQueryBehaviour = function () { - - this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour - this.inherit(XmlBehaviour); // Get xml behaviour - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { + +/**@type {(new() => Partial)}*/ +var XQueryBehaviour = function () { + + this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour + this.inherit(XmlBehaviour); // Get xml behaviour + + this.add("autoclosing", "insertion", function (state, action, editor, session, text) { if (text == '>') { var position = editor.getCursorPosition(); var iterator = new TokenIterator(session, position.row, position.column); @@ -32,11 +33,13 @@ function hasType(token, type) { var atCursor = false; var state = JSON.parse(state).pop(); if ((token && token.value === '>') || state !== "StartTag") return; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ + if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))) { do { token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { + } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType( + token, 'entity.attribute-name') || hasType(token, 'text'))); + } + else { atCursor = true; } var previous = iterator.stepBackward(); @@ -44,18 +47,18 @@ function hasType(token, type) { return; } var tag = token.value.substring(1); - if (atCursor){ + if (atCursor) { var tag = tag.substring(0, position.column - token.start); } return { - text: '>' + '', - selection: [1, 1] + text: '>' + '', + selection: [1, 1] }; } }); - }; - oop.inherits(XQueryBehaviour, Behaviour); +}; +oop.inherits(XQueryBehaviour, Behaviour); - exports.XQueryBehaviour = XQueryBehaviour; +exports.XQueryBehaviour = XQueryBehaviour; diff --git a/src/mode/folding/fold_mode.js b/src/mode/folding/fold_mode.js index 7cbbc82ce65..2a5b306b798 100644 --- a/src/mode/folding/fold_mode.js +++ b/src/mode/folding/fold_mode.js @@ -2,7 +2,6 @@ var Range = require("../../range").Range; -/**@type {(new() => Partial) & {prototype: import("../../../ace-internal").Ace.FoldMode}}*/ var FoldMode = exports.FoldMode = function() {}; (function() { diff --git a/src/mode/text.js b/src/mode/text.js index 8e575896815..cd6a765d0b6 100644 --- a/src/mode/text.js +++ b/src/mode/text.js @@ -2,6 +2,7 @@ /** * @typedef {import("../../ace-internal").Ace.SyntaxMode} SyntaxMode */ + var config = require("../config"); var Tokenizer = require("../tokenizer").Tokenizer; @@ -14,7 +15,6 @@ var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; -/**@type {(new() => Partial) & {prototype: SyntaxMode}}*/ var Mode; Mode = function() { this.HighlightRules = TextHighlightRules; From a911b4c2f55922d87b4cc2e6226f62adaa8287ce Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 15 Dec 2023 19:20:07 +0400 Subject: [PATCH 04/33] exclude src/mode (whole dit with files); correct final declaration for ace-builds --- Makefile.dryice.js | 27 ++++++++++++++++++--------- tool/ace_declaration_generator.js | 27 +++++++++++++++++---------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 7ac4d0cb023..8bfab0db1f8 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -35,6 +35,7 @@ var fs = require("fs"); var path = require("path"); var copy = require('architect-build/copy'); var build = require('architect-build/build'); +var {updateDeclarationModuleNames, generateDeclaration} = require('./tool/ace_declaration_generator'); var ACE_HOME = __dirname; var BUILD_DIR = ACE_HOME + "/build"; @@ -174,20 +175,24 @@ function ace() { } } +function correctDeclarationsForBuild(path, additionalDeclarations) { + var definitions = fs.readFileSync(path, 'utf8'); + var newDefinitions = updateDeclarationModuleNames(definitions); + if (additionalDeclarations) { + newDefinitions = newDefinitions + '\n' + additionalDeclarations; + } + fs.writeFileSync(path, newDefinitions); +} + function buildTypes() { - var aceCodeModeDefinitions = '/// '; - var aceCodeExtensionDefinitions = '/// '; // ace-builds package has different structure and can't use mode types defined for the ace-code. - // ace-builds modes are declared along with other modules in the ace-modules.d.ts file below. - var definitions = fs.readFileSync(ACE_HOME + '/ace.d.ts', 'utf8').replace(aceCodeModeDefinitions, '').replace(aceCodeExtensionDefinitions, ''); var paths = fs.readdirSync(BUILD_DIR + '/src-noconflict'); - var moduleRef = '/// '; fs.readdirSync(BUILD_DIR + '/src-noconflict/snippets').forEach(function(path) { paths.push("snippets/" + path); }); - var moduleNameRegex = /^(mode|theme|ext|keybinding)-|^snippets\//; + var moduleNameRegex = /^(keybinding)-/; var pathModules = [ "declare module 'ace-builds/webpack-resolver';", @@ -199,9 +204,13 @@ function buildTypes() { return "declare module 'ace-builds/src-noconflict/" + moduleName + "';"; } }).filter(Boolean)).join("\n") + "\n"; - - fs.writeFileSync(BUILD_DIR + '/ace.d.ts', moduleRef + '\n' + definitions); - fs.writeFileSync(BUILD_DIR + '/ace-modules.d.ts', pathModules); + + fs.copyFileSync(ACE_HOME + '/ace-internal.d.ts', BUILD_DIR + '/ace.d.ts'); + generateDeclaration(BUILD_DIR + '/ace.d.ts'); + fs.copyFileSync(ACE_HOME + '/ace-modes.d.ts', BUILD_DIR + '/ace-modes.d.ts'); + correctDeclarationsForBuild(BUILD_DIR + '/ace.d.ts', pathModules); + correctDeclarationsForBuild(BUILD_DIR + '/ace-modes.d.ts'); + var esmUrls = []; var loader = paths.map(function(path) { diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 815e1ed9f4e..9d0f893d5f0 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -23,7 +23,7 @@ function getParsedConfigFromDirectory(directoryPath) { /** * @return {string} */ -function generateInitialDeclaration() { +function generateInitialDeclaration(excludeDir) { const baseDirectory = path.resolve(__dirname, '..'); const parsedConfig = getParsedConfigFromDirectory(baseDirectory); const defaultCompilerHost = ts.createCompilerHost({}); @@ -34,9 +34,15 @@ function generateInitialDeclaration() { writeFile: function (fileName, content) { fileContent = content; return; + }, + getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { + if (fileName.includes(excludeDir)) { + return undefined; + } + return defaultCompilerHost.getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile); } }; - + const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options, customCompilerHost); program.emit(); return fileContent; @@ -307,6 +313,9 @@ function cloneAceNamespace(aceNamespacePath) { noEmit: true }); const sourceFile = program.getSourceFile(aceNamespacePath); + if (!sourceFile) { + throw new Error("Could not find ace.d.ts"); + } const printer = ts.createPrinter(); for (let i = 0; i < sourceFile.statements.length; i++) { const node = sourceFile.statements[i]; @@ -323,8 +332,9 @@ function cloneAceNamespace(aceNamespacePath) { * @param {string} aceNamespacePath */ function generateDeclaration(aceNamespacePath) { - aceNamespacePath = path.resolve(__dirname, aceNamespacePath); - let data = generateInitialDeclaration(); + const excludeDir = "src/mode"; //TODO: remove, when modes are ES6 + + let data = generateInitialDeclaration(excludeDir); let packageName = "ace-code"; let updatedContent = data.replace(/(declare module ")/g, "$1" + packageName + "/src/"); @@ -346,18 +356,15 @@ function generateDeclaration(aceNamespacePath) { */ function updateDeclarationModuleNames(content) { let output = content.replace( - /ace\-code(?:\/src)?\/(mode|theme|ext|keybinding|snippets)\//g, "ace-builds/src-noconflict/$1-"); + /ace\-code(?:\/src)?\/(mode(?!\/(?:matching_brace_outdent|matching_parens_outdent|behaviour|folding))|theme|ext|keybinding|snippets)\//g, "ace-builds/src-noconflict/$1-"); + output = output.replace(/"ace\-code"/g, "\"ace-builds\""); output = output.replace(/ace\-code(?:\/src)?/g, "ace-builds-internal"); - output = output.replace(/ace\-code/g, "ace-builds"); - output = output + '\n' + "declare module 'ace-builds/webpack-resolver';\n" - + "declare module 'ace-builds/esm-resolver';"; - //TODO: modes/worker return output; } if (!module.parent) { - generateDeclaration("../ace-internal.d.ts"); + generateDeclaration(__dirname + "/../ace-internal.d.ts"); } else { exports.generateDeclaration = generateDeclaration; From a57489b307c1558629bedeaa737342f3ede592a0 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 5 Feb 2024 14:29:34 +0400 Subject: [PATCH 05/33] move `for` static method under `Autocomplete` class; fix types --- ace-internal.d.ts | 13 ++++++------ src/autocomplete.js | 48 ++++++++++++++++++++++++--------------------- src/config.js | 3 --- src/editor.js | 1 + 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/ace-internal.d.ts b/ace-internal.d.ts index f3a2585633a..4a02c0aa79a 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -48,16 +48,18 @@ export namespace Ace { loadModule(moduleName: string | [string, string], onLoad?: (module: any) => void): void; - - init(packaged: any): any; - - defineOptions(obj: any, path: string, options: { [key: string]: any }): Config; + + defineOptions(obj: any, path: string, options: { [key: string]: any }): AppConfig; resetOptions(obj: any): void; setDefaultValue(path: string, name: string, value: any): void; setDefaultValues(path: string, optionHash: { [key: string]: any }): void; + + setMessages(value: any): void; + + nls(string: string, params?:{ [x: string]: any; }): string; } interface Theme { @@ -364,7 +366,7 @@ export namespace Ace { highlightGutterLine: boolean; hScrollBarAlwaysVisible: boolean; vScrollBarAlwaysVisible: boolean; - fontSize: string; + fontSize: string | number; fontFamily: string; maxLines: number; minLines: number; @@ -1236,7 +1238,6 @@ declare module "./src/background_tokenizer" { declare module "./src/document" { export interface Document extends Ace.EventEmitter { - } } diff --git a/src/autocomplete.js b/src/autocomplete.js index e921caa9c50..2c5cfba8ba3 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -470,7 +470,7 @@ class Autocomplete { /** * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions * @param {Editor} editor - * @param {CompletionOptions} options + * @param {CompletionOptions} [options] */ showPopup(editor, options) { if (this.editor) @@ -510,7 +510,7 @@ class Autocomplete { /** * @param {boolean} keepPopupPosition - * @param {CompletionOptions} options + * @param {CompletionOptions} [options] */ updateCompletions(keepPopupPosition, options) { if (keepPopupPosition && this.base && this.completions) { @@ -733,6 +733,30 @@ class Autocomplete { this.inlineRenderer = this.popup = this.editor = null; } + /** + * @param {Editor} editor + * @return {Autocomplete} + */ + static for(editor) { + if (editor.completer instanceof Autocomplete) { + return editor.completer; + } + if (editor.completer) { + editor.completer.destroy(); + editor.completer = null; + } + if (config.get("sharedPopups")) { + if (!Autocomplete["$sharedInstance"]) + Autocomplete["$sharedInstance"] = new Autocomplete(); + editor.completer = Autocomplete["$sharedInstance"]; + } else { + editor.completer = new Autocomplete(); + editor.once("destroy", destroyCompleter); + } + // @ts-expect-error + return editor.completer; + } + } Autocomplete.prototype.commands = { @@ -762,26 +786,6 @@ Autocomplete.prototype.commands = { "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } }; - -Autocomplete.for = function(editor) { - if (editor.completer instanceof Autocomplete) { - return editor.completer; - } - if (editor.completer) { - editor.completer.destroy(); - editor.completer = null; - } - if (config.get("sharedPopups")) { - if (!Autocomplete["$sharedInstance"]) - Autocomplete["$sharedInstance"] = new Autocomplete(); - editor.completer = Autocomplete["$sharedInstance"]; - } else { - editor.completer = new Autocomplete(); - editor.once("destroy", destroyCompleter); - } - return editor.completer; -}; - Autocomplete.startCommand = { name: "startAutocomplete", exec: function(editor, options) { diff --git a/src/config.js b/src/config.js index 2c81c537b65..3320f571b12 100644 --- a/src/config.js +++ b/src/config.js @@ -100,9 +100,6 @@ var loader = function(moduleName, cb) { console.error("loader is not configured"); }; var customLoader; -/** - * @param {(moduleName: string, afterLoad: (err: Error | null, module: unknown) => void) => void}cb - */ exports.setLoader = function(cb) { customLoader = cb; }; diff --git a/src/editor.js b/src/editor.js index a43203f5a10..8270a6b6b67 100644 --- a/src/editor.js +++ b/src/editor.js @@ -479,6 +479,7 @@ class Editor { * @return {string} */ getFontSize() { + // @ts-expect-error return this.getOption("fontSize") || dom.computedStyle(this.container).fontSize; } From 0e4c4702c85e2986185aebfee5d426056afecdef Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 5 Feb 2024 14:30:33 +0400 Subject: [PATCH 06/33] remove private properties/methods from public API --- tool/ace_declaration_generator.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 9d0f893d5f0..c9edc60840c 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -207,7 +207,18 @@ function fixDeclaration(content, aceNamespacePath) { const sourceCode = program.getSourceFile(temporaryName); const result = ts.transform(sourceCode, [transformer]); - const printer = ts.createPrinter(); + const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { + substituteNode(hint, node) { + // remove all private members + if ((ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration(node) + || ts.isPropertySignature(node)) && ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text)) { + return ts.factory.createNotEmittedStatement(node); + } else if (ts.isVariableStatement(node) && node.getText().indexOf("export const $") > -1) { + return ts.factory.createNotEmittedStatement(node); + } + return node; + } + }); //TODO: const outputName = aceNamespacePath.replace("ace-internal", "ace"); @@ -228,7 +239,7 @@ function fixDeclaration(content, aceNamespacePath) { function checkFinalDeclaration(declarationName) { const program = ts.createProgram([declarationName], { noEmit: true, - target: "es2019", + target: ts.ScriptTarget.ES2019, lib: ["lib.es2019.d.ts", "lib.dom.d.ts"] }); const diagnostics = ts.getPreEmitDiagnostics(program); From ee141968579c93f13a68fd687b6124b8cf08645d Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 5 Feb 2024 14:55:36 +0400 Subject: [PATCH 07/33] remove unnecessary generated declaration; fix tsconfig.json --- package.json | 2 +- tool/ace_declaration_generator.js | 3 +++ tsconfig.json | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8a1a040f01d..7bb594f8de4 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "typecheck": "tsc -p tsconfig.json", "update-types": "node ./tool/modes-declaration-generator.js", "changelog": "standard-version", - "prepack": "node tool/esm_resolver_generator.js && node Makefile.dryice.js css --target build-styles && rm -rf styles && mv build-styles/css styles" + "prepack": "node tool/esm_resolver_generator.js && node tool/ace_declaration_generator.js && node Makefile.dryice.js css --target build-styles && rm -rf styles && mv build-styles/css styles" }, "standard-version": { "skip": { diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index c9edc60840c..0710619106b 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -16,6 +16,9 @@ function getParsedConfigFromDirectory(directoryPath) { readDirectory: ts.sys.readDirectory, useCaseSensitiveFileNames: true }; + configFile.config.compilerOptions.noEmit = false; + configFile.config.compilerOptions.emitDeclarationOnly = true; + configFile.config.compilerOptions.outFile = "./types/index.d.ts"; return ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, directoryPath); } diff --git a/tsconfig.json b/tsconfig.json index 5d60a248705..40f7b26ae02 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,7 @@ "allowJs": true, "checkJs": true, "declaration": true, - "emitDeclarationOnly": true, - "outFile": "./types/index.d.ts" + "noEmit": true, }, "exclude": [ "node_modules", From 367442966d7f2b15cfad1623387874328ce00bf0 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 8 Apr 2024 18:19:16 +0400 Subject: [PATCH 08/33] update ace.d.ts --- ace.d.ts | 10505 +++++++++++++++++++++++++--- package.json | 2 +- tool/ace_declaration_generator.js | 6 +- 3 files changed, 9347 insertions(+), 1166 deletions(-) diff --git a/ace.d.ts b/ace.d.ts index d22d3d23572..68d6bfac577 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,1167 +1,9344 @@ /// -/// - -export namespace Ace { - export type NewLineMode = 'auto' | 'unix' | 'windows'; - - export interface Anchor extends EventEmitter { - getPosition(): Position; - getDocument(): Document; - setPosition(row: number, column: number, noClip?: boolean): void; - detach(): void; - attach(doc: Document): void; - } - - export interface Document extends EventEmitter { - setValue(text: string): void; - getValue(): string; - createAnchor(row: number, column: number): Anchor; - getNewLineCharacter(): string; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - isNewLine(text: string): boolean; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getAllLines(): string[]; - getLength(): number; - getTextRange(range: Range): string; - getLinesForRange(range: Range): string[]; - insert(position: Position, text: string): Position; - insert(position: {row: number, column: number}, text: string): Position; - insertInLine(position: Position, text: string): Position; - insertNewLine(position: Point): Point; - clippedPos(row: number, column: number): Point; - clonePos(pos: Point): Point; - pos(row: number, column: number): Point; - insertFullLines(row: number, lines: string[]): void; - insertMergedLines(position: Position, lines: string[]): Point; - remove(range: Range): Position; - removeInLine(row: number, startColumn: number, endColumn: number): Position; - removeFullLines(firstRow: number, lastRow: number): string[]; - removeNewLine(row: number): void; - replace(range: Range, text: string): Position; - applyDeltas(deltas: Delta[]): void; - revertDeltas(deltas: Delta[]): void; - applyDelta(delta: Delta, doNotValidate?: boolean): void; - revertDelta(delta: Delta): void; - indexToPosition(index: number, startRow: number): Position; - positionToIndex(pos: Position, startRow?: number): number; - } - - export interface FoldLine { - folds: Fold[]; - range: Range; - start: Point; - end: Point; - - shiftRow(shift: number): void; - addFold(fold: Fold): void; - containsRow(row: number): boolean; - walk(callback: Function, endRow?: number, endColumn?: number): void; - getNextFoldTo(row: number, column: number): null | { fold: Fold, kind: string }; - addRemoveChars(row: number, column: number, len: number): void; - split(row: number, column: number): FoldLine; - merge(foldLineNext: FoldLine): void; - idxToPosition(idx: number): Point; - } - - export interface Fold { - range: Range; - start: Point; - end: Point; - foldLine?: FoldLine; - sameRow: boolean; - subFolds: Fold[]; - - setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - addSubFold(fold: Fold): Fold; - restoreRange(range: Range): void; - } - - interface Folding { - getFoldAt(row: number, column: number, side: number): Fold; - getFoldsInRange(range: Range): Fold[]; - getFoldsInRangeList(ranges: Range[]): Fold[]; - getAllFolds(): Fold[]; - getFoldStringAt(row: number, - column: number, - trim?: number, - foldLine?: FoldLine): string | null; - getFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getNextFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getFoldedRowCount(first: number, last: number): number; - addFold(placeholder: string | Fold, range?: Range): Fold; - addFolds(folds: Fold[]): void; - removeFold(fold: Fold): void; - removeFolds(folds: Fold[]): void; - expandFold(fold: Fold): void; - expandFolds(folds: Fold[]): void; - unfold(location: null | number | Point | Range, - expandInner?: boolean): Fold[] | undefined; - isRowFolded(docRow: number, startFoldRow?: FoldLine): boolean; - getFoldRowEnd(docRow: number, startFoldRow?: FoldLine): number; - getFoldRowStart(docRow: number, startFoldRow?: FoldLine): number; - getFoldDisplayLine(foldLine: FoldLine, - endRow: number | null, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - getDisplayLine(row: number, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - toggleFold(tryToUnfold?: boolean): void; - getCommentFoldRange(row: number, - column: number, - dir: number): Range | undefined; - foldAll(startRow?: number, endRow?: number, depth?: number): void; - setFoldStyle(style: string): void; - getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { - range?: Range, - firstRange: Range +declare module "ace-code/src/lib/useragent" { + export namespace OS { + let LINUX: string; + let MAC: string; + let WINDOWS: string; + } + export function getOS(): string; + export const isWin: boolean; + export const isMac: boolean; + export const isLinux: boolean; + export const isIE: number; + export const isOldIE: boolean; + export const isGecko: any; + export const isMozilla: any; + export const isOpera: boolean; + export const isWebKit: number; + export const isChrome: number; + export const isSafari: true; + export const isEdge: number; + export const isAIR: boolean; + export const isAndroid: boolean; + export const isChromeOS: boolean; + export const isIOS: boolean; + export const isMobile: boolean; +} +declare module "ace-code/src/lib/dom" { + export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; + export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; + export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; + export function removeChildren(element: HTMLElement): void; + export function createTextNode(textContent: string, element?: HTMLElement): Text; + export function createFragment(element?: HTMLElement): DocumentFragment; + export function hasCssClass(el: HTMLElement, name: string): boolean; + export function addCssClass(el: HTMLElement, name: string): void; + export function removeCssClass(el: HTMLElement, name: string): void; + export function toggleCssClass(el: HTMLElement, name: string): boolean; + export function setCssClass(node: HTMLElement, className: string, include: boolean): void; + export function hasCssString(id: string, doc?: Document): boolean; + export function removeElementById(id: string, doc?: Document): void; + export function useStrictCSP(value: any): void; + export function importCssStylsheet(uri: string, doc?: Document): void; + export function scrollbarWidth(doc?: Document): number; + export function computedStyle(element: Element, style?: any): Partial; + export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; + export const HAS_CSS_ANIMATION: boolean; + export const HAS_CSS_TRANSFORMS: boolean; + export const HI_DPI: boolean; + export function translate(element: any, tx: any, ty: any): void; + export function importCssString(cssText: any, id: any, target: any): number; +} +declare module "ace-code/src/lib/oop" { + export function inherits(ctor: any, superCtor: any): void; + export function mixin(obj: T, mixin: any): any; + export function implement(proto: T, mixin: any): any; +} +declare module "ace-code/src/lib/deep_copy" { + export function deepCopy(obj: any): any; +} +declare module "ace-code/src/lib/lang" { + export function last(a: any): any; + export function stringReverse(string: any): any; + export function stringRepeat(string: any, count: any): string; + export function stringTrimLeft(string: any): any; + export function stringTrimRight(string: any): any; + export function copyObject(obj: any): {}; + export function copyArray(array: any): any[]; + export const deepCopy: (obj: any) => any; + export function arrayToMap(arr: any): {}; + export function createMap(props: any): any; + export function arrayRemove(array: any, value: any): void; + export function escapeRegExp(str: any): any; + export function escapeHTML(str: any): string; + export function getMatchOffsets(string: any, regExp: any): any[]; + export function deferredCall(fcn: any): { + (timeout: any): any; + schedule: any; + call(): any; + cancel(): any; + isPending(): any; + }; + export function delayedCall(fcn: any, defaultTimeout: any): { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; + isPending(): any; + }; + export function supportsLookbehind(): boolean; + export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; +} +declare module "ace-code/src/lib/keys" { } +declare module "ace-code/src/lib/event" { + export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; + export function removeListener(elem: any, type: any, callback: any): void; + export function stopEvent(e: any): boolean; + export function stopPropagation(e: any): void; + export function preventDefault(e: any): void; + export function getButton(e: any): any; + export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; + export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; + export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; + export function getModifierString(e: KeyboardEvent | MouseEvent): any; + export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; + export function nextTick(callback: any, win: any): void; + export function onIdle(cb: any, timeout: any): number; + export function blockIdle(delay: any): void; + export const nextFrame: any; +} +declare module "ace-code/src/lib/event_emitter" { + /**@type {any}*/ + export var EventEmitter: any; +} +declare module "ace-code/src/layer/font_metrics" { + const FontMetrics_base: undefined; + export class FontMetrics { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + el: HTMLDivElement; + /** + * @param size + */ + checkForSizeChanges(size: any): void; + charSizes: any; + allowBoldFonts: boolean; + /** + * @param {boolean} val + */ + setPolling(val: boolean): void; + getCharacterWidth(ch: any): any; + destroy(): void; + els: any[] | HTMLElement | Text; + transformCoordinates(clientPos: any, elPos: any): any[]; + } + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface FontMetrics extends Ace.EventEmitter { + } +} +declare module "ace-code/src/apply_delta" { + export function applyDelta(docLines: string[], delta: import("ace-code").Ace.Delta, doNotValidate?: any): void; +} +declare module "ace-code/src/document" { + const Document_base: undefined; + /** + * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. + * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. + **/ + export class Document { + /** + * + * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty. + * @param {String | String[]} textOrLines text The starting text + **/ + constructor(textOrLines: string | string[]); + /** + * Replaces all the lines in the current `Document` with the value of `text`. + * + * @param {String} text The text to use + **/ + setValue(text: string): void; + /** + * Returns all the lines in the document as a single string, joined by the new line character. + * @returns {String} + **/ + getValue(): string; + /** + * Creates a new `Anchor` to define a floating point in the document. + * @param {Number} row The row number to use + * @param {Number} column The column number to use + * @returns {Anchor} + **/ + createAnchor(row: number, column: number): Anchor; + /** + * Returns the newline character that's being used, depending on the value of `newLineMode`. + * @returns {String} If `newLineMode == windows`, `\r\n` is returned. + * If `newLineMode == unix`, `\n` is returned. + * If `newLineMode == auto`, the value of `autoNewLine` is returned. + * + **/ + getNewLineCharacter(): string; + /** + * [Sets the new line mode.]{: #Document.setNewLineMode.desc} + * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} + + **/ + setNewLineMode(newLineMode: NewLineMode): void; + /** + * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} + * @returns {NewLineMode} + **/ + getNewLineMode(): NewLineMode; + /** + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * @param {String} text The text to check + * @returns {boolean} + **/ + isNewLine(text: string): boolean; + /** + * Returns a verbatim copy of the given line as it is in the document + * @param {Number} row The row index to retrieve + * @returns {string} + **/ + getLine(row: number): string; + /** + * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. + * @param {Number} firstRow The first row index to retrieve + * @param {Number} lastRow The final row index to retrieve + * @returns {string[]} + **/ + getLines(firstRow: number, lastRow: number): string[]; + /** + * Returns all lines in the document as string array. + * @returns {string[]} + **/ + getAllLines(): string[]; + /** + * Returns the number of rows in the document. + * @returns {Number} + **/ + getLength(): number; + /** + * Returns all the text within `range` as a single string. + * @param {IRange} range The range to work with. + * + * @returns {String} + **/ + getTextRange(range: IRange): string; + /** + * Returns all the text within `range` as an array of lines. + * @param {IRange} range The range to work with. + * + * @returns {string[]} + **/ + getLinesForRange(range: IRange): string[]; + /** + * @param row + * @param lines + + * @deprecated + */ + insertLines(row: any, lines: any): void; + /** + * @param firstRow + * @param lastRow + * @returns {String[]} + + * @deprecated + */ + removeLines(firstRow: any, lastRow: any): string[]; + /** + * @param position + * @returns {Point} + + * @deprecated + */ + insertNewLine(position: any): Point; + /** + * Inserts a block of `text` at the indicated `position`. + * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` + * @param {String} text A chunk of text to insert + * @returns {Point} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + + **/ + insert(position: Point, text: string): Point; + /** + * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event. + * + * This differs from the `insert` method in two ways: + * 1. This does NOT handle newline characters (single-line text only). + * 2. This is faster than the `insert` method for single-line text insertions. + * + * @param {Point} position The position to insert at; it's an object that looks like `{ row: row, column: column}` + * @param {String} text A chunk of text without new lines + * @returns {Point} Returns the position of the end of the inserted text + **/ + insertInLine(position: Point, text: string): Point; + /** + * + * @param {number} row + * @param {number} column + * @return {Point} + */ + clippedPos(row: number, column: number): Point; + /** + * @param {Point} pos + * @return {Point} + */ + clonePos(pos: Point): Point; + /** + * @param {number} row + * @param {number} column + * @return {Point} + */ + pos(row: number, column: number): Point; + /** + * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. + * @param {Number} row The index of the row to insert at + * @param {string[]} lines An array of strings + + **/ + insertFullLines(row: number, lines: string[]): void; + /** + * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. + * @param {Point} position + * @param {string[]} lines An array of strings + * @returns {Point} Contains the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If `lines` is empty, this function returns an object containing the current row, and column, like this: + * ``` + * {row: row, column: 0} + * ``` + **/ + insertMergedLines(position: Point, lines: string[]): Point; + /** + * Removes the `range` from the document. + * @param {IRange} range A specified Range to remove + * @returns {Point} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + + **/ + remove(range: IRange): Point; + /** + * Removes the specified columns from the `row`. This method also triggers a `"change"` event. + * @param {Number} row The row to remove from + * @param {Number} startColumn The column to start removing at + * @param {Number} endColumn The column to stop removing at + * @returns {Point} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. + + **/ + removeInLine(row: number, startColumn: number, endColumn: number): Point; + /** + * Removes a range of full lines. This method also triggers the `"change"` event. + * @param {Number} firstRow The first row to be removed + * @param {Number} lastRow The last row to be removed + * @returns {String[]} Returns all the removed lines. + + **/ + removeFullLines(firstRow: number, lastRow: number): string[]; + /** + * Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event. + * @param {Number} row The row to check + * + **/ + removeNewLine(row: number): void; + /** + * Replaces a range in the document with the new `text`. + * @param {Range | IRange} range A specified Range to replace + * @param {String} text The new text to use as a replacement + * @returns {Point} Returns an object containing the final row and column, like this: + * {row: endRow, column: 0} + * If the text and range are empty, this function returns an object containing the current `range.start` value. + * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. + * + **/ + replace(range: Range | IRange, text: string): Point; + /** + * Applies all changes in `deltas` to the document. + * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) + **/ + applyDeltas(deltas: Delta[]): void; + /** + * Reverts all changes in `deltas` from the document. + * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) + **/ + revertDeltas(deltas: Delta[]): void; + /** + * Applies `delta` to the document. + * @param {Delta} delta A delta object (can include "insert" and "remove" actions) + * @param {boolean} [doNotValidate] + **/ + applyDelta(delta: Delta, doNotValidate?: boolean): void; + /** + * Reverts `delta` from the document. + * @param {Delta} delta A delta object (can include "insert" and "remove" actions) + **/ + revertDelta(delta: Delta): void; + /** + * Converts an index position in a document to a `{row, column}` object. + * + * Index refers to the "absolute position" of a character in the document. For example: + * + * ```javascript + * var x = 0; // 10 characters, plus one for newline + * var y = -1; + * ``` + * + * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. + * + * @param {Number} index An index to convert + * @param {Number} [startRow=0] The row from which to start the conversion + * @returns {Point} A `{row, column}` object of the `index` position + */ + indexToPosition(index: number, startRow?: number): Point; + /** + * Converts the `{row, column}` position in a document to the character's index. + * + * Index refers to the "absolute position" of a character in the document. For example: + * + * ```javascript + * var x = 0; // 10 characters, plus one for newline + * var y = -1; + * ``` + * + * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. + * + * @param {Point} pos The `{row, column}` to convert + * @param {Number} [startRow=0] The row from which to start the conversion + * @returns {Number} The index position in the document + */ + positionToIndex(pos: Point, startRow?: number): number; + } + export type Delta = import("ace-code").Ace.Delta; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + export type NewLineMode = import("ace-code").Ace.NewLineMode; + import Anchor_1 = require("ace-code/src/anchor"); + import Anchor = Anchor_1.Anchor; + import Range_1 = require("ace-code/src/range"); + import Range = Range_1.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type DocumentEvents = import("ace-code").Ace.DocumentEvents; + } + export interface Document extends Ace.EventEmitter { + } +} +declare module "ace-code/src/anchor" { + const Anchor_base: undefined; + /** + * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. + **/ + export class Anchor { + /** + * Creates a new `Anchor` and associates it with a document. + * + * @param {Document} doc The document to associate with the anchor + * @param {Number|import("ace-code").Ace.Point} row The starting row position + * @param {Number} [column] The starting column position + **/ + constructor(doc: Document, row: number | import("ace-code").Ace.Point, column?: number); + /** + * Returns an object identifying the `row` and `column` position of the current anchor. + * @returns {import("ace-code").Ace.Point} + **/ + getPosition(): import("ace-code").Ace.Point; + /** + * + * Returns the current document. + * @returns {Document} + **/ + getDocument(): Document; + /** + * Internal function called when `"change"` event fired. + * @param {import("ace-code").Ace.Delta} delta + */ + onChange(delta: import("ace-code").Ace.Delta): void; + /** + * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. + * @param {Number} row The row index to move the anchor to + * @param {Number} column The column index to move the anchor to + * @param {Boolean} [noClip] Identifies if you want the position to be clipped + **/ + setPosition(row: number, column: number, noClip?: boolean): void; + row: any; + column: number; + /** + * When called, the `"change"` event listener is removed. + * + **/ + detach(): void; + /** + * When called, the `"change"` event listener is appended. + * @param {Document} doc The document to associate with + * + **/ + attach(doc: Document): void; + /**@type{Document}*/ + document: Document; + markerId?: number; + } + export type Document = import("ace-code/src/document").Document; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type AnchorEvents = import("ace-code").Ace.AnchorEvents; + type Document = import("ace-code").Ace.Document; + } + export interface Anchor extends Ace.EventEmitter { + markerId?: number; + document: Ace.Document; + } +} +declare module "ace-code/src/lib/net" { + export function get(url: any, callback: any): void; + export function loadScript(path: any, callback: any): void; + export function qualifyURL(url: any): string; +} +declare module "ace-code/src/lib/report_error" { + export function reportError(msg: any, data: any): void; +} +declare module "ace-code/src/lib/default_english_messages" { + export var defaultEnglishMessages: { + "autocomplete.popup.aria-roledescription": string; + "autocomplete.popup.aria-label": string; + "autocomplete.popup.item.aria-roledescription": string; + "autocomplete.loading": string; + "editor.scroller.aria-roledescription": string; + "editor.scroller.aria-label": string; + "editor.gutter.aria-roledescription": string; + "editor.gutter.aria-label": string; + "error-marker.good-state": string; + "prompt.recently-used": string; + "prompt.other-commands": string; + "prompt.no-matching-commands": string; + "search-box.find.placeholder": string; + "search-box.find-all.text": string; + "search-box.replace.placeholder": string; + "search-box.replace-next.text": string; + "search-box.replace-all.text": string; + "search-box.toggle-replace.title": string; + "search-box.toggle-regexp.title": string; + "search-box.toggle-case.title": string; + "search-box.toggle-whole-word.title": string; + "search-box.toggle-in-selection.title": string; + "search-box.search-counter": string; + "text-input.aria-roledescription": string; + "text-input.aria-label": string; + "gutter.code-folding.range.aria-label": string; + "gutter.code-folding.closed.aria-label": string; + "gutter.code-folding.open.aria-label": string; + "gutter.code-folding.closed.title": string; + "gutter.code-folding.open.title": string; + "gutter.annotation.aria-label.error": string; + "gutter.annotation.aria-label.warning": string; + "gutter.annotation.aria-label.info": string; + "inline-fold.closed.title": string; + "gutter-tooltip.aria-label.error.singular": string; + "gutter-tooltip.aria-label.error.plural": string; + "gutter-tooltip.aria-label.warning.singular": string; + "gutter-tooltip.aria-label.warning.plural": string; + "gutter-tooltip.aria-label.info.singular": string; + "gutter-tooltip.aria-label.info.plural": string; + }; +} +declare module "ace-code/src/lib/app_config" { + const AppConfig_base: undefined; + export class AppConfig { + /** + * @param {Object} obj + * @param {string} path + * @param {{ [key: string]: any }} options + * @returns {AppConfig} + */ + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + /** + * @param {Object} obj + */ + resetOptions(obj: any): void; + /** + * @param {string} path + * @param {string} name + * @param {any} value + */ + setDefaultValue(path: string, name: string, value: any): boolean; + /** + * @param {string} path + * @param {{ [key: string]: any; }} optionHash + */ + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + /** + * @param {any} value + */ + setMessages(value: any): void; + /** + * @param {string} key + * @param {string} defaultString + * @param {{ [x: string]: any; }} [params] + */ + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: typeof warn; + reportError: (msg: any, data: any) => void; + } + function warn(message: any, ...args: any[]): void; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface AppConfig extends Ace.EventEmitter { + } +} +declare module "ace-code/src/theme/textmate-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/textmate" { + export const isDark: false; + export const cssClass: "ace-tm"; + export const cssText: string; +} +declare module "ace-code/src/config" { + const _exports: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K_1, callback: any, capturing?: boolean): any; + addEventListener(name: K_2, callback: any, capturing?: boolean): any; + off(name: K_3, callback: any): void; + removeListener(name: K_4, callback: any): void; + removeEventListener(name: K_5, callback: any): void; + removeAllListeners(name?: string): void; + /** + * @param {string} key + * @return {*} + */ + get: (key: string) => any; + /** + * @param {string} key + * @param value + */ + set: (key: string, value: any) => void; + /** + * @return {{[key: string]: any}} + */ + all: () => { + [key: string]: any; + }; + /** + * module loading + * @param {string} name + * @param {string} [component] + * @returns {string} + */ + moduleUrl: (name: string, component?: string) => string; + /** + * @param {string} name + * @param {string} subst + * @returns {string} + */ + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + /** + * @param {string | [string, string]} moduleId + * @param {(module: any) => void} onLoad + */ + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.32.9"; + }; + export = _exports; + import AppConfig_1 = require("ace-code/src/lib/app_config"); + import AppConfig = AppConfig_1.AppConfig; +} +declare module "ace-code/src/layer/lines" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + export class Lines { + /** + * @param {HTMLElement} element + * @param {number} [canvasHeight] + */ + constructor(element: HTMLElement, canvasHeight?: number); + element: HTMLElement; + canvasHeight: number; + cells: any[]; + cellCache: any[]; + /** + * @param {LayerConfig} config + */ + moveContainer(config: LayerConfig): void; + /** + * @param {LayerConfig} oldConfig + * @param {LayerConfig} newConfig + */ + pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; + /** + * @param {number} row + * @param {Partial} config + * @param {EditSession} session + */ + computeLineTop(row: number, config: Partial, session: EditSession): number; + /** + * @param {number} row + * @param {LayerConfig} config + * @param {EditSession} session + */ + computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; + getLength(): number; + /** + * @param {number} index + */ + get(index: number): any; + shift(): void; + pop(): void; + push(cell: any): void; + unshift(cell: any): void; + last(): any; + createCell(row: any, config: any, session: any, initElement: any): any; + } +} +declare module "ace-code/src/layer/gutter" { + const Gutter_base: undefined; + export class Gutter { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + element: HTMLDivElement; + gutterWidth: number; + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + session: import("ace-code/src/edit_session").EditSession; + /** + * @param {number} row + * @param {string} className + */ + addGutterDecoration(row: number, className: string): void; + /** + * @param {number} row + * @param {string} className + */ + removeGutterDecoration(row: number, className: string): void; + /** + * @param {any[]} annotations + */ + setAnnotations(annotations: any[]): void; + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + config: import("ace-code").Ace.LayerConfig; + oldLastRow: number; + updateLineHighlight(): void; + /** + * @param {LayerConfig} config + */ + scrollLines(config: LayerConfig): void; + /** + * @param {boolean} highlightGutterLine + */ + setHighlightGutterLine(highlightGutterLine: boolean): void; + /** + * @param {boolean} show + */ + setShowLineNumbers(show: boolean): void; + getShowLineNumbers(): boolean; + /** + * @param {boolean} [show] + */ + setShowFoldWidgets(show?: boolean): void; + getShowFoldWidgets(): boolean; + /** + * @param {{ x: number; }} point + */ + getRegion(point: { + x: number; + }): "markers" | "foldWidgets"; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + import Lines_1 = require("ace-code/src/layer/lines"); + import Lines = Lines_1.Lines; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type GutterEvents = import("ace-code").Ace.GutterEvents; + } + export interface Gutter extends Ace.EventEmitter { + } +} +declare module "ace-code/src/layer/marker" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + export class Marker { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + element: HTMLDivElement; + /** + * @param {number} padding + */ + setPadding(padding: number): void; + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + session: import("ace-code/src/edit_session").EditSession; + /** + * @param {{ [x: number]: import("ace-code").Ace.MarkerLike; }} markers + */ + setMarkers(markers: { + [x: number]: import("ace-code").Ace.MarkerLike; + }): void; + markers: { + [x: number]: import("ace-code").Ace.MarkerLike; + }; + /** + * @param {string} className + * @param {string} css + */ + elt(className: string, css: string): void; + i: number; + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + config: import("ace-code").Ace.LayerConfig; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} layerConfig + * @param {string} [extraStyle] + */ + drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {LayerConfig} config + * @param {string} [extraStyle] + */ + drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {number} [extraLength] + * @param {string} [extraStyle] + */ + drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {number} extraLength + * @param {string} extraStyle + */ + drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {undefined} [extraStyle] + */ + drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {undefined} [extraStyle] + */ + drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; + } + import Range_2 = require("ace-code/src/range"); + import Range = Range_2.Range; +} +declare module "ace-code/src/layer/text_util" { + export function isTextToken(tokenType: any): boolean; +} +declare module "ace-code/src/layer/text" { + const Text_base: undefined; + export class Text { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + dom: typeof dom; + element: HTMLDivElement; + EOL_CHAR: any; + /** + * @param {number} padding + */ + setPadding(padding: number): void; + /** + * @returns {number} + */ + getLineHeight(): number; + /** + * @returns {number} + */ + getCharacterWidth(): number; + checkForSizeChanges(): void; + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + /**@type {EditSession}*/ + session: EditSession; + /** + * @param {string} showInvisibles + */ + setShowInvisibles(showInvisibles: string): boolean; + showInvisibles: any; + showSpaces: boolean; + showTabs: boolean; + showEOL: boolean; + /** + * @param {boolean} display + */ + setDisplayIndentGuides(display: boolean): boolean; + displayIndentGuides: any; + /** + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): boolean; + tabSize: number; + /** + * @param {LayerConfig} config + * @param {number} firstRow + * @param {number} lastRow + */ + updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; + config?: import("ace-code").Ace.LayerConfig; + /** + * @param {LayerConfig} config + */ + scrollLines(config: LayerConfig): void; + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + renderIndentGuide(parent: any, value: any, max: any): any; + EOF_CHAR: string; + EOL_CHAR_LF: string; + EOL_CHAR_CRLF: string; + TAB_CHAR: string; + SPACE_CHAR: string; + MAX_LINE_LENGTH: number; + destroy: {}; + onChangeTabSize: () => void; + } + export type LayerConfig = import("ace-code").Ace.LayerConfig; + export type EditSession = import("ace-code/src/edit_session").EditSession; + import dom = require("ace-code/src/lib/dom"); + import Lines_2 = require("ace-code/src/layer/lines"); + import Lines = Lines_2.Lines; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type TextEvents = import("ace-code").Ace.TextEvents; + type LayerConfig = import("ace-code").Ace.LayerConfig; + } + export interface Text extends Ace.EventEmitter { + config?: Ace.LayerConfig; + } +} +declare module "ace-code/src/layer/cursor" { + export class Cursor { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + element: HTMLDivElement; + isVisible: boolean; + isBlinking: boolean; + blinkInterval: number; + smoothBlinking: boolean; + cursors: any[]; + cursor: HTMLDivElement; + /** + * @param {number} padding + */ + setPadding(padding: number): void; + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + session: import("ace-code/src/edit_session").EditSession; + /** + * @param {boolean} blinking + */ + setBlinking(blinking: boolean): void; + /** + * @param {number} blinkInterval + */ + setBlinkInterval(blinkInterval: number): void; + /** + * @param {boolean} smoothBlinking + */ + setSmoothBlinking(smoothBlinking: boolean): void; + addCursor(): HTMLDivElement; + removeCursor(): any; + hideCursor(): void; + showCursor(): void; + restartTimer(): void; + intervalId: number; + /** + * @param {import("ace-code").Ace.Point} [position] + * @param {boolean} [onScreen] + */ + getPixelPosition(position?: import("ace-code").Ace.Point, onScreen?: boolean): { + left: number; + top: number; + }; + isCursorInView(pixelPos: any, config: any): boolean; + update(config: any): void; + config: any; + overwrite: any; + destroy(): void; + drawCursor: any; + timeoutId?: number; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export interface Cursor { + timeoutId?: number; + } +} +declare module "ace-code/src/scrollbar" { + const VScrollBar_base: typeof Scrollbar; + /** + * Represents a vertical scroll bar. + **/ + export class VScrollBar extends Scrollbar { + /** + * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + scrollTop: number; + scrollHeight: number; + width: number; + /** + * Emitted when the scroll bar, well, scrolls. + * @event scroll + **/ + onScroll(): void; + /** + * Returns the width of the scroll bar. + * @returns {Number} + **/ + getWidth(): number; + /** + * Sets the height of the scroll bar, in pixels. + * @param {Number} height The new height + **/ + setHeight(height: number): void; + /** + * Sets the scroll height of the scroll bar, in pixels. + * @param {Number} height The new scroll height + **/ + setScrollHeight(height: number): void; + /** + * Sets the scroll top of the scroll bar. + * @param {Number} scrollTop The new scroll top + **/ + setScrollTop(scrollTop: number): void; + /** + * Sets the inner height of the scroll bar, in pixels. + * @param {Number} height The new inner height + * @deprecated Use setScrollHeight instead + **/ + setInnerHeight: (height: number) => void; + } + const HScrollBar_base: typeof Scrollbar; + /** + * Represents a horisontal scroll bar. + **/ + export class HScrollBar extends Scrollbar { + /** + * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + scrollLeft: number; + height: any; + /** + * Emitted when the scroll bar, well, scrolls. + * @event scroll + **/ + onScroll(): void; + /** + * Returns the height of the scroll bar. + * @returns {Number} + **/ + getHeight(): number; + /** + * Sets the width of the scroll bar, in pixels. + * @param {Number} width The new width + **/ + setWidth(width: number): void; + /** + * Sets the inner width of the scroll bar, in pixels. + * @param {Number} width The new inner width + * @deprecated Use setScrollWidth instead + **/ + setInnerWidth(width: number): void; + /** + * Sets the scroll width of the scroll bar, in pixels. + * @param {Number} width The new scroll width + **/ + setScrollWidth(width: number): void; + /** + * Sets the scroll left of the scroll bar. + * @param {Number} scrollLeft The new scroll left + **/ + setScrollLeft(scrollLeft: number): void; + } + /** + * An abstract class representing a native scrollbar control. + **/ + class Scrollbar { + /** + * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {string} classSuffix + **/ + constructor(parent: Element, classSuffix: string); + element: HTMLDivElement; + inner: HTMLDivElement; + skipEvent: boolean; + setVisible(isVisible: any): void; + isVisible: any; + coeff: number; + } + export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface VScrollBar extends Ace.EventEmitter { + } + export interface HScrollBar extends Ace.EventEmitter { + } +} +declare module "ace-code/src/scrollbar_custom" { + const VScrollBar_base: typeof ScrollBar; + /** + * Represents a vertical scroll bar. + * @class VScrollBar + **/ + /** + * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + * + * @constructor + **/ + export class VScrollBar extends ScrollBar { + constructor(parent: any, renderer: any); + scrollTop: number; + scrollHeight: number; + parent: any; + width: number; + renderer: any; + /** + * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + **/ + onMouseDown(eType: any, e: any): void; + getHeight(): number; + /** + * Returns new top for scroll thumb + * @param {Number}thumbTop + * @returns {Number} + **/ + scrollTopFromThumbTop(thumbTop: number): number; + /** + * Returns the width of the scroll bar. + * @returns {Number} + **/ + getWidth(): number; + /** + * Sets the height of the scroll bar, in pixels. + * @param {Number} height The new height + **/ + setHeight(height: number): void; + height: number; + slideHeight: number; + viewHeight: number; + /** + * Sets the inner and scroll height of the scroll bar, in pixels. + * @param {Number} height The new inner height + * + * @param {boolean} force Forcely update height + **/ + setScrollHeight(height: number, force: boolean): void; + pageHeight: any; + thumbHeight: number; + /** + * Sets the scroll top of the scroll bar. + * @param {Number} scrollTop The new scroll top + **/ + setScrollTop(scrollTop: number): void; + thumbTop: number; + setInnerHeight: (height: number, force: boolean) => void; + } + const HScrollBar_base: typeof ScrollBar; + /** + * Represents a horizontal scroll bar. + **/ + export class HScrollBar extends ScrollBar { + /** + * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + scrollLeft: number; + scrollWidth: number; + height: number; + renderer: any; + /** + * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + **/ + onMouseDown(eType: any, e: any): void; + /** + * Returns the height of the scroll bar. + * @returns {Number} + **/ + getHeight(): number; + /** + * Returns new left for scroll thumb + * @param {Number} thumbLeft + * @returns {Number} + **/ + scrollLeftFromThumbLeft(thumbLeft: number): number; + /** + * Sets the width of the scroll bar, in pixels. + * @param {Number} width The new width + **/ + setWidth(width: number): void; + width: number; + slideWidth: number; + viewWidth: number; + /** + * Sets the inner and scroll width of the scroll bar, in pixels. + * @param {Number} width The new inner width + * @param {boolean} force Forcely update width + **/ + setScrollWidth(width: number, force: boolean): void; + pageWidth: any; + thumbWidth: number; + /** + * Sets the scroll left of the scroll bar. + * @param {Number} scrollLeft The new scroll left + **/ + setScrollLeft(scrollLeft: number): void; + thumbLeft: number; + setInnerWidth: (width: number, force: boolean) => void; + } + /** + * An abstract class representing a native scrollbar control. + **/ + class ScrollBar { + /** + * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {string} classSuffix + **/ + constructor(parent: Element, classSuffix: string); + element: HTMLDivElement; + inner: HTMLDivElement; + VScrollWidth: number; + HScrollHeight: number; + skipEvent: boolean; + setVisible(isVisible: any): void; + isVisible: any; + coeff: number; + } + export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface VScrollBar extends Ace.EventEmitter { + } + export interface HScrollBar extends Ace.EventEmitter { + } +} +declare module "ace-code/src/renderloop" { + /** + * Batches changes (that force something to be redrawn) in the background. + **/ + export class RenderLoop { + constructor(onRender: any, win: any); + onRender: any; + pending: boolean; + changes: number; + window: any; + schedule(change: any): void; + clear(change: any): number; + } +} +declare module "ace-code/src/css/editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/layer/decorators" { + export class Decorator { + constructor(parent: any, renderer: any); + canvas: HTMLCanvasElement; + renderer: any; + pixelRatio: number; + maxHeight: any; + lineHeight: any; + canvasHeight: any; + heightRatio: number; + canvasWidth: any; + minDecorationHeight: number; + halfMinDecorationHeight: number; + colors: {}; + compensateFoldRows(row: any, foldData: any): number; + } +} +declare module "ace-code/src/virtual_renderer" { + const VirtualRenderer_base: undefined; + const VirtualRenderer_base_1: undefined; + /** + * The class that is responsible for drawing everything you see on the screen! + * @related editor.renderer + **/ + export class VirtualRenderer { + /** + * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. + * @param {HTMLElement | null} [container] The root element of the editor + * @param {String} [theme] The starting theme + + **/ + constructor(container?: HTMLElement | null, theme?: string); + container: HTMLElement; + /**@type {HTMLElement}*/ + scroller: HTMLElement; + /**@type {HTMLElement}*/ + content: HTMLElement; + canvas: HTMLDivElement; + scrollBar: VScrollBar; + scrollBarV: import("ace-code").Ace.VScrollbar; + scrollBarH: import("ace-code").Ace.HScrollbar; + scrollTop: number; + scrollLeft: number; + cursorPos: { + row: number; + column: number; + }; + layerConfig: { + width: number; + padding: number; + firstRow: number; + firstRowScreen: number; + lastRow: number; + lineHeight: number; + characterWidth: number; + minHeight: number; + maxHeight: number; + offset: number; + height: number; + gutterOffset: number; + }; + scrollMargin: { + left: number; + right: number; + top: number; + bottom: number; + v: number; + h: number; + }; + margin: { + left: number; + right: number; + top: number; + bottom: number; + v: number; + h: number; + }; + updateCharacterSize(): void; + characterWidth: number; + lineHeight: number; + /** + * + * Associates the renderer with an [[EditSession `EditSession`]]. + * @param {EditSession} session The session to associate with + **/ + setSession(session: EditSession): void; + session: import("ace-code/src/edit_session").EditSession; + onChangeNewLineMode(): void; + /** + * Triggers a partial update of the text, from the range given by the two parameters. + * @param {Number} firstRow The first row to update + * @param {Number} lastRow The last row to update + * @param {boolean} [force] + **/ + updateLines(firstRow: number, lastRow: number, force?: boolean): void; + onChangeTabSize(): void; + /** + * Triggers a full update of the text, for all the rows. + **/ + updateText(): void; + /** + * Triggers a full update of all the layers, for all the rows. + * @param {Boolean} [force] If `true`, forces the changes through + + **/ + updateFull(force?: boolean): void; + /** + * Updates the font size. + **/ + updateFontSize(): void; + /** + * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} + * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed + * @param {Number} [gutterWidth] The width of the gutter in pixels + * @param {Number} [width] The width of the editor in pixels + * @param {Number} [height] The hiehgt of the editor, in pixels + + **/ + onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; + resizing: number; + gutterWidth: any; + /** + * + * @param {number} width + + */ + onGutterResize(width: number): void; + /** + * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. + + **/ + adjustWrapLimit(): boolean; + /** + * Identifies whether you want to have an animated scroll or not. + * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls + + **/ + setAnimatedScroll(shouldAnimate: boolean): void; + /** + * Returns whether an animated scroll happens or not. + * @returns {Boolean} + + **/ + getAnimatedScroll(): boolean; + /** + * Identifies whether you want to show invisible characters or not. + * @param {Boolean} showInvisibles Set to `true` to show invisibles + + **/ + setShowInvisibles(showInvisibles: boolean): void; + /** + * Returns whether invisible characters are being shown or not. + * @returns {Boolean} + + **/ + getShowInvisibles(): boolean; + /** + * @return {boolean} + + */ + getDisplayIndentGuides(): boolean; + /** + * @param {boolean} display + + */ + setDisplayIndentGuides(display: boolean): void; + /** + + * @return {boolean} + */ + getHighlightIndentGuides(): boolean; + /** + + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): void; + /** + * Identifies whether you want to show the print margin or not. + * @param {Boolean} showPrintMargin Set to `true` to show the print margin + + **/ + setShowPrintMargin(showPrintMargin: boolean): void; + /** + * Returns whether the print margin is being shown or not. + * @returns {Boolean} + + **/ + getShowPrintMargin(): boolean; + /** + * Identifies whether you want to show the print margin column or not. + * @param {number} printMarginColumn Set to `true` to show the print margin column + + **/ + setPrintMarginColumn(printMarginColumn: number): void; + /** + * Returns whether the print margin column is being shown or not. + * @returns {number} + + **/ + getPrintMarginColumn(): number; + /** + * Returns `true` if the gutter is being shown. + * @returns {Boolean} + + **/ + getShowGutter(): boolean; + /** + * Identifies whether you want to show the gutter or not. + * @param {Boolean} show Set to `true` to show the gutter + + **/ + setShowGutter(show: boolean): void; + /** + + * @returns {boolean} + */ + getFadeFoldWidgets(): boolean; + /** + + * @param {boolean} show + */ + setFadeFoldWidgets(show: boolean): void; + /** + * + * @param {boolean} shouldHighlight + */ + setHighlightGutterLine(shouldHighlight: boolean): void; + /** + + * @returns {boolean} + */ + getHighlightGutterLine(): boolean; + /** + * + * Returns the root element containing this renderer. + * @returns {HTMLElement} + **/ + getContainerElement(): HTMLElement; + /** + * + * Returns the element that the mouse events are attached to + * @returns {HTMLElement} + **/ + getMouseEventTarget(): HTMLElement; + /** + * + * Returns the element to which the hidden text area is added. + * @returns {HTMLElement} + **/ + getTextAreaContainer(): HTMLElement; + /** + * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} + * @returns {Number} + **/ + getFirstVisibleRow(): number; + /** + * + * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. + * @returns {Number} + **/ + getFirstFullyVisibleRow(): number; + /** + * + * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. + * @returns {Number} + **/ + getLastFullyVisibleRow(): number; + /** + * + * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} + * @returns {Number} + **/ + getLastVisibleRow(): number; + /** + * Sets the padding for all the layers. + * @param {Number} padding A new padding value (in pixels) + + **/ + setPadding(padding: number): void; + /** + * + * @param {number} [top] + * @param {number} [bottom] + * @param {number} [left] + * @param {number} [right] + + */ + setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; + /** + * + * @param {number} [top] + * @param {number} [bottom] + * @param {number} [left] + * @param {number} [right] + + */ + setMargin(top?: number, bottom?: number, left?: number, right?: number): void; + /** + * Returns whether the horizontal scrollbar is set to be always visible. + * @returns {Boolean} + + **/ + getHScrollBarAlwaysVisible(): boolean; + /** + * Identifies whether you want to show the horizontal scrollbar or not. + * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible + + **/ + setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; + /** + * Returns whether the horizontal scrollbar is set to be always visible. + * @returns {Boolean} + + **/ + getVScrollBarAlwaysVisible(): boolean; + /** + * Identifies whether you want to show the horizontal scrollbar or not. + * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible + **/ + setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; + freeze(): void; + unfreeze(): void; + desiredHeight: any; + /** + * Schedules an update to all the front markers in the document. + **/ + updateFrontMarkers(): void; + /** + * + * Schedules an update to all the back markers in the document. + **/ + updateBackMarkers(): void; + /** + * + * Deprecated; (moved to [[EditSession]]) + * @deprecated + **/ + addGutterDecoration(row: any, className: any): void; + /** + * Deprecated; (moved to [[EditSession]]) + * @deprecated + **/ + removeGutterDecoration(row: any, className: any): void; + /** + * + * Redraw breakpoints. + * @param {any} [rows] + */ + updateBreakpoints(rows?: any): void; + /** + * Sets annotations for the gutter. + * @param {import("ace-code").Ace.Annotation[]} annotations An array containing annotations + * + **/ + setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; + /** + * + * Updates the cursor icon. + **/ + updateCursor(): void; + /** + * + * Hides the cursor icon. + **/ + hideCursor(): void; + /** + * + * Shows the cursor icon. + **/ + showCursor(): void; + /** + * + * @param {Point} anchor + * @param {Point} lead + * @param {number} [offset] + */ + scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; + /** + * + * Scrolls the cursor into the first visibile area of the editor + * @param {Point} [cursor] + * @param {number} [offset] + * @param {{ top?: any; bottom?: any; }} [$viewMargin] + */ + scrollCursorIntoView(cursor?: Point, offset?: number, $viewMargin?: { + top?: any; + bottom?: any; + }): void; + /** + * {:EditSession.getScrollTop} + * @related EditSession.getScrollTop + * @returns {Number} + **/ + getScrollTop(): number; + /** + * {:EditSession.getScrollLeft} + * @related EditSession.getScrollLeft + * @returns {Number} + **/ + getScrollLeft(): number; + /** + * Returns the first visible row, regardless of whether it's fully visible or not. + * @returns {Number} + **/ + getScrollTopRow(): number; + /** + * Returns the last visible row, regardless of whether it's fully visible or not. + * @returns {Number} + **/ + getScrollBottomRow(): number; + /** + * Gracefully scrolls from the top of the editor to the row indicated. + * @param {Number} row A row id + * + * @related EditSession.setScrollTop + **/ + scrollToRow(row: number): void; + /** + * + * @param {Point} cursor + * @param {number} [alignment] + * @returns {number} + */ + alignCursor(cursor: Point, alignment?: number): number; + /** + * Gracefully scrolls the editor to the row indicated. + * @param {Number} line A line number + * @param {Boolean} center If `true`, centers the editor the to indicated line + * @param {Boolean} animate If `true` animates scrolling + * @param {() => void} [callback] Function to be called after the animation has finished + + **/ + scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; + /** + * + * @param fromValue + * @param [callback] + + */ + animateScrolling(fromValue: any, callback?: any): void; + /** + * Scrolls the editor to the y pixel indicated. + * @param {Number} scrollTop The position to scroll to + **/ + scrollToY(scrollTop: number): void; + /** + * Scrolls the editor across the x-axis to the pixel indicated. + * @param {Number} scrollLeft The position to scroll to + **/ + scrollToX(scrollLeft: number): void; + /** + * Scrolls the editor across both x- and y-axes. + * @param {Number} x The x value to scroll to + * @param {Number} y The y value to scroll to + **/ + scrollTo(x: number, y: number): void; + /** + * Scrolls the editor across both x- and y-axes. + * @param {Number} deltaX The x value to scroll by + * @param {Number} deltaY The y value to scroll by + **/ + scrollBy(deltaX: number, deltaY: number): void; + /** + * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. + * @param {Number} deltaX The x value to scroll by + * @param {Number} deltaY The y value to scroll by + * + * @returns {Boolean} + **/ + isScrollableBy(deltaX: number, deltaY: number): boolean; + /** + * + * @param {number} x + * @param {number} y + * @returns {import("ace-code").Ace.ScreenCoordinates} + + */ + pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; + /** + * + * @param {number} x + * @param {number} y + * @returns {Point} + + */ + screenToTextCoordinates(x: number, y: number): Point; + /** + * Returns an object containing the `pageX` and `pageY` coordinates of the document position. + * @param {Number} row The document row position + * @param {Number} column The document column position + * + * @returns {{ pageX: number, pageY: number}} + **/ + textToScreenCoordinates(row: number, column: number): { + pageX: number; + pageY: number; + }; + /** + * + * Focuses the current container. + **/ + visualizeFocus(): void; + /** + * + * Blurs the current container. + **/ + visualizeBlur(): void; + /** + * @param {Object} composition + + **/ + showComposition(composition: any): void; + /** + * @param {String} text A string of text to use + * + * Sets the inner text of the current composition to `text`. + + **/ + setCompositionText(text: string): void; + /** + * + * Hides the current composition. + + **/ + hideComposition(): void; + /** + * @param {string} text + * @param {Point} [position] + */ + setGhostText(text: string, position?: Point): void; + removeGhostText(): void; + /** + * @param {string} text + * @param {string} type + * @param {number} row + * @param {number} [column] + */ + addToken(text: string, type: string, row: number, column?: number): void; + removeExtraToken(row: any, column: any): void; + /** + * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} + * @param {String | Theme} [theme] The path to a theme + * @param {() => void} [cb] optional callback + + **/ + setTheme(theme?: string | Theme, cb?: () => void): void; + /** + * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} + * @returns {String} + **/ + getTheme(): string; + /** + * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} + * @param {String} style A class name + * @param {boolean}[include] + **/ + setStyle(style: string, include?: boolean): void; + /** + * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} + * @param {String} style A class name + * + **/ + unsetStyle(style: string): void; + /** + * @param {string} style + */ + setCursorStyle(style: string): void; + /** + * @param {String} cursorStyle A css cursor style + **/ + setMouseCursor(cursorStyle: string): void; + attachToShadowRoot(): void; + /** + * Destroys the text and cursor layers for this renderer. + + **/ + destroy(): void; + CHANGE_CURSOR: number; + CHANGE_MARKER: number; + CHANGE_GUTTER: number; + CHANGE_SCROLL: number; + CHANGE_LINES: number; + CHANGE_TEXT: number; + CHANGE_SIZE: number; + CHANGE_MARKER_BACK: number; + CHANGE_MARKER_FRONT: number; + CHANGE_FULL: number; + CHANGE_H_SCROLL: number; + STEPS: number; + textarea?: HTMLTextAreaElement; + enableKeyboardAccessibility?: boolean; + keyboardFocusClassName?: string; + showInvisibles?: boolean; + theme?: any; + destroyed?: boolean; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code").Ace.Point; + export type Theme = import("ace-code").Ace.Theme; + import GutterLayer_1 = require("ace-code/src/layer/gutter"); + import GutterLayer = GutterLayer_1.Gutter; + import MarkerLayer_1 = require("ace-code/src/layer/marker"); + import MarkerLayer = MarkerLayer_1.Marker; + import TextLayer_1 = require("ace-code/src/layer/text"); + import TextLayer = TextLayer_1.Text; + import CursorLayer_1 = require("ace-code/src/layer/cursor"); + import CursorLayer = CursorLayer_1.Cursor; + import VScrollBar_1 = require("ace-code/src/scrollbar"); + import VScrollBar = VScrollBar_1.VScrollBar; + import FontMetrics_1 = require("ace-code/src/layer/font_metrics"); + import FontMetrics = FontMetrics_1.FontMetrics; + import RenderLoop_1 = require("ace-code/src/renderloop"); + import RenderLoop = RenderLoop_1.RenderLoop; + import Decorator_1 = require("ace-code/src/layer/decorators"); + import Decorator = Decorator_1.Decorator; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type VirtualRendererOptions = import("ace-code").Ace.VirtualRendererOptions; + type EditSession = import("ace-code").Ace.EditSession; + } + export interface VirtualRenderer extends Ace + .EventEmitter, Ace.OptionsProvider { + textarea?: HTMLTextAreaElement; + enableKeyboardAccessibility?: boolean; + keyboardFocusClassName?: string; + showInvisibles?: boolean; + theme?: any; + destroyed?: boolean; + session: Ace.EditSession; + } +} +declare module "ace-code/src/selection" { + const Selection_base: undefined; + const Selection_base_1: undefined; + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code/src/anchor").Anchor} Anchor + * @typedef {import("ace-code").Ace.Point} Point + */ + export class Selection { + /** + * Creates a new `Selection` object. + * @param {EditSession} session The session to use + * @constructor + **/ + constructor(session: EditSession); + /**@type {EditSession}*/ + session: EditSession; + /**@type {import("ace-code/src/document").Document}*/ + doc: import("ace-code/src/document").Document; + /**@type {Anchor}*/ + cursor: Anchor; + lead: Anchor; + /**@type {Anchor}*/ + anchor: Anchor; + /** + * Returns `true` if the selection is empty. + * @returns {Boolean} + **/ + isEmpty(): boolean; + /** + * Returns `true` if the selection is a multi-line. + * @returns {Boolean} + **/ + isMultiLine(): boolean; + /** + * Returns an object containing the `row` and `column` current position of the cursor. + * @returns {Point} + **/ + getCursor(): Point; + /** + * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. + * @param {Number} row The new row + * @param {Number} column The new column + * + **/ + setAnchor(row: number, column: number): void; + /** + * Returns an object containing the `row` and `column` of the calling selection anchor. + * + * @returns {Point} + * @related Anchor.getPosition + **/ + getAnchor(): Point; + /** + * Returns an object containing the `row` and `column` of the calling selection lead. + * @returns {Object} + **/ + getSelectionLead(): any; + /** + * Returns `true` if the selection is going backwards in the document. + * @returns {Boolean} + **/ + isBackwards(): boolean; + /** + * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} + * @returns {Range} + **/ + getRange(): Range; + /** + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ + clearSelection(): void; + /** + * Selects all the text in the document. + **/ + selectAll(): void; + /** + * Sets the selection to the provided range. + * @param {import("ace-code").Ace.IRange} range The range of text to select + * @param {Boolean} [reverse] Indicates if the range should go backwards (`true`) or not + **/ + setRange(range: import("ace-code").Ace.IRange, reverse?: boolean): void; + /** + * Moves the selection cursor to the indicated row and column. + * @param {Number} row The row to select to + * @param {Number} column The column to select to + **/ + selectTo(row: number, column: number): void; + /** + * Moves the selection cursor to the row and column indicated by `pos`. + * @param {Point} pos An object containing the row and column + **/ + selectToPosition(pos: Point): void; + /** + * Moves the selection cursor to the indicated row and column. + * @param {Number} row The row to select to + * @param {Number} column The column to select to + **/ + moveTo(row: number, column: number): void; + /** + * Moves the selection cursor to the row and column indicated by `pos`. + * @param {Object} pos An object containing the row and column + **/ + moveToPosition(pos: any): void; + /** + * Moves the selection up one row. + **/ + selectUp(): void; + /** + * Moves the selection down one row. + **/ + selectDown(): void; + /** + * Moves the selection right one column. + **/ + selectRight(): void; + /** + * Moves the selection left one column. + **/ + selectLeft(): void; + /** + * Moves the selection to the beginning of the current line. + **/ + selectLineStart(): void; + /** + * Moves the selection to the end of the current line. + **/ + selectLineEnd(): void; + /** + * Moves the selection to the end of the file. + **/ + selectFileEnd(): void; + /** + * Moves the selection to the start of the file. + **/ + selectFileStart(): void; + /** + * Moves the selection to the first word on the right. + **/ + selectWordRight(): void; + /** + * Moves the selection to the first word on the left. + **/ + selectWordLeft(): void; + /** + * Moves the selection to highlight the entire word. + * @related EditSession.getWordRange + **/ + getWordRange(row: any, column: any): Range; + /** + * Selects an entire word boundary. + **/ + selectWord(): void; + /** + * Selects a word, including its right whitespace. + * @related EditSession.getAWordRange + **/ + selectAWord(): void; + getLineRange(row: any, excludeLastChar: any): Range; + /** + * Selects the entire line. + **/ + selectLine(): void; + /** + * Moves the cursor up one row. + **/ + moveCursorUp(): void; + /** + * Moves the cursor down one row. + **/ + moveCursorDown(): void; + /** + * + * Returns `true` if moving the character next to the cursor in the specified direction is a soft tab. + * @param {Point} cursor the current cursor position + * @param {Number} tabSize the tab size + * @param {Number} direction 1 for right, -1 for left + */ + wouldMoveIntoSoftTab(cursor: Point, tabSize: number, direction: number): boolean; + /** + * Moves the cursor left one column. + **/ + moveCursorLeft(): void; + /** + * Moves the cursor right one column. + **/ + moveCursorRight(): void; + /** + * Moves the cursor to the start of the line. + **/ + moveCursorLineStart(): void; + /** + * Moves the cursor to the end of the line. + **/ + moveCursorLineEnd(): void; + /** + * Moves the cursor to the end of the file. + **/ + moveCursorFileEnd(): void; + /** + * Moves the cursor to the start of the file. + **/ + moveCursorFileStart(): void; + /** + * Moves the cursor to the word on the right. + **/ + moveCursorLongWordRight(): void; + /** + * + * Moves the cursor to the word on the left. + **/ + moveCursorLongWordLeft(): void; + moveCursorShortWordRight(): void; + moveCursorShortWordLeft(): void; + moveCursorWordRight(): void; + moveCursorWordLeft(): void; + /** + * Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document. + * @param {Number} rows The number of rows to move by + * @param {Number} chars The number of characters to move by + * + * @related EditSession.documentToScreenPosition + **/ + moveCursorBy(rows: number, chars: number): void; + /** + * Moves the selection to the position indicated by its `row` and `column`. + * @param {Point} position The position to move to + **/ + moveCursorToPosition(position: Point): void; + /** + * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} + * @param {Number} row The row to move to + * @param {Number} column The column to move to + * @param {Boolean} [keepDesiredColumn] [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} + **/ + moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; + /** + * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} + * @param {Number} row The row to move to + * @param {Number} column The column to move to + * @param {Boolean} keepDesiredColumn {:preventUpdateBool} + **/ + moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; + detach(): void; + /** + * @param {Range & {desiredColumn?: number}} range + */ + fromOrientedRange(range: Range & { + desiredColumn?: number; + }): void; + /** + * @param {Range & {desiredColumn?: number}} [range] + */ + toOrientedRange(range?: Range & { + desiredColumn?: number; + }): Range & { + desiredColumn?: number; + }; + /** + * Saves the current cursor position and calls `func` that can change the cursor + * postion. The result is the range of the starting and eventual cursor position. + * Will reset the cursor position. + * @param {Function} func The callback that should change the cursor position + * @returns {Range} + **/ + getRangeOfMovements(func: Function): Range; + /** + * + * @returns {Range|Range[]} + */ + toJSON(): Range | Range[]; + /** + * + * @param data + */ + fromJSON(data: any): void; + /** + * + * @param data + * @return {boolean} + */ + isEqual(data: any): boolean; + /** + * Left for backward compatibility + * @deprecated + */ + setSelectionAnchor: (row: number, column: number) => void; + /** + * Left for backward compatibility + * @deprecated + */ + getSelectionAnchor: () => Point; + setSelectionRange: (range: import("ace-code").Ace.IRange, reverse?: boolean) => void; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Anchor = import("ace-code/src/anchor").Anchor; + export type Point = import("ace-code").Ace.Point; + import Range_3 = require("ace-code/src/range"); + import Range = Range_3.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type SelectionEvents = import("ace-code").Ace.SelectionEvents; + type MultiSelectProperties = import("ace-code").Ace.MultiSelectProperties; + } + export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { + } +} +declare module "ace-code/src/clipboard" { + export let lineMode: string | false; + export function pasteCancelled(): boolean; + export function cancel(): void; +} +declare module "ace-code/src/keyboard/textinput" { + export function $setUserAgentForTests(_isMobile: any, _isIOS: any): void; + export var TextInput: any; +} +declare module "ace-code/src/mouse/mouse_event" { + export class MouseEvent { + constructor(domEvent: any, editor: any); + /** @type {number} */ speed: number; + /** @type {number} */ wheelX: number; + /** @type {number} */ wheelY: number; + domEvent: any; + editor: any; + x: any; + clientX: any; + y: any; + clientY: any; + propagationStopped: boolean; + defaultPrevented: boolean; + stopPropagation(): void; + preventDefault(): void; + stop(): void; + /** + * Get the document position below the mouse cursor + * + * @return {Object} 'row' and 'column' of the document position + */ + getDocumentPosition(): any; + /** + * Get the relative position within the gutter. + * + * @return {Number} 'row' within the gutter. + */ + getGutterRow(): number; + /** + * Check if the mouse cursor is inside of the text selection + * + * @return {Boolean} whether the mouse cursor is inside of the selection + */ + inSelection(): boolean; + /** + * Get the clicked mouse button + * + * @return {Number} 0 for left button, 1 for middle button, 2 for right button + */ + getButton(): number; + /** + * @return {Boolean} whether the shift key was pressed when the event was emitted + */ + getShiftKey(): boolean; + getAccelKey(): any; + time?: number; + } + export interface MouseEvent { + time?: number; + } +} +declare module "ace-code/src/mouse/default_handlers" { + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + export class DefaultHandlers { + /** + * @param {MouseHandler} mouseHandler + */ + constructor(mouseHandler: MouseHandler); + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; + /** + * + * @param {import("ace-code").Ace.Position} [pos] + * @param {boolean} [waitForClickSelection] + * @this {MouseHandler} + */ + startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; + /** + * @this {MouseHandler} + */ + select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + /** + * @param {string | number} unitName + * @this {MouseHandler} + */ + extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; + /** + * @this {MouseHandler} + */ + selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + /** + * @this {MouseHandler} + */ + focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onMouseWheel(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + selectEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + selectAllEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + selectByWordsEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + } +} +declare module "ace-code/src/lib/scroll" { + export function preventParentScroll(event: any): void; +} +declare module "ace-code/src/tooltip" { + export class HoverTooltip extends Tooltip { + constructor(parentNode?: HTMLElement); + timeout: number; + lastT: number; + idleTime: number; + lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; + onMouseOut(e: any): void; + /** + * @param {MouseEvent} e + * @param {Editor} editor + */ + onMouseMove(e: MouseEvent, editor: Editor): void; + waitForHover(): void; + /** + * @param {Editor} editor + */ + addToEditor(editor: Editor): void; + /** + * @param {Editor} editor + */ + removeFromEditor(editor: Editor): void; + /** + * @param {MouseEvent} e + */ + isOutsideOfText(e: MouseEvent): boolean; + /** + * @param {any} value + */ + setDataProvider(value: any): void; + /** + * @param {Editor} editor + * @param {Range} range + * @param {any} domNode + * @param {MouseEvent} startingEvent + */ + showForRange(editor: Editor, range: Range, domNode: any, startingEvent: MouseEvent): void; + range: Range; + /** + * @param {Range} range + * @param {EditSession} [session] + */ + addMarker(range: Range, session?: EditSession): void; + marker: number; + row: number; + } + export type Editor = import("ace-code/src/editor").Editor; + export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export var popupManager: PopupManager; + export class Tooltip { + /** + * @param {Element} parentNode + **/ + constructor(parentNode: Element); + isOpen: boolean; + /** + * @returns {HTMLElement} + **/ + getElement(): HTMLElement; + /** + * @param {String} text + **/ + setText(text: string): void; + /** + * @param {String} html + **/ + setHtml(html: string): void; + /** + * @param {Number} x + * @param {Number} y + **/ + setPosition(x: number, y: number): void; + /** + * @param {String} className + **/ + setClassName(className: string): void; + /** + * @param {import("ace-code").Ace.Theme} theme + */ + setTheme(theme: import("ace-code").Ace.Theme): void; + /** + * @param {String} [text] + * @param {Number} [x] + * @param {Number} [y] + **/ + show(text?: string, x?: number, y?: number): void; + hide(e: any): void; + /** + * @returns {Number} + **/ + getHeight(): number; + /** + * @returns {Number} + **/ + getWidth(): number; + destroy(): void; + } + import Range_4 = require("ace-code/src/range"); + import Range = Range_4.Range; + class PopupManager { + /**@type{Tooltip[]} */ + popups: Tooltip[]; + /** + * @param {Tooltip} popup + */ + addPopup(popup: Tooltip): void; + /** + * @param {Tooltip} popup + */ + removePopup(popup: Tooltip): void; + updatePopups(): void; + /** + * @param {Tooltip} popupA + * @param {Tooltip} popupB + * @return {boolean} + */ + doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; + } + export {}; + export interface HoverTooltip { + row: number; + } +} +declare module "ace-code/src/mouse/default_gutter_handler" { + /** + * @param {MouseHandler} mouseHandler + * @this {MouseHandler} + */ + export function GutterHandler(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, mouseHandler: MouseHandler): void; + export interface GutterHandler { + } + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + export class GutterTooltip extends Tooltip { + static get annotationLabels(): { + error: { + singular: any; + plural: any; + }; + warning: { + singular: any; + plural: any; + }; + info: { + singular: any; + plural: any; + }; + }; + static annotationsToSummaryString(annotations: any): string; + constructor(editor: any); + editor: any; + setPosition(x: any, y: any): void; + showTooltip(row: any): void; + hideTooltip(): void; + } + import Tooltip_1 = require("ace-code/src/tooltip"); + import Tooltip = Tooltip_1.Tooltip; + export interface GutterHandler { + } +} +declare module "ace-code/src/mouse/dragdrop_handler" { + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + /** + * @param {MouseHandler} mouseHandler + */ + export function DragdropHandler(mouseHandler: MouseHandler): void; + export class DragdropHandler { + /** + * @param {MouseHandler} mouseHandler + */ + constructor(mouseHandler: MouseHandler); + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragStart: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragEnter: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragOver: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + onDragLeave: (e: any) => void; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDrop: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + } +} +declare module "ace-code/src/mouse/touch_handler" { + export function addTouchListeners(el: any, editor: any): void; +} +declare module "ace-code/src/mouse/mouse_handler" { + export class MouseHandler { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + /** @type {MouseEvent} */ mouseEvent: MouseEvent; + editor: import("ace-code/src/editor").Editor; + onMouseEvent(name: any, e: any): void; + onMouseMove(name: any, e: any): void; + /** + * @param {string} name + * @param {{ wheelX: number; wheelY: number; }} e + */ + onMouseWheel(name: string, e: { + wheelX: number; + wheelY: number; + }): void; + setState(state: any): void; + state: any; + captureMouse(ev: any, mouseMoveHandler: any): number; + x: any; + y: any; + isMousePressed: boolean; + releaseMouse: (e: any) => void; + cancelContextMenu(): void; + destroy(): void; + cancelDrag?: boolean; + mousedownEvent?: MouseEvent; + startSelect?: (pos?: import("ace-code").Ace.Point, waitForClickSelection?: boolean) => void; + select?: () => void; + selectEnd?: () => void; + } + export type Editor = import("ace-code/src/editor").Editor; + import MouseEvent_1 = require("ace-code/src/mouse/mouse_event"); + import MouseEvent = MouseEvent_1.MouseEvent; + namespace Ace { + type Range = import("ace-code").Ace.Range; + type MouseEvent = import("ace-code").Ace.MouseEvent; + type Point = import("ace-code").Ace.Point; + } + export interface MouseHandler { + cancelDrag?: boolean; + mousedownEvent?: Ace.MouseEvent; + startSelect?: (pos?: Ace.Point, waitForClickSelection?: boolean) => void; + select?: () => void; + selectEnd?: () => void; + } +} +declare module "ace-code/src/mouse/fold_handler" { + export class FoldHandler { + constructor(editor: any); + } +} +declare module "ace-code/src/keyboard/keybinding" { + export type Editor = import("ace-code/src/editor").Editor; + export type KeyboardHandler = import("ace-code").Ace.KeyboardHandler; + export class KeyBinding { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + /** + * @param {KeyboardHandler} kb + */ + setDefaultHandler(kb: KeyboardHandler): void; + /** + * @param {KeyboardHandler} kb + */ + setKeyboardHandler(kb: KeyboardHandler): void; + /** + * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] + * @param {number} [pos] + */ + addKeyboardHandler(kb?: Partial & { + attach?: (editor: import("ace-code/src/editor").Editor) => void; + detach?: (editor: import("ace-code/src/editor").Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + } & { + attach?: (editor: any) => void; + detach?: (editor: any) => void; + }, pos?: number): void; + /** + * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb + * @returns {boolean} + */ + removeKeyboardHandler(kb: Partial & { + attach?: (editor: import("ace-code/src/editor").Editor) => void; + detach?: (editor: import("ace-code/src/editor").Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + } & { + attach?: (editor: any) => void; + detach?: (editor: any) => void; + }): boolean; + /** + * @return {KeyboardHandler} + */ + getKeyboardHandler(): KeyboardHandler; + getStatusText(): string; + /** + * @param {any} e + * @param {number} hashId + * @param {number} keyCode + * @return {boolean} + */ + onCommandKey(e: any, hashId: number, keyCode: number): boolean; + /** + * @param {string} text + * @return {boolean} + */ + onTextInput(text: string): boolean; + } +} +declare module "ace-code/src/search" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + /** + * A class designed to handle all sorts of text searches within a [[Document `Document`]]. + **/ + export class Search { + /** + * Sets the search options via the `options` parameter. + * @param {Partial} options An object containing all the new search properties + * @returns {Search} + * @chainable + **/ + set(options: Partial): Search; + /** + * [Returns an object containing all the search options.]{: #Search.getOptions} + * @returns {Partial} + **/ + getOptions(): Partial; + /** + * Sets the search options via the `options` parameter. + * @param {SearchOptions} options object containing all the search propertie + * @related Search.set + **/ + setOptions(options: { + /** + * - The string or regular expression you're looking for + */ + needle?: string | RegExp; + /** + * - Whether to search backwards from where cursor currently is + */ + backwards?: boolean; + /** + * - Whether to wrap the search back to the beginning when it hits the end + */ + wrap?: boolean; + /** + * - Whether the search ought to be case-sensitive + */ + caseSensitive?: boolean; + /** + * - Whether the search matches only on whole words + */ + wholeWord?: boolean; + /** + * - The [[Range]] to search within. Set this to `null` for the whole document + */ + range?: Range | null; + /** + * - Whether the search is a regular expression or not + */ + regExp?: boolean; + /** + * - The starting [[Range]] or cursor position to begin the search + */ + start?: Range | import("ace-code").Ace.Position; + /** + * - Whether or not to include the current line in the search + */ + skipCurrent?: boolean; + preserveCase?: boolean; + preventScroll?: boolean; + /** + * ** + */ + re?: any; + }): void; + /** + * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. + * @param {EditSession} session The session to search with + * @returns {Range|false} + **/ + find(session: EditSession): Range | false; + /** + * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. + * @param {EditSession} session The session to search with + * @returns {Range[]} + **/ + findAll(session: EditSession): Range[]; + /** + * Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`. + * @param {String} input The text to search in + * @param {any} replacement The replacing text + * + (String): If `options.regExp` is `true`, this function returns `input` with the replacement already made. Otherwise, this function just returns `replacement`.
+ * If `options.needle` was not found, this function returns `null`. + * + * + * @returns {String} + **/ + replace(input: string, replacement: any): string; + } + import Range_5 = require("ace-code/src/range"); + import Range = Range_5.Range; +} +declare module "ace-code/src/keyboard/hash_handler" { + export type Command = import("ace-code").Ace.Command; + export type CommandLike = import("ace-code").Ace.CommandLike; + export class HashHandler extends MultiHashHandler { + } + export namespace HashHandler { + function call(thisArg: any, config: any, platform: any): void; + } + export class MultiHashHandler { + /** + * @param {Record | Command[]} [config] + * @param {string} [platform] + */ + constructor(config?: Record | Command[], platform?: string); + platform: string; + /**@type {Record}*/ + commands: Record; + commandKeyBinding: {}; + /** + * @param {Command} command + */ + addCommand(command: Command): void; + /** + * @param {Command | string} command + * @param {boolean} [keepCommand] + */ + removeCommand(command: Command | string, keepCommand?: boolean): void; + /** + * @param {string | { win?: string; mac?: string; position?:number}} key + * @param {CommandLike | string} command + * @param {number} [position] + */ + bindKey(key: string | { + win?: string; + mac?: string; + position?: number; + }, command: CommandLike | string, position?: number): void; + /** + * @param {Record | Command[]} [commands] + */ + addCommands(commands?: Record | Command[]): void; + /** + * @param {Record} commands + */ + removeCommands(commands: Record): void; + /** + * @param {Record} keyList + */ + bindKeys(keyList: Record): void; + /** + * Accepts keys in the form ctrl+Enter or ctrl-Enter + * keys without modifiers or shift only + * @param {string} keys + * @returns {{key: string, hashId: number} | false} + */ + parseKeys(keys: string): { + key: string; + hashId: number; + } | false; + /** + * @param {number} hashId + * @param {string} keyString + * @returns {Command} + */ + findKeyCommand(hashId: number, keyString: string): Command; + /** + * @param {{ $keyChain: string | any[]; }} data + * @param {number} hashId + * @param {string} keyString + * @param {number} keyCode + * @returns {{command: string} | void} + */ + handleKeyboard(data: { + }, hashId: number, keyString: string, keyCode: number): { + command: string; + } | void; + /** + * @param {any} [editor] + * @param {any} [data] + * @returns {string} + */ + getStatusText(editor?: any, data?: any): string; + } + export namespace MultiHashHandler { + function call(thisArg: any, config: any, platform: any): void; + } +} +declare module "ace-code/src/commands/command_manager" { + const CommandManager_base: typeof MultiHashHandler; + export class CommandManager extends MultiHashHandler { + /** + * new CommandManager(platform, commands) + * @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"` + * @param {any[]} commands A list of commands + **/ + constructor(platform: string, commands: any[]); + byName: Record; + /** + * + * @param {string | string[] | import("ace-code").Ace.Command} command + * @param {Editor} editor + * @param {any} args + * @returns {boolean} + */ + exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; + /** + * @param {Editor} editor + * @returns {boolean} + */ + toggleRecording(editor: Editor): boolean; + macro: any; + recording: boolean; + oldMacro: any; + /** + * @param {Editor} editor + */ + replay(editor: Editor): boolean; + trimMacro(m: any): any; + } + export type Editor = import("ace-code/src/editor").Editor; + import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); + import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface CommandManager extends Ace.EventEmitter { + } +} +declare module "ace-code/src/commands/default_commands" { + export const commands: import("ace-code").Ace.Command[]; +} +declare module "ace-code/src/token_iterator" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + /** + * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens. + **/ + export class TokenIterator { + /** + * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. + * @param {EditSession} session The session to associate with + * @param {Number} initialRow The row to start the tokenizing at + * @param {Number} initialColumn The column to start the tokenizing at + **/ + constructor(session: EditSession, initialRow: number, initialColumn: number); + /** + * Moves iterator position to the start of previous token. + * @returns {import("ace-code").Ace.Token|null} + **/ + stepBackward(): import("ace-code").Ace.Token | null; + /** + * Moves iterator position to the start of next token. + * @returns {import("ace-code").Ace.Token|null} + **/ + stepForward(): import("ace-code").Ace.Token | null; + /** + * + * Returns current token. + * @returns {import("ace-code").Ace.Token} + **/ + getCurrentToken(): import("ace-code").Ace.Token; + /** + * + * Returns the current row. + * @returns {Number} + **/ + getCurrentTokenRow(): number; + /** + * + * Returns the current column. + * @returns {Number} + **/ + getCurrentTokenColumn(): number; + /** + * Return the current token position. + * @returns {import("ace-code").Ace.Point} + */ + getCurrentTokenPosition(): import("ace-code").Ace.Point; + /** + * Return the current token range. + * @returns {Range} + */ + getCurrentTokenRange(): Range; + } + import Range_6 = require("ace-code/src/range"); + import Range = Range_6.Range; +} +declare module "ace-code/src/line_widgets" { + export class LineWidgets { + /** + * @param {EditSession} session + */ + constructor(session: EditSession); + session: import("ace-code/src/edit_session").EditSession; + /** + * + * @param {import("ace-code").Ace.Delta} delta + */ + updateOnChange(delta: import("ace-code").Ace.Delta): void; + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + renderWidgets(e: any, renderer: VirtualRenderer): void; + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + measureWidgets(e: any, renderer: VirtualRenderer): void; + /** + * @param {number} row + * @return {number} + */ + getRowLength(row: number): number; + /** + * + * @param {Editor} editor + */ + attach(editor: Editor): void; + /**@type {Editor} */ + editor: Editor; + detach(e: any): void; + /** + * + * @param e + * @param {EditSession} session + */ + updateOnFold(e: any, session: EditSession): void; + /** + * + * @param {LineWidget} w + * @return {LineWidget} + */ + addLineWidget(w: LineWidget): LineWidget; + /** + * @param {LineWidget} w + */ + removeLineWidget(w: LineWidget): void; + /** + * + * @param {number} row + * @return {LineWidget[]} + */ + getWidgetsAtRow(row: number): LineWidget[]; + /** + * @param {LineWidget} w + */ + onWidgetChanged(w: LineWidget): void; + firstRow: number; + lastRow: number; + lineWidgets: import("ace-code").Ace.LineWidget[]; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Editor = import("ace-code/src/editor").Editor; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + export type LineWidget = import("ace-code").Ace.LineWidget; + namespace Ace { + type LineWidget = import("ace-code").Ace.LineWidget; + type Editor = import("ace-code").Ace.Editor; + } + export interface LineWidgets { + lineWidgets: Ace.LineWidget[]; + editor: Ace.Editor; + } +} +declare module "ace-code/src/keyboard/gutter_handler" { + export class GutterKeyboardHandler { + constructor(editor: any); + editor: any; + gutterLayer: any; + element: any; + lines: any; + activeRowIndex: any; + activeLane: string; + annotationTooltip: GutterTooltip; + addListener(): void; + removeListener(): void; + lane: any; + } + export class GutterKeyboardEvent { + constructor(domEvent: any, gutterKeyboardHandler: any); + gutterKeyboardHandler: any; + domEvent: any; + /** + * Returns the key that was presssed. + * + * @return {string} the key that was pressed. + */ + getKey(): string; + /** + * Returns the row in the gutter that was focused after the keyboard event was handled. + * + * @return {number} the key that was pressed. + */ + getRow(): number; + /** + * Returns whether focus is on the annotation lane after the keyboard event was handled. + * + * @return {boolean} true if focus was on the annotation lane after the keyboard event. + */ + isInAnnotationLane(): boolean; + /** + * Returns whether focus is on the fold lane after the keyboard event was handled. + * + * @return {boolean} true if focus was on the fold lane after the keyboard event. + */ + isInFoldLane(): boolean; + } + import GutterTooltip_1 = require("ace-code/src/mouse/default_gutter_handler"); + import GutterTooltip = GutterTooltip_1.GutterTooltip; +} +declare module "ace-code/src/editor" { + const Editor_base: undefined; + const Editor_base_1: undefined; + const Editor_base_2: undefined; + const Editor_base_3: undefined; + const Editor_base_4: undefined; + const Editor_base_5: undefined; + const Editor_base_6: undefined; + const Editor_base_7: undefined; + /** + * The main entry point into the Ace functionality. + * + * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. + * + * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. + **/ + export class Editor { + /** + * Creates a new `Editor` object. + * + * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything + * @param {EditSession} [session] The `EditSession` to refer to + * @param {Partial} [options] The default options + **/ + constructor(renderer: VirtualRenderer, session?: EditSession, options?: Partial); + /**@type{EditSession}*/ session: EditSession; + /**@type {HTMLElement & {env?:any, value?:any}}*/ + container: HTMLElement & { + env?: any; + value?: any; + }; + /**@type {VirtualRenderer}*/ + renderer: VirtualRenderer; + /**@type {string}*/ + id: string; + commands: CommandManager; + textInput: any; + /**@type {KeyBinding}*/ + keyBinding: KeyBinding; + startOperation(commandEvent: any): void; + prevOp: {}; + previousCommand: any; + /** + * @type {{[key: string]: any;}} + */ + curOp: { + [key: string]: any; + }; + /** + * @arg e + */ + endOperation(e: any): any; + mergeNextCommand: boolean; + sequenceStartTime: number; + /** + * Sets a new key handler, such as "vim" or "windows". + * @param {String | import("ace-code").Ace.KeyboardHandler | null} keyboardHandler The new key handler + * @param {() => void} [cb] + **/ + setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; + /** + * Returns the keyboard handler, such as "vim" or "windows". + * @returns {Object} + **/ + getKeyboardHandler(): any; + /** + * Sets a new editsession to use. This method also emits the `'changeSession'` event. + * @param {EditSession} [session] The new session to use + **/ + setSession(session?: EditSession): void; + selection: import("ace-code/src/selection").Selection; + /** + * Returns the current session being used. + * @returns {EditSession} + **/ + getSession(): EditSession; + /** + * Sets the current document to `val`. + * @param {String} val The new value to set for the document + * @param {Number} [cursorPos] Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end + * + * @returns {String} The current document value + * @related Document.setValue + **/ + setValue(val: string, cursorPos?: number): string; + /** + * Returns the current session's content. + * + * @returns {String} + * @related EditSession.getValue + **/ + getValue(): string; + /** + * + * Returns the currently highlighted selection. + * @returns {Selection} The selection object + **/ + getSelection(): Selection; + /** + * {:VirtualRenderer.onResize} + * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed + * @related VirtualRenderer.onResize + **/ + resize(force?: boolean): void; + /** + * {:VirtualRenderer.setTheme} + * @param {string | import("ace-code").Ace.Theme} theme The path to a theme + * @param {() => void} [cb] optional callback called when theme is loaded + **/ + setTheme(theme: string | import("ace-code").Ace.Theme, cb?: () => void): void; + /** + * {:VirtualRenderer.getTheme} + * + * @returns {String} The set theme + * @related VirtualRenderer.getTheme + **/ + getTheme(): string; + /** + * {:VirtualRenderer.setStyle} + * @param {String} style A class name + * @related VirtualRenderer.setStyle + **/ + setStyle(style: string): void; + /** + * {:VirtualRenderer.unsetStyle} + * @related VirtualRenderer.unsetStyle + * @param {string} style + */ + unsetStyle(style: string): void; + /** + * Gets the current font size of the editor text. + * @return {string} + */ + getFontSize(): string; + /** + * Set a new font size (in pixels) for the editor text. + * @param {String} size A font size ( _e.g._ "12px") + **/ + setFontSize(size: string): void; + /** + * + * Brings the current `textInput` into focus. + **/ + focus(): void; + /** + * Returns `true` if the current `textInput` is in focus. + * @return {Boolean} + **/ + isFocused(): boolean; + /** + * + * Blurs the current `textInput`. + **/ + blur(): void; + /** + * Emitted once the editor comes into focus. + **/ + onFocus(e: any): void; + /** + * Emitted once the editor has been blurred. + **/ + onBlur(e: any): void; + /** + * Emitted whenever the document is changed. + * @param {import("ace-code").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes + **/ + onDocumentChange(delta: import("ace-code").Ace.Delta): void; + onTokenizerUpdate(e: any): void; + onScrollTopChange(): void; + onScrollLeftChange(): void; + /** + * Emitted when the selection changes. + **/ + onCursorChange(): void; + /** + * + * @param e + */ + onSelectionChange(e: any): void; + onChangeFrontMarker(): void; + onChangeBackMarker(): void; + onChangeBreakpoint(): void; + onChangeAnnotation(): void; + /** + * @param e + */ + onChangeMode(e: any): void; + onChangeWrapLimit(): void; + onChangeWrapMode(): void; + /** + */ + onChangeFold(): void; + /** + * Returns the string of text currently highlighted. + * @returns {String} + **/ + getCopyText(): string; + /** + * Called whenever a text "copy" happens. + **/ + onCopy(): void; + /** + * Called whenever a text "cut" happens. + **/ + onCut(): void; + /** + * Called whenever a text "paste" happens. + * @param {String} text The pasted text + * @param {any} event + **/ + onPaste(text: string, event: any): void; + /** + * + * @param {string | string[]} command + * @param [args] + * @return {boolean} + */ + execCommand(command: string | string[], args?: any): boolean; + /** + * Inserts `text` into wherever the cursor is pointing. + * @param {String} text The new text to add + * @param {boolean} [pasted] + **/ + insert(text: string, pasted?: boolean): void; + autoIndent(): void; + /** + * + * @param text + * @param composition + * @returns {*} + */ + onTextInput(text: any, composition: any): any; + /** + * @param {string} [text] + * @param {any} [composition] + */ + applyComposition(text?: string, composition?: any): void; + onCommandKey(e: any, hashId: any, keyCode: any): boolean; + /** + * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. + * @param {Boolean} overwrite Defines whether or not to set overwrites + * @related EditSession.setOverwrite + **/ + setOverwrite(overwrite: boolean): void; + /** + * Returns `true` if overwrites are enabled; `false` otherwise. + * @returns {Boolean} + * @related EditSession.getOverwrite + **/ + getOverwrite(): boolean; + /** + * Sets the value of overwrite to the opposite of whatever it currently is. + * @related EditSession.toggleOverwrite + **/ + toggleOverwrite(): void; + /** + * Sets how fast the mouse scrolling should do. + * @param {Number} speed A value indicating the new speed (in milliseconds) + **/ + setScrollSpeed(speed: number): void; + /** + * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). + * @returns {Number} + **/ + getScrollSpeed(): number; + /** + * Sets the delay (in milliseconds) of the mouse drag. + * @param {Number} dragDelay A value indicating the new delay + **/ + setDragDelay(dragDelay: number): void; + /** + * Returns the current mouse drag delay. + * @returns {Number} + **/ + getDragDelay(): number; + /** + * Draw selection markers spanning whole line, or only over selected text. Default value is "line" + * @param {"fullLine" | "screenLine" | "text" | "line"} val The new selection style "line"|"text" + **/ + setSelectionStyle(val: "fullLine" | "screenLine" | "text" | "line"): void; + /** + * Returns the current selection style. + * @returns {import("ace-code").Ace.EditorOptions["selectionStyle"]} + **/ + getSelectionStyle(): import("ace-code").Ace.EditorOptions["selectionStyle"]; + /** + * Determines whether or not the current line should be highlighted. + * @param {Boolean} shouldHighlight Set to `true` to highlight the current line + **/ + setHighlightActiveLine(shouldHighlight: boolean): void; + /** + * Returns `true` if current lines are always highlighted. + * @return {Boolean} + **/ + getHighlightActiveLine(): boolean; + /** + * @param {boolean} shouldHighlight + */ + setHighlightGutterLine(shouldHighlight: boolean): void; + /** + * @returns {Boolean} + */ + getHighlightGutterLine(): boolean; + /** + * Determines if the currently selected word should be highlighted. + * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word + **/ + setHighlightSelectedWord(shouldHighlight: boolean): void; + /** + * Returns `true` if currently highlighted words are to be highlighted. + * @returns {Boolean} + **/ + getHighlightSelectedWord(): boolean; + /** + * @param {boolean} shouldAnimate + */ + setAnimatedScroll(shouldAnimate: boolean): void; + /** + * @return {boolean} + */ + getAnimatedScroll(): boolean; + /** + * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. + * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters + **/ + setShowInvisibles(showInvisibles: boolean): void; + /** + * Returns `true` if invisible characters are being shown. + * @returns {Boolean} + **/ + getShowInvisibles(): boolean; + /** + * @param {boolean} display + */ + setDisplayIndentGuides(display: boolean): void; + /** + * @return {boolean} + */ + getDisplayIndentGuides(): boolean; + /** + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): void; + /** + * @return {boolean} + */ + getHighlightIndentGuides(): boolean; + /** + * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. + * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin + * + **/ + setShowPrintMargin(showPrintMargin: boolean): void; + /** + * Returns `true` if the print margin is being shown. + * @returns {Boolean} + **/ + getShowPrintMargin(): boolean; + /** + * Sets the column defining where the print margin should be. + * @param {Number} showPrintMargin Specifies the new print margin + * + **/ + setPrintMarginColumn(showPrintMargin: number): void; + /** + * Returns the column number of where the print margin is. + * @returns {Number} + **/ + getPrintMarginColumn(): number; + /** + * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. + * @param {Boolean} readOnly Specifies whether the editor can be modified or not + **/ + setReadOnly(readOnly: boolean): void; + /** + * Returns `true` if the editor is set to read-only mode. + * @returns {Boolean} + **/ + getReadOnly(): boolean; + /** + * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} + * @param {Boolean} enabled Enables or disables behaviors + **/ + setBehavioursEnabled(enabled: boolean): void; + /** + * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} + * @returns {Boolean} + **/ + getBehavioursEnabled(): boolean; + /** + * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets + * when such a character is typed in. + * @param {Boolean} enabled Enables or disables wrapping behaviors + **/ + setWrapBehavioursEnabled(enabled: boolean): void; + /** + * Returns `true` if the wrapping behaviors are currently enabled. + * @returns {boolean} + **/ + getWrapBehavioursEnabled(): boolean; + /** + * Indicates whether the fold widgets should be shown or not. + * @param {Boolean} show Specifies whether the fold widgets are shown + **/ + setShowFoldWidgets(show: boolean): void; + /** + * Returns `true` if the fold widgets are shown. + * @return {Boolean} + **/ + getShowFoldWidgets(): boolean; + /** + * @param {boolean} fade + */ + setFadeFoldWidgets(fade: boolean): void; + /** + * @returns {boolean} + */ + getFadeFoldWidgets(): boolean; + /** + * Removes the current selection or one character. + * @param {'left' | 'right'} [dir] The direction of the deletion to occur, either "left" or "right" + **/ + remove(dir?: 'left' | 'right'): void; + /** + * Removes the word directly to the right of the current selection. + **/ + removeWordRight(): void; + /** + * Removes the word directly to the left of the current selection. + **/ + removeWordLeft(): void; + /** + * Removes all the words to the left of the current selection, until the start of the line. + **/ + removeToLineStart(): void; + /** + * Removes all the words to the right of the current selection, until the end of the line. + **/ + removeToLineEnd(): void; + /** + * Splits the line at the current selection (by inserting an `'\n'`). + **/ + splitLine(): void; + /** + * Set the "ghost" text in provided position. "Ghost" text is a kind of + * preview text inside the editor which can be used to preview some code + * inline in the editor such as, for example, code completions. + * + * @param {String} text Text to be inserted as "ghost" text + * @param {Point} [position] Position to insert text to + */ + setGhostText(text: string, position?: Point): void; + /** + * Removes "ghost" text currently displayed in the editor. + */ + removeGhostText(): void; + /** + * Transposes current line. + **/ + transposeLetters(): void; + /** + * Converts the current selection entirely into lowercase. + **/ + toLowerCase(): void; + /** + * Converts the current selection entirely into uppercase. + **/ + toUpperCase(): void; + /** + * Inserts an indentation into the current cursor position or indents the selected lines. + * + * @related EditSession.indentRows + **/ + indent(): void; + /** + * Indents the current line. + * @related EditSession.indentRows + **/ + blockIndent(): void; + /** + * Outdents the current line. + * @related EditSession.outdentRows + **/ + blockOutdent(): void; + sortLines(): void; + /** + * Given the currently selected range, this function either comments all the lines, or uncomments all of them. + **/ + toggleCommentLines(): void; + toggleBlockComment(): void; + /** + * Works like [[EditSession.getTokenAt]], except it returns a number. + * @returns {any} + **/ + getNumberAt(row: any, column: any): any; + /** + * If the character before the cursor is a number, this functions changes its value by `amount`. + * @param {Number} amount The value to change the numeral by (can be negative to decrease value) + **/ + modifyNumber(amount: number): void; + /** + */ + toggleWord(): void; + /** + * Finds link at defined {row} and {column} + * @returns {String} + **/ + findLinkAt(row: any, column: any): string; + /** + * Open valid url under cursor in another tab + * @returns {Boolean} + **/ + openLink(): boolean; + /** + * Removes all the lines in the current selection + * @related EditSession.remove + **/ + removeLines(): void; + duplicateSelection(): void; + /** + * Shifts all the selected lines down one row. + * + * @related EditSession.moveLinesUp + **/ + moveLinesDown(): void; + /** + * Shifts all the selected lines up one row. + * @related EditSession.moveLinesDown + **/ + moveLinesUp(): void; + /** + * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: + * ```json + * { row: newRowLocation, column: newColumnLocation } + * ``` + * @param {Range} range The range of text you want moved within the document + * @param {Point} toPosition The location (row and column) where you want to move the text to + * @param {boolean} [copy] + * + * @returns {Range} The new range where the text was moved to. + * @related EditSession.moveText + **/ + moveText(range: Range, toPosition: Point, copy?: boolean): Range; + /** + * Copies all the selected lines up one row. + * + **/ + copyLinesUp(): void; + /** + * Copies all the selected lines down one row. + * @related EditSession.duplicateLines + * + **/ + copyLinesDown(): void; + inVirtualSelectionMode: boolean; + onCompositionStart(compositionState: any): void; + onCompositionUpdate(text: any): void; + onCompositionEnd(): void; + /** + * {:VirtualRenderer.getFirstVisibleRow} + * + * @returns {Number} + * @related VirtualRenderer.getFirstVisibleRow + **/ + getFirstVisibleRow(): number; + /** + * {:VirtualRenderer.getLastVisibleRow} + * + * @returns {Number} + * @related VirtualRenderer.getLastVisibleRow + **/ + getLastVisibleRow(): number; + /** + * Indicates if the row is currently visible on the screen. + * @param {Number} row The row to check + * + * @returns {Boolean} + **/ + isRowVisible(row: number): boolean; + /** + * Indicates if the entire row is currently visible on the screen. + * @param {Number} row The row to check + * + * + * @returns {Boolean} + **/ + isRowFullyVisible(row: number): boolean; + /** + * Selects the text from the current position of the document until where a "page down" finishes. + **/ + selectPageDown(): void; + /** + * Selects the text from the current position of the document until where a "page up" finishes. + **/ + selectPageUp(): void; + /** + * Shifts the document to wherever "page down" is, as well as moving the cursor position. + **/ + gotoPageDown(): void; + /** + * Shifts the document to wherever "page up" is, as well as moving the cursor position. + **/ + gotoPageUp(): void; + /** + * Scrolls the document to wherever "page down" is, without changing the cursor position. + **/ + scrollPageDown(): void; + /** + * Scrolls the document to wherever "page up" is, without changing the cursor position. + **/ + scrollPageUp(): void; + /** + * Moves the editor to the specified row. + * @related VirtualRenderer.scrollToRow + * @param {number} row + */ + scrollToRow(row: number): void; + /** + * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). + * @param {Number} line The line to scroll to + * @param {Boolean} center If `true` + * @param {Boolean} animate If `true` animates scrolling + * @param {() => void} [callback] Function to be called when the animation has finished + * + * @related VirtualRenderer.scrollToLine + **/ + scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; + /** + * Attempts to center the current selection on the screen. + **/ + centerSelection(): void; + /** + * Gets the current position of the cursor. + * @returns {Point} An object that looks something like this: + * + * ```json + * { row: currRow, column: currCol } + * ``` + * + * @related Selection.getCursor + **/ + getCursorPosition(): Point; + /** + * Returns the screen position of the cursor. + * @returns {Point} + * @related EditSession.documentToScreenPosition + **/ + getCursorPositionScreen(): Point; + /** + * {:Selection.getRange} + * @returns {Range} + * @related Selection.getRange + **/ + getSelectionRange(): Range; + /** + * Selects all the text in editor. + * @related Selection.selectAll + **/ + selectAll(): void; + /** + * {:Selection.clearSelection} + * @related Selection.clearSelection + **/ + clearSelection(): void; + /** + * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. + * @param {Number} row The new row number + * @param {Number} column The new column number + * @related Selection.moveCursorTo + **/ + moveCursorTo(row: number, column: number): void; + /** + * Moves the cursor to the position indicated by `pos.row` and `pos.column`. + * @param {Point} pos An object with two properties, row and column + * @related Selection.moveCursorToPosition + **/ + moveCursorToPosition(pos: Point): void; + /** + * Moves the cursor's row and column to the next matching bracket or HTML tag. + * @param {boolean} [select] + * @param {boolean} [expand] + */ + jumpToMatching(select?: boolean, expand?: boolean): void; + /** + * Moves the cursor to the specified line number, and also into the indicated column. + * @param {Number} lineNumber The line number to go to + * @param {Number} [column] A column number to go to + * @param {Boolean} [animate] If `true` animates scolling + **/ + gotoLine(lineNumber: number, column?: number, animate?: boolean): void; + /** + * Moves the cursor to the specified row and column. Note that this does de-select the current selection. + * @param {Number} row The new row number + * @param {Number} column The new column number + * + * @related Editor.moveCursorTo + **/ + navigateTo(row: number, column: number): void; + /** + * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateUp(times?: number): void; + /** + * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateDown(times?: number): void; + /** + * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateLeft(times?: number): void; + /** + * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateRight(times?: number): void; + /** + * + * Moves the cursor to the start of the current line. Note that this does de-select the current selection. + **/ + navigateLineStart(): void; + /** + * + * Moves the cursor to the end of the current line. Note that this does de-select the current selection. + **/ + navigateLineEnd(): void; + /** + * + * Moves the cursor to the end of the current file. Note that this does de-select the current selection. + **/ + navigateFileEnd(): void; + /** + * + * Moves the cursor to the start of the current file. Note that this does de-select the current selection. + **/ + navigateFileStart(): void; + /** + * + * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection. + **/ + navigateWordRight(): void; + /** + * + * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection. + **/ + navigateWordLeft(): void; + /** + * Replaces the first occurrence of `options.needle` with the value in `replacement`. + * @param {String} [replacement] The text to replace with + * @param {Partial} [options] The [[Search `Search`]] options to use + * @return {number} + **/ + replace(replacement?: string, options?: Partial): number; + /** + * Replaces all occurrences of `options.needle` with the value in `replacement`. + * @param {String} [replacement] The text to replace with + * @param {Partial} [options] The [[Search `Search`]] options to use + * @return {number} + **/ + replaceAll(replacement?: string, options?: Partial): number; + /** + * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. + * @related Search.getOptions + * @returns {Partial} + **/ + getLastSearchOptions(): Partial; + /** + * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. + * @param {String|RegExp|Object} needle The text to search for (optional) + * @param {Partial} [options] An object defining various search properties + * @param {Boolean} [animate] If `true` animate scrolling + * @related Search.find + **/ + find(needle: string | RegExp | any, options?: Partial, animate?: boolean): false | Range; + /** + * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. + * @param {Partial} [options] search options + * @param {Boolean} [animate] If `true` animate scrolling + * + * @related Editor.find + **/ + findNext(options?: Partial, animate?: boolean): void; + /** + * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. + * @param {Partial} [options] search options + * @param {Boolean} [animate] If `true` animate scrolling + * + * @related Editor.find + **/ + findPrevious(options?: Partial, animate?: boolean): void; + /** + * + * @param {Range} range + * @param {boolean} [animate] + */ + revealRange(range: Range, animate?: boolean): void; + /** + * {:UndoManager.undo} + * @related UndoManager.undo + **/ + undo(): void; + /** + * {:UndoManager.redo} + * @related UndoManager.redo + **/ + redo(): void; + /** + * + * Cleans up the entire editor. + **/ + destroy(): void; + /** + * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element + * @param {Boolean} enable default true + **/ + setAutoScrollEditorIntoView(enable: boolean): void; + /** + * opens a prompt displaying message + **/ + prompt(message: any, options: any, callback: any): void; + env?: any; + widgetManager?: LineWidgets; + completer?: import("ace-code/src/autocomplete").Autocomplete | import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + completers: import("ace-code").Ace.Completer[]; + showKeyboardShortcuts?: () => void; + showSettingsMenu?: () => void; + searchBox?: import("ace-code/src/ext/searchbox").SearchBox; + } + export namespace Editor { + export { $uid }; + } + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + export type Selection = import("ace-code/src/selection").Selection; + export type Point = import("ace-code").Ace.Point; + export type SearchOptions = import("ace-code").Ace.SearchOptions; + import EditSession_1 = require("ace-code/src/edit_session"); + import EditSession = EditSession_1.EditSession; + import CommandManager_1 = require("ace-code/src/commands/command_manager"); + import CommandManager = CommandManager_1.CommandManager; + import MouseHandler_1 = require("ace-code/src/mouse/mouse_handler"); + import MouseHandler = MouseHandler_1.MouseHandler; + import KeyBinding_1 = require("ace-code/src/keyboard/keybinding"); + import KeyBinding = KeyBinding_1.KeyBinding; + import Search_1 = require("ace-code/src/search"); + import Search = Search_1.Search; + import Range_7 = require("ace-code/src/range"); + import Range = Range_7.Range; + import LineWidgets_1 = require("ace-code/src/line_widgets"); + import LineWidgets = LineWidgets_1.LineWidgets; + var $uid: number; + export {}; + namespace Ace { + type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type EditorOptions = import("ace-code").Ace.EditorOptions; + type EventEmitter = import("ace-code").Ace.EventEmitter; + type EditorEvents = import("ace-code").Ace.EditorEvents; + type CodeLenseEditorExtension = import("ace-code").Ace.CodeLenseEditorExtension; + type ElasticTabstopsEditorExtension = import("ace-code").Ace.ElasticTabstopsEditorExtension; + type TextareaEditorExtension = import("ace-code").Ace.TextareaEditorExtension; + type PromptEditorExtension = import("ace-code").Ace.PromptEditorExtension; + type OptionsEditorExtension = import("ace-code").Ace.OptionsEditorExtension; + type EditSession = import("ace-code").Ace.EditSession; + type LineWidgets = import("ace-code").Ace.LineWidgets; + type Autocomplete = import("ace-code").Ace.Autocomplete; + type InlineAutocomplete = import("ace-code").Ace.InlineAutocomplete; + type Completer = import("ace-code").Ace.Completer; + type SearchBox = import("ace-code").Ace.SearchBox; + } + export interface Editor extends Ace.EditorMultiSelectProperties, Ace.OptionsProvider, Ace.EventEmitter, Ace.CodeLenseEditorExtension, Ace.ElasticTabstopsEditorExtension, Ace.TextareaEditorExtension, Ace.PromptEditorExtension, Ace.OptionsEditorExtension { + session: Ace.EditSession; + env?: any; + widgetManager?: Ace.LineWidgets; + completer?: Ace.Autocomplete | Ace.InlineAutocomplete; + completers: Ace.Completer[]; + showKeyboardShortcuts?: () => void; + showSettingsMenu?: () => void; + searchBox?: Ace.SearchBox; + } +} +declare module "ace-code/src/undomanager" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Delta = import("ace-code").Ace.Delta; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code").Ace.Delta} Delta + * @typedef {import("ace-code").Ace.Point} Point + * @typedef {import("ace-code").Ace.IRange} IRange + */ + /** + * This object maintains the undo stack for an [[EditSession `EditSession`]]. + **/ + export class UndoManager { + /** + * + * @param {EditSession} session + */ + addSession(session: EditSession): void; + /** + * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: + * + * - `args[0]` is an array of deltas + * - `args[1]` is the document to associate with + * + * @param {import("ace-code").Ace.Delta} delta + * @param {boolean} allowMerge + * @param {EditSession} [session] + **/ + add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; + lastDeltas: any[]; + /** + * + * @param {any} selection + * @param {number} [rev] + */ + addSelection(selection: any, rev?: number): void; + startNewGroup(): any; + /** + * + * @param {number} from + * @param {number} [to] + */ + markIgnored(from: number, to?: number): void; + /** + * + * @param {number} rev + * @param {boolean} [after] + * @return {{ value: string, rev: number }} + */ + getSelection(rev: number, after?: boolean): { + value: string; + rev: number; + }; + /** + * @return {number} + */ + getRevision(): number; + /** + * + * @param {number} from + * @param {number} [to] + * @return {import("ace-code").Ace.Delta[]} + */ + getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; + /** + * + * @param {number} from + * @param {number} [to] + */ + getChangedRanges(from: number, to?: number): void; + /** + * + * @param {number} from + * @param {number} [to] + */ + getChangedLines(from: number, to?: number): void; + /** + * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} + * @param {EditSession} session + * @param {Boolean} [dontSelect] {:dontSelect} + **/ + undo(session: EditSession, dontSelect?: boolean): void; + /** + * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} + * @param {EditSession} session + * @param {Boolean} [dontSelect] {:dontSelect} + * + **/ + redo(session: EditSession, dontSelect?: boolean): void; + /** + * Destroys the stack of undo and redo redo operations. + **/ + reset(): void; + mark: number; + selections: any[]; + /** + * Returns `true` if there are undo operations left to perform. + * @returns {Boolean} + **/ + canUndo(): boolean; + /** + * Returns `true` if there are redo operations left to perform. + * @returns {Boolean} + **/ + canRedo(): boolean; + /** + * Marks the current status clean + * @param {number} [rev] + */ + bookmark(rev?: number): void; + /** + * Returns if the current status is clean + * @returns {Boolean} + **/ + isAtBookmark(): boolean; + /** + * Returns an object which can be safely stringified into JSON + * @returns {object} + */ + toJSON(): object; + /** + * Takes in an object which was returned from the toJSON method above, + * and resets the current undoManager instance to use the previously exported + * instance state. + * @param {object} json + */ + fromJSON(json: object): void; + hasUndo: () => boolean; + hasRedo: () => boolean; + isClean: () => boolean; + markClean: (rev?: number) => void; + } +} +declare module "ace-code/src/tokenizer" { + /** + * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). + **/ + export class Tokenizer { + /** + * Constructs a new tokenizer based on the given rules and flags. + * @param {Object} rules The highlighting rules + **/ + constructor(rules: any); + /**@type {RegExp}*/ + splitRegex: RegExp; + states: any; + regExps: {}; + matchMappings: {}; + /** + * @param {string} src + * @returns {string} + */ + removeCapturingGroups(src: string): string; + /** + * @param {string} src + * @param {string} flag + */ + createSplitterRegexp(src: string, flag: string): RegExp; + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @param {string} line + * @param {string | string[]} startState + * @returns {{tokens:import("ace-code").Ace.Token[], state: string|string[]}} + */ + getLineTokens(line: string, startState: string | string[]): { + tokens: import("ace-code").Ace.Token[]; + state: string | string[]; + }; + reportError: (msg: any, data: any) => void; + } +} +declare module "ace-code/src/autocomplete/popup" { + const AcePopup_base: undefined; + /** + * This object is used in some places where needed to show popups - like prompt; autocomplete etc. + */ + export class AcePopup { + /** + * Creates and renders single line editor in popup window. If `parentNode` param is isset, then attaching it to this element. + * @param {Element} [parentNode] + */ + constructor(parentNode?: Element); + setSelectOnHover: (val: boolean) => void; + setRow: (line: number) => void; + getRow: () => number; + getHoveredRow: () => number; + filterText: string; + isOpen: boolean; + isTopdown: boolean; + autoSelect: boolean; + data: import("ace-code/src/autocomplete").Completion[]; + setData: (data: import("ace-code/src/autocomplete").Completion[], filterText: string) => void; + getData: (row: number) => import("ace-code/src/autocomplete").Completion; + hide: () => void; + anchor: "bottom" | "top"; + anchorPosition: import("ace-code").Ace.Point; + tryShow: (pos: any, lineHeight: number, anchor: "bottom" | "top", forceShow?: boolean) => boolean; + show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; + goTo: (where: import("ace-code").Ace.AcePopupNavigation) => void; + getTextLeftOffset: () => number; + anchorPos: any; + isMouseOver?: boolean; + selectedNode?: HTMLElement; + } + /** + * + * @param {HTMLElement} [el] + * @return {Editor} + */ + export function $singleLineEditor(el?: HTMLElement): Editor; + export function getAriaId(index: any): string; + import Editor_1 = require("ace-code/src/editor"); + import Editor = Editor_1.Editor; + export {}; + namespace Ace { + type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; + type Completion = import("ace-code").Ace.Completion; + type Point = import("ace-code").Ace.Point; + type AcePopupNavigation = import("ace-code").Ace.AcePopupNavigation; + } + export interface AcePopup extends Ace.AcePopupWithEditor { + setSelectOnHover: (val: boolean) => void; + setRow: (line: number) => void; + getRow: () => number; + getHoveredRow: () => number; + filterText: string; + isOpen: boolean; + isTopdown: boolean; + autoSelect: boolean; + data: Ace.Completion[]; + setData: (data: Ace.Completion[], filterText: string) => void; + getData: (row: number) => Ace.Completion; + hide: () => void; + anchor: "top" | "bottom"; + anchorPosition: Ace.Point; + tryShow: (pos: any, lineHeight: number, anchor: "top" | "bottom", forceShow?: boolean) => boolean; + show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; + goTo: (where: Ace.AcePopupNavigation) => void; + getTextLeftOffset: () => number; + anchorPos: any; + isMouseOver?: boolean; + selectedNode?: HTMLElement; + } +} +declare module "ace-code/src/range_list" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code").Ace.Point; + export class RangeList { + ranges: any[]; + /** + * @param {Point} pos + * @param {boolean} [excludeEdges] + * @param {number} [startIndex] + * @return {number} + */ + pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; + /** + * @param {Range} range + */ + add(range: Range): any[]; + /** + * @param {Range[]} list + */ + addList(list: Range[]): any[]; + /** + * @param {Point} pos + */ + substractPoint(pos: Point): any[]; + merge(): any[]; + /** + * @param {number} row + * @param {number} column + */ + contains(row: number, column: number): boolean; + /** + * @param {Point} pos + */ + containsPoint(pos: Point): boolean; + /** + * @param {Point} pos + */ + rangeAtPoint(pos: Point): any; + /** + * @param {number} startRow + * @param {number} endRow + */ + clipRows(startRow: number, endRow: number): any[]; + removeAll(): any[]; + /** + * @param {EditSession} session + */ + attach(session: EditSession): void; + session: import("ace-code/src/edit_session").EditSession; + onChange: any; + detach(): void; + comparePoints: (p1: import("ace-code").Ace.Point, p2: import("ace-code").Ace.Point) => number; + } + import Range_8 = require("ace-code/src/range"); + import Range = Range_8.Range; +} +declare module "ace-code/src/snippets" { + export const snippetManager: SnippetManager; + export type Snippet = { + content?: string; + replaceBefore?: string; + replaceAfter?: string; + startRe?: RegExp; + endRe?: RegExp; + triggerRe?: RegExp; + endTriggerRe?: RegExp; + trigger?: string; + endTrigger?: string; + matchBefore?: string[]; + matchAfter?: string[]; + name?: string; + tabTrigger?: string; + guard?: string; + endGuard?: string; + }; + class SnippetManager { + snippetMap: {}; + snippetNameMap: {}; + variables: { + CURRENT_WORD: (editor: any) => any; + SELECTION: (editor: any, name: any, indentation: any) => any; + CURRENT_LINE: (editor: any) => any; + PREV_LINE: (editor: any) => any; + LINE_INDEX: (editor: any) => any; + LINE_NUMBER: (editor: any) => any; + SOFT_TABS: (editor: any) => "YES" | "NO"; + TAB_SIZE: (editor: any) => any; + CLIPBOARD: (editor: any) => any; + FILENAME: (editor: any) => string; + FILENAME_BASE: (editor: any) => string; + DIRECTORY: (editor: any) => string; + FILEPATH: (editor: any) => string; + WORKSPACE_NAME: () => string; + FULLNAME: () => string; + BLOCK_COMMENT_START: (editor: any) => any; + BLOCK_COMMENT_END: (editor: any) => any; + LINE_COMMENT: (editor: any) => any; + CURRENT_YEAR: any; + CURRENT_YEAR_SHORT: any; + CURRENT_MONTH: any; + CURRENT_MONTH_NAME: any; + CURRENT_MONTH_NAME_SHORT: any; + CURRENT_DATE: any; + CURRENT_DAY_NAME: any; + CURRENT_DAY_NAME_SHORT: any; + CURRENT_HOUR: any; + CURRENT_MINUTE: any; + CURRENT_SECOND: any; + }; + /** + * @return {Tokenizer} + */ + getTokenizer(): Tokenizer; + createTokenizer(): any; + tokenizeTmSnippet(str: any, startState: any): (string | import("ace-code").Ace.Token)[]; + getVariableValue(editor: any, name: any, indentation: any): any; + tmStrFormat(str: any, ch: any, editor: any): any; + tmFormatFunction(str: any, ch: any, editor: any): any; + resolveVariables(snippet: any, editor: any): any[]; + getDisplayTextForSnippet(editor: any, snippetText: any): any; + insertSnippetForSelection(editor: any, snippetText: any, options?: {}): void; + insertSnippet(editor: any, snippetText: any, options?: {}): void; + getActiveScopes(editor: any): any[]; + expandWithTab(editor: any, options: any): any; + expandSnippetForSelection(editor: any, options: any): boolean; + /** + * @param {Snippet[]} snippetList + * @param {string} before + * @param {string} after + * @return {Snippet} + */ + findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; + /** + * @param {any[]} snippets + * @param {string} scope + */ + register(snippets: any[], scope: string): void; + unregister(snippets: any, scope: any): void; + parseSnippetFile(str: any): Snippet[]; + getSnippetByName(name: any, editor: any): undefined; + } + import Tokenizer_1 = require("ace-code/src/tokenizer"); + import Tokenizer = Tokenizer_1.Tokenizer; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + interface SnippetManager extends Ace.EventEmitter { + } +} +declare module "ace-code/src/autocomplete/inline_screenreader" { + /** + * This object is used to communicate inline code completions rendered into an editor with ghost text to screen reader users. + */ + export class AceInlineScreenReader { + /** + * Creates the off-screen div in which the ghost text content in redered and which the screen reader reads. + * @param {import("ace-code/src/editor").Editor} editor + */ + constructor(editor: import("ace-code/src/editor").Editor); + editor: import("ace-code/src/editor").Editor; + screenReaderDiv: HTMLDivElement; + /** + * Set the ghost text content to the screen reader div + * @param {string} content + */ + setScreenReaderContent(content: string): void; + popup: import("ace-code/src/autocomplete/popup").AcePopup; + destroy(): void; + /** + * Take this._lines, render it as blocks and add those to the screen reader div. + */ + createCodeBlock(): HTMLPreElement; + } +} +declare module "ace-code/src/autocomplete/inline" { + export type Editor = import("ace-code/src/editor").Editor; + /** + * This object is used to manage inline code completions rendered into an editor with ghost text. + */ + export class AceInline { + editor: any; + /** + * Renders the completion as ghost text to the current cursor position + * @param {Editor} editor + * @param {import("ace-code").Ace.Completion} completion + * @param {string} prefix + * @returns {boolean} True if the completion could be rendered to the editor, false otherwise + */ + show(editor: Editor, completion: import("ace-code").Ace.Completion, prefix: string): boolean; + inlineScreenReader: AceInlineScreenReader; + isOpen(): boolean; + hide(): boolean; + destroy(): void; + } + import AceInlineScreenReader_1 = require("ace-code/src/autocomplete/inline_screenreader"); + import AceInlineScreenReader = AceInlineScreenReader_1.AceInlineScreenReader; +} +declare module "ace-code/src/autocomplete/util" { + export function parForEach(array: any, fn: any, callback: any): void; + export function retrievePrecedingIdentifier(text: any, pos: any, regex: any): string; + export function retrieveFollowingIdentifier(text: any, pos: any, regex: any): any[]; + export function getCompletionPrefix(editor: any): string; + export function triggerAutocomplete(editor: Editor, previousChar?: string): boolean; + export type Editor = import("ace-code/src/editor").Editor; +} +declare module "ace-code/src/autocomplete" { + /** + * This object controls the autocompletion components and their lifecycle. + * There is an autocompletion popup, an optional inline ghost text renderer and a docuent tooltip popup inside. + */ + export class Autocomplete { + static get completionsForLoading(): { + caption: any; + value: string; + }[]; + /** + * @param {Editor} editor + * @return {Autocomplete} + */ + static for(editor: Editor): Autocomplete; + autoInsert: boolean; + autoSelect: boolean; + autoShown: boolean; + exactMatch: boolean; + inlineEnabled: boolean; + keyboardHandler: HashHandler; + parentNode: any; + setSelectOnHover: boolean; + hasSeen: Set; + /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + showLoadingState: boolean; + /** + * @property {number} stickySelectionDelay - a numerical value that determines after how many ms the popup selection will become 'sticky'. + * Normally, when new elements are added to an open popup, the selection is reset to the first row of the popup. If sticky, the focus will remain + * on the currently selected item when new items are added to the popup. Set to a negative value to disable this feature and never set selection to sticky. + */ + stickySelectionDelay: number; + blurListener(e: any): void; + changeListener(e: any): void; + mousedownListener(e: any): void; + mousewheelListener(e: any): void; + onLayoutChange(): void; + changeTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + isPending(): any; + }; + tooltipTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + isPending(): any; + }; + popupTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + isPending(): any; + }; + stickySelectionTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + isPending(): any; + }; + /**@type {AcePopup}**/ + popup: AcePopup; + inlineRenderer: AceInline; + /** + * @return {AcePopup} + */ + getPopup(): AcePopup; + stickySelection: boolean; + observeLayoutChanges(): void; + unObserveLayoutChanges(): void; + /** + * @param {Editor} editor + * @param {string} prefix + * @param {boolean} [keepPopupPosition] + */ + openPopup(editor: Editor, prefix: string, keepPopupPosition?: boolean): void; + /** + * Detaches all elements from the editor, and cleans up the data for the session + */ + detach(): void; + activated: boolean; + completionProvider: CompletionProvider; + completions: FilteredList; + base: import("ace-code/src/anchor").Anchor; + mouseOutListener(e: any): void; + goTo(where: any): void; + /** + * @param {Completion} data + * @param {undefined} [options] + * @return {boolean | void} + */ + insertMatch(data: Completion, options?: undefined): boolean | void; + /** + * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions + * @param {Editor} editor + * @param {CompletionOptions} [options] + */ + showPopup(editor: Editor, options?: CompletionOptions): void; + editor: import("ace-code/src/editor").Editor; + getCompletionProvider(initialPosition: any): CompletionProvider; + /** + * This method is deprecated, it is only kept for backwards compatibility. + * Use the same method include CompletionProvider instead for the same functionality. + * @deprecated + */ + gatherCompletions(editor: any, callback: any): boolean; + /** + * @param {boolean} keepPopupPosition + * @param {CompletionOptions} [options] + */ + updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; + cancelContextMenu(): void; + updateDocTooltip(): void; + showDocTooltip(item: any): void; + tooltipNode: HTMLDivElement; + hideDocTooltip(): void; + onTooltipClick(e: any): void; + destroy(): void; + commands: { + Up: (editor: any) => void; + Down: (editor: any) => void; + "Ctrl-Up|Ctrl-Home": (editor: any) => void; + "Ctrl-Down|Ctrl-End": (editor: any) => void; + Esc: (editor: any) => void; + Return: (editor: any) => any; + "Shift-Return": (editor: any) => void; + Tab: (editor: any) => any; + Backspace: (editor: any) => void; + PageUp: (editor: any) => void; + PageDown: (editor: any) => void; + }; + emptyMessage?: Function; + } + /** + * This class is responsible for providing completions and inserting them to the editor + */ + export class CompletionProvider { + /** + * @param {{pos: import("ace-code").Ace.Position, prefix: string}} initialPosition + */ + constructor(initialPosition: { + pos: import("ace-code").Ace.Position; + prefix: string; + }); + initialPosition: { + pos: import("ace-code").Ace.Position; + prefix: string; + }; + active: boolean; + /** + * @param {Editor} editor + * @param {number} index + * @param {CompletionProviderOptions} [options] + * @returns {boolean} + */ + insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; + /** + * @param {Editor} editor + * @param {Completion} data + * @param {CompletionProviderOptions} [options] + * @returns {boolean} + */ + insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; + /** + * @param {Editor} editor + * @param {import("ace-code").Ace.CompletionCallbackFunction} callback + */ + gatherCompletions(editor: Editor, callback: import("ace-code").Ace.CompletionCallbackFunction): boolean; + completers: import("ace-code").Ace.Completer[]; + /** + * This is the entry point to the class, it gathers, then provides the completions asynchronously via callback. + * The callback function may be called multiple times, the last invokation is marked with a `finished` flag + * @param {Editor} editor + * @param {CompletionProviderOptions} options + * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback + */ + provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ + ], finished: boolean) => void): void; + detach(): void; + completions: FilteredList; + } + export type Editor = import("ace-code/src/editor").Editor; + export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; + export type CompletionOptions = import("ace-code").Ace.CompletionOptions; + export type BaseCompletion = { + /** + * - a numerical value that determines the order in which completions would be displayed. + * A lower score means that the completion would be displayed further from the start + */ + score?: number; + /** + * - a short description of the completion + */ + meta?: string; + /** + * - the text that would be displayed in the completion list. If omitted, value or snippet + * would be shown instead. + */ + caption?: string; + /** + * - an HTML string that would be displayed as an additional popup + */ + docHTML?: string; + /** + * - a plain text that would be displayed as an additional popup. If `docHTML` exists, + * it would be used instead of `docText`. + */ + docText?: string; + /** + * - the identifier of the completer + */ + completerId?: string; + /** + * - An object specifying the range of text to be replaced with the new completion value (experimental) + */ + range?: import("ace-code").Ace.IRange; + /** + * - A command to be executed after the completion is inserted (experimental) + */ + command?: string; + /** + * - a text snippet that would be inserted when the completion is selected + */ + snippet?: string; + /** + * - The text that would be inserted when selecting this completion. + */ + value?: string; + completer?: import("ace-code").Ace.Completer & { + insertMatch: (editor: Editor, data: Completion) => void; + }; + hideInlinePreview?: boolean; + }; + export type SnippetCompletion = BaseCompletion & { + snippet: string; + }; + export type ValueCompletion = BaseCompletion & { + value: string; + }; + /** + * Represents a suggested text snippet intended to complete a user's input + */ + export type Completion = SnippetCompletion | ValueCompletion; + import HashHandler_1 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_1.HashHandler; + import AcePopup_1 = require("ace-code/src/autocomplete/popup"); + import AcePopup = AcePopup_1.AcePopup; + import AceInline_1 = require("ace-code/src/autocomplete/inline"); + import AceInline = AceInline_1.AceInline; + export class FilteredList { + constructor(array: any, filterText: any); + all: any; + filtered: any; + filterText: any; + exactMatch: boolean; + ignoreCaption: boolean; + setFilter(str: any): void; + filterCompletions(items: any, needle: any): any[]; + } + export namespace startCommand { + let name: string; + function exec(editor: any, options: any): void; + let bindKey: string; + } + export {}; + namespace Ace { + type AcePopup = import("ace-code").Ace.AcePopup; + type FilteredList = import("ace-code").Ace.FilteredList; + } + export interface Autocomplete { + popup: Ace.AcePopup; + emptyMessage?: Function; + } + export interface CompletionProvider { + completions: Ace.FilteredList; + } +} +declare module "ace-code/src/ext/command_bar" { + const CommandBarTooltip_base: undefined; + /** + * Displays a command tooltip above the currently active line selection, with clickable elements. + * + * Internally it is a composite of two tooltips, one for the main tooltip and one for the + * overflowing commands. + * The commands are added sequentially in registration order. + * When attached to an editor, it is either always shown or only when the active line is hovered + * with mouse, depending on the alwaysShow property. + */ + export class CommandBarTooltip { + /** + * @param {HTMLElement} parentNode + * @param {Partial} [options] + */ + constructor(parentNode: HTMLElement, options?: Partial); + parentNode: HTMLElement; + tooltip: Tooltip; + moreOptions: Tooltip; + maxElementsOnTooltip: number; + eventListeners: {}; + elements: {}; + commands: {}; + tooltipEl: any[] | HTMLElement | Text; + moreOptionsEl: any[] | HTMLElement | Text; + /** + * Registers a command on the command bar tooltip. + * + * The commands are added in sequential order. If there is not enough space on the main + * toolbar, the remaining elements are added to the overflow menu. + * + * @param {string} id + * @param {TooltipCommand} command + */ + registerCommand(id: string, command: TooltipCommand): void; + isShown(): boolean; + isMoreOptionsShown(): boolean; + getAlwaysShow(): boolean; + /** + * Sets the display mode of the tooltip + * + * When true, the tooltip is always displayed while it is attached to an editor. + * When false, the tooltip is displayed only when the mouse hovers over the active editor line. + * + * @param {boolean} alwaysShow + */ + setAlwaysShow(alwaysShow: boolean): void; + /** + * Attaches the clickable command bar tooltip to an editor + * + * Depending on the alwaysShow parameter it either displays the tooltip immediately, + * or subscribes to the necessary events to display the tooltip on hover. + * + * @param {Editor} editor + */ + attach(editor: Editor): void; + editor: import("ace-code/src/editor").Editor; + /** + * Updates the position of the command bar tooltip. It aligns itself above the active line in the editor. + */ + updatePosition(): void; + /** + * Updates each command element in the tooltip. + * + * This is automatically called on certain events, but can be called manually as well. + */ + update(): void; + /** + * Detaches the tooltip from the editor. + */ + detach(): void; + destroy(): void; + } + export type Editor = import("ace-code/src/editor").Editor; + export type TooltipCommand = import("ace-code").Ace.TooltipCommand; + import Tooltip_2 = require("ace-code/src/tooltip"); + import Tooltip = Tooltip_2.Tooltip; + export var TOOLTIP_CLASS_NAME: string; + export var BUTTON_CLASS_NAME: string; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface CommandBarTooltip extends Ace.EventEmitter { + } +} +declare module "ace-code/src/autocomplete/text_completer" { + export function getCompletions(editor: any, session: any, pos: any, prefix: any, callback: any): void; +} +declare module "ace-code/src/ext/language_tools" { + export function setCompleters(val: any): void; + export function addCompleter(completer: any): void; + import textCompleter = require("ace-code/src/autocomplete/text_completer"); + /**@type {import("ace-code").Ace.Completer}*/ + export var keyWordCompleter: import("ace-code").Ace.Completer; + /**@type {import("ace-code").Ace.Completer} */ + export var snippetCompleter: import("ace-code").Ace.Completer; + export { textCompleter }; +} +declare module "ace-code/src/ext/inline_autocomplete" { + /** + * This class controls the inline-only autocompletion components and their lifecycle. + * This is more lightweight than the popup-based autocompletion, as it can only work with exact prefix matches. + * There is an inline ghost text renderer and an optional command bar tooltip inside. + */ + export class InlineAutocomplete { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + editor: Editor; + keyboardHandler: HashHandler; + blurListener(e: any): void; + changeListener(e: any): void; + changeTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; + isPending(): any; + }; + /** + * + * @return {AceInline} + */ + getInlineRenderer(): AceInline; + inlineRenderer: AceInline; + /** + * @return {CommandBarTooltip} + */ + getInlineTooltip(): CommandBarTooltip; + inlineTooltip: CommandBarTooltip; + /** + * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; + * @param {import("ace-code").Ace.CompletionOptions} options + */ + show(options: import("ace-code").Ace.CompletionOptions): void; + activated: boolean; + insertMatch(): boolean; + /** + * @param {import("ace-code").Ace.InlineAutocompleteAction} where + */ + goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; + getLength(): any; + /** + * @param {number} [index] + * @returns {import("ace-code").Ace.Completion | undefined} + */ + getData(index?: number): import("ace-code").Ace.Completion | undefined; + getIndex(): number; + isOpen(): boolean; + /** + * @param {number} value + */ + setIndex(value: number): void; + /** + * @return {CompletionProvider} + */ + getCompletionProvider(initialPosition: any): CompletionProvider; + completionProvider: CompletionProvider; + /** + * @param {import("ace-code").Ace.CompletionOptions} [options] + */ + updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; + base: import("ace-code/src/anchor").Anchor; + completions: FilteredList; + detach(): void; + destroy(): void; + updateDocTooltip(): void; + /** + * + * @type {{[key: string]: import("ace-code").Ace.Command}} + */ + commands: { + [key: string]: import("ace-code").Ace.Command; + }; + } + export namespace InlineAutocomplete { + function _for(editor: any): any; + export { _for as for }; + export namespace startCommand { + let name: string; + function exec(editor: any, options: any): void; + export namespace bindKey { + let win: string; + let mac: string; + } + } + /** + * Factory method to create a command bar tooltip for inline autocomplete. + * + * @param {HTMLElement} parentEl The parent element where the tooltip HTML elements will be added. + * @returns {CommandBarTooltip} The command bar tooltip for inline autocomplete + */ + export function createInlineTooltip(parentEl: HTMLElement): CommandBarTooltip; + } + import Editor_2 = require("ace-code/src/editor"); + import Editor = Editor_2.Editor; + import HashHandler_2 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_2.HashHandler; + import AceInline_2 = require("ace-code/src/autocomplete/inline"); + import AceInline = AceInline_2.AceInline; + import CommandBarTooltip_1 = require("ace-code/src/ext/command_bar"); + import CommandBarTooltip = CommandBarTooltip_1.CommandBarTooltip; + import CompletionProvider_1 = require("ace-code/src/autocomplete"); + import CompletionProvider = CompletionProvider_1.CompletionProvider; + import FilteredList_1 = require("ace-code/src/autocomplete"); + import FilteredList = FilteredList_1.FilteredList; +} +declare module "ace-code/src/ext/searchbox-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/searchbox" { + export function Search(editor: Editor, isReplace?: boolean): void; + export type Editor = import("ace-code/src/editor").Editor; + export class SearchBox { + /** + * @param {Editor} editor + * @param {undefined} [range] + * @param {undefined} [showReplaceForm] + */ + constructor(editor: Editor, range?: undefined, showReplaceForm?: undefined); + /**@type {any}*/ + activeInput: any; + /**@type {any}*/ + element: any; + setSession(e: any): void; + /** + * @param {Editor} editor + */ + setEditor(editor: Editor): void; + /**@type {Editor}*/ + editor: Editor; + searchRange: any; + /**@type {HTMLElement}*/ + searchBox: HTMLElement; + /**@type {HTMLElement}*/ + replaceBox: HTMLElement; + /**@type {HTMLInputElement}*/ + searchOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + replaceOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + regExpOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + caseSensitiveOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + wholeWordOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + searchInput: HTMLInputElement; + /**@type {HTMLInputElement}*/ + replaceInput: HTMLInputElement; + /**@type {HTMLElement}*/ + searchCounter: HTMLElement; + setSearchRange(range: any): void; + searchRangeMarker: number; + /** + * @param {RegExp} [re] + */ + highlight(re?: RegExp): void; + /** + * @param {boolean} skipCurrent + * @param {boolean} backwards + * @param {any} [preventScroll] + */ + find(skipCurrent: boolean, backwards: boolean, preventScroll?: any): void; + updateCounter(): void; + findNext(): void; + findPrev(): void; + findAll(): void; + replace(): void; + replaceAndFindNext(): void; + replaceAll(): void; + hide(): void; + active: boolean; + /** + * @param {string} value + * @param {boolean} [isReplace] + */ + show(value: string, isReplace?: boolean): void; + isFocused(): boolean; + } + import HashHandler_3 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_3.HashHandler; +} +declare module "ace-code/src/search_highlight" { + export type Marker = import("ace-code/src/layer/marker").Marker; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export class SearchHighlight { + /** + * @param {any} regExp + * @param {string} clazz + */ + constructor(regExp: any, clazz: string, type?: string); + clazz: string; + type: string; + setRegexp(regExp: any): void; + regExp: any; + cache: any[]; + /** + * @param {any} html + * @param {Marker} markerLayer + * @param {EditSession} session + * @param {Partial} config + */ + update(html: any, markerLayer: Marker, session: EditSession, config: Partial): void; + MAX_RANGES: number; + } +} +declare module "ace-code/src/occur" { + export type Editor = import("ace-code/src/editor").Editor; + export type Point = import("ace-code").Ace.Point; + export type SearchOptions = import("ace-code").Ace.SearchOptions; + /** + * Finds all lines matching a search term in the current [[Document + * `Document`]] and displays them instead of the original `Document`. Keeps + * track of the mapping between the occur doc and the original doc. + **/ + export class Occur extends Search { + /** + * Enables occur mode. expects that `options.needle` is a search term. + * This search term is used to filter out all the lines that include it + * and these are then used as the content of a new [[Document + * `Document`]]. The current cursor position of editor will be translated + * so that the cursor is on the matching row/column as it was before. + * @param {Editor} editor + * @param {Object} options options.needle should be a String + * @return {Boolean} Whether occur activation was successful + * + **/ + enter(editor: Editor, options: any): boolean; + /** + * Disables occur mode. Resets the [[Sessions `EditSession`]] [[Document + * `Document`]] back to the original doc. If options.translatePosition is + * truthy also maps the [[Editors `Editor`]] cursor position accordingly. + * @param {Editor} editor + * @param {Object} options options.translatePosition + * @return {Boolean} Whether occur deactivation was successful + * + **/ + exit(editor: Editor, options: any): boolean; + /** + * @param {EditSession} sess + * @param {RegExp} regexp + */ + highlight(sess: EditSession, regexp: RegExp): void; + /** + * @param {Editor} editor + * @param {Partial} options + */ + displayOccurContent(editor: Editor, options: Partial): void; + /** + * @param {Editor} editor + */ + displayOriginalContent(editor: Editor): void; + /** + * Translates the position from the original document to the occur lines in + * the document or the beginning if the doc {row: 0, column: 0} if not + * found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the original document + * @return {Point} position in occur doc + **/ + originalToOccurPosition(session: EditSession, pos: Point): Point; + /** + * Translates the position from the occur document to the original document + * or `pos` if not found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the occur session document + * @return {Point} position + **/ + occurToOriginalPosition(session: EditSession, pos: Point): Point; + /** + * @param {EditSession} session + * @param {Partial} options + */ + matchingLines(session: EditSession, options: Partial): any[]; + } + import Search_2 = require("ace-code/src/search"); + import Search = Search_2.Search; + import EditSession_2 = require("ace-code/src/edit_session"); + import EditSession = EditSession_2.EditSession; +} +declare module "ace-code/src/marker_group" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type MarkerGroupItem = { + range: import("ace-code/src/range").Range; + className: string; }; - toggleFoldWidget(toggleParent?: boolean): void; - updateFoldWidgets(delta: Delta): void; - } - - export interface Range { - start: Point; - end: Point; - - isEqual(range: Range): boolean; - toString(): string; - contains(row: number, column: number): boolean; - compareRange(range: Range): number; - comparePoint(p: Point): number; - containsRange(range: Range): boolean; - intersects(range: Range): boolean; - isEnd(row: number, column: number): boolean; - isStart(row: number, column: number): boolean; - setStart(row: number, column: number): void; - setEnd(row: number, column: number): void; - inside(row: number, column: number): boolean; - insideStart(row: number, column: number): boolean; - insideEnd(row: number, column: number): boolean; - compare(row: number, column: number): number; - compareStart(row: number, column: number): number; - compareEnd(row: number, column: number): number; - compareInside(row: number, column: number): number; - clipRows(firstRow: number, lastRow: number): Range; - extend(row: number, column: number): Range; - isEmpty(): boolean; - isMultiLine(): boolean; - clone(): Range; - collapseRows(): Range; - toScreenRange(session: EditSession): Range; - moveBy(row: number, column: number): void; - } - - export interface EditSessionOptions { - wrap: "off" | "free" | "printmargin" | boolean | number; - wrapMethod: 'code' | 'text' | 'auto'; - indentedSoftWrap: boolean; - firstLineNumber: number; - useWorker: boolean; - useSoftTabs: boolean; - tabSize: number; - navigateWithinSoftTabs: boolean; - foldStyle: 'markbegin' | 'markbeginend' | 'manual'; - overwrite: boolean; - newLineMode: NewLineMode; - mode: string; - } - - export interface VirtualRendererOptions { - animatedScroll: boolean; - showInvisibles: boolean; - showPrintMargin: boolean; - printMarginColumn: number; - printMargin: boolean | number; - showGutter: boolean; - fadeFoldWidgets: boolean; - showFoldWidgets: boolean; - showLineNumbers: boolean; - displayIndentGuides: boolean; - highlightIndentGuides: boolean; - highlightGutterLine: boolean; - hScrollBarAlwaysVisible: boolean; - vScrollBarAlwaysVisible: boolean; - fontSize: number; - fontFamily: string; - maxLines: number; - minLines: number; - scrollPastEnd: number; - fixedWidthGutter: boolean; - customScrollbar: boolean; - theme: string; - hasCssTransforms: boolean; - maxPixelHeight: number; - useSvgGutterIcons: boolean; - showFoldedAnnotations: boolean; - } - - export interface MouseHandlerOptions { - scrollSpeed: number; - dragDelay: number; - dragEnabled: boolean; - focusTimeout: number; - tooltipFollowsMouse: boolean; - } - - export interface EditorOptions extends EditSessionOptions, - MouseHandlerOptions, - VirtualRendererOptions { - selectionStyle: string; - highlightActiveLine: boolean; - highlightSelectedWord: boolean; - readOnly: boolean; - copyWithEmptySelection: boolean; - cursorStyle: 'ace' | 'slim' | 'smooth' | 'wide'; - mergeUndoDeltas: true | false | 'always'; - behavioursEnabled: boolean; - wrapBehavioursEnabled: boolean; - enableAutoIndent: boolean; - enableBasicAutocompletion: boolean | Completer[]; - enableLiveAutocompletion: boolean | Completer[]; - liveAutocompletionDelay: number; - liveAutocompletionThreshold: number; - enableSnippets: boolean; - autoScrollEditorIntoView: boolean; - keyboardHandler: string | null; - placeholder: string; - value: string; - session: EditSession; - relativeLineNumbers: boolean; - enableMultiselect: boolean; - enableKeyboardAccessibility: boolean; - } - - export interface SearchOptions { - needle: string | RegExp; - preventScroll: boolean; - backwards: boolean; - start: Range; - skipCurrent: boolean; - range: Range; - preserveCase: boolean; - regExp: boolean; - wholeWord: boolean; - caseSensitive: boolean; - wrap: boolean; - } - - export interface EventEmitter { - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - removeAllListeners(name?: string): void; - } - - export interface Point { - row: number; - column: number; - } - - export interface Delta { - action: 'insert' | 'remove'; - start: Point; - end: Point; - lines: string[]; - } - - export interface Annotation { - row?: number; - column?: number; - text: string; - type: string; - } - - export interface MarkerGroupItem { - range: Range; - className: string; - } - - export class MarkerGroup { - constructor(session: EditSession); - setMarkers(markers: MarkerGroupItem[]): void; - getMarkerAtPosition(pos: Position): MarkerGroupItem; - } - - - export interface Command { - name?: string; - bindKey?: string | { mac?: string, win?: string }; - readOnly?: boolean; - exec: (editor: Editor, args?: any) => void; - } - - export type CommandLike = Command | ((editor: Editor) => void); - - export interface KeyboardHandler { - handleKeyboard: Function; - } - - export interface MarkerLike { - range?: Range; - type: string; - renderer?: MarkerRenderer; - clazz: string; - inFront: boolean; - id: number; - update?: (html: string[], - // TODO maybe define Marker class - marker: any, - session: EditSession, - config: any) => void; - } - - export type MarkerRenderer = (html: string[], - range: Range, - left: number, - top: number, - config: any) => void; - - export interface Token { - type: string; - value: string; - index?: number; - start?: number; - } - - interface BaseCompletion { - score?: number; - meta?: string; - caption?: string; - docHTML?: string; - docText?: string; - completerId?: string; - } - - export interface SnippetCompletion extends BaseCompletion { - snippet: string; - } - - export interface ValueCompletion extends BaseCompletion { - value: string; - } - - export type Completion = SnippetCompletion | ValueCompletion - - export interface Tokenizer { - removeCapturingGroups(src: string): string; - createSplitterRegexp(src: string, flag?: string): RegExp; - getLineTokens(line: string, startState: string | string[]): Token[]; - } - - interface TokenIterator { - getCurrentToken(): Token; - getCurrentTokenColumn(): number; - getCurrentTokenRow(): number; - getCurrentTokenPosition(): Point; - getCurrentTokenRange(): Range; - stepBackward(): Token; - stepForward(): Token; - } - - export type HighlightRule = {defaultToken: string} | {include: string} | {todo: string} | { - token: string | string[] | ((value: string) => string); - regex: string | RegExp; - next?: string; - push?: string; - comment?: string; - caseInsensitive?: boolean; - } - - export type HighlightRulesMap = Record; - - export type KeywordMapper = (keyword: string) => string; - - export interface HighlightRules { - addRules(rules: HighlightRulesMap, prefix?: string): void; - getRules(): HighlightRulesMap; - embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; - getEmbeds(): string[]; - normalizeRules(): void; - createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; - } - - export interface FoldMode { - foldingStartMarker: RegExp; - foldingStopMarker?: RegExp; - getFoldWidget(session: EditSession, foldStyle: string, row: number): string; - getFoldWidgetRange(session: EditSession, foldStyle: string, row: number, forceMultiline?: boolean): Range | undefined; - indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; - 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) => {text: string, selection: number[]} | Range | undefined; - type BehaviorMap = Record>; - - export interface Behaviour { - add(name: string, action: string, callback: BehaviorAction): void; - addBehaviours(behaviours: BehaviorMap): void; - remove(name: string): void; - inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; - getBehaviours(filter: string[]): BehaviorMap; - } - - export interface Outdent { - checkOutdent(line: string, input: string): boolean; - autoOutdent(doc: Document, row: number): number | undefined; - } - - export interface SyntaxMode { - HighlightRules: new () => HighlightRules; - foldingRules?: FoldMode; - $behaviour?: Behaviour; - $defaultBehaviour?: Behaviour; - lineCommentStart?: 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: Document, row: number): void; - // TODO implement WorkerClient types - createWorker(session: EditSession): any; - createModeDelegates(mapping: { [key: string]: string }): void; - transformAction: BehaviorAction; - getKeywords(append?: boolean): Array; - getCompletions(state: string, - session: EditSession, - pos: Point, - prefix: string): Completion[]; - } - - type AfterLoadCallback = (err: Error | null, module: unknown) => void; - type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; - - export interface Config { - get(key: string): any; - set(key: string, value: any): void; - all(): { [key: string]: any }; - moduleUrl(name: string, component?: string): string; - setModuleUrl(name: string, subst: string): string; - setLoader(cb: LoaderFunction): void; - setModuleLoader(name: string, onLoad: Function): void; - loadModule(moduleName: string | [string, string], - onLoad?: (module: any) => void): void; - init(packaged: any): any; - defineOptions(obj: any, path: string, options: { [key: string]: any }): Config; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): void; - setDefaultValues(path: string, optionHash: { [key: string]: any }): void; - } - - export interface OptionsProvider { - setOptions(optList: { [key: string]: any }): void; - getOptions(optionNames?: string[] | { [key: string]: any }): { [key: string]: any }; - setOption(name: string, value: any): void; - getOption(name: string): any; - } - - export interface UndoManager { - addSession(session: EditSession): void; - add(delta: Delta, allowMerge: boolean, session: EditSession): void; - addSelection(selection: string, rev?: number): void; - startNewGroup(): void; - markIgnored(from: number, to?: number): void; - getSelection(rev: number, after?: boolean): { value: string, rev: number }; - getRevision(): number; - getDeltas(from: number, to?: number): Delta[]; - undo(session: EditSession, dontSelect?: boolean): void; - redo(session: EditSession, dontSelect?: boolean): void; - reset(): void; - canUndo(): boolean; - canRedo(): boolean; - bookmark(rev?: number): void; - isAtBookmark(): boolean; - hasUndo(): boolean; - hasRedo(): boolean; - isClean(): boolean; - markClean(rev?: number): void; - toJSON(): object; - fromJSON(json: object): void; - } - - export interface Position { - row: number, - column: number - } - - export interface EditSession extends EventEmitter, OptionsProvider, Folding { - selection: Selection; - - // TODO: define BackgroundTokenizer - - on(name: 'changeFold', - callback: (obj: { data: Fold, action: string }) => void): Function; - on(name: 'changeScrollLeft', callback: (scrollLeft: number) => void): Function; - on(name: 'changeScrollTop', callback: (scrollTop: number) => void): Function; - on(name: 'tokenizerUpdate', - callback: (obj: { data: { first: number, last: number } }) => void): Function; - on(name: 'change', callback: () => void): Function; - on(name: 'changeTabSize', callback: () => void): Function; - - - setOption(name: T, value: EditSessionOptions[T]): void; - getOption(name: T): EditSessionOptions[T]; - - readonly doc: Document; - - setDocument(doc: Document): void; - getDocument(): Document; - resetCaches(): void; - setValue(text: string): void; - getValue(): string; - getSelection(): Selection; - getState(row: number): string; - getTokens(row: number): Token[]; - getTokenAt(row: number, column: number): Token | null; - setUndoManager(undoManager: UndoManager): void; - markUndoGroup(): void; - getUndoManager(): UndoManager; - getTabString(): string; - setUseSoftTabs(val: boolean): void; - getUseSoftTabs(): boolean; - setTabSize(tabSize: number): void; - getTabSize(): number; - isTabStop(position: Position): boolean; - setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; - getNavigateWithinSoftTabs(): boolean; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - addGutterDecoration(row: number, className: string): void; - removeGutterDecoration(row: number, className: string): void; - getBreakpoints(): string[]; - setBreakpoints(rows: number[]): void; - clearBreakpoints(): void; - setBreakpoint(row: number, className: string): void; - clearBreakpoint(row: number): void; - addMarker(range: Range, - className: string, - type: "fullLine" | "screenLine" | "text" | MarkerRenderer, - inFront?: boolean): number; - addDynamicMarker(marker: MarkerLike, inFront: boolean): MarkerLike; - removeMarker(markerId: number): void; - getMarkers(inFront?: boolean): {[id: number]: MarkerLike}; - highlight(re: RegExp): void; - highlightLines(startRow: number, - endRow: number, - className: string, - inFront?: boolean): Range; - setAnnotations(annotations: Annotation[]): void; - getAnnotations(): Annotation[]; - clearAnnotations(): void; - getWordRange(row: number, column: number): Range; - getAWordRange(row: number, column: number): Range; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - setUseWorker(useWorker: boolean): void; - getUseWorker(): boolean; - setMode(mode: string | SyntaxMode, callback?: () => void): void; - getMode(): SyntaxMode; - setScrollTop(scrollTop: number): void; - getScrollTop(): number; - setScrollLeft(scrollLeft: number): void; - getScrollLeft(): number; - getScreenWidth(): number; - getLineWidgetMaxWidth(): number; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getLength(): number; - getTextRange(range: Range): string; - insert(position: Position, text: string): void; - remove(range: Range): void; - removeFullLines(firstRow: number, lastRow: number): void; - undoChanges(deltas: Delta[], dontSelect?: boolean): void; - redoChanges(deltas: Delta[], dontSelect?: boolean): void; - setUndoSelect(enable: boolean): void; - replace(range: Range, text: string): void; - moveText(fromRange: Range, toPosition: Position, copy?: boolean): void; - indentRows(startRow: number, endRow: number, indentString: string): void; - outdentRows(range: Range): void; - moveLinesUp(firstRow: number, lastRow: number): void; - moveLinesDown(firstRow: number, lastRow: number): void; - duplicateLines(firstRow: number, lastRow: number): void; - setUseWrapMode(useWrapMode: boolean): void; - getUseWrapMode(): boolean; - setWrapLimitRange(min: number, max: number): void; - adjustWrapLimit(desiredLimit: number): boolean; - getWrapLimit(): number; - setWrapLimit(limit: number): void; - getWrapLimitRange(): { min: number, max: number }; - getRowLineCount(row: number): number; - getRowWrapIndent(screenRow: number): number; - getScreenLastRowColumn(screenRow: number): number; - getDocumentLastRowColumn(docRow: number, docColumn: number): number; - getdocumentLastRowColumnPosition(docRow: number, docColumn: number): Position; - getRowSplitData(row: number): string | undefined; - getScreenTabSize(screenColumn: number): number; - screenToDocumentRow(screenRow: number, screenColumn: number): number; - screenToDocumentColumn(screenRow: number, screenColumn: number): number; - screenToDocumentPosition(screenRow: number, - screenColumn: number, - offsetX?: number): Position; - documentToScreenPosition(docRow: number, docColumn: number): Position; - documentToScreenPosition(position: Position): Position; - documentToScreenColumn(row: number, docColumn: number): number; - documentToScreenRow(docRow: number, docColumn: number): number; - getScreenLength(): number; - getPrecedingCharacter(): string; - toJSON(): Object; - destroy(): void; - } - - export interface KeyBinding { - setDefaultHandler(handler: KeyboardHandler): void; - setKeyboardHandler(handler: KeyboardHandler): void; - addKeyboardHandler(handler: KeyboardHandler, pos?: number): void; - removeKeyboardHandler(handler: KeyboardHandler): boolean; - getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - onCommandKey(e: any, hashId: number, keyCode: number): boolean; - onTextInput(text: string): boolean; - } - - interface CommandMap { - [name: string]: Command; - } - - type execEventHandler = (obj: { - editor: Editor, - command: Command, - args: any[] - }) => void; - - export interface CommandManager extends EventEmitter { - byName: CommandMap, - commands: CommandMap, - on(name: 'exec', callback: execEventHandler): Function; - on(name: 'afterExec', callback: execEventHandler): Function; - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - - exec(command: string, editor: Editor, args: any): boolean; - toggleRecording(editor: Editor): void; - replay(editor: Editor): void; - addCommand(command: Command): void; - addCommands(command: Command[]): void; - removeCommand(command: Command | string, keepCommand?: boolean): void; - removeCommands(command: Command[]): void; - bindKey(key: string | { mac?: string, win?: string}, - command: CommandLike, - position?: number): void; - bindKeys(keys: {[s: string]: Function}): void; - parseKeys(keyPart: string): {key: string, hashId: number}; - findKeyCommand(hashId: number, keyString: string): string | undefined; - handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: string | number): void | {command: string}; - getStatusText(editor: Editor, data: {}): string; - } - - export interface VirtualRenderer extends OptionsProvider, EventEmitter { - readonly container: HTMLElement; - readonly scroller: HTMLElement; - readonly content: HTMLElement; - readonly characterWidth: number; - readonly lineHeight: number; - readonly scrollLeft: number; - readonly scrollTop: number; - readonly $padding: number; - - setOption(name: T, value: VirtualRendererOptions[T]): void; - getOption(name: T): VirtualRendererOptions[T]; - - setSession(session: EditSession): void; - updateLines(firstRow: number, lastRow: number, force?: boolean): void; - updateText(): void; - updateFull(force?: boolean): void; - updateFontSize(): void; - adjustWrapLimit(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: boolean): void; - getPrintMarginColumn(): boolean; - setShowGutter(show: boolean): void; - getShowGutter(): boolean; - setFadeFoldWidgets(show: boolean): void; - getFadeFoldWidgets(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - getContainerElement(): HTMLElement; - getMouseEventTarget(): HTMLElement; - getTextAreaContainer(): HTMLElement; - getFirstVisibleRow(): number; - getFirstFullyVisibleRow(): number; - getLastFullyVisibleRow(): number; - getLastVisibleRow(): number; - setPadding(padding: number): void; - setScrollMargin(top: number, - bottom: number, - left: number, - right: number): void; - setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getHScrollBarAlwaysVisible(): boolean; - setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getVScrollBarAlwaysVisible(): boolean; - freeze(): void; - unfreeze(): void; - updateFrontMarkers(): void; - updateBackMarkers(): void; - updateBreakpoints(): void; - setAnnotations(annotations: Annotation[]): void; - updateCursor(): void; - hideCursor(): void; - showCursor(): void; - scrollSelectionIntoView(anchor: Position, - lead: Position, - offset?: number): void; - scrollCursorIntoView(cursor: Position, offset?: number): void; - getScrollTop(): number; - getScrollLeft(): number; - getScrollTopRow(): number; - getScrollBottomRow(): number; - scrollToRow(row: number): void; - alignCursor(cursor: Position | number, alignment: number): number; - scrollToLine(line: number, - center: boolean, - animate: boolean, - callback: () => void): void; - animateScrolling(fromValue: number, callback: () => void): void; - scrollToY(scrollTop: number): void; - scrollToX(scrollLeft: number): void; - scrollTo(x: number, y: number): void; - scrollBy(deltaX: number, deltaY: number): void; - isScrollableBy(deltaX: number, deltaY: number): boolean; - textToScreenCoordinates(row: number, column: number): { pageX: number, pageY: number}; - pixelToScreenCoordinates(x: number, y: number): {row: number, column: number, side: 1|-1, offsetX: number}; - visualizeFocus(): void; - visualizeBlur(): void; - showComposition(position: number): void; - setCompositionText(text: string): void; - hideComposition(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string, include?: boolean): void; - unsetStyle(style: string): void; - setCursorStyle(style: string): void; - setMouseCursor(cursorStyle: string): void; - attachToShadowRoot(): void; - destroy(): void; - } - - - export interface Selection extends EventEmitter { - moveCursorWordLeft(): void; - moveCursorWordRight(): void; - fromOrientedRange(range: Range): void; - setSelectionRange(match: any): void; - getAllRanges(): Range[]; - addRange(range: Range): void; - isEmpty(): boolean; - isMultiLine(): boolean; - setCursor(row: number, column: number): void; - setAnchor(row: number, column: number): void; - getAnchor(): Position; - getCursor(): Position; - isBackwards(): boolean; - getRange(): Range; - clearSelection(): void; - selectAll(): void; - setRange(range: Range, reverse?: boolean): void; - selectTo(row: number, column: number): void; - selectToPosition(pos: any): void; - selectUp(): void; - selectDown(): void; - selectRight(): void; - selectLeft(): void; - selectLineStart(): void; - selectLineEnd(): void; - selectFileEnd(): void; - selectFileStart(): void; - selectWordRight(): void; - selectWordLeft(): void; - getWordRange(): void; - selectWord(): void; - selectAWord(): void; - selectLine(): void; - moveCursorUp(): void; - moveCursorDown(): void; - moveCursorLeft(): void; - moveCursorRight(): void; - moveCursorLineStart(): void; - moveCursorLineEnd(): void; - moveCursorFileEnd(): void; - moveCursorFileStart(): void; - moveCursorLongWordRight(): void; - moveCursorLongWordLeft(): void; - moveCursorBy(rows: number, chars: number): void; - moveCursorToPosition(position: any): void; - moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - - toJSON(): SavedSelection | SavedSelection[]; - fromJSON(selection: SavedSelection | SavedSelection[]): void; - } - interface SavedSelection { - start: Point; - end: Point; - isBackwards: boolean; - } - - var Selection: { - new(session: EditSession): Selection; - } - - export interface TextInput { - resetSelection(): void; - setAriaOption(activeDescendant: string, role: string): void; - } - - export interface Editor extends OptionsProvider, EventEmitter { - container: HTMLElement; - renderer: VirtualRenderer; - id: string; - commands: CommandManager; - keyBinding: KeyBinding; - session: EditSession; - selection: Selection; - textInput: TextInput; - - on(name: 'blur', callback: (e: Event) => void): void; - on(name: 'input', callback: () => void): void; - on(name: 'change', callback: (delta: Delta) => void): void; - on(name: 'changeSelectionStyle', callback: (obj: { data: string }) => void): void; - on(name: 'changeSession', - callback: (obj: { session: EditSession, oldSession: EditSession }) => void): void; - on(name: 'copy', callback: (obj: { text: string }) => void): void; - on(name: 'focus', callback: (e: Event) => void): void; - on(name: 'paste', callback: (obj: { text: string }) => void): void; - on(name: 'mousemove', callback: (e: any) => void): void; - on(name: 'mouseup', callback: (e: any) => void): void; - on(name: 'mousewheel', callback: (e: any) => void): void; - on(name: 'click', callback: (e: any) => void): void; - on(name: 'guttermousedown', callback: (e: any) => void): void; - on(name: 'gutterkeydown', callback: (e: any) => void): void; - - onPaste(text: string, event: any): void; - - setOption(name: T, value: EditorOptions[T]): void; - getOption(name: T): EditorOptions[T]; - - setKeyboardHandler(keyboardHandler: string, callback?: () => void): void; - setKeyboardHandler(keyboardHandler: KeyboardHandler|null): void; - getKeyboardHandler(): string; - setSession(session: EditSession | undefined): void; - getSession(): EditSession; - setValue(val: string, cursorPos?: number): string; - getValue(): string; - getSelection(): Selection; - resize(force?: boolean): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string): void; - unsetStyle(style: string): void; - getFontSize(): string; - setFontSize(size: number|string): void; - focus(): void; - isFocused(): boolean; - blur(): void; - getSelectedText(): string; - getCopyText(): string; - execCommand(command: string | string[], args?: any): boolean; - insert(text: string, pasted?: boolean): void; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - setScrollSpeed(speed: number): void; - getScrollSpeed(): number; - setDragDelay(dragDelay: number): void; - getDragDelay(): number; - setSelectionStyle(val: string): void; - getSelectionStyle(): string; - setHighlightActiveLine(shouldHighlight: boolean): void; - getHighlightActiveLine(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - setHighlightSelectedWord(shouldHighlight: boolean): void; - getHighlightSelectedWord(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: number): void; - getPrintMarginColumn(): number; - setReadOnly(readOnly: boolean): void; - getReadOnly(): boolean; - setBehavioursEnabled(enabled: boolean): void; - getBehavioursEnabled(): boolean; - setWrapBehavioursEnabled(enabled: boolean): void; - getWrapBehavioursEnabled(): boolean; - setShowFoldWidgets(show: boolean): void; - getShowFoldWidgets(): boolean; - setFadeFoldWidgets(fade: boolean): void; - getFadeFoldWidgets(): boolean; - remove(dir?: 'left' | 'right'): void; - removeWordRight(): void; - removeWordLeft(): void; - removeLineToEnd(): void; - splitLine(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - transposeLetters(): void; - toLowerCase(): void; - toUpperCase(): void; - indent(): void; - blockIndent(): void; - blockOutdent(): void; - sortLines(): void; - toggleCommentLines(): void; - toggleBlockComment(): void; - modifyNumber(amount: number): void; - removeLines(): void; - duplicateSelection(): void; - moveLinesDown(): void; - moveLinesUp(): void; - moveText(range: Range, toPosition: Point, copy?: boolean): Range; - copyLinesUp(): void; - copyLinesDown(): void; - getFirstVisibleRow(): number; - getLastVisibleRow(): number; - isRowVisible(row: number): boolean; - isRowFullyVisible(row: number): boolean; - selectPageDown(): void; - selectPageUp(): void; - gotoPageDown(): void; - gotoPageUp(): void; - scrollPageDown(): void; - scrollPageUp(): void; - scrollToRow(row: number): void; - scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void; - centerSelection(): void; - getCursorPosition(): Point; - getCursorPositionScreen(): Point; - getSelectionRange(): Range; - selectAll(): void; - clearSelection(): void; - moveCursorTo(row: number, column: number): void; - moveCursorToPosition(pos: Point): void; - jumpToMatching(select: boolean, expand: boolean): void; - gotoLine(lineNumber: number, column: number, animate: boolean): void; - navigateTo(row: number, column: number): void; - navigateUp(times?: number): void; - navigateDown(times?: number): void; - navigateLeft(times?: number): void; - navigateRight(times?: number): void; - navigateLineStart(): void; - navigateLineEnd(): void; - navigateFileEnd(): void; - navigateFileStart(): void; - navigateWordRight(): void; - navigateWordLeft(): void; - replace(replacement: string, options?: Partial): number; - replaceAll(replacement: string, options?: Partial): number; - getLastSearchOptions(): Partial; - find(needle: string | RegExp, options?: Partial, animate?: boolean): Ace.Range | undefined; - findNext(options?: Partial, animate?: boolean): void; - findPrevious(options?: Partial, animate?: boolean): void; - findAll(needle: string | RegExp, options?: Partial, additive?: boolean): number; - undo(): void; - redo(): void; - destroy(): void; - setAutoScrollEditorIntoView(enable: boolean): void; - completers: Completer[]; - } - - type CompleterCallback = (error: any, completions: Completion[]) => void; - - interface Completer { - identifierRegexps?: Array, - getCompletions(editor: Editor, - session: EditSession, - position: Point, - prefix: string, - callback: CompleterCallback): void; - getDocTooltip?(item: Completion): undefined | string | Completion; - onSeen?: (editor: Ace.Editor, completion: Completion) => void; - onInsert?: (editor: Ace.Editor, completion: Completion) => void; - cancel?(): void; - id?: string; - triggerCharacters?: string[]; - hideInlinePreview?: boolean; - } - - export class AceInline { - show(editor: Editor, completion: Completion, prefix: string): void; - isOpen(): void; - hide(): void; - destroy(): void; - } - - interface CompletionOptions { - matches?: Completion[]; - } - - type CompletionProviderOptions = { - exactMatch?: boolean; - ignoreCaption?: boolean; - } - - type CompletionRecord = { - all: Completion[]; - filtered: Completion[]; - filterText: string; - } | CompletionProviderOptions - - type GatherCompletionRecord = { - prefix: string; - matches: Completion[]; - finished: boolean; - } - - type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; - type CompletionProviderCallback = (err: Error | undefined, completions: CompletionRecord, finished: boolean) => void; - - export class CompletionProvider { - insertByIndex(editor: Editor, index: number, options: CompletionProviderOptions): boolean; - insertMatch(editor: Editor, data: Completion, options: CompletionProviderOptions): boolean; - completions: CompletionRecord; - gatherCompletions(editor: Editor, callback: CompletionCallbackFunction): boolean; - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: CompletionProviderCallback): void; - detach(): void; - } - - export class Autocomplete { - constructor(); - autoInsert?: boolean; - autoSelect?: boolean; - autoShown?: boolean; - exactMatch?: boolean; - inlineEnabled?: boolean; - parentNode?: HTMLElement; - setSelectOnHover?: Boolean; - stickySelectionDelay?: Number; - ignoreCaption?: Boolean; - showLoadingState?: Boolean; - emptyMessage?(prefix: String): String; - getPopup(): AcePopup; - showPopup(editor: Editor, options: CompletionOptions): void; - detach(): void; - destroy(): void; - } - - type AcePopupNavigation = "up" | "down" | "start" | "end"; - - export class AcePopup { - constructor(parentNode: HTMLElement); - setData(list: Completion[], filterText: string): void; - getData(row: number): Completion; - getRow(): number; - getRow(line: number): void; - hide(): void; - show(pos: Point, lineHeight: number, topdownOnly: boolean): void; - tryShow(pos: Point, lineHeight: number, anchor: "top" | "bottom" | undefined, forceShow?: boolean): boolean; - goTo(where: AcePopupNavigation): void; - } -} - - -export const version: string; -export const config: Ace.Config; -export function require(name: string): any; -export function edit(el: Element | string, options?: Partial): Ace.Editor; -export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession; -export const VirtualRenderer: { - new(container: HTMLElement, theme?: string): Ace.VirtualRenderer; -}; -export const EditSession: { - new(text: string | Ace.Document, mode?: Ace.SyntaxMode): Ace.EditSession; -}; -export const UndoManager: { - new(): Ace.UndoManager; -}; -export const Editor: { - new(): Ace.Editor; -}; -export const Range: { - new(startRow: number, startColumn: number, endRow: number, endColumn: number): Ace.Range; - fromPoints(start: Ace.Point, end: Ace.Point): Ace.Range; - comparePoints(p1: Ace.Point, p2: Ace.Point): number; -}; - - -type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; - -type TooltipCommandFunction = (editor: Ace.Editor) => T; - -interface TooltipCommand extends Ace.Command { - enabled: TooltipCommandFunction | boolean, - getValue?: TooltipCommandFunction, - type: "button" | "text" | "checkbox" - iconCssClass: string, - cssClass: string -} - -export class InlineAutocomplete { - constructor(); - getInlineRenderer(): Ace.AceInline; - getInlineTooltip(): CommandBarTooltip; - getCompletionProvider(): Ace.CompletionProvider; - show(editor: Ace.Editor): void; - isOpen(): boolean; - detach(): void; - destroy(): void; - goTo(action: InlineAutocompleteAction): void; - tooltipEnabled: boolean; - commands: Record - getIndex(): number; - setIndex(value: number): void; - getLength(): number; - getData(index?: number): Ace.Completion | undefined; - updateCompletions(options: Ace.CompletionOptions): void; -} - -export class CommandBarTooltip { - constructor(parentElement: HTMLElement); - registerCommand(id: string, command: TooltipCommand): void; - attach(editor: Ace.Editor): void; - updatePosition(): void; - update(): void; - isShown(): boolean; - getAlwaysShow(): boolean; - setAlwaysShow(alwaysShow: boolean): void; - detach(): void; - destroy(): void; + export type Marker = import("ace-code/src/layer/marker").Marker; + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem + */ + /** + * @typedef {import("ace-code/src/layer/marker").Marker} Marker + */ + export class MarkerGroup { + /** + * @param {EditSession} session + */ + constructor(session: EditSession); + markers: any[]; + /**@type {EditSession}*/ + session: EditSession; + /** + * Finds the first marker containing pos + * @param {import("ace-code").Ace.Point} pos + * @returns import("ace-code").Ace.MarkerGroupItem + */ + getMarkerAtPosition(pos: import("ace-code").Ace.Point): any; + /** + * Comparator for Array.sort function, which sorts marker definitions by their positions + * + * @param {MarkerGroupItem} a first marker. + * @param {MarkerGroupItem} b second marker. + * @returns {number} negative number if a should be before b, positive number if b should be before a, 0 otherwise. + */ + markersComparator(a: MarkerGroupItem, b: MarkerGroupItem): number; + /** + * Sets marker definitions to be rendered. Limits the number of markers at MAX_MARKERS. + * @param {MarkerGroupItem[]} markers an array of marker definitions. + */ + setMarkers(markers: MarkerGroupItem[]): void; + /** + * @param {any} html + * @param {Marker} markerLayer + * @param {EditSession} session + * @param {{ firstRow: any; lastRow: any; }} config + */ + update(html: any, markerLayer: Marker, session: EditSession, config: { + firstRow: any; + lastRow: any; + }): void; + MAX_MARKERS: number; + } +} +declare module "ace-code/src/ext/elastic_tabstops_lite" { + export class ElasticTabstopsLite { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + onAfterExec: () => void; + onExec: () => void; + onChange: (delta: any) => void; + /** + * @param {number[]} rows + */ + processRows(rows: number[]): void; + } + import Editor_3 = require("ace-code/src/editor"); + import Editor = Editor_3.Editor; +} +declare module "ace-code/src/edit_session/fold" { + export class Fold extends RangeList { + /** + * @param {Range} range + * @param {any} placeholder + */ + constructor(range: Range, placeholder: any); + foldLine: import("ace-code/src/edit_session/fold_line").FoldLine; + placeholder: any; + range: import("ace-code/src/range").Range; + start: import("ace-code").Ace.Point; + end: import("ace-code").Ace.Point; + sameRow: boolean; + /**@type {Fold[]}*/ + subFolds: Fold[]; + /** + * @param {FoldLine} foldLine + */ + setFoldLine(foldLine: FoldLine): void; + clone(): Fold; + /** + * @param {Fold} fold + */ + addSubFold(fold: Fold): any; + /** + * @param {IRange} range + */ + restoreRange(range: IRange): void; + collapseChildren?: number; + } + export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + export type Range = import("ace-code/src/range").Range; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + import RangeList_1 = require("ace-code/src/range_list"); + import RangeList = RangeList_1.RangeList; + export interface Fold { + collapseChildren?: number; + } +} +declare module "ace-code/src/edit_session/fold_line" { + export type Fold = import("ace-code/src/edit_session/fold").Fold; + export class FoldLine { + /** + * If an array is passed in, the folds are expected to be sorted already. + * @param {FoldLine[]} foldData + * @param {Fold[]|Fold} folds + */ + constructor(foldData: FoldLine[], folds: Fold[] | Fold); + foldData: FoldLine[]; + /**@type {Fold[]} */ + folds: Fold[]; + range: Range; + start: import("ace-code").Ace.Point; + end: import("ace-code").Ace.Point; + /** + * Note: This doesn't update wrapData! + * @param {number} shift + */ + shiftRow(shift: number): void; + /** + * @param {Fold} fold + */ + addFold(fold: Fold): void; + /** + * @param {number} row + */ + containsRow(row: number): boolean; + /** + * @param {Function} callback + * @param {number} endRow + * @param {number} endColumn + */ + walk(callback: Function, endRow: number, endColumn: number): void; + /** + * @param {number} row + * @param {number} column + * @return {{ fold: Fold, kind: string } | null} + */ + getNextFoldTo(row: number, column: number): { + fold: Fold; + kind: string; + } | null; + /** + * @param {number} row + * @param {number} column + * @param {number} len + */ + addRemoveChars(row: number, column: number, len: number): void; + /** + * @param {number} row + * @param {number} column + * @return {FoldLine | null} + */ + split(row: number, column: number): FoldLine | null; + /** + * @param {FoldLine} foldLineNext + */ + merge(foldLineNext: FoldLine): void; + toString(): string; + /** + * @param {number} idx + * @return {import("ace-code").Ace.Point} + */ + idxToPosition(idx: number): import("ace-code").Ace.Point; + } + import Range_9 = require("ace-code/src/range"); + import Range = Range_9.Range; +} +declare module "ace-code/src/lib/bidiutil" { + export const ON_R: 3; + export const AN: 4; + export const R_H: 5; + export const B: 6; + export const RLE: 7; + export const DOT: "·"; + export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; + export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; + export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; + export var L: number; + export var R: number; + export var EN: number; +} +declare module "ace-code/src/bidihandler" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + /** + * This object is used to ensure Bi-Directional support (for languages with text flowing from right to left, like Arabic or Hebrew) + * including correct caret positioning, text selection mouse and keyboard arrows functioning + **/ + export class BidiHandler { + /** + * Creates a new `BidiHandler` object + * @param {EditSession} session The session to use + **/ + constructor(session: EditSession); + session: import("ace-code/src/edit_session").EditSession; + bidiMap: {}; + currentRow: any; + bidiUtil: typeof bidiUtil; + charWidths: any[]; + EOL: string; + showInvisibles: boolean; + isRtlDir: boolean; + line: string; + wrapIndent: number; + EOF: string; + RLE: string; + contentWidth: number; + fontMetrics: any; + rtlLineOffset: number; + wrapOffset: number; + isMoveLeftOperation: boolean; + seenBidi: boolean; + /** + * Returns 'true' if row contains Bidi characters, in such case + * creates Bidi map to be used in operations related to selection + * (keyboard arrays, mouse click, select) + * @param {Number} screenRow the screen row to be checked + * @param {Number} [docRow] the document row to be checked [optional] + * @param {Number} [splitIndex] the wrapped screen line index [ optional] + **/ + isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; + onChange(delta: any): void; + getDocumentRow(): number; + getSplitIndex(): number; + updateRowLine(docRow: any, splitIndex: any): void; + updateBidiMap(): void; + /** + * Resets stored info related to current screen row + **/ + markAsDirty(): void; + /** + * Updates array of character widths + * @param {Object} fontMetrics metrics + * + **/ + updateCharacterWidths(fontMetrics: any): void; + characterWidth: any; + setShowInvisibles(showInvisibles: any): void; + setEolChar(eolChar: any): void; + setContentWidth(width: any): void; + isRtlLine(row: any): boolean; + setRtlDirection(editor: any, isRtlDir: any): void; + /** + * Returns offset of character at position defined by column. + * @param {Number} col the screen column position + * + * @return {Number} horizontal pixel offset of given screen column + **/ + getPosLeft(col: number): number; + /** + * Returns 'selections' - array of objects defining set of selection rectangles + * @param {Number} startCol the start column position + * @param {Number} endCol the end column position + * + * @return {Object[]} Each object contains 'left' and 'width' values defining selection rectangle. + **/ + getSelections(startCol: number, endCol: number): any[]; + /** + * Converts character coordinates on the screen to respective document column number + * @param {Number} posX character horizontal offset + * + * @return {Number} screen column number corresponding to given pixel offset + **/ + offsetToCol(posX: number): number; + } + import bidiUtil = require("ace-code/src/lib/bidiutil"); +} +declare module "ace-code/src/background_tokenizer" { + const BackgroundTokenizer_base: undefined; + /** + * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. + * + * If a certain row is changed, everything below that row is re-tokenized. + **/ + export class BackgroundTokenizer { + /** + * Creates a new `BackgroundTokenizer` object. + * @param {Tokenizer} tokenizer The tokenizer to use + * @param {EditSession} [session] The editor session to associate with + **/ + constructor(tokenizer: Tokenizer, session?: EditSession); + /**@type {false|number}*/ + running: false | number; + lines: any[]; + states: any[]; + currentLine: number; + tokenizer: import("ace-code/src/tokenizer").Tokenizer; + /** + * Sets a new tokenizer for this object. + * @param {Tokenizer} tokenizer The new tokenizer to use + **/ + setTokenizer(tokenizer: Tokenizer): void; + /** + * Sets a new document to associate with this object. + * @param {Document} doc The new document to associate with + **/ + setDocument(doc: Document): void; + doc: import("ace-code/src/document").Document; + /** + * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. + * @param {Number} firstRow The starting row region + * @param {Number} lastRow The final row region + **/ + fireUpdateEvent(firstRow: number, lastRow: number): void; + /** + * Starts tokenizing at the row indicated. + * @param {Number} startRow The row to start at + **/ + start(startRow: number): void; + /** + * Sets pretty long delay to prevent the tokenizer from interfering with the user + */ + scheduleStart(): void; + /** + * Stops tokenizing. + **/ + stop(): void; + /** + * Gives list of [[Token]]'s of the row. (tokens are cached) + * @param {Number} row The row to get tokens at + * @returns {import("ace-code").Ace.Token[]} + **/ + getTokens(row: number): import("ace-code").Ace.Token[]; + /** + * Returns the state of tokenization at the end of a row. + * @param {Number} row The row to get state at + * @returns {string} + **/ + getState(row: number): string; + cleanup(): void; + } + export type Document = import("ace-code/src/document").Document; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; + } + export interface BackgroundTokenizer extends Ace.EventEmitter { + } +} +declare module "ace-code/src/edit_session/folding" { + export type IFolding = import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding; + export type Delta = import("ace-code").Ace.Delta; + /** + * @typedef {import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding} IFolding + * @typedef {import("ace-code").Ace.Delta } Delta + */ + /** + * @this {IFolding} + * @type {IFolding} + */ + export function Folding(this: IFolding): void; + export class Folding { + /** + * Looks up a fold at a given row/column. Possible values for side: + * -1: ignore a fold if fold.start = row/column + * +1: ignore a fold if fold.end = row/column + * @param {number} row + * @param {number} column + * @param {number} [side] + * @return {Fold} + **/ + getFoldAt: (row: number, column: number, side?: number) => Fold; + /** + * Returns all folds in the given range. Note, that this will return folds + * @param {Range| Delta} range + * @returns {Fold[]} + **/ + getFoldsInRange: (range: import("ace-code").Ace.Delta | Range) => Fold[]; + /** + * + * @param {Range[]|Range}ranges + * @returns {Fold[]} + */ + getFoldsInRangeList: (ranges: Range | Range[]) => Fold[]; + /** + * Returns all folds in the document + * @returns {Fold[]} + */ + getAllFolds: () => Fold[]; + /** + * Returns the string between folds at the given position. + * E.g. + * foob|arwolrd -> "bar" + * foobarwol|rd -> "world" + * foobarwolrd -> + * + * where | means the position of row/column + * + * The trim option determs if the return string should be trimed according + * to the "side" passed with the trim value: + * + * E.g. + * foob|arwolrd -trim=-1> "b" + * foobarwol|rd -trim=+1> "rld" + * fo|obarwolrd -trim=00> "foo" + * @param {number} row + * @param {number} column + * @param {number} [trim] + * @param {FoldLine} [foldLine] + * @returns {string | null} + */ + getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: FoldLine) => string; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldLine] + * @returns {null|FoldLine} + */ + getFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + /** + * Returns the fold which starts after or contains docRow + * @param {number} docRow + * @param {FoldLine} [startFoldLine] + * @returns {null|FoldLine} + */ + getNextFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + /** + * + * @param {number} first + * @param {number} last + * @return {number} + */ + getFoldedRowCount: (first: number, last: number) => number; + /** + * Adds a new fold. + * + * @param {Fold|string} placeholder + * @param {Range} [range] + * @returns {Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + * @this {IFolding} + */ + addFold: (placeholder: string | Fold, range?: Range) => Fold; + /** + * @param {Fold[]} folds + */ + addFolds: (folds: Fold[]) => void; + /** + * + * @param {Fold} fold + */ + removeFold: (fold: Fold) => void; + /** + * + * @param {Fold[]} folds + */ + removeFolds: (folds: Fold[]) => void; + /** + * @param {Fold} fold + */ + expandFold: (fold: Fold) => void; + /** + * @param {Fold[]}folds + */ + expandFolds: (folds: Fold[]) => void; + /** + * + * @param {number|null|import("ace-code").Ace.Point|Range|Range[]} [location] + * @param {boolean} [expandInner] + * @return {Fold[]| undefined} + */ + unfold: (location?: number | import("ace-code").Ace.Point | Range | Range[], expandInner?: boolean) => Fold[]; + /** + * Checks if a given documentRow is folded. This is true if there are some + * folded parts such that some parts of the line is still visible. + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @returns {boolean} + **/ + isRowFolded: (docRow: number, startFoldRow?: FoldLine) => boolean; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @return {number} + */ + getRowFoldEnd: (docRow: number, startFoldRow?: FoldLine) => number; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @returns {number} + */ + getRowFoldStart: (docRow: number, startFoldRow?: FoldLine) => number; + /** + * + * @param {FoldLine} foldLine + * @param {number | null} [endRow] + * @param {number | null} [endColumn] + * @param {number | null} [startRow] + * @param {number | null} [startColumn] + * @return {string} + */ + getFoldDisplayLine: (foldLine: FoldLine, endRow?: number, endColumn?: number, startRow?: number, startColumn?: number) => string; + /** + * + * @param {number} row + * @param {number | null} endColumn + * @param {number | null} startRow + * @param {number | null} startColumn + * @return {string} + */ + getDisplayLine: (row: number, endColumn: number, startRow: number, startColumn: number) => string; + /** + * @param {boolean} [tryToUnfold] + */ + toggleFold: (tryToUnfold?: boolean) => void; + /** + * + * @param {number} row + * @param {number} column + * @param {number} [dir] + * @return {Range | undefined} + */ + getCommentFoldRange: (row: number, column: number, dir?: number) => Range; + /** + * + * @param {number | null} [startRow] + * @param {number | null} [endRow] + * @param {number | null} [depth] + * @param {Function} [test] + */ + foldAll: (startRow?: number, endRow?: number, depth?: number, test?: Function) => void; + /** + * + * @param {number} level + */ + foldToLevel: (level: number) => void; + /** + * + */ + foldAllComments: () => void; + /** + * @param {string} style + */ + setFoldStyle: (style: string) => void; + /** + * @param {number} row + * @param {boolean} [ignoreCurrent] + * @return {{range?: Range, firstRange?: Range}} + */ + getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { + range?: Range; + firstRange?: Range; + }; + /** + * + * @param {number} row + * @param {any} e + */ + onFoldWidgetClick: (row: number, e: any) => void; + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget: (toggleParent?: boolean) => void; + /** + * @param {Delta} delta + */ + updateFoldWidgets: (delta: import("ace-code").Ace.Delta) => void; + /** + * @param e + */ + tokenizerUpdateFoldWidgets: (e: any) => void; + } + import Fold_1 = require("ace-code/src/edit_session/fold"); + import Fold = Fold_1.Fold; + import Range_10 = require("ace-code/src/range"); + import Range = Range_10.Range; + import FoldLine_1 = require("ace-code/src/edit_session/fold_line"); + import FoldLine = FoldLine_1.FoldLine; +} +declare module "ace-code/src/edit_session/bracket_match" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code/src/edit_session").Point; + export function BracketMatch(): void; + export class BracketMatch { + /** + * + * @param {Point} position + * @param {string} [chr] + * @this {EditSession} + */ + findMatchingBracket: (this: import("ace-code/src/edit_session").EditSession, position: Point, chr?: string) => import("ace-code").Ace.Point; + /** + * @param {Point} pos + * @return {null|Range} + * @this {EditSession} + */ + getBracketRange: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => null | Range; + /** + * Returns: + * * null if there is no any bracket at `pos`; + * * two Ranges if there is opening and closing brackets; + * * one Range if there is only one bracket + * + * @param {Point} pos + * @param {boolean} [isBackwards] + * @returns {null|Range[]} + * @this {EditSession} + */ + getMatchingBracketRanges: (this: import("ace-code/src/edit_session").EditSession, pos: Point, isBackwards?: boolean) => null | Range[]; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + * @param {Point} pos + * @returns {{closeTag: Range, closeTagName: Range, openTag: Range, openTagName: Range} | undefined} + * @this {EditSession} + */ + getMatchingTags: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + } | undefined; + } + import Range_11 = require("ace-code/src/range"); + import Range = Range_11.Range; +} +declare module "ace-code/src/edit_session" { + const EditSession_base: undefined; + const EditSession_base_1: undefined; + const EditSession_base_2: undefined; + const EditSession_base_3: undefined; + /** + * @typedef TextMode + * @type {SyntaxMode} + */ + /** + * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. + * + * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. + **/ + export class EditSession { + /** + * Returns a new instance of EditSession with state from JSON. + * @method fromJSON + * @param {string|object} session The EditSession state. + * @returns {EditSession} + */ + static fromJSON(session: string | object): EditSession; + /** + * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. + * @param {Document | String} [text] [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} + * @param {SyntaxMode} [mode] [The initial language mode to use for the document]{: #modeParam} + **/ + constructor(text?: Document | string, mode?: SyntaxMode); + /**@type {Document}*/ doc: Document; + id: string; + bgTokenizer: BackgroundTokenizer; + selection: Selection; + destroyed: boolean; + /** + * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. + * + * @param {Document} doc The new `Document` to use + * + **/ + setDocument(doc: Document): void; + /** + * Returns the `Document` associated with this session. + * @return {Document} + **/ + getDocument(): Document; + resetCaches(): void; + onChangeFold(e: any): void; + /** + * + * @param {Delta} delta + */ + onChange(delta: Delta): void; + mergeUndoDeltas: boolean; + /** + * Sets the session text. + * @param {String} text The new text to place + **/ + setValue(text: string): void; + /** + * Returns the current edit session. + * @method toJSON + * @returns {Object} + */ + toJSON(): any; + /** + * Returns selection object. + * @returns {Selection} + **/ + getSelection(): Selection; + /** + * {:BackgroundTokenizer.getState} + * @param {Number} row The row to start at + * @returns {string} + * @related BackgroundTokenizer.getState + **/ + getState(row: number): string; + /** + * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. + * @param {Number} row The row to start at + * @returns {import("ace-code").Ace.Token[]} + **/ + getTokens(row: number): import("ace-code").Ace.Token[]; + /** + * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. + * @param {Number} row The row number to retrieve from + * @param {Number} column The column number to retrieve from + * @returns {import("ace-code").Ace.Token} + * + **/ + getTokenAt(row: number, column: number): import("ace-code").Ace.Token; + /** + * Sets the undo manager. + * @param {UndoManager} undoManager The new undo manager + **/ + setUndoManager(undoManager: UndoManager): void; + /** + * starts a new group in undo history + **/ + markUndoGroup(): void; + /** + * Returns the current undo manager. + * @returns {UndoManager} + **/ + getUndoManager(): UndoManager; + /** + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + * @returns {String} + **/ + getTabString(): string; + /** + * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). + * @param {Boolean} val Value indicating whether or not to use soft tabs + **/ + setUseSoftTabs(val: boolean): void; + /** + * Returns `true` if soft tabs are being used, `false` otherwise. + * @returns {Boolean} + **/ + getUseSoftTabs(): boolean; + /** + * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. + * @param {Number} tabSize The new tab size + **/ + setTabSize(tabSize: number): void; + /** + * Returns the current tab size. + * @return {number} + **/ + getTabSize(): number; + /** + * Returns `true` if the character at the position is a soft tab. + * @param {Point} position The position to check + **/ + isTabStop(position: Point): boolean; + /** + * Set whether keyboard navigation of soft tabs moves the cursor within the soft tab, rather than over + * @param {Boolean} navigateWithinSoftTabs Value indicating whether or not to navigate within soft tabs + **/ + setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; + /** + * Returns `true` if keyboard navigation moves the cursor within soft tabs, `false` if it moves the cursor over soft tabs. + * @returns {Boolean} + **/ + getNavigateWithinSoftTabs(): boolean; + /** + * Pass in `true` to enable overwrites in your session, or `false` to disable. + * + * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. + * + * @param {Boolean} overwrite Defines whether or not to set overwrites + * + **/ + setOverwrite(overwrite: boolean): void; + /** + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ + getOverwrite(): boolean; + /** + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ + toggleOverwrite(): void; + /** + * Adds `className` to the `row`, to be used for CSS stylings and whatnot. + * @param {Number} row The row number + * @param {String} className The class to add + **/ + addGutterDecoration(row: number, className: string): void; + /** + * Removes `className` from the `row`. + * @param {Number} row The row number + * @param {String} className The class to add + **/ + removeGutterDecoration(row: number, className: string): void; + /** + * Returns an array of strings, indicating the breakpoint class (if any) applied to each row. + * @returns {String[]} + **/ + getBreakpoints(): string[]; + /** + * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. + * @param {number[]} rows An array of row indices + **/ + setBreakpoints(rows: number[]): void; + /** + * Removes all breakpoints on the rows. This function also emits the `'changeBreakpoint'` event. + **/ + clearBreakpoints(): void; + /** + * Sets a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. + * @param {Number} row A row index + * @param {String} className Class of the breakpoint + **/ + setBreakpoint(row: number, className: string): void; + /** + * Removes a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. + * @param {Number} row A row index + **/ + clearBreakpoint(row: number): void; + /** + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * @param {Range} range Define the range of the marker + * @param {String} clazz Set the CSS class for the marker + * @param {import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line"} [type] Identify the renderer type of the marker. If string provided, corresponding built-in renderer is used. Supported string types are "fullLine", "screenLine", "text" or "line". If a Function is provided, that Function is used as renderer. + * @param {Boolean} [inFront] Set to `true` to establish a front marker + * + * @return {Number} The new marker id + **/ + addMarker(range: Range, clazz: string, type?: import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line", inFront?: boolean): number; + /** + * Adds a dynamic marker to the session. + * @param {import("ace-code").Ace.MarkerLike} marker object with update method + * @param {Boolean} [inFront] Set to `true` to establish a front marker + * + * @return {import("ace-code").Ace.MarkerLike} The added marker + **/ + addDynamicMarker(marker: import("ace-code").Ace.MarkerLike, inFront?: boolean): import("ace-code").Ace.MarkerLike; + /** + * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. + * @param {Number} markerId A number representing a marker + **/ + removeMarker(markerId: number): void; + /** + * Returns an object containing all of the markers, either front or back. + * @param {Boolean} [inFront] If `true`, indicates you only want front markers; `false` indicates only back markers + * + * @returns {{[id: number]: import("ace-code").Ace.MarkerLike}} + **/ + getMarkers(inFront?: boolean): { + [id: number]: import("ace-code").Ace.MarkerLike; + }; + /** + * @param {RegExp} re + */ + highlight(re: RegExp): void; + /** + * experimental + * @param {number} startRow + * @param {number} endRow + * @param {string} clazz + * @param {boolean} [inFront] + * @return {Range} + */ + highlightLines(startRow: number, endRow: number, clazz: string, inFront?: boolean): Range; + /** + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + * @param {import("ace-code").Ace.Annotation[]} annotations A list of annotations + **/ + setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; + /** + * Returns the annotations for the `EditSession`. + * @returns {import("ace-code").Ace.Annotation[]} + **/ + getAnnotations(): import("ace-code").Ace.Annotation[]; + /** + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ + clearAnnotations(): void; + /** + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * @param {Number} row The row to start at + * @param {Number} column The column to start at + * + * @returns {Range} + **/ + getWordRange(row: number, column: number): Range; + /** + * Gets the range of a word, including its right whitespace. + * @param {Number} row The row number to start from + * @param {Number} column The column number to start from + * + * @return {Range} + **/ + getAWordRange(row: number, column: number): Range; + /** + * {:Document.setNewLineMode.desc} + * @param {import("ace-code").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} + * + * + * @related Document.setNewLineMode + **/ + setNewLineMode(newLineMode: import("ace-code").Ace.NewLineMode): void; + /** + * + * Returns the current new line mode. + * @returns {import("ace-code").Ace.NewLineMode} + * @related Document.getNewLineMode + **/ + getNewLineMode(): import("ace-code").Ace.NewLineMode; + /** + * Identifies if you want to use a worker for the `EditSession`. + * @param {Boolean} useWorker Set to `true` to use a worker + **/ + setUseWorker(useWorker: boolean): void; + /** + * Returns `true` if workers are being used. + **/ + getUseWorker(): boolean; + /** + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ + onReloadTokenizer(e: any): void; + /** + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * @param {SyntaxMode | string} mode Set a new text mode + * @param {() => void} [cb] optional callback + **/ + setMode(mode: SyntaxMode | string, cb?: () => void): void; + /**@type {RegExp}*/ + tokenRe: RegExp; + /**@type {RegExp}*/ + nonTokenRe: RegExp; + /** + * Returns the current text mode. + * @returns {TextMode} The current text mode + **/ + getMode(): TextMode; + /** + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + * @param {Number} scrollTop The new scroll top value + **/ + setScrollTop(scrollTop: number): void; + /** + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + * @returns {Number} + **/ + getScrollTop(): number; + /** + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + * @param {number} scrollLeft + */ + setScrollLeft(scrollLeft: number): void; + /** + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + * @returns {Number} + **/ + getScrollLeft(): number; + /** + * Returns the width of the screen. + * @returns {Number} + **/ + getScreenWidth(): number; + /** + * @return {number} + */ + getLineWidgetMaxWidth(): number; + lineWidgetWidth: number; + screenWidth: any; + /** + * Returns a verbatim copy of the given line as it is in the document + * @param {Number} row The row to retrieve from + * @returns {String} + **/ + getLine(row: number): string; + /** + * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. + * @param {Number} firstRow The first row index to retrieve + * @param {Number} lastRow The final row index to retrieve + * + * @returns {String[]} + * + **/ + getLines(firstRow: number, lastRow: number): string[]; + /** + * Returns the number of rows in the document. + * @returns {Number} + **/ + getLength(): number; + /** + * {:Document.getTextRange.desc} + * @param {IRange} [range] The range to work with + * + * @returns {String} + **/ + getTextRange(range?: IRange): string; + /** + * Inserts a block of `text` and the indicated `position`. + * @param {Point} position The position {row, column} to start inserting at + * @param {String} text A chunk of text to insert + * @returns {Point} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + **/ + insert(position: Point, text: string): Point; + /** + * Removes the `range` from the document. + * @param {IRange} range A specified Range to remove + * @returns {Point} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + **/ + remove(range: IRange): Point; + /** + * Removes a range of full lines. This method also triggers the `'change'` event. + * @param {Number} firstRow The first row to be removed + * @param {Number} lastRow The last row to be removed + * @returns {String[]} Returns all the removed lines. + * + * @related Document.removeFullLines + * + **/ + removeFullLines(firstRow: number, lastRow: number): string[]; + /** + * Reverts previous changes to your document. + * @param {Delta[]} deltas An array of previous changes + * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} + **/ + undoChanges(deltas: Delta[], dontSelect?: boolean): void; + /** + * Re-implements a previously undone change to your document. + * @param {Delta[]} deltas An array of previous changes + * @param {Boolean} [dontSelect] {:dontSelect} + **/ + redoChanges(deltas: Delta[], dontSelect?: boolean): void; + /** + * Enables or disables highlighting of the range where an undo occurred. + * @param {Boolean} enable If `true`, selects the range of the reinserted change + * + **/ + setUndoSelect(enable: boolean): void; + /** + * Replaces a range in the document with the new `text`. + * + * @param {IRange} range A specified Range to replace + * @param {String} text The new text to use as a replacement + * @returns {Point} An object containing the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If the text and range are empty, this function returns an object containing the current `range.start` value. + * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. + * + * @related Document.replace + **/ + replace(range: IRange, text: string): Point; + /** + * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: + * ```json + * { row: newRowLocation, column: newColumnLocation } + * ``` + * @param {Range} fromRange The range of text you want moved within the document + * @param {Point} toPosition The location (row and column) where you want to move the text to + * @param {boolean} [copy] + * @returns {Range} The new range where the text was moved to. + **/ + moveText(fromRange: Range, toPosition: Point, copy?: boolean): Range; + /** + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * + * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. + * @param {Number} startRow Starting row + * @param {Number} endRow Ending row + * @param {String} indentString The indent token + **/ + indentRows(startRow: number, endRow: number, indentString: string): void; + /** + * Outdents all the rows defined by the `start` and `end` properties of `range`. + * @param {Range} range A range of rows + **/ + outdentRows(range: Range): void; + /** + * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. + * @param {Number} firstRow The starting row to move up + * @param {Number} lastRow The final row to move up + * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + **/ + moveLinesUp(firstRow: number, lastRow: number): number; + /** + * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. + * @param {Number} firstRow The starting row to move down + * @param {Number} lastRow The final row to move down + * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + **/ + moveLinesDown(firstRow: number, lastRow: number): number; + /** + * Duplicates all the text between `firstRow` and `lastRow`. + * @param {Number} firstRow The starting row to duplicate + * @param {Number} lastRow The final row to duplicate + * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + **/ + duplicateLines(firstRow: number, lastRow: number): number; + /** + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + * @param {Boolean} useWrapMode Enable (or disable) wrap mode + **/ + setUseWrapMode(useWrapMode: boolean): void; + /** + * Returns `true` if wrap mode is being used; `false` otherwise. + * @returns {Boolean} + **/ + getUseWrapMode(): boolean; + /** + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + * @param {Number} min The minimum wrap value (the left side wrap) + * @param {Number} max The maximum wrap value (the right side wrap) + **/ + setWrapLimitRange(min: number, max: number): void; + /** + * This should generally only be called by the renderer when a resize is detected. + * @param {Number} desiredLimit The new wrap limit + * @param [$printMargin] + * @returns {Boolean} + **/ + adjustWrapLimit(desiredLimit: number, $printMargin?: any): boolean; + /** + * Returns the value of wrap limit. + * @returns {Number} The wrap limit. + **/ + getWrapLimit(): number; + /** + * Sets the line length for soft wrap in the editor. Lines will break + * at a minimum of the given length minus 20 chars and at a maximum + * of the given number of chars. + * @param {number} limit The maximum line length in chars, for soft wrapping lines. + */ + setWrapLimit(limit: number): void; + /** + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * + * { min: wrapLimitRange_min, max: wrapLimitRange_max } + * + * @returns {{ min: number, max: number }} + **/ + getWrapLimitRange(): { + min: number; + max: number; + }; + /** + * Returns number of screenrows in a wrapped line. + * @param {Number} row The row number to check + * @returns {Number} + **/ + getRowLength(row: number): number; + /** + * @param {Number} row + * @returns {Number} + **/ + getRowLineCount(row: number): number; + /** + * @param {Number} screenRow + * @returns {Number} + **/ + getRowWrapIndent(screenRow: number): number; + /** + * Returns the position (on screen) for the last character in the provided screen row. + * @param {Number} screenRow The screen row to check + * @returns {Number} + * + * @related EditSession.documentToScreenColumn + **/ + getScreenLastRowColumn(screenRow: number): number; + /** + * For the given document row and column, this returns the column position of the last screen row. + * @param {Number} docRow + * @param {Number} docColumn + * @returns {number} + **/ + getDocumentLastRowColumn(docRow: number, docColumn: number): number; + /** + * For the given document row and column, this returns the document position of the last row. + * @param {Number} docRow + * @param {Number} docColumn + * @returns {Point} + **/ + getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; + /** + * For the given row, this returns the split data. + * @param {number} row + * @returns {String | undefined} + */ + getRowSplitData(row: number): string | undefined; + /** + * The distance to the next tab stop at the specified screen column. + * @param {Number} screenColumn The screen column to check + * + * @returns {Number} + **/ + getScreenTabSize(screenColumn: number): number; + /** + * @param {number} screenRow + * @param {number} screenColumn + * @returns {number} + */ + screenToDocumentRow(screenRow: number, screenColumn: number): number; + /** + * @param {number} screenRow + * @param {number} screenColumn + * @returns {number} + */ + screenToDocumentColumn(screenRow: number, screenColumn: number): number; + /** + * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} + * @param {Number} screenRow The screen row to check + * @param {Number} screenColumn The screen column to check + * @param {Number} [offsetX] screen character x-offset [optional] + * + * @returns {Point} The object returned has two properties: `row` and `column`. + * + * @related EditSession.documentToScreenPosition + **/ + screenToDocumentPosition(screenRow: number, screenColumn: number, offsetX?: number): Point; + /** + * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * @param {Number|Point} docRow The document row to check + * @param {Number|undefined} [docColumn] The document column to check + * @returns {Point} The object returned by this method has two properties: `row` and `column`. + * + * @related EditSession.screenToDocumentPosition + **/ + documentToScreenPosition(docRow: number | Point, docColumn?: number | undefined): Point; + /** + * For the given document row and column, returns the screen column. + * @param {Number|Point} row + * @param {Number} [docColumn] + * @returns {Number} + **/ + documentToScreenColumn(row: number | Point, docColumn?: number): number; + /** + * For the given document row and column, returns the screen row. + * @param {Number|Point} docRow + * @param {Number} [docColumn] + * @returns {number} + **/ + documentToScreenRow(docRow: number | Point, docColumn?: number): number; + /** + * Returns the length of the screen. + * @returns {Number} + **/ + getScreenLength(): number; + /** + * @returns {string} the last character preceding the cursor in the editor + */ + getPrecedingCharacter(): string; + destroy(): void; + /** + * Returns the current [[Document `Document`]] as a string. + * @method getValue + * @returns {String} + * @alias EditSession.toString + **/ + getValue: () => string; + /** + * + * @type {null | import("ace-code").Ace.LineWidget[]} + */ + lineWidgets: null | import("ace-code").Ace.LineWidget[]; + isFullWidth: typeof isFullWidth; + widgetManager?: any; + curOp?: { + [key: string]: any; + command: {}; + args: string; + scrollTop: number; + }; + lineWidgetsWidth?: number; + getSelectionMarkers(): any[]; + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; + } + export namespace EditSession { + export { $uid }; + } + export type FontMetrics = import("ace-code/src/layer/font_metrics").FontMetrics; + export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + export type Point = import("ace-code").Ace.Point; + export type Delta = import("ace-code").Ace.Delta; + export type IRange = import("ace-code").Ace.IRange; + export type SyntaxMode = import("ace-code").Ace.SyntaxMode; + export type TextMode = SyntaxMode; + import Document_1 = require("ace-code/src/document"); + import Document = Document_1.Document; + import BackgroundTokenizer_1 = require("ace-code/src/background_tokenizer"); + import BackgroundTokenizer = BackgroundTokenizer_1.BackgroundTokenizer; + import Selection_1 = require("ace-code/src/selection"); + import Selection = Selection_1.Selection; + import BidiHandler_1 = require("ace-code/src/bidihandler"); + import BidiHandler = BidiHandler_1.BidiHandler; + import UndoManager_1 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_1.UndoManager; + import Range_12 = require("ace-code/src/range"); + import Range = Range_12.Range; + function isFullWidth(c: any): boolean; + var $uid: number; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type EditSessionEvents = import("ace-code").Ace.EditSessionEvents; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type EditSessionOptions = import("ace-code").Ace.EditSessionOptions; + type Folding = import("ace-code").Ace.Folding; + type BracketMatch = import("ace-code").Ace.BracketMatch; + type Document = import("ace-code").Ace.Document; + type Point = import("ace-code").Ace.Point; + type Occur = import("ace-code").Ace.Occur; + } + export interface EditSession extends Ace. + EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace. + BracketMatch { + doc: Ace.Document; + widgetManager?: any; + curOp?: { + command: {}; + args: string; + scrollTop: number; + [key: string]: any; + }; + lineWidgetsWidth?: number; + getSelectionMarkers(): any[]; + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; + } +} +declare module "ace-code/src/range" { + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code").Ace.IRange} IRange + * @typedef {import("ace-code").Ace.Point} Point + */ + /** + * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogous to a range, as ranges contain a starting row and starting column, and an ending row, and ending column. + **/ + export class Range { + /** + * Creates a new `Range` object with the given starting and ending rows and columns. + * @param {Number} [startRow] The starting row + * @param {Number} [startColumn] The starting column + * @param {Number} [endRow] The ending row + * @param {Number} [endColumn] The ending column + * @constructor + **/ + constructor(startRow?: number, startColumn?: number, endRow?: number, endColumn?: number); + /**@type {Point}*/ + start: Point; + /**@type {Point}*/ + end: Point; + /** + * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. + * @param {IRange} range A range to check against + * @return {Boolean} + **/ + isEqual(range: IRange): boolean; + /** + * Returns a string containing the range's row and column information, given like this: + * ``` + * [start.row/start.column] -> [end.row/end.column] + * ``` + * @return {String} + **/ + toString(): string; + /** + * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if: + * ```javascript + * this.start.row <= row <= this.end.row && + * this.start.column <= column <= this.end.column + * ``` + * @param {Number} row A row to check for + * @param {Number} column A column to check for + * @returns {Boolean} + * @related [[Range.compare]] + **/ + contains(row: number, column: number): boolean; + /** + * Compares `this` range (A) with another range (B). + * @param {IRange} range A range to compare with + * @related [[Range.compare]] + * @returns {Number} This method returns one of the following numbers: + * * `-2`: (B) is in front of (A), and doesn't intersect with (A) + * * `-1`: (B) begins before (A) but ends inside of (A) + * * `0`: (B) is completely inside of (A) + * * `+1`: (B) begins inside of (A) but ends outside of (A) + * * `+2`: (B) is after (A) and doesn't intersect with (A) + * * `42`: FTW state: (B) ends in (A) but starts outside of (A) + **/ + compareRange(range: IRange): number; + /** + * Compares the row and column of `p` with the starting and ending [[Point]]'s of the calling range (by calling [[Range.compare]]). + * @param {Point} p A point to compare with + * @related [[Range.compare]] + * @returns {Number} + **/ + comparePoint(p: Point): number; + /** + * Checks the start and end [[Point]]'s of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range. + * @param {IRange} range A range to compare with + * @returns {Boolean} + * @related [[Range.comparePoint]] + **/ + containsRange(range: IRange): boolean; + /** + * Returns `true` if passed in `range` intersects with the one calling this method. + * @param {IRange} range A range to compare with + * @returns {Boolean} + **/ + intersects(range: IRange): boolean; + /** + * Returns `true` if the caller's ending row is the same as `row`, and if the caller's ending column is the same as `column`. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + **/ + isEnd(row: number, column: number): boolean; + /** + * Returns `true` if the caller's starting row is the same as `row`, and if the caller's starting column is the same as `column`. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + **/ + isStart(row: number, column: number): boolean; + /** + * Sets the starting row and column for the range. + * @param {Number|Point} row A row to set + * @param {Number} [column] A column to set + * + **/ + setStart(row: number | Point, column?: number): void; + /** + * Sets the starting row and column for the range. + * @param {Number|Point} row A row to set + * @param {Number} [column] A column to set + * + **/ + setEnd(row: number | Point, column?: number): void; + /** + * Returns `true` if the `row` and `column` are within the given range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + **/ + inside(row: number, column: number): boolean; + /** + * Returns `true` if the `row` and `column` are within the given range's starting [[Point]]. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + **/ + insideStart(row: number, column: number): boolean; + /** + * Returns `true` if the `row` and `column` are within the given range's ending [[Point]]. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + * + **/ + insideEnd(row: number, column: number): boolean; + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if `row` is greater than the calling range + * * `-1` if `row` is less then the calling range + * * `0` otherwise + * + * If the starting row of the calling range is equal to `row`, and: + * * `column` is greater than or equal to the calling range's starting column, this returns `0` + * * Otherwise, it returns -1 + * + * If the ending row of the calling range is equal to `row`, and: + * * `column` is less than or equal to the calling range's ending column, this returns `0` + * * Otherwise, it returns 1 + **/ + compare(row: number, column: number): number; + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `-1` if calling range's starting column and calling range's starting row are equal `row` and `column` + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + **/ + compareStart(row: number, column: number): number; + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if calling range's ending column and calling range's ending row are equal `row` and `column`. + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + */ + compareEnd(row: number, column: number): number; + /** + * Compares the `row` and `column` with the start and end [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column` + * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column` + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + **/ + compareInside(row: number, column: number): number; + /** + * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object. + * @param {Number} firstRow The starting row + * @param {Number} lastRow The ending row + * @returns {Range} + **/ + clipRows(firstRow: number, lastRow: number): Range; + /** + * Changes the `row` and `column` for the calling range for both the starting and ending [[Point]]'s. + * @param {Number} row A new row to extend to + * @param {Number} column A new column to extend to + * @returns {Range} The original range with the new row + **/ + extend(row: number, column: number): Range; + /** + * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). + * @returns {Boolean} + **/ + isEmpty(): boolean; + /** + * Returns `true` if the range spans across multiple lines. + * @returns {Boolean} + **/ + isMultiLine(): boolean; + /** + * Returns a duplicate of the calling range. + * @returns {Range} + **/ + clone(): Range; + /** + * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. + * @returns {Range} + **/ + collapseRows(): Range; + /** + * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. + * @param {EditSession} session The `EditSession` to retrieve coordinates from + * @returns {Range} + **/ + toScreenRange(session: EditSession): Range; + /** + * Shift the calling range by `row` and `column` values. + * @param {Number} row + * @param {Number} column + * @experimental + */ + moveBy(row: number, column: number): void; + id?: number; + cursor?: import("ace-code").Ace.Point; + isBackwards?: boolean; + } + export namespace Range { + export { fromPoints, comparePoints }; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type IRange = import("ace-code").Ace.IRange; + export type Point = import("ace-code").Ace.Point; + /** + * Creates and returns a new `Range` based on the `start` [[Point]] and `end` [[Point]] of the given parameters. + * @param {Point} start A starting point to use + * @param {Point} end An ending point to use + * @returns {Range} + **/ + function fromPoints(start: Point, end: Point): Range; + /** + * Compares `p1` and `p2` [[Point]]'s, useful for sorting + * @param {Point} p1 + * @param {Point} p2 + * @returns {Number} + */ + function comparePoints(p1: Point, p2: Point): number; + export {}; + namespace Ace { + type Point = import("ace-code").Ace.Point; + } + export interface Range { + id?: number; + cursor?: Ace.Point; + isBackwards?: boolean; + } +} +declare module "ace-code/src/worker/worker_client" { + export var WorkerClient: any; +} +declare module "ace-code/src/placeholder" { + const PlaceHolder_base: undefined; + export class PlaceHolder { + /** + * @param {EditSession} session + * @param {Number} length + * @param {import("ace-code").Ace.Point} pos + * @param {any[]} others + * @param {String} mainClass + * @param {String} othersClass + **/ + constructor(session: EditSession, length: number, pos: import("ace-code").Ace.Point, others: any[], mainClass: string, othersClass: string); + length: number; + session: import("ace-code/src/edit_session").EditSession; + doc: import("ace-code/src/document").Document; + mainClass: string; + othersClass: string; + /** + * PlaceHolder.setup() + * + * TODO + * + **/ + setup(): void; + selectionBefore: Range | Range[]; + pos: import("ace-code/src/anchor").Anchor; + others: any[]; + /** + * PlaceHolder.showOtherMarkers() + * + * TODO + * + **/ + showOtherMarkers(): void; + othersActive: boolean; + /** + * PlaceHolder.hideOtherMarkers() + * + * Hides all over markers in the [[EditSession `EditSession`]] that are not the currently selected one. + * + **/ + hideOtherMarkers(): void; + /** + * PlaceHolder@onUpdate(e) + * + * Emitted when the place holder updates. + * @param {import("ace-code").Ace.Delta} delta + */ + onUpdate(delta: import("ace-code").Ace.Delta): void; + /** + * @param {import("ace-code").Ace.Delta} delta + */ + updateAnchors(delta: import("ace-code").Ace.Delta): void; + updateMarkers(): void; + /** + * PlaceHolder@onCursorChange(e) + * + * Emitted when the cursor changes. + * @param {any} [event] + */ + onCursorChange(event?: any): void; + /** + * PlaceHolder.detach() + * + * TODO + * + **/ + detach(): void; + /** + * PlaceHolder.cancel() + * + * TODO + * + **/ + cancel(): void; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + import Range_13 = require("ace-code/src/range"); + import Range = Range_13.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; + } + export interface PlaceHolder extends Ace.EventEmitter { + } +} +declare module "ace-code/src/mouse/multi_select_handler" { + export function onMouseDown(e: any): any; +} +declare module "ace-code/src/commands/multi_select_commands" { + export const defaultCommands: import("ace-code").Ace.Command[]; + export const multiSelectCommands: import("ace-code").Ace.Command[]; + export const keyboardHandler: HashHandler; + import HashHandler_4 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_4.HashHandler; +} +declare module "ace-code/src/multi_select" { + export const commands: import("ace-code").Ace.Command[]; + export const onSessionChange: (e: any) => void; + export type Anchor = import("ace-code/src/anchor").Anchor; + export type Point = import("ace-code").Ace.Point; + export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; + /** + * @param {Editor} editor + */ + export function MultiSelect(editor: Editor): void; + import Editor_4 = require("ace-code/src/editor"); + import Editor = Editor_4.Editor; +} +declare module "ace-code/src/ext/error_marker" { + export function showErrorMarker(editor: import("ace-code/src/editor").Editor, dir: number): void; +} +declare module "ace-code" { + export namespace Ace { + type Anchor = import("ace-code/src/anchor").Anchor; + type Editor = import("ace-code/src/editor").Editor; + type EditSession = import("ace-code/src/edit_session").EditSession; + type Document = import("ace-code/src/document").Document; + type Fold = import("ace-code/src/edit_session/fold").Fold; + type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + type Range = import("ace-code/src/range").Range; + type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + type UndoManager = import("ace-code/src/undomanager").UndoManager; + type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + type TokenIterator = import("ace-code/src/token_iterator").TokenIterator; + type Selection = import("ace-code/src/selection").Selection; + type Autocomplete = import("ace-code/src/autocomplete").Autocomplete; + type InlineAutocomplete = import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + type CompletionProvider = import("ace-code/src/autocomplete").CompletionProvider; + type AcePopup = import("ace-code/src/autocomplete/popup").AcePopup; + type AceInline = import("ace-code/src/autocomplete/inline").AceInline; + type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + type RangeList = import("ace-code/src/range_list").RangeList; + type FilteredList = import("ace-code/src/autocomplete").FilteredList; + type LineWidgets = import("ace-code/src/line_widgets").LineWidgets; + type SearchBox = import("ace-code/src/ext/searchbox").SearchBox; + type Occur = import("ace-code/src/occur").Occur; + type DefaultHandlers = import("ace-code/src/mouse/default_handlers").DefaultHandlers; + type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; + type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; + type AppConfig = import("ace-code/src/lib/app_config").AppConfig; + type AfterLoadCallback = (err: Error | null, module: unknown) => void; + type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface Config { + get(key: string): any; + set(key: string, value: any): void; + all(): { + [key: string]: any; + }; + moduleUrl(name: string, component?: string): string; + setModuleUrl(name: string, subst: string): string; + setLoader(cb: LoaderFunction): void; + setModuleLoader(name: string, onLoad: Function): void; + loadModule(moduleName: string | [ + string, + string + ], onLoad?: (module: any) => void): void; + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): void; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(string: string, params?: { + [x: string]: any; + }): string; + } + interface Theme { + cssClass?: string; + cssText?: string; + padding?: number | string; + isDark?: boolean; + } + interface ScrollBar { + setVisible(visible: boolean): void; + [key: string]: any; + } + interface HScrollbar extends ScrollBar { + setWidth(width: number): void; + } + interface VScrollbar extends ScrollBar { + setHeight(width: number): void; + } + interface LayerConfig { + width: number; + padding: number; + firstRow: number; + firstRowScreen: number; + lastRow: number; + lineHeight: number; + characterWidth: number; + minHeight: number; + maxHeight: number; + offset: number; + height: number; + gutterOffset: number; + } + interface HardWrapOptions { + startRow: number; + endRow: number; + allowMerge?: boolean; + column?: number; + } + interface CommandBarOptions { + maxElementsOnTooltip: number; + alwaysShow: boolean; + showDelay: number; + hideDelay: number; + } + interface ScreenCoordinates { + row: number; + column: number; + side?: 1 | -1; + offsetX?: number; + } + interface Folding { + /** + * Looks up a fold at a given row/column. Possible values for side: + * -1: ignore a fold if fold.start = row/column + * +1: ignore a fold if fold.end = row/column + **/ + getFoldAt(row: number, column: number, side?: number): Ace.Fold; + /** + * Returns all folds in the given range. Note, that this will return folds + **/ + getFoldsInRange(range: Ace.Range | Ace.Delta): Ace.Fold[]; + getFoldsInRangeList(ranges: Ace.Range[] | Ace.Range): Ace.Fold[]; + /** + * Returns all folds in the document + */ + getAllFolds(): Ace.Fold[]; + /** + * Returns the string between folds at the given position. + * E.g. + * foob|arwolrd -> "bar" + * foobarwol|rd -> "world" + * foobarwolrd -> + * + * where | means the position of row/column + * + * The trim option determs if the return string should be trimed according + * to the "side" passed with the trim value: + * + * E.g. + * foob|arwolrd -trim=-1> "b" + * foobarwol|rd -trim=+1> "rld" + * fo|obarwolrd -trim=00> "foo" + */ + getFoldStringAt(row: number, column: number, trim?: number, foldLine?: Ace.FoldLine): string | null; + getFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + /** + * Returns the fold which starts after or contains docRow + */ + getNextFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + getFoldedRowCount(first: number, last: number): number; + /** + * Adds a new fold. + * @returns {Ace.Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + */ + addFold(placeholder: Ace.Fold | string, range?: Ace.Range): Ace.Fold; + addFolds(folds: Ace.Fold[]): void; + removeFold(fold: Ace.Fold): void; + removeFolds(folds: Ace.Fold[]): void; + expandFold(fold: Ace.Fold): void; + expandFolds(folds: Ace.Fold[]): void; + unfold(location?: number | null | Ace.Point | Ace.Range | Ace.Range[], expandInner?: boolean): Ace.Fold[] | undefined; + /** + * Checks if a given documentRow is folded. This is true if there are some + * folded parts such that some parts of the line is still visible. + **/ + isRowFolded(docRow: number, startFoldRow?: Ace.FoldLine): boolean; + getRowFoldEnd(docRow: number, startFoldRow?: Ace.FoldLine): number; + getRowFoldStart(docRow: number, startFoldRow?: Ace.FoldLine): number; + getFoldDisplayLine(foldLine: Ace.FoldLine, endRow?: number | null, endColumn?: number | null, startRow?: number | null, startColumn?: number | null): string; + getDisplayLine(row: number, endColumn: number | null, startRow: number | null, startColumn: number | null): string; + toggleFold(tryToUnfold?: boolean): void; + getCommentFoldRange(row: number, column: number, dir?: number): Ace.Range | undefined; + foldAll(startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function): void; + foldToLevel(level: number): void; + foldAllComments(): void; + setFoldStyle(style: string): void; + foldWidgets: any[]; + getFoldWidget: any; + getFoldWidgetRange: any; + getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { + range?: Ace.Range; + firstRange?: Ace.Range; + }; + onFoldWidgetClick(row: number, e: any): void; + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget(toggleParent?: boolean): void; + updateFoldWidgets(delta: Ace.Delta): void; + tokenizerUpdateFoldWidgets(e: any): void; + } + interface BracketMatch { + findMatchingBracket: (position: Point, chr?: string) => Point; + getBracketRange: (pos: Point) => null | Range; + /** + * Returns: + * * null if there is no any bracket at `pos`; + * * two Ranges if there is opening and closing brackets; + * * one Range if there is only one bracket + */ + getMatchingBracketRanges: (pos: Point, isBackwards?: boolean) => null | Range[]; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + */ + getMatchingTags: (pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + }; + } + interface IRange { + start: Point; + end: Point; + } + interface LineWidget { + el: HTMLElement; + rowCount: number; + hidden: boolean; + column?: number; + row?: number; + session: EditSession; + html?: string; + text?: string; + className?: string; + coverGutter?: boolean; + pixelHeight?: number; + editor: Editor; + coverLine?: boolean; + fixedWidth?: boolean; + fullWidth?: boolean; + screenWidth?: number; + rowsAbove?: number; + lenses?: any[]; + } + type NewLineMode = "auto" | "unix" | "windows"; + interface EditSessionOptions { + wrap: "off" | "free" | "printmargin" | boolean | number; + wrapMethod: "code" | "text" | "auto"; + indentedSoftWrap: boolean; + firstLineNumber: number; + useWorker: boolean; + useSoftTabs: boolean; + tabSize: number; + navigateWithinSoftTabs: boolean; + foldStyle: "markbegin" | "markbeginend" | "manual"; + overwrite: boolean; + newLineMode: NewLineMode; + mode: string; + } + interface VirtualRendererOptions { + animatedScroll: boolean; + showInvisibles: boolean; + showPrintMargin: boolean; + printMarginColumn: number; + printMargin: boolean | number; + showGutter: boolean; + fadeFoldWidgets: boolean; + showFoldWidgets: boolean; + showLineNumbers: boolean; + displayIndentGuides: boolean; + highlightIndentGuides: boolean; + highlightGutterLine: boolean; + hScrollBarAlwaysVisible: boolean; + vScrollBarAlwaysVisible: boolean; + fontSize: string | number; + fontFamily: string; + maxLines: number; + minLines: number; + scrollPastEnd: number; + fixedWidthGutter: boolean; + customScrollbar: boolean; + theme: string; + hasCssTransforms: boolean; + maxPixelHeight: number; + useSvgGutterIcons: boolean; + showFoldedAnnotations: boolean; + useResizeObserver: boolean; + } + interface MouseHandlerOptions { + scrollSpeed: number; + dragDelay: number; + dragEnabled: boolean; + focusTimeout: number; + tooltipFollowsMouse: boolean; + } + interface EditorOptions extends EditSessionOptions, MouseHandlerOptions, VirtualRendererOptions { + selectionStyle: "fullLine" | "screenLine" | "text" | "line"; + highlightActiveLine: boolean; + highlightSelectedWord: boolean; + readOnly: boolean; + copyWithEmptySelection: boolean; + cursorStyle: "ace" | "slim" | "smooth" | "wide"; + mergeUndoDeltas: true | false | "always"; + behavioursEnabled: boolean; + wrapBehavioursEnabled: boolean; + enableAutoIndent: boolean; + enableBasicAutocompletion: boolean | Completer[]; + enableLiveAutocompletion: boolean | Completer[]; + liveAutocompletionDelay: number; + liveAutocompletionThreshold: number; + enableSnippets: boolean; + autoScrollEditorIntoView: boolean; + keyboardHandler: string | null; + placeholder: string; + value: string; + session: EditSession; + relativeLineNumbers: boolean; + enableMultiselect: boolean; + enableKeyboardAccessibility: boolean; + enableCodeLens: boolean; + } + interface EventsBase { + [key: string]: any; + } + interface EditSessionEvents { + /** + * Emitted when the document changes. + * @param delta + */ + "change": (delta: Delta) => void; + /** + * Emitted when the tab size changes, via [[EditSession.setTabSize]]. + * @param tabSize + */ + "changeTabSize": (tabSize: number) => void; + /** + * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. + * @param overwrite + */ + "changeOverwrite": (overwrite: boolean) => void; + /** + * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. + * @param e + */ + "changeBreakpoint": (e: { + row: number; + breakpoint: boolean; + }) => void; + /** + * Emitted when a front marker changes. + * @param e + */ + "changeFrontMarker": (e: { + row: number; + marker: boolean; + }) => void; + /** + * Emitted when a back marker changes. + * @param e + */ + "changeBackMarker": (e: { + row: number; + marker: boolean; + }) => void; + /** + * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. + * @param e + */ + "changeAnnotation": (e: { + row: number; + lines: string[]; + }) => void; + /** + * Emitted when a background tokenizer asynchronously processes new rows. + */ + "tokenizerUpdate": (e: { + data: { + first: string; + last: string; + }; + }) => void; + /** + * Emitted when the current mode changes. + * @param e + */ + "changeMode": (e: any) => void; + /** + * Emitted when the wrap mode changes. + * @param e + */ + "changeWrapMode": (e: any) => void; + /** + * Emitted when the wrapping limit changes. + * @param e + */ + "changeWrapLimit": (e: any) => void; + /** + * Emitted when a code fold is added or removed. + * @param e + */ + "changeFold": (e: any, session: EditSession) => void; + /** + * Emitted when the scroll top changes. + * @param scrollTop The new scroll top value + **/ + "changeScrollTop": (scrollTop: number) => void; + /** + * Emitted when the scroll left changes. + * @param scrollLeft The new scroll left value + **/ + "changeScrollLeft": (scrollLeft: number) => void; + "changeEditor": (e: { + editor: Editor; + }) => void; + } + interface EditorEvents { + "change": (delta: Delta) => void; + "changeSelection": () => void; + "input": () => void; + /** + * Emitted whenever the [[EditSession]] changes. + * @param e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. + **/ + "changeSession": (e: { + oldSession: EditSession; + session: EditSession; + }) => void; + "blur": (e: any) => void; + "mousedown": (e: MouseEvent) => void; + "mousemove": (e: MouseEvent & { + scrollTop?: any; + }, editor?: Editor) => void; + "changeStatus": () => void; + "keyboardActivity": () => void; + "mousewheel": (e: MouseEvent) => void; + "mouseup": (e: MouseEvent) => void; + "beforeEndOperation": (e: any) => void; + "nativecontextmenu": (e: any) => void; + "destroy": () => void; + "focus": () => void; + /** + * Emitted when text is copied. + * @param text The copied text + **/ + "copy": (text: string) => void; + /** + * Emitted when text is pasted. + **/ + "paste": (text: string, event: any) => void; + /** + * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. + * @param data Contains one property, `data`, which indicates the new selection style + **/ + "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; + } + interface AcePopupEvents { + "click": (e: MouseEvent) => void; + "dblclick": (e: MouseEvent) => void; + "tripleclick": (e: MouseEvent) => void; + "quadclick": (e: MouseEvent) => void; + "show": () => void; + "hide": () => void; + "select": (hide: boolean) => void; + "changeHoverMarker": (e: any) => void; + } + interface DocumentEvents { + /** + * Fires whenever the document changes. + * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available: + * * `"insert"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being added + * * `"remove"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being removed + * + **/ + "change": (e: Delta) => void; + "changeNewLineMode": () => void; + } + interface AnchorEvents { + /** + * Fires whenever the anchor position changes. + * Both of these objects have a `row` and `column` property corresponding to the position. + * Events that can trigger this function include [[Anchor.setPosition `setPosition()`]]. + * @param {Object} e An object containing information about the anchor position. It has two properties: + * - `old`: An object describing the old Anchor position + * - `value`: An object describing the new Anchor position + **/ + "change": (e: { + old: Point; + value: Point; + }) => void; + } + interface BackgroundTokenizerEvents { + /** + * Fires whenever the background tokeniziers between a range of rows are going to be updated. + * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + **/ + "update": (e: { + first: number; + last: number; + }) => void; + } + interface SelectionEvents { + /** + * Emitted when the cursor position changes. + **/ + "changeCursor": () => void; + /** + * Emitted when the cursor selection changes. + **/ + "changeSelection": () => void; + } + interface PlaceHolderEvents { + } + interface GutterEvents { + "changeGutterWidth": (width: number) => void; + } + interface TextEvents { + "changeCharacterSize": (e: any) => void; + } + interface VirtualRendererEvents { + "afterRender": (e: any, renderer: VirtualRenderer) => void; + "beforeRender": (e: any, renderer: VirtualRenderer) => void; + } + class EventEmitter { + once(name: K, callback: T[K]): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K, callback: T[K], capturing?: boolean): T[K]; + addEventListener(name: K, callback: T[K], capturing?: boolean): T[K]; + off(name: K, callback: T[K]): void; + removeListener(name: K, callback: T[K]): void; + removeEventListener(name: K, callback: T[K]): void; + removeAllListeners(name?: string): void; + } + interface SearchOptions { + needle: string | RegExp; + preventScroll: boolean; + backwards: boolean; + start: Range; + skipCurrent: boolean; + range: Range; + preserveCase: boolean; + regExp: boolean; + wholeWord: boolean; + caseSensitive: boolean; + wrap: boolean; + re: RegExp; + } + interface Point { + row: number; + column: number; + } + type Position = Point; + interface Delta { + action: "insert" | "remove"; + start: Point; + end: Point; + lines: string[]; + id?: number; + folds?: Fold[]; + } + interface Annotation { + row: number; + column: number; + text: string; + type: string; + } + export interface MarkerGroupItem { + range: Range; + className: string; + } + type MarkerGroup = import("ace-code/src/marker_group").MarkerGroup; + export interface Command { + name?: string; + bindKey?: string | { + mac?: string; + win?: string; + }; + readOnly?: boolean; + exec?: (editor?: Editor | any, args?: any) => void; + isAvailable?: (editor: Editor) => boolean; + description?: string; + multiSelectAction?: "forEach" | "forEachLine" | Function; + scrollIntoView?: true | "cursor" | "center" | "selectionPart" | "animate" | "selection" | "none"; + aceCommandGroup?: string; + passEvent?: boolean; + level?: number; + action?: string; + } + type CommandLike = Command | ((editor: Editor) => void) | ((sb: SearchBox) => void); + type KeyboardHandler = Partial & { + attach?: (editor: Editor) => void; + detach?: (editor: Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + }; + export interface MarkerLike { + range?: Range; + type: string; + renderer?: MarkerRenderer; + clazz: string; + inFront?: boolean; + id?: number; + update?: (html: string[], + // TODO maybe define Marker class + marker: any, session: EditSession, config: any) => void; + [key: string]: any; + } + type MarkerRenderer = (html: string[], range: Range, left: number, top: number, config: any) => void; + interface Token { + type: string; + value: string; + index?: number; + start?: number; + } + type BaseCompletion = import("ace-code/src/autocomplete").BaseCompletion; + type SnippetCompletion = import("ace-code/src/autocomplete").SnippetCompletion; + type ValueCompletion = import("ace-code/src/autocomplete").ValueCompletion; + type Completion = import("ace-code/src/autocomplete").Completion; + type HighlightRule = ({ + defaultToken: string; + } | { + include: string; + } | { + todo: string; + } | { + token: string | string[] | ((value: string) => string); + regex: string | RegExp; + next?: string | (() => void); + push?: string; + comment?: string; + caseInsensitive?: boolean; + nextState?: string; + }) & { + [key: string]: any; + }; + type HighlightRulesMap = Record; + type KeywordMapper = (keyword: string) => string; + interface HighlightRules { + addRules(rules: HighlightRulesMap, prefix?: string): void; + getRules(): HighlightRulesMap; + embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; + getEmbeds(): string[]; + normalizeRules(): void; + createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; + } + type FoldWidget = "start" | "end" | ""; + interface FoldMode { + foldingStartMarker: RegExp; + foldingStopMarker?: RegExp; + getFoldWidget(session: EditSession, foldStyle: string, row: number): FoldWidget; + getFoldWidgetRange(session: EditSession, foldStyle: string, row: number): Range | undefined; + indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; + 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) => ({ + text: string; + selection: number[]; + } | Range) & { + [key: string]: any; + } | undefined; + type BehaviorMap = Record>; + interface Behaviour { + add(name: string, action: string, callback: BehaviorAction): void; + addBehaviours(behaviours: BehaviorMap): void; + remove(name: string): void; + inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; + getBehaviours(filter?: string[]): BehaviorMap; + } + interface Outdent { + checkOutdent(line: string, input: string): boolean; + autoOutdent(doc: Document, row: number): number | undefined; + } + interface SyntaxMode { + HighlightRules: { + new (config: any): HighlightRules; + }; //TODO: fix this + foldingRules?: FoldMode; + /** + * characters that indicate the start of a line comment + */ + lineCommentStart?: string; + /** + * characters that indicate the start and end of a block comment + */ + blockComment?: { + start: string; + end: string; + }; + tokenRe?: RegExp; + nonTokenRe?: RegExp; + completionKeywords: string[]; + 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; + // 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[]; + } + interface OptionsBase { + [key: string]: any; + } + class OptionsProvider { + setOptions(optList: Partial): void; + getOptions(optionNames?: Array | Partial): Partial; + setOption(name: K, value: T[K]): void; + getOption(name: K): T[K]; + } + type KeyBinding = import("ace-code/src/keyboard/keybinding").KeyBinding; + interface CommandMap { + [name: string]: Command; + } + type execEventHandler = (obj: { + editor: Editor; + command: Command; + args: any[]; + }) => void; + interface CommandManagerEvents { + on(name: "exec", callback: execEventHandler): Function; + on(name: "afterExec", callback: execEventHandler): Function; + } + type CommandManager = import("ace-code/src/commands/command_manager").CommandManager; + interface SavedSelection { + start: Point; + end: Point; + isBackwards: boolean; + } + var Selection: { + new (session: EditSession): Selection; + }; + interface TextInput { + resetSelection(): void; + setAriaOption(options?: { + activeDescendant: string; + role: string; + setLabel: any; + }): void; + } + type CompleterCallback = (error: any, completions: Completion[]) => void; + interface Completer { + identifierRegexps?: Array; + getCompletions(editor: Editor, session: EditSession, position: Point, prefix: string, callback: CompleterCallback): void; + getDocTooltip?(item: Completion): void | string | Completion; + onSeen?: (editor: Ace.Editor, completion: Completion) => void; + onInsert?: (editor: Ace.Editor, completion: Completion) => void; + cancel?(): void; + id?: string; + triggerCharacters?: string[]; + hideInlinePreview?: boolean; + } + interface CompletionOptions { + matches?: Completion[]; + } + type CompletionProviderOptions = { + exactMatch?: boolean; + ignoreCaption?: boolean; + }; + type GatherCompletionRecord = { + prefix: string; + matches: Completion[]; + finished: boolean; + }; + type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; + type CompletionProviderCallback = (this: import("ace-code/src/autocomplete").Autocomplete, err: Error | undefined, completions: import("ace-code/src/autocomplete").FilteredList, finished: boolean) => void; + type AcePopupNavigation = "up" | "down" | "start" | "end"; + interface EditorMultiSelectProperties { + inMultiSelectMode?: boolean; + /** + * Updates the cursor and marker layers. + **/ + updateSelectionMarkers: () => void; + /** + * Adds the selection and cursor. + * @param orientedRange A range containing a cursor + **/ + addSelectionMarker: (orientedRange: Ace.Range & { + marker?: any; + }) => Ace.Range & { + marker?: any; + }; + /** + * Removes the selection marker. + * @param range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. + **/ + removeSelectionMarker: (range: Ace.Range & { + marker?: any; + }) => void; + removeSelectionMarkers: (ranges: (Ace.Range & { + marker?: any; + })[]) => void; + /** + * Executes a command for each selection range. + * @param cmd The command to execute + * @param [args] Any arguments for the command + **/ + forEachSelection: (cmd: Object, args?: string, options?: Object) => void; + /** + * Removes all the selections except the last added one. + **/ + exitMultiSelectMode: () => void; + getSelectedText: () => string; + /** + * Finds and selects all the occurrences of `needle`. + * @param needle The text to find + * @param options The search options + * @param additive keeps + * @returns {Number} The cumulative count of all found matches + **/ + findAll: (needle?: string, options?: Partial, additive?: boolean) => number; + /** + * Adds a cursor above or below the active cursor. + * @param dir The direction of lines to select: -1 for up, 1 for down + * @param [skip] If `true`, removes the active selection range + */ + selectMoreLines: (dir: number, skip?: boolean) => void; + /** + * Transposes the selected ranges. + * @param {Number} dir The direction to rotate selections + **/ + transposeSelections: (dir: number) => void; + /** + * Finds the next occurrence of text in an active selection and adds it to the selections. + * @param {Number} dir The direction of lines to select: -1 for up, 1 for down + * @param {Boolean} [skip] If `true`, removes the active selection range + * @param {Boolean} [stopAtFirst] + **/ + selectMore: (dir: number, skip?: boolean, stopAtFirst?: boolean) => void; + /** + * Aligns the cursors or selected text. + **/ + alignCursors: () => void; + multiSelect?: any; + } + interface CodeLenseEditorExtension { + codeLensProviders?: any[]; + } + interface ElasticTabstopsEditorExtension { + elasticTabstops?: import("ace-code/src/ext/elastic_tabstops_lite").ElasticTabstopsLite; + } + interface TextareaEditorExtension { + setDisplaySettings?: (settings: any) => void; + } + interface PromptEditorExtension { + cmdLine?: Editor; + } + interface OptionsEditorExtension { + } + interface MultiSelectProperties { + ranges: Ace.Range[] | null; + rangeList: Ace.RangeList | null; + /** + * Adds a range to a selection by entering multiselect mode, if necessary. + * @param {Ace.Range} range The new range to add + * @param {Boolean} [$blockChangeEvents] Whether or not to block changing events + **/ + addRange(range: Ace.Range, $blockChangeEvents?: boolean): any; + inMultiSelectMode: boolean; + /** + * @param {Ace.Range} [range] + **/ + toSingleRange(range?: Ace.Range): void; + /** + * Removes a Range containing pos (if it exists). + * @param {Ace.Point} pos The position to remove, as a `{row, column}` object + **/ + substractPoint(pos: Ace.Point): any; + /** + * Merges overlapping ranges ensuring consistency after changes + **/ + mergeOverlappingRanges(): void; + rangeCount: number; + /** + * Returns a concatenation of all the ranges. + * @returns {Ace.Range[]} + **/ + getAllRanges(): Ace.Range[]; + /** + * Splits all the ranges into lines. + **/ + splitIntoLines(): void; + /** + */ + joinSelections(): void; + /** + **/ + toggleBlockSelection(): void; + /** + * + * Gets list of ranges composing rectangular block on the screen + * + * @param {Ace.ScreenCoordinates} screenCursor The cursor to use + * @param {Ace.ScreenCoordinates} screenAnchor The anchor to use + * @param {Boolean} [includeEmptyLines] If true, this includes ranges inside the block which are empty due to clipping + * @returns {Ace.Range[]} + **/ + rectangularRangeBlock(screenCursor: Ace.ScreenCoordinates, screenAnchor: Ace.ScreenCoordinates, includeEmptyLines?: boolean): Ace.Range[]; + index?: number; + } + type AcePopupEventsCombined = Ace.EditorEvents & Ace.AcePopupEvents; + type AcePopupWithEditor = Ace.EventEmitter & Ace.Editor; + type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; + type TooltipCommandFunction = (editor: Ace.Editor) => T; + export interface TooltipCommand extends Ace.Command { + enabled: TooltipCommandFunction | boolean; + getValue?: TooltipCommandFunction; + type: "button" | "text" | "checkbox"; + iconCssClass?: string; + cssClass?: string; + } + export type CommandBarTooltip = import("ace-code/src/ext/command_bar").CommandBarTooltip; + export type TokenizeResult = Array>; + } + export const config: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): import("ace-code/src/lib/app_config").AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K_1, callback: any, capturing?: boolean): any; + addEventListener(name: K_2, callback: any, capturing?: boolean): any; + off(name: K_3, callback: any): void; + removeListener(name: K_4, callback: any): void; + removeEventListener(name: K_5, callback: any): void; + removeAllListeners(name?: string): void; + get: (key: string) => any; + set: (key: string, value: any) => void; + all: () => { + [key: string]: any; + }; + moduleUrl: (name: string, component?: string) => string; + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.32.9"; + }; + export function edit(el: string | (HTMLElement & { + env?: any; + value?: any; + }), options?: any): Editor; + export function createEditSession(text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode): EditSession; + import Editor_5 = require("ace-code/src/editor"); + import Editor = Editor_5.Editor; + import EditSession_3 = require("ace-code/src/edit_session"); + import EditSession = EditSession_3.EditSession; + import Range_14 = require("ace-code/src/range"); + import Range = Range_14.Range; + import UndoManager_2 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_2.UndoManager; + import Renderer_1 = require("ace-code/src/virtual_renderer"); + import Renderer = Renderer_1.VirtualRenderer; + export var version: "1.32.9"; + export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; +} +declare module "ace-code/src/commands/occur_commands" { + export namespace occurStartCommand { + let name: string; + function exec(editor: any, options: any): void; + let readOnly: boolean; + } +} +declare module "ace-code/src/commands/incremental_search_commands" { + export const iSearchStartCommands: ({ + name: string; + bindKey: { + win: string; + mac: string; + }; + exec: (editor: any, options: any) => void; + readOnly: boolean; + } | { + name: string; + exec: (editor: any, jumpToNext: any) => void; + readOnly: boolean; + bindKey?: undefined; + })[]; + export const iSearchCommands: ({ + name: string; + bindKey: { + win: string; + mac: string; + }; + exec: (iSearch: any, options: any) => void; + } | { + name: string; + exec: (iSearch: any, string: any) => void; + bindKey?: undefined; + } | { + name: string; + bindKey: string; + exec: (iSearch: any) => void; + })[]; + export function IncrementalSearchKeyboardHandler(iSearch: any): void; + export class IncrementalSearchKeyboardHandler { + constructor(iSearch: any); + } +} +declare module "ace-code/src/incremental_search" { + /** + * Implements immediate searching while the user is typing. When incremental + * search is activated, keystrokes into the editor will be used for composing + * a search term. Immediately after every keystroke the search is updated: + * - so-far-matching characters are highlighted + * - the cursor is moved to the next match + * + **/ + export class IncrementalSearch extends Search { + /** + * @param {boolean} backwards + */ + activate(editor: any, backwards: boolean): void; + /** + * @param {boolean} [reset] + */ + deactivate(reset?: boolean): void; + /** + * @param {Editor} editor + */ + selectionFix(editor: Editor): void; + /** + * @param {RegExp} regexp + */ + highlight(regexp: RegExp): void; + /** + * @param {boolean} [reset] + */ + cancelSearch(reset?: boolean): Range; + /** + * @param {boolean} moveToNext + * @param {Function} needleUpdateFunc + */ + highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; + /** + * @param {string} s + */ + addString(s: string): false | Range; + /** + * @param {any} c + */ + removeChar(c: any): false | Range; + next(options: any): false | Range; + onMouseDown(evt: any): boolean; + /** + * @param {string} text + */ + onPaste(text: string): void; + convertNeedleToRegExp(): false | Range; + convertNeedleToString(): false | Range; + statusMessage(found: any): void; + message(msg: any): void; + } + import Search_3 = require("ace-code/src/search"); + import Search = Search_3.Search; + import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); + import Editor_6 = require("ace-code/src/editor"); + import Editor = Editor_6.Editor; + import Range_15 = require("ace-code/src/range"); + import Range = Range_15.Range; +} +declare module "ace-code/src/split" { + export type ISplit = import("ace-code").Ace.EventEmitter & { + [key: string]: any; + }; + /** + * @typedef {import("ace-code").Ace.EventEmitter & {[key: string]: any}} ISplit + */ + export var Split: any; +} +declare module "ace-code/src/tokenizer_dev" { + export class Tokenizer extends BaseTokenizer { + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @returns {Object} + **/ + getLineTokens(line: any, startState: any): any; + } + import BaseTokenizer_1 = require("ace-code/src/tokenizer"); + import BaseTokenizer = BaseTokenizer_1.Tokenizer; +} +declare module "ace-code/src/unicode" { + export const wordChars: any; +} +declare module "ace-code/src/ext/beautify" { + export const singletonTags: string[]; + export const blockTags: string[]; + export const formatOptions: { + lineBreaksAfterCommasInCurlyBlock?: boolean; + }; + export function beautify(session: import("ace-code/src/edit_session").EditSession): void; + export const commands: { + name: string; + description: string; + exec: (editor: any) => void; + bindKey: string; + }[]; +} +declare module "ace-code/src/ext/code_lens" { + export function setLenses(session: EditSession, lenses: any): number; + export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; + export function clear(session: EditSession): void; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { + }; +} +declare module "ace-code/src/ext/emmet" { + export const commands: HashHandler; + export function runEmmetCommand(editor: Editor): number | boolean; + export function updateCommands(editor: Editor, enabled?: boolean): void; + export function isSupportedMode(mode: any): boolean; + export function isAvailable(editor: Editor, command: string): boolean; + export function load(cb: any): boolean; + export function setCore(e: any): void; + import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_5.HashHandler; + import Editor_7 = require("ace-code/src/editor"); + import Editor = Editor_7.Editor; + /** + * Implementation of {@link IEmmetEditor} interface for Ace + */ + export class AceEmmetEditor { + /** + * @param {Editor} editor + */ + setupContext(editor: Editor): void; + ace: Editor; + indentation: string; + /** + * Returns character indexes of selected text: object with start + * and end properties. If there's no selection, should return + * object with start and end properties referring + * to current caret position + * @return {Object} + * @example + * var selection = editor.getSelectionRange(); + * alert(selection.start + ', ' + selection.end); + */ + getSelectionRange(): any; + /** + * Creates selection from start to end character + * indexes. If end is ommited, this method should place caret + * and start index + * @param {Number} start + * @param {Number} [end] + * @example + * editor.createSelection(10, 40); + * + * //move caret to 15th character + * editor.createSelection(15); + */ + createSelection(start: number, end?: number): void; + /** + * Returns current line's start and end indexes as object with start + * and end properties + * @return {Object} + * @example + * var range = editor.getCurrentLineRange(); + * alert(range.start + ', ' + range.end); + */ + getCurrentLineRange(): any; + /** + * Returns current caret position + * @return {Number|null} + */ + getCaretPos(): number | null; + /** + * Set new caret position + * @param {Number} index Caret position + */ + setCaretPos(index: number): void; + /** + * Returns content of current line + * @return {String} + */ + getCurrentLine(): string; + /** + * Replace editor's content or it's part (from start to + * end index). If value contains + * caret_placeholder, the editor will put caret into + * this position. If you skip start and end + * arguments, the whole target's content will be replaced with + * value. + * + * If you pass start argument only, + * the value will be placed at start string + * index of current content. + * + * If you pass start and end arguments, + * the corresponding substring of current target's content will be + * replaced with value. + * @param {String} value Content you want to paste + * @param {Number} [start] Start index of editor's content + * @param {Number} [end] End index of editor's content + * @param {Boolean} [noIndent] Do not auto indent value + */ + replaceContent(value: string, start?: number, end?: number, noIndent?: boolean): void; + /** + * Returns editor's content + * @return {String} + */ + getContent(): string; + /** + * Returns current editor's syntax mode + * @return {String} + */ + getSyntax(): string; + /** + * Returns current output profile name (@see emmet#setupProfile) + * @return {String} + */ + getProfileName(): string; + /** + * Ask user to enter something + * @param {String} title Dialog title + * @return {String} Entered data + * @since 0.65 + */ + prompt(title: string): string; + /** + * Returns current selection + * @return {String} + * @since 0.65 + */ + getSelection(): string; + /** + * Returns current editor's file path + * @return {String} + * @since 0.65 + */ + getFilePath(): string; + } +} +declare module "ace-code/src/ext/hardwrap" { + /** + * @param {import("ace-code/src/editor").Editor} editor + * @param {import("ace-code").Ace.HardWrapOptions} options + */ + export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; +} +declare module "ace-code/src/ext/menu_tools/settings_menu.css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/menu_tools/overlay_page" { + export function overlayPage(editor: any, contentElement: HTMLElement, callback?: any): { + close: () => void; + setIgnoreFocusOut: (ignore: boolean) => void; + }; +} +declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { + export function getEditorKeybordShortcuts(editor: import("ace-code/src/editor").Editor): any[]; +} +declare module "ace-code/src/ext/keybinding_menu" { + export function init(editor: Editor): void; + import Editor_8 = require("ace-code/src/editor"); + import Editor = Editor_8.Editor; +} +declare module "ace-code/src/ext/linking" { } +declare module "ace-code/src/ext/modelist" { + /** + * Suggests a mode based on the file extension present in the given path + * @param {string} path The path to the file + * @returns {Mode} Returns an object containing information about the + * suggested mode. + */ + export function getModeForPath(path: string): Mode; + export var modes: any[]; + export var modesByName: {}; + class Mode { + /** + * @param {string} name + * @param {string} caption + * @param {string} extensions + */ + constructor(name: string, caption: string, extensions: string); + name: string; + caption: string; + mode: string; + extensions: string; + extRe: RegExp; + /** + * @param {string} filename + */ + supportsFile(filename: string): RegExpMatchArray; + } + export {}; +} +declare module "ace-code/src/ext/themelist" { + export const themesByName: {}; + export const themes: { + caption: string; + theme: string; + isDark: boolean; + name: string; + }[]; +} +declare module "ace-code/src/ext/options" { + const OptionPanel_base: undefined; + export class OptionPanel { + /** + * + * @param {Editor} editor + * @param {HTMLElement} [element] + */ + constructor(editor: Editor, element?: HTMLElement); + editor: import("ace-code/src/editor").Editor; + container: HTMLElement; + groups: any[]; + options: {}; + add(config: any): void; + render(): void; + renderOptionGroup(group: any): any[]; + /** + * @param {string} key + * @param {Object} option + */ + renderOptionControl(key: string, option: any): any; + /** + * + * @param key + * @param option + */ + renderOption(key: any, option: any): (string | any[] | { + class: string; + })[]; + /** + * @param {string | number | Object} option + * @param {string | number | boolean} value + */ + setOption(option: string | number | any, value: string | number | boolean): void; + getOption(option: any): any; + } + export type Editor = import("ace-code/src/editor").Editor; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + export interface OptionPanel extends Ace.EventEmitter { + } +} +declare module "ace-code/src/ext/prompt" { + export type PromptOptions = { + /** + * Prompt name. + */ + name: string; + /** + * Defines which part of the predefined value should be highlited. + */ + selection: [ + start: number, + end: number + ]; + /** + * Set to true if prompt has description below input box. + */ + hasDescription: boolean; + /** + * Description below input box. + */ + prompt: string; + /** + * Placeholder for value. + */ + placeholder: string; + /** + * Set to true to keep the prompt open when focus moves to another part of the editor. + */ + ignoreFocusOut: boolean; + /** + * Function for defining list of options for value. + */ + getCompletions: Function; + /** + * Function for defining current value prefix. + */ + getPrefix: Function; + /** + * Function called when Enter is pressed. + */ + onAccept: Function; + /** + * Function called when input is added to prompt input box. + */ + onInput: Function; + /** + * Function called when Esc|Shift-Esc is pressed. + */ + onCancel: Function; + /** + * Function for defining history list. + */ + history: Function; + maxHistoryCount: number; + addToHistory: Function; + }; + export type Editor = import("ace-code/src/editor").Editor; + /** + * @typedef PromptOptions + * @property {String} name Prompt name. + * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). + * @property {[start: number, end: number]} selection Defines which part of the predefined value should be highlited. + * @property {Boolean} hasDescription Set to true if prompt has description below input box. + * @property {String} prompt Description below input box. + * @property {String} placeholder Placeholder for value. + * @property {Object} $rules Specific rules for input like password or regexp. + * @property {Boolean} ignoreFocusOut Set to true to keep the prompt open when focus moves to another part of the editor. + * @property {Function} getCompletions Function for defining list of options for value. + * @property {Function} getPrefix Function for defining current value prefix. + * @property {Function} onAccept Function called when Enter is pressed. + * @property {Function} onInput Function called when input is added to prompt input box. + * @property {Function} onCancel Function called when Esc|Shift-Esc is pressed. + * @property {Function} history Function for defining history list. + * @property {number} maxHistoryCount + * @property {Function} addToHistory + */ + /** + * Prompt plugin is used for getting input from user. + * + * @param {Editor} editor Ouside editor related to this prompt. Will be blurred when prompt is open. + * @param {String | Partial} message Predefined value of prompt input box. + * @param {Partial} options Cusomizable options for this prompt. + * @param {Function} [callback] Function called after done. + * */ + export function prompt(editor: Editor, message: string | Partial, options: Partial, callback?: Function): any; + export namespace prompt { + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function gotoLine(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function commands(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function modes(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + } +} +declare module "ace-code/src/ext/rtl" { + export {}; +} +declare module "ace-code/src/ext/settings_menu" { + export function init(): void; +} +declare module "ace-code/src/ext/simple_tokenizer" { + /** + * Parses provided content according to provided highlighting rules and return tokens. + * Tokens either have the className set according to Ace themes or have no className if they are just pure text tokens. + * Result is a list of list of tokens, where each line from the provided content is a separate list of tokens. + * + * @param {string} content to tokenize + * @param {import("ace-code").Ace.HighlightRules} highlightRules defining the language grammar + * @returns {import("ace-code").Ace.TokenizeResult} tokenization result containing a list of token for each of the lines from content + */ + export function tokenize(content: string, highlightRules: import("ace-code").Ace.HighlightRules): import("ace-code").Ace.TokenizeResult; +} +declare module "ace-code/src/ext/spellcheck" { + export function contextMenuHandler(e: any): void; +} +declare module "ace-code/src/ext/split" { + const _exports: typeof import("ace-code/src/split"); + export = _exports; +} +declare module "ace-code/src/ext/static-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/static_highlight" { + /** + * + * @param {HTMLElement} el + * @param opts + * @param [callback] + * @returns {boolean} + */ + function highlight(el: HTMLElement, opts: any, callback?: any): boolean; + export namespace highlight { + export { render, renderSync, highlight }; + } + /** + * Transforms a given input code snippet into HTML using the given mode + * + * @param {string} input Code snippet + * @param {string|import("ace-code").Ace.SyntaxMode} mode String specifying the mode to load such as + * `ace/mode/javascript` or, a mode loaded from `/ace/mode` + * (use 'ServerSideHiglighter.getMode'). + * @param {string} theme String specifying the theme to load such as + * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. + * @param {number} lineStart A number indicating the first line number. Defaults + * to 1. + * @param {boolean} disableGutter Specifies whether or not to disable the gutter. + * `true` disables the gutter, `false` enables the gutter. Defaults to `false`. + * @param {function} [callback] When specifying the mode or theme as a string, + * this method has no return value and you must specify a callback function. The + * callback will receive the rendered object containing the properties `html` + * and `css`. + * @returns {object} An object containing the properties `html` and `css`. + */ + function render(input: string, mode: string | import("ace-code").Ace.SyntaxMode, theme: string, lineStart: number, disableGutter: boolean, callback?: Function): object; + /** + * Transforms a given input code snippet into HTML using the given mode + * @param {string} input Code snippet + * @param {import("ace-code").Ace.SyntaxMode|string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') + * @param {any} theme + * @param {any} lineStart + * @param {boolean} disableGutter + * @returns {object} An object containing: html, css + */ + function renderSync(input: string, mode: import("ace-code").Ace.SyntaxMode | string, theme: any, lineStart: any, disableGutter: boolean): object; +} +declare module "ace-code/src/ext/statusbar" { + export type Editor = import("ace-code/src/editor").Editor; + /** simple statusbar **/ + export class StatusBar { + /** + * @param {Editor} editor + * @param {HTMLElement} parentNode + */ + constructor(editor: Editor, parentNode: HTMLElement); + element: HTMLDivElement; + /** + * @param {Editor} editor + */ + updateStatus(editor: Editor): void; + } +} +declare module "ace-code/src/ext/textarea" { + const _exports: { + config: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): import("ace-code/src/lib/app_config").AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K_1, callback: any, capturing?: boolean): any; + addEventListener(name: K_2, callback: any, capturing?: boolean): any; + off(name: K_3, callback: any): void; + removeListener(name: K_4, callback: any): void; + removeEventListener(name: K_5, callback: any): void; + removeAllListeners(name?: string): void; + get: (key: string) => any; + set: (key: string, value: any) => void; + all: () => { + [key: string]: any; + }; + moduleUrl: (name: string, component?: string) => string; + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.32.9"; + }; + edit: (el: string | (HTMLElement & { + env?: any; + value?: any; + }), options?: any) => ace.Editor; + createEditSession: (text: string | import("ace-code/src/document").Document, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; + Range: typeof ace.Range; + Editor: typeof ace.Editor; + EditSession: typeof ace.EditSession; + UndoManager: typeof ace.UndoManager; + VirtualRenderer: typeof ace.VirtualRenderer; + version: "1.32.9"; + transformTextarea: (element: any, options: any) => ace.Editor; + defaultOptions: { + mode: string; + theme: string; + wrap: string; + fontSize: string; + showGutter: string; + keybindings: string; + showPrintMargin: string; + useSoftTabs: string; + showInvisibles: string; + }; + }; + export = _exports; + import ace = require("ace-code"); +} +declare module "ace-code/src/ext/whitespace" { + export function $detectIndentation(lines: string[], fallback?: any): { + ch?: string; + length?: number; + }; + export function detectIndentation(session: EditSession): { + ch?: string; + length?: number; + } | {}; + export function trimTrailingSpace(session: EditSession, options: { + trimEmpty?: boolean; + keepCursorPosition?: boolean; + }): void; + export function convertIndentation(session: EditSession, ch: string, len: number): void; + export function $parseStringArg(text: string): {}; + export function $parseArg(arg: any): any; + export const commands: { + name: string; + description: string; + exec: (editor: any, args: any) => void; + }[]; + export type EditSession = import("ace-code/src/edit_session").EditSession; +} +declare module "ace-code/src/keyboard/textarea" { + import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_6.HashHandler; +} +declare function defineProp(obj: any, name: any, val: any): void; +declare function defineProp(obj: any, name: any, val: any): void; +declare module "ace-code/src/lib/fixoldbrowsers" { + export {}; +} +declare module "ace-code/src/snippets/abc.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/abc" { + export const snippetText: string; + export const scope: "abc"; +} +declare module "ace-code/src/snippets/actionscript.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/actionscript" { + export const snippetText: string; + export const scope: "actionscript"; +} +declare module "ace-code/src/snippets/c_cpp.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/c_cpp" { + export const snippetText: string; + export const scope: "c_cpp"; +} +declare module "ace-code/src/snippets/clojure.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/clojure" { + export const snippetText: string; + export const scope: "clojure"; +} +declare module "ace-code/src/snippets/coffee.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/coffee" { + export const snippetText: string; + export const scope: "coffee"; +} +declare module "ace-code/src/snippets/csound_document.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/csound_document" { + export const snippetText: string; + export const scope: "csound_document"; +} +declare module "ace-code/src/snippets/csound_orchestra.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/csound_orchestra" { + export const snippetText: string; + export const scope: "csound_orchestra"; +} +declare module "ace-code/src/snippets/css.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/css" { + export const snippetText: string; + export const scope: "css"; +} +declare module "ace-code/src/snippets/dart.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/dart" { + export const snippetText: string; + export const scope: "dart"; +} +declare module "ace-code/src/snippets/diff.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/diff" { + export const snippetText: string; + export const scope: "diff"; +} +declare module "ace-code/src/snippets/django.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/django" { + export const snippetText: string; + export const scope: "django"; +} +declare module "ace-code/src/snippets/drools.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/drools" { + export const snippetText: string; + export const scope: "drools"; +} +declare module "ace-code/src/snippets/edifact.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/edifact" { + export const snippetText: string; + export const scope: "edifact"; +} +declare module "ace-code/src/snippets/erlang.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/erlang" { + export const snippetText: string; + export const scope: "erlang"; +} +declare module "ace-code/src/snippets/fsl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/fsl" { + export const snippetText: string; + export const scope: "fsl"; +} +declare module "ace-code/src/snippets/gobstones.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/gobstones" { + export const snippetText: string; + export const scope: "gobstones"; +} +declare module "ace-code/src/snippets/graphqlschema.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/graphqlschema" { + export const snippetText: string; + export const scope: "graphqlschema"; +} +declare module "ace-code/src/snippets/haml.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/haml" { + export const snippetText: string; + export const scope: "haml"; +} +declare module "ace-code/src/snippets/haskell.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/haskell" { + export const snippetText: string; + export const scope: "haskell"; +} +declare module "ace-code/src/snippets/html.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/html" { + export const snippetText: string; + export const scope: "html"; +} +declare module "ace-code/src/snippets/io" { + export const snippets: ({ + content: string; + name: string; + scope: string; + tabTrigger: string; + keyEquivalent?: undefined; + } | { + content: string; + keyEquivalent: string; + name: string; + scope: string; + tabTrigger: string; + } | { + content: string; + keyEquivalent: string; + name: string; + scope: string; + tabTrigger?: undefined; + })[]; + export const scope: "io"; +} +declare module "ace-code/src/snippets/java.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/java" { + export const snippetText: string; + export const scope: "java"; +} +declare module "ace-code/src/snippets/javascript.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/javascript" { + export const snippetText: string; + export const scope: "javascript"; +} +declare module "ace-code/src/snippets/jsp.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/jsp" { + export const snippetText: string; + export const scope: "jsp"; +} +declare module "ace-code/src/snippets/liquid.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/liquid" { + export const snippetText: string; + export const scope: "liquid"; +} +declare module "ace-code/src/snippets/lsl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/lsl" { + export const snippetText: string; + export const scope: "lsl"; +} +declare module "ace-code/src/snippets/lua.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/lua" { + export const snippetText: string; + export const scope: "lua"; +} +declare module "ace-code/src/snippets/makefile.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/makefile" { + export const snippetText: string; + export const scope: "makefile"; +} +declare module "ace-code/src/snippets/markdown.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/markdown" { + export const snippetText: string; + export const scope: "markdown"; +} +declare module "ace-code/src/snippets/maze.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/maze" { + export const snippetText: string; + export const scope: "maze"; +} +declare module "ace-code/src/snippets/perl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/perl" { + export const snippetText: string; + export const scope: "perl"; +} +declare module "ace-code/src/snippets/php.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/php" { + export const snippetText: string; + export const scope: "php"; +} +declare module "ace-code/src/snippets/python.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/python" { + export const snippetText: string; + export const scope: "python"; +} +declare module "ace-code/src/snippets/r.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/r" { + export const snippetText: string; + export const scope: "r"; +} +declare module "ace-code/src/snippets/razor.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/razor" { + export const snippetText: string; + export const scope: "razor"; +} +declare module "ace-code/src/snippets/robot.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/robot" { + export const snippetText: string; + export const scope: "robot"; +} +declare module "ace-code/src/snippets/rst.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/rst" { + export const snippetText: string; + export const scope: "rst"; +} +declare module "ace-code/src/snippets/ruby.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/ruby" { + export const snippetText: string; + export const scope: "ruby"; +} +declare module "ace-code/src/snippets/sh.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sh" { + export const snippetText: string; + export const scope: "sh"; +} +declare module "ace-code/src/snippets/snippets.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/snippets" { + export const snippetText: string; + export const scope: "snippets"; +} +declare module "ace-code/src/snippets/sql.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sql" { + export const snippetText: string; + export const scope: "sql"; +} +declare module "ace-code/src/snippets/sqlserver.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sqlserver" { + export const snippetText: string; + export const scope: "sqlserver"; +} +declare module "ace-code/src/snippets/tcl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/tcl" { + export const snippetText: string; + export const scope: "tcl"; +} +declare module "ace-code/src/snippets/tex.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/tex" { + export const snippetText: string; + export const scope: "tex"; +} +declare module "ace-code/src/snippets/textile.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/textile" { + export const snippetText: string; + export const scope: "textile"; +} +declare module "ace-code/src/snippets/vala" { + export const snippets: { + content: string; + name: string; + scope: string; + tabTrigger: string; + }[]; + export const scope: ""; +} +declare module "ace-code/src/snippets/velocity.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/velocity" { + export const snippetText: string; + export const scope: "velocity"; + export const includeScopes: string[]; +} +declare module "ace-code/src/snippets/wollok.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/wollok" { + export const snippetText: string; + export const scope: "wollok"; +} +declare module "ace-code/src/theme/ambiance-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/ambiance" { + export const isDark: true; + export const cssClass: "ace-ambiance"; + export const cssText: string; +} +declare module "ace-code/src/theme/chaos-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/chaos" { + export const isDark: true; + export const cssClass: "ace-chaos"; + export const cssText: string; +} +declare module "ace-code/src/theme/chrome-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/chrome" { + export const isDark: false; + export const cssClass: "ace-chrome"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_day-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_day" { + export const isDark: false; + export const cssClass: "ace-cloud9-day"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_night-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_night" { + export const isDark: true; + export const cssClass: "ace-cloud9-night"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_night_low_color-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_night_low_color" { + export const isDark: true; + export const cssClass: "ace-cloud9-night-low-color"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud_editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud_editor" { + export const isDark: false; + export const cssClass: "ace-cloud_editor"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud_editor_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud_editor_dark" { + export const isDark: true; + export const cssClass: "ace-cloud_editor_dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/clouds-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/clouds" { + export const isDark: false; + export const cssClass: "ace-clouds"; + export const cssText: string; +} +declare module "ace-code/src/theme/clouds_midnight-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/clouds_midnight" { + export const isDark: true; + export const cssClass: "ace-clouds-midnight"; + export const cssText: string; +} +declare module "ace-code/src/theme/cobalt-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cobalt" { + export const isDark: true; + export const cssClass: "ace-cobalt"; + export const cssText: string; +} +declare module "ace-code/src/theme/crimson_editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/crimson_editor" { + export const isDark: false; + export const cssText: string; + export const cssClass: "ace-crimson-editor"; +} +declare module "ace-code/src/theme/dawn-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dawn" { + export const isDark: false; + export const cssClass: "ace-dawn"; + export const cssText: string; +} +declare module "ace-code/src/theme/dracula-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dracula" { + export const isDark: true; + export const cssClass: "ace-dracula"; + export const cssText: string; +} +declare module "ace-code/src/theme/dreamweaver-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dreamweaver" { + export const isDark: false; + export const cssClass: "ace-dreamweaver"; + export const cssText: string; +} +declare module "ace-code/src/theme/eclipse-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/eclipse" { + export const isDark: false; + export const cssText: string; + export const cssClass: "ace-eclipse"; +} +declare module "ace-code/src/theme/github-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/github" { + export const isDark: false; + export const cssClass: "ace-github"; + export const cssText: string; +} +declare module "ace-code/src/theme/github_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/github_dark" { + export const isDark: true; + export const cssClass: "ace-github-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/gob-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gob" { + export const isDark: true; + export const cssClass: "ace-gob"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox" { + export const isDark: true; + export const cssClass: "ace-gruvbox"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox_dark_hard-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox_dark_hard" { + export const isDark: true; + export const cssClass: "ace-gruvbox-dark-hard"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox_light_hard-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox_light_hard" { + export const isDark: false; + export const cssClass: "ace-gruvbox-light-hard"; + export const cssText: string; +} +declare module "ace-code/src/theme/idle_fingers-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/idle_fingers" { + export const isDark: true; + export const cssClass: "ace-idle-fingers"; + export const cssText: string; +} +declare module "ace-code/src/theme/iplastic-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/iplastic" { + export const isDark: false; + export const cssClass: "ace-iplastic"; + export const cssText: string; +} +declare module "ace-code/src/theme/katzenmilch-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/katzenmilch" { + export const isDark: false; + export const cssClass: "ace-katzenmilch"; + export const cssText: string; +} +declare module "ace-code/src/theme/kr_theme-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/kr_theme" { + export const isDark: true; + export const cssClass: "ace-kr-theme"; + export const cssText: string; +} +declare module "ace-code/src/theme/kuroir-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/kuroir" { + export const isDark: false; + export const cssClass: "ace-kuroir"; + export const cssText: string; +} +declare module "ace-code/src/theme/merbivore-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/merbivore" { + export const isDark: true; + export const cssClass: "ace-merbivore"; + export const cssText: string; +} +declare module "ace-code/src/theme/merbivore_soft-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/merbivore_soft" { + export const isDark: true; + export const cssClass: "ace-merbivore-soft"; + export const cssText: string; +} +declare module "ace-code/src/theme/mono_industrial-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/mono_industrial" { + export const isDark: true; + export const cssClass: "ace-mono-industrial"; + export const cssText: string; +} +declare module "ace-code/src/theme/monokai-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/monokai" { + export const isDark: true; + export const cssClass: "ace-monokai"; + export const cssText: string; +} +declare module "ace-code/src/theme/nord_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/nord_dark" { + export const isDark: true; + export const cssClass: "ace-nord-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/one_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/one_dark" { + export const isDark: true; + export const cssClass: "ace-one-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/pastel_on_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/pastel_on_dark" { + export const isDark: true; + export const cssClass: "ace-pastel-on-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/solarized_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/solarized_dark" { + export const isDark: true; + export const cssClass: "ace-solarized-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/solarized_light-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/solarized_light" { + export const isDark: false; + export const cssClass: "ace-solarized-light"; + export const cssText: string; +} +declare module "ace-code/src/theme/sqlserver-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/sqlserver" { + export const isDark: false; + export const cssClass: "ace-sqlserver"; + export const cssText: string; +} +declare module "ace-code/src/theme/terminal-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/terminal" { + export const isDark: true; + export const cssClass: "ace-terminal-theme"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow" { + export const isDark: false; + export const cssClass: "ace-tomorrow"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_blue-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_blue" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-blue"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_bright-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_bright" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-bright"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_eighties-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_eighties" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-eighties"; + export const cssText: string; +} +declare module "ace-code/src/theme/twilight-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/twilight" { + export const isDark: true; + export const cssClass: "ace-twilight"; + export const cssText: string; +} +declare module "ace-code/src/theme/vibrant_ink-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/vibrant_ink" { + export const isDark: true; + export const cssClass: "ace-vibrant-ink"; + export const cssText: string; +} +declare module "ace-code/src/theme/xcode-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/xcode" { + export const isDark: false; + export const cssClass: "ace-xcode"; + export const cssText: string; } diff --git a/package.json b/package.json index 7bb594f8de4..01c8a175e51 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint": "eslint \"src/**/*.js\"", "fix": "eslint --fix \"src/**/*.js\"", "typecheck": "tsc -p tsconfig.json", - "update-types": "node ./tool/modes-declaration-generator.js", + "update-types": "node ./tool/ace_declaration_generator.js", "changelog": "standard-version", "prepack": "node tool/esm_resolver_generator.js && node tool/ace_declaration_generator.js && node Makefile.dryice.js css --target build-styles && rm -rf styles && mv build-styles/css styles" }, diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 0710619106b..1128f368c3f 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -346,6 +346,9 @@ function cloneAceNamespace(aceNamespacePath) { * @param {string} aceNamespacePath */ function generateDeclaration(aceNamespacePath) { + if (!aceNamespacePath) { + aceNamespacePath = __dirname + "/../ace-internal.d.ts" + } const excludeDir = "src/mode"; //TODO: remove, when modes are ES6 let data = generateInitialDeclaration(excludeDir); @@ -378,7 +381,8 @@ function updateDeclarationModuleNames(content) { if (!module.parent) { - generateDeclaration(__dirname + "/../ace-internal.d.ts"); + require("./modes-declaration-generator"); + generateDeclaration(); } else { exports.generateDeclaration = generateDeclaration; From 65d23ffa58385a9df708b40153bc6d0462917554 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 17 Apr 2024 15:12:25 +0400 Subject: [PATCH 09/33] split modules by different context --- Makefile.dryice.js | 14 +- ace-ext.d.ts | 980 +++ ace-extensions.d.ts | 20 - ace-modes.d.ts | 904 +-- ace-modules.d.ts | 7870 +++++++++++++++++++++++++ ace-snippets.d.ts | 400 ++ ace-theme.d.ts | 423 ++ ace.d.ts | 8520 +-------------------------- package.json | 5 +- tool/ace_declaration_generator.js | 105 +- tool/modes-declaration-generator.js | 3 +- tsconfig.json | 3 +- 12 files changed, 10366 insertions(+), 8881 deletions(-) create mode 100644 ace-ext.d.ts delete mode 100644 ace-extensions.d.ts create mode 100644 ace-modules.d.ts create mode 100644 ace-snippets.d.ts create mode 100644 ace-theme.d.ts diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 8bfab0db1f8..11f0130b6ea 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -35,7 +35,11 @@ var fs = require("fs"); var path = require("path"); var copy = require('architect-build/copy'); var build = require('architect-build/build'); -var {updateDeclarationModuleNames, generateDeclaration} = require('./tool/ace_declaration_generator'); +var { + updateDeclarationModuleNames, + generateDeclaration, + SEPARATE_MODULES +} = require('./tool/ace_declaration_generator'); var ACE_HOME = __dirname; var BUILD_DIR = ACE_HOME + "/build"; @@ -210,6 +214,14 @@ function buildTypes() { fs.copyFileSync(ACE_HOME + '/ace-modes.d.ts', BUILD_DIR + '/ace-modes.d.ts'); correctDeclarationsForBuild(BUILD_DIR + '/ace.d.ts', pathModules); correctDeclarationsForBuild(BUILD_DIR + '/ace-modes.d.ts'); + + let allModules = SEPARATE_MODULES; + allModules.push("modules"); // core modules + allModules.forEach(function (key) { + let fileName = '/ace-' + key + '.d.ts'; + fs.copyFileSync(ACE_HOME + fileName, BUILD_DIR + fileName); + correctDeclarationsForBuild(BUILD_DIR + fileName); + }); var esmUrls = []; diff --git a/ace-ext.d.ts b/ace-ext.d.ts new file mode 100644 index 00000000000..65552aeff27 --- /dev/null +++ b/ace-ext.d.ts @@ -0,0 +1,980 @@ +declare module "ace-code/src/ext/command_bar" { + const CommandBarTooltip_base: undefined; + + /** + * Displays a command tooltip above the currently active line selection, with clickable elements. + * + * Internally it is a composite of two tooltips, one for the main tooltip and one for the + * overflowing commands. + * The commands are added sequentially in registration order. + * When attached to an editor, it is either always shown or only when the active line is hovered + * with mouse, depending on the alwaysShow property. + */ + export class CommandBarTooltip { + /** + * @param {HTMLElement} parentNode + * @param {Partial} [options] + */ + constructor(parentNode: HTMLElement, options?: Partial); + + parentNode: HTMLElement; + tooltip: Tooltip; + moreOptions: Tooltip; + maxElementsOnTooltip: number; + eventListeners: {}; + elements: {}; + commands: {}; + tooltipEl: any[] | HTMLElement | Text; + moreOptionsEl: any[] | HTMLElement | Text; + + /** + * Registers a command on the command bar tooltip. + * + * The commands are added in sequential order. If there is not enough space on the main + * toolbar, the remaining elements are added to the overflow menu. + * + * @param {string} id + * @param {TooltipCommand} command + */ + registerCommand(id: string, command: TooltipCommand): void; + + isShown(): boolean; + + isMoreOptionsShown(): boolean; + + getAlwaysShow(): boolean; + + /** + * Sets the display mode of the tooltip + * + * When true, the tooltip is always displayed while it is attached to an editor. + * When false, the tooltip is displayed only when the mouse hovers over the active editor line. + * + * @param {boolean} alwaysShow + */ + setAlwaysShow(alwaysShow: boolean): void; + + /** + * Attaches the clickable command bar tooltip to an editor + * + * Depending on the alwaysShow parameter it either displays the tooltip immediately, + * or subscribes to the necessary events to display the tooltip on hover. + * + * @param {Editor} editor + */ + attach(editor: Editor): void; + + editor: import("ace-code/src/editor").Editor; + + /** + * Updates the position of the command bar tooltip. It aligns itself above the active line in the editor. + */ + updatePosition(): void; + + /** + * Updates each command element in the tooltip. + * + * This is automatically called on certain events, but can be called manually as well. + */ + update(): void; + + /** + * Detaches the tooltip from the editor. + */ + detach(): void; + + destroy(): void; + } + + export type Editor = import("ace-code/src/editor").Editor; + export type TooltipCommand = import("ace-code").Ace.TooltipCommand; + import Tooltip_2 = require("ace-code/src/tooltip"); + import Tooltip = Tooltip_2.Tooltip; + export var TOOLTIP_CLASS_NAME: string; + export var BUTTON_CLASS_NAME: string; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface CommandBarTooltip extends Ace.EventEmitter { + } +} +declare module "ace-code/src/ext/language_tools" { + export function setCompleters(val: any): void; + + export function addCompleter(completer: any): void; + + import textCompleter = require("ace-code/src/autocomplete/text_completer"); + /**@type {import("ace-code").Ace.Completer}*/ + export var keyWordCompleter: import("ace-code").Ace.Completer; + /**@type {import("ace-code").Ace.Completer} */ + export var snippetCompleter: import("ace-code").Ace.Completer; + export {textCompleter}; +} +declare module "ace-code/src/ext/inline_autocomplete" { + /** + * This class controls the inline-only autocompletion components and their lifecycle. + * This is more lightweight than the popup-based autocompletion, as it can only work with exact prefix matches. + * There is an inline ghost text renderer and an optional command bar tooltip inside. + */ + export class InlineAutocomplete { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + + editor: Editor; + keyboardHandler: HashHandler; + + blurListener(e: any): void; + + changeListener(e: any): void; + + changeTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; + isPending(): any; + }; + + /** + * + * @return {AceInline} + */ + getInlineRenderer(): AceInline; + + inlineRenderer: AceInline; + + /** + * @return {CommandBarTooltip} + */ + getInlineTooltip(): CommandBarTooltip; + + inlineTooltip: CommandBarTooltip; + + /** + * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; + * @param {import("ace-code").Ace.CompletionOptions} options + */ + show(options: import("ace-code").Ace.CompletionOptions): void; + + activated: boolean; + + insertMatch(): boolean; + + /** + * @param {import("ace-code").Ace.InlineAutocompleteAction} where + */ + goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; + + getLength(): any; + + /** + * @param {number} [index] + * @returns {import("ace-code").Ace.Completion | undefined} + */ + getData(index?: number): import("ace-code").Ace.Completion | undefined; + + getIndex(): number; + + isOpen(): boolean; + + /** + * @param {number} value + */ + setIndex(value: number): void; + + /** + * @return {CompletionProvider} + */ + getCompletionProvider(initialPosition: any): CompletionProvider; + + completionProvider: CompletionProvider; + + /** + * @param {import("ace-code").Ace.CompletionOptions} [options] + */ + updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; + + base: import("ace-code/src/anchor").Anchor; + completions: FilteredList; + + detach(): void; + + destroy(): void; + + updateDocTooltip(): void; + + /** + * + * @type {{[key: string]: import("ace-code").Ace.Command}} + */ + commands: { + [key: string]: import("ace-code").Ace.Command; + }; + } + + export namespace InlineAutocomplete { + function _for(editor: any): any; + + export {_for as for}; + export namespace startCommand { + let name: string; + + function exec(editor: any, options: any): void; + + export namespace bindKey { + let win: string; + let mac: string; + } + } + + /** + * Factory method to create a command bar tooltip for inline autocomplete. + * + * @param {HTMLElement} parentEl The parent element where the tooltip HTML elements will be added. + * @returns {CommandBarTooltip} The command bar tooltip for inline autocomplete + */ + export function createInlineTooltip(parentEl: HTMLElement): CommandBarTooltip; + } + import Editor_2 = require("ace-code/src/editor"); + import Editor = Editor_2.Editor; + import HashHandler_2 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_2.HashHandler; + import AceInline_2 = require("ace-code/src/autocomplete/inline"); + import AceInline = AceInline_2.AceInline; + import CommandBarTooltip_1 = require("ace-code/src/ext/command_bar"); + import CommandBarTooltip = CommandBarTooltip_1.CommandBarTooltip; + import CompletionProvider_1 = require("ace-code/src/autocomplete"); + import CompletionProvider = CompletionProvider_1.CompletionProvider; + import FilteredList_1 = require("ace-code/src/autocomplete"); + import FilteredList = FilteredList_1.FilteredList; +} +declare module "ace-code/src/ext/searchbox-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/searchbox" { + export function Search(editor: Editor, isReplace?: boolean): void; + + export type Editor = import("ace-code/src/editor").Editor; + + export class SearchBox { + /** + * @param {Editor} editor + * @param {undefined} [range] + * @param {undefined} [showReplaceForm] + */ + constructor(editor: Editor, range?: undefined, showReplaceForm?: undefined); + + /**@type {any}*/ + activeInput: any; + /**@type {any}*/ + element: any; + + setSession(e: any): void; + + /** + * @param {Editor} editor + */ + setEditor(editor: Editor): void; + + /**@type {Editor}*/ + editor: Editor; + searchRange: any; + /**@type {HTMLElement}*/ + searchBox: HTMLElement; + /**@type {HTMLElement}*/ + replaceBox: HTMLElement; + /**@type {HTMLInputElement}*/ + searchOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + replaceOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + regExpOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + caseSensitiveOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + wholeWordOption: HTMLInputElement; + /**@type {HTMLInputElement}*/ + searchInput: HTMLInputElement; + /**@type {HTMLInputElement}*/ + replaceInput: HTMLInputElement; + /**@type {HTMLElement}*/ + searchCounter: HTMLElement; + + setSearchRange(range: any): void; + + searchRangeMarker: number; + + /** + * @param {RegExp} [re] + */ + highlight(re?: RegExp): void; + + /** + * @param {boolean} skipCurrent + * @param {boolean} backwards + * @param {any} [preventScroll] + */ + find(skipCurrent: boolean, backwards: boolean, preventScroll?: any): void; + + updateCounter(): void; + + findNext(): void; + + findPrev(): void; + + findAll(): void; + + replace(): void; + + replaceAndFindNext(): void; + + replaceAll(): void; + + hide(): void; + + active: boolean; + + /** + * @param {string} value + * @param {boolean} [isReplace] + */ + show(value: string, isReplace?: boolean): void; + + isFocused(): boolean; + } + + import HashHandler_3 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_3.HashHandler; +} +declare module "ace-code/src/ext/elastic_tabstops_lite" { + export class ElasticTabstopsLite { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + + onAfterExec: () => void; + onExec: () => void; + onChange: (delta: any) => void; + + /** + * @param {number[]} rows + */ + processRows(rows: number[]): void; + } + + import Editor_3 = require("ace-code/src/editor"); + import Editor = Editor_3.Editor; +} +declare module "ace-code/src/ext/error_marker" { + export function showErrorMarker(editor: import("ace-code/src/editor").Editor, dir: number): void; +} +declare module "ace-code/src/ext/beautify" { + export const singletonTags: string[]; + export const blockTags: string[]; + export const formatOptions: { + lineBreaksAfterCommasInCurlyBlock?: boolean; + }; + + export function beautify(session: import("ace-code/src/edit_session").EditSession): void; + + export const commands: { + name: string; + description: string; + exec: (editor: any) => void; + bindKey: string; + }[]; +} +declare module "ace-code/src/ext/code_lens" { + export function setLenses(session: EditSession, lenses: any): number; + + export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; + + export function clear(session: EditSession): void; + + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & {}; +} +declare module "ace-code/src/ext/emmet" { + export const commands: HashHandler; + + export function runEmmetCommand(editor: Editor): number | boolean; + + export function updateCommands(editor: Editor, enabled?: boolean): void; + + export function isSupportedMode(mode: any): boolean; + + export function isAvailable(editor: Editor, command: string): boolean; + + export function load(cb: any): boolean; + + export function setCore(e: any): void; + + import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_5.HashHandler; + import Editor_7 = require("ace-code/src/editor"); + import Editor = Editor_7.Editor; + + /** + * Implementation of {@link IEmmetEditor} interface for Ace + */ + export class AceEmmetEditor { + /** + * @param {Editor} editor + */ + setupContext(editor: Editor): void; + + ace: Editor; + indentation: string; + + /** + * Returns character indexes of selected text: object with start + * and end properties. If there's no selection, should return + * object with start and end properties referring + * to current caret position + * @return {Object} + * @example + * var selection = editor.getSelectionRange(); + * alert(selection.start + ', ' + selection.end); + */ + getSelectionRange(): any; + + /** + * Creates selection from start to end character + * indexes. If end is ommited, this method should place caret + * and start index + * @param {Number} start + * @param {Number} [end] + * @example + * editor.createSelection(10, 40); + * + * //move caret to 15th character + * editor.createSelection(15); + */ + createSelection(start: number, end?: number): void; + + /** + * Returns current line's start and end indexes as object with start + * and end properties + * @return {Object} + * @example + * var range = editor.getCurrentLineRange(); + * alert(range.start + ', ' + range.end); + */ + getCurrentLineRange(): any; + + /** + * Returns current caret position + * @return {Number|null} + */ + getCaretPos(): number | null; + + /** + * Set new caret position + * @param {Number} index Caret position + */ + setCaretPos(index: number): void; + + /** + * Returns content of current line + * @return {String} + */ + getCurrentLine(): string; + + /** + * Replace editor's content or it's part (from start to + * end index). If value contains + * caret_placeholder, the editor will put caret into + * this position. If you skip start and end + * arguments, the whole target's content will be replaced with + * value. + * + * If you pass start argument only, + * the value will be placed at start string + * index of current content. + * + * If you pass start and end arguments, + * the corresponding substring of current target's content will be + * replaced with value. + * @param {String} value Content you want to paste + * @param {Number} [start] Start index of editor's content + * @param {Number} [end] End index of editor's content + * @param {Boolean} [noIndent] Do not auto indent value + */ + replaceContent(value: string, start?: number, end?: number, noIndent?: boolean): void; + + /** + * Returns editor's content + * @return {String} + */ + getContent(): string; + + /** + * Returns current editor's syntax mode + * @return {String} + */ + getSyntax(): string; + + /** + * Returns current output profile name (@see emmet#setupProfile) + * @return {String} + */ + getProfileName(): string; + + /** + * Ask user to enter something + * @param {String} title Dialog title + * @return {String} Entered data + * @since 0.65 + */ + prompt(title: string): string; + + /** + * Returns current selection + * @return {String} + * @since 0.65 + */ + getSelection(): string; + + /** + * Returns current editor's file path + * @return {String} + * @since 0.65 + */ + getFilePath(): string; + } +} +declare module "ace-code/src/ext/hardwrap" { + /** + * @param {import("ace-code/src/editor").Editor} editor + * @param {import("ace-code").Ace.HardWrapOptions} options + */ + export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; +} +declare module "ace-code/src/ext/menu_tools/settings_menu.css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/menu_tools/overlay_page" { + export function overlayPage(editor: any, contentElement: HTMLElement, callback?: any): { + close: () => void; + setIgnoreFocusOut: (ignore: boolean) => void; + }; +} +declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { + export function getEditorKeybordShortcuts(editor: import("ace-code/src/editor").Editor): any[]; +} +declare module "ace-code/src/ext/keybinding_menu" { + export function init(editor: Editor): void; + + import Editor_8 = require("ace-code/src/editor"); + import Editor = Editor_8.Editor; +} +declare module "ace-code/src/ext/linking" { +} +declare module "ace-code/src/ext/modelist" { + /** + * Suggests a mode based on the file extension present in the given path + * @param {string} path The path to the file + * @returns {Mode} Returns an object containing information about the + * suggested mode. + */ + export function getModeForPath(path: string): Mode; + + export var modes: any[]; + export var modesByName: {}; + + class Mode { + /** + * @param {string} name + * @param {string} caption + * @param {string} extensions + */ + constructor(name: string, caption: string, extensions: string); + + name: string; + caption: string; + mode: string; + extensions: string; + extRe: RegExp; + + /** + * @param {string} filename + */ + supportsFile(filename: string): RegExpMatchArray; + } + + export {}; +} +declare module "ace-code/src/ext/themelist" { + export const themesByName: {}; + export const themes: { + caption: string; + theme: string; + isDark: boolean; + name: string; + }[]; +} +declare module "ace-code/src/ext/options" { + const OptionPanel_base: undefined; + + export class OptionPanel { + /** + * + * @param {Editor} editor + * @param {HTMLElement} [element] + */ + constructor(editor: Editor, element?: HTMLElement); + + editor: import("ace-code/src/editor").Editor; + container: HTMLElement; + groups: any[]; + options: {}; + + add(config: any): void; + + render(): void; + + renderOptionGroup(group: any): any[]; + + /** + * @param {string} key + * @param {Object} option + */ + renderOptionControl(key: string, option: any): any; + + /** + * + * @param key + * @param option + */ + renderOption(key: any, option: any): (string | any[] | { + class: string; + })[]; + + /** + * @param {string | number | Object} option + * @param {string | number | boolean} value + */ + setOption(option: string | number | any, value: string | number | boolean): void; + + getOption(option: any): any; + } + + export type Editor = import("ace-code/src/editor").Editor; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface OptionPanel extends Ace.EventEmitter { + } +} +declare module "ace-code/src/ext/prompt" { + export type PromptOptions = { + /** + * Prompt name. + */ + name: string; + /** + * Defines which part of the predefined value should be highlited. + */ + selection: [ + start: number, + end: number + ]; + /** + * Set to true if prompt has description below input box. + */ + hasDescription: boolean; + /** + * Description below input box. + */ + prompt: string; + /** + * Placeholder for value. + */ + placeholder: string; + /** + * Set to true to keep the prompt open when focus moves to another part of the editor. + */ + ignoreFocusOut: boolean; + /** + * Function for defining list of options for value. + */ + getCompletions: Function; + /** + * Function for defining current value prefix. + */ + getPrefix: Function; + /** + * Function called when Enter is pressed. + */ + onAccept: Function; + /** + * Function called when input is added to prompt input box. + */ + onInput: Function; + /** + * Function called when Esc|Shift-Esc is pressed. + */ + onCancel: Function; + /** + * Function for defining history list. + */ + history: Function; + maxHistoryCount: number; + addToHistory: Function; + }; + export type Editor = import("ace-code/src/editor").Editor; + + /** + * @typedef PromptOptions + * @property {String} name Prompt name. + * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). + * @property {[start: number, end: number]} selection Defines which part of the predefined value should be highlited. + * @property {Boolean} hasDescription Set to true if prompt has description below input box. + * @property {String} prompt Description below input box. + * @property {String} placeholder Placeholder for value. + * @property {Object} $rules Specific rules for input like password or regexp. + * @property {Boolean} ignoreFocusOut Set to true to keep the prompt open when focus moves to another part of the editor. + * @property {Function} getCompletions Function for defining list of options for value. + * @property {Function} getPrefix Function for defining current value prefix. + * @property {Function} onAccept Function called when Enter is pressed. + * @property {Function} onInput Function called when input is added to prompt input box. + * @property {Function} onCancel Function called when Esc|Shift-Esc is pressed. + * @property {Function} history Function for defining history list. + * @property {number} maxHistoryCount + * @property {Function} addToHistory + */ + /** + * Prompt plugin is used for getting input from user. + * + * @param {Editor} editor Ouside editor related to this prompt. Will be blurred when prompt is open. + * @param {String | Partial} message Predefined value of prompt input box. + * @param {Partial} options Cusomizable options for this prompt. + * @param {Function} [callback] Function called after done. + * */ + export function prompt(editor: Editor, message: string | Partial, options: Partial, callback?: Function): any; + + export namespace prompt { + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function gotoLine(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function commands(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + + /** + * + * @param {Editor} editor + * @param {Function} [callback] + */ + function modes(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + } +} +declare module "ace-code/src/ext/rtl" { + export {}; +} +declare module "ace-code/src/ext/settings_menu" { + export function init(): void; +} +declare module "ace-code/src/ext/simple_tokenizer" { + /** + * Parses provided content according to provided highlighting rules and return tokens. + * Tokens either have the className set according to Ace themes or have no className if they are just pure text tokens. + * Result is a list of list of tokens, where each line from the provided content is a separate list of tokens. + * + * @param {string} content to tokenize + * @param {import("ace-code").Ace.HighlightRules} highlightRules defining the language grammar + * @returns {import("ace-code").Ace.TokenizeResult} tokenization result containing a list of token for each of the lines from content + */ + export function tokenize(content: string, highlightRules: import("ace-code").Ace.HighlightRules): import("ace-code").Ace.TokenizeResult; +} +declare module "ace-code/src/ext/spellcheck" { + export function contextMenuHandler(e: any): void; +} +declare module "ace-code/src/ext/split" { + const _exports: typeof import("ace-code/src/split"); + export = _exports; +} +declare module "ace-code/src/ext/static-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/ext/static_highlight" { + /** + * + * @param {HTMLElement} el + * @param opts + * @param [callback] + * @returns {boolean} + */ + function highlight(el: HTMLElement, opts: any, callback?: any): boolean; + + export namespace highlight { + export {render, renderSync, highlight}; + } + + /** + * Transforms a given input code snippet into HTML using the given mode + * + * @param {string} input Code snippet + * @param {string|import("ace-code").Ace.SyntaxMode} mode String specifying the mode to load such as + * `ace/mode/javascript` or, a mode loaded from `/ace/mode` + * (use 'ServerSideHiglighter.getMode'). + * @param {string} theme String specifying the theme to load such as + * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. + * @param {number} lineStart A number indicating the first line number. Defaults + * to 1. + * @param {boolean} disableGutter Specifies whether or not to disable the gutter. + * `true` disables the gutter, `false` enables the gutter. Defaults to `false`. + * @param {function} [callback] When specifying the mode or theme as a string, + * this method has no return value and you must specify a callback function. The + * callback will receive the rendered object containing the properties `html` + * and `css`. + * @returns {object} An object containing the properties `html` and `css`. + */ + function render(input: string, mode: string | import("ace-code").Ace.SyntaxMode, theme: string, lineStart: number, disableGutter: boolean, callback?: Function): object; + + /** + * Transforms a given input code snippet into HTML using the given mode + * @param {string} input Code snippet + * @param {import("ace-code").Ace.SyntaxMode|string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') + * @param {any} theme + * @param {any} lineStart + * @param {boolean} disableGutter + * @returns {object} An object containing: html, css + */ + function renderSync(input: string, mode: import("ace-code").Ace.SyntaxMode | string, theme: any, lineStart: any, disableGutter: boolean): object; +} +declare module "ace-code/src/ext/statusbar" { + export type Editor = import("ace-code/src/editor").Editor; + + /** simple statusbar **/ + export class StatusBar { + /** + * @param {Editor} editor + * @param {HTMLElement} parentNode + */ + constructor(editor: Editor, parentNode: HTMLElement); + + element: HTMLDivElement; + + /** + * @param {Editor} editor + */ + updateStatus(editor: Editor): void; + } +} +declare module "ace-code/src/ext/textarea" { + const _exports: { + config: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): import("ace-code/src/lib/app_config").AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K_1, callback: any, capturing?: boolean): any; + addEventListener(name: K_2, callback: any, capturing?: boolean): any; + off(name: K_3, callback: any): void; + removeListener(name: K_4, callback: any): void; + removeEventListener(name: K_5, callback: any): void; + removeAllListeners(name?: string): void; + get: (key: string) => any; + set: (key: string, value: any) => void; + all: () => { + [key: string]: any; + }; + moduleUrl: (name: string, component?: string) => string; + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.32.9"; + }; + edit: (el: string | (HTMLElement & { + env?: any; + value?: any; + }), options?: any) => ace.Editor; + createEditSession: (text: string | import("ace-code/src/document").Document, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; + Range: typeof ace.Range; + Editor: typeof ace.Editor; + EditSession: typeof ace.EditSession; + UndoManager: typeof ace.UndoManager; + VirtualRenderer: typeof ace.VirtualRenderer; + version: "1.32.9"; + transformTextarea: (element: any, options: any) => ace.Editor; + defaultOptions: { + mode: string; + theme: string; + wrap: string; + fontSize: string; + showGutter: string; + keybindings: string; + showPrintMargin: string; + useSoftTabs: string; + showInvisibles: string; + }; + }; + export = _exports; + import ace = require("ace-code"); +} +declare module "ace-code/src/ext/whitespace" { + export function $detectIndentation(lines: string[], fallback?: any): { + ch?: string; + length?: number; + }; + + export function detectIndentation(session: EditSession): { + ch?: string; + length?: number; + } | {}; + + export function trimTrailingSpace(session: EditSession, options: { + trimEmpty?: boolean; + keepCursorPosition?: boolean; + }): void; + + export function convertIndentation(session: EditSession, ch: string, len: number): void; + + export function $parseStringArg(text: string): {}; + + export function $parseArg(arg: any): any; + + export const commands: { + name: string; + description: string; + exec: (editor: any, args: any) => void; + }[]; + export type EditSession = import("ace-code/src/edit_session").EditSession; +} diff --git a/ace-extensions.d.ts b/ace-extensions.d.ts deleted file mode 100644 index d6988579647..00000000000 --- a/ace-extensions.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -declare module "ace-code/src/ext/simple_tokenizer" { - export type TokenizeResult = Array> - export function tokenize(content: string, highlightRules: import("./ace").Ace.HighlightRules): TokenizeResult; -} - -declare module "ace-code/src/ext/modelist" { - export type Mode = { - name: string; - caption: string; - mode: string; - extensions: string; - supportsFile(filename: string): boolean; - } - export function getModeForPath(path: string): Mode; - export const modes: Mode[]; - export const modesByName: Record; -} diff --git a/ace-modes.d.ts b/ace-modes.d.ts index f852d5fe0ff..eeec864a093 100644 --- a/ace-modes.d.ts +++ b/ace-modes.d.ts @@ -1,254 +1,278 @@ declare module "ace-code/src/mode/abap_highlight_rules" { - export const AbapHighlightRules: new () => import(".").Ace.HighlightRules; + export const AbapHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/abap" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/abc_highlight_rules" { - export const ABCHighlightRules: new () => import(".").Ace.HighlightRules; + export const ABCHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/abc" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/actionscript_highlight_rules" { - export const ActionScriptHighlightRules: new () => import(".").Ace.HighlightRules; + export const ActionScriptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/actionscript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ada_highlight_rules" { - export const AdaHighlightRules: new () => import(".").Ace.HighlightRules; + export const AdaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ada" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/alda_highlight_rules" { - export const AldaHighlightRules: new () => import(".").Ace.HighlightRules; + export const AldaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/alda" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/apache_conf_highlight_rules" { - export const ApacheConfHighlightRules: new () => import(".").Ace.HighlightRules; + export const ApacheConfHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/apache_conf" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/apex_highlight_rules" { - export const ApexHighlightRules: new () => import(".").Ace.HighlightRules; + export const ApexHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/apex" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/applescript_highlight_rules" { - export const AppleScriptHighlightRules: new () => import(".").Ace.HighlightRules; + export const AppleScriptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/applescript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/aql_highlight_rules" { - export const AqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const AqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/aql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/asciidoc_highlight_rules" { - export const AsciidocHighlightRules: new () => import(".").Ace.HighlightRules; + export const AsciidocHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/asciidoc" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/asl_highlight_rules" { - export const ASLHighlightRules: new () => import(".").Ace.HighlightRules; + export const ASLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/asl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/assembly_arm32_highlight_rules" { - export const AssemblyARM32HighlightRules: new () => import(".").Ace.HighlightRules; + export const AssemblyARM32HighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/assembly_arm32" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/assembly_x86_highlight_rules" { - export const AssemblyX86HighlightRules: new () => import(".").Ace.HighlightRules; + export const AssemblyX86HighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/assembly_x86" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/astro_highlight_rules" { - export const AstroHighlightRules: new () => import(".").Ace.HighlightRules; + export const AstroHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/astro" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/autohotkey_highlight_rules" { - export const AutoHotKeyHighlightRules: new () => import(".").Ace.HighlightRules; + export const AutoHotKeyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/autohotkey" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/batchfile_highlight_rules" { - export const BatchFileHighlightRules: new () => import(".").Ace.HighlightRules; + export const BatchFileHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/batchfile" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/behaviour" { - export const Behaviour: new () => import(".").Ace.Behaviour; + export const Behaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/css" { + export const CssBehaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/cstyle" { + export const CstyleBehaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/html" { + export const HtmlBehaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/liquid" { + export const LiquidBehaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/xml" { + export const XmlBehaviour: new () => import("ace-code").Ace.Behaviour; +} + +declare module "ace-code/src/mode/behaviour/xquery" { + export const XQueryBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/bibtex_highlight_rules" { - export const BibTeXHighlightRules: new () => import(".").Ace.HighlightRules; + export const BibTeXHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/bibtex" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/c_cpp_highlight_rules" { export const cFunctions: string; - export const c_cppHighlightRules: new () => import(".").Ace.HighlightRules; + export const c_cppHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/c_cpp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/c9search_highlight_rules" { - export const C9SearchHighlightRules: new () => import(".").Ace.HighlightRules; + export const C9SearchHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/c9search" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/cirru_highlight_rules" { - export const CirruHighlightRules: new () => import(".").Ace.HighlightRules; + export const CirruHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/cirru" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/clojure_highlight_rules" { - export const ClojureHighlightRules: new () => import(".").Ace.HighlightRules; + export const ClojureHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/clojure" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/cobol_highlight_rules" { - export const CobolHighlightRules: new () => import(".").Ace.HighlightRules; + export const CobolHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/cobol" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/coffee_highlight_rules" { - export const CoffeeHighlightRules: new () => import(".").Ace.HighlightRules; + export const CoffeeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/coffee" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/coldfusion_highlight_rules" { - export const ColdfusionHighlightRules: new () => import(".").Ace.HighlightRules; + export const ColdfusionHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/coldfusion" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/crystal_highlight_rules" { - export const CrystalHighlightRules: new () => import(".").Ace.HighlightRules; + export const CrystalHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/crystal" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/csharp_highlight_rules" { - export const CSharpHighlightRules: new () => import(".").Ace.HighlightRules; + export const CSharpHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csharp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/csound_document_highlight_rules" { - export const CsoundDocumentHighlightRules: new () => import(".").Ace.HighlightRules; + export const CsoundDocumentHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csound_document" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/csound_orchestra_highlight_rules" { - export const CsoundOrchestraHighlightRules: new () => import(".").Ace.HighlightRules; + export const CsoundOrchestraHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csound_orchestra" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/csound_preprocessor_highlight_rules" { - export const CsoundPreprocessorHighlightRules: new () => import(".").Ace.HighlightRules; + export const CsoundPreprocessorHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csound_score_highlight_rules" { - export const CsoundScoreHighlightRules: new () => import(".").Ace.HighlightRules; + export const CsoundScoreHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csound_score" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/csp_highlight_rules" { - export const CspHighlightRules: new () => import(".").Ace.HighlightRules; + export const CspHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/csp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/css_completions" { - export const CssCompletions: new () => import(".").Ace.Completion; + export const CssCompletions: new () => import("ace-code").Ace.Completion; } declare module "ace-code/src/mode/css_highlight_rules" { @@ -260,934 +284,1034 @@ declare module "ace-code/src/mode/css_highlight_rules" { export const numRe: string; export const pseudoElements: string; export const pseudoClasses: string; - export const CssHighlightRules: new () => import(".").Ace.HighlightRules; + export const CssHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/css" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/curly_highlight_rules" { - export const CurlyHighlightRules: new () => import(".").Ace.HighlightRules; + export const CurlyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/curly" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/cuttlefish_highlight_rules" { - export const CuttlefishHighlightRules: new () => import(".").Ace.HighlightRules; + export const CuttlefishHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/cuttlefish" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/d_highlight_rules" { - export const DHighlightRules: new () => import(".").Ace.HighlightRules; + export const DHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/d" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/dart_highlight_rules" { - export const DartHighlightRules: new () => import(".").Ace.HighlightRules; + export const DartHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/dart" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/diff_highlight_rules" { - export const DiffHighlightRules: new () => import(".").Ace.HighlightRules; + export const DiffHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/diff" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/django" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/doc_comment_highlight_rules" { - export const DocCommentHighlightRules: new () => import(".").Ace.HighlightRules; + export const DocCommentHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/dockerfile_highlight_rules" { - export const DockerfileHighlightRules: new () => import(".").Ace.HighlightRules; + export const DockerfileHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/dockerfile" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/dot_highlight_rules" { - export const DotHighlightRules: new () => import(".").Ace.HighlightRules; + export const DotHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/dot" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/drools_highlight_rules" { - export const DroolsHighlightRules: new () => import(".").Ace.HighlightRules; + export const DroolsHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/drools" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/edifact_highlight_rules" { - export const EdifactHighlightRules: new () => import(".").Ace.HighlightRules; + export const EdifactHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/edifact" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/eiffel_highlight_rules" { - export const EiffelHighlightRules: new () => import(".").Ace.HighlightRules; + export const EiffelHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/eiffel" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ejs" { - export const EjsHighlightRules: new () => import(".").Ace.HighlightRules; - export const Mode: new () => import(".").Ace.SyntaxMode; + export const EjsHighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/elixir_highlight_rules" { - export const ElixirHighlightRules: new () => import(".").Ace.HighlightRules; + export const ElixirHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/elixir" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/elm_highlight_rules" { - export const ElmHighlightRules: new () => import(".").Ace.HighlightRules; + export const ElmHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/elm" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/erlang_highlight_rules" { - export const ErlangHighlightRules: new () => import(".").Ace.HighlightRules; + export const ErlangHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/erlang" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/flix_highlight_rules" { - export const FlixHighlightRules: new () => import(".").Ace.HighlightRules; + export const FlixHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/flix" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; +} + +declare module "ace-code/src/mode/folding/asciidoc" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/c9search" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/coffee" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/csharp" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/cstyle" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/diff" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/drools" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/fold_mode" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/haskell_cabal" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/html" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/ini" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/java" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/latex" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/lua" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/markdown" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/mixed" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/php" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/pythonic" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/ruby" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/sql" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/sqlserver" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/vbscript" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/velocity" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/xml" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + +declare module "ace-code/src/mode/folding/yaml" { + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/forth_highlight_rules" { - export const ForthHighlightRules: new () => import(".").Ace.HighlightRules; + export const ForthHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/forth" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/fortran_highlight_rules" { - export const FortranHighlightRules: new () => import(".").Ace.HighlightRules; + export const FortranHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/fortran" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/fsharp_highlight_rules" { - export const FSharpHighlightRules: new () => import(".").Ace.HighlightRules; + export const FSharpHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/fsharp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/fsl_highlight_rules" { - export const FSLHighlightRules: new () => import(".").Ace.HighlightRules; + export const FSLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/fsl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ftl_highlight_rules" { - export const FtlHighlightRules: new () => import(".").Ace.HighlightRules; + export const FtlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ftl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/gcode_highlight_rules" { - export const GcodeHighlightRules: new () => import(".").Ace.HighlightRules; + export const GcodeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/gcode" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/gherkin_highlight_rules" { - export const GherkinHighlightRules: new () => import(".").Ace.HighlightRules; + export const GherkinHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/gherkin" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/gitignore_highlight_rules" { - export const GitignoreHighlightRules: new () => import(".").Ace.HighlightRules; + export const GitignoreHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/gitignore" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/glsl_highlight_rules" { - export const glslHighlightRules: new () => import(".").Ace.HighlightRules; + export const glslHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/glsl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/gobstones_highlight_rules" { - export const GobstonesHighlightRules: new () => import(".").Ace.HighlightRules; + export const GobstonesHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/gobstones" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/golang_highlight_rules" { - export const GolangHighlightRules: new () => import(".").Ace.HighlightRules; + export const GolangHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/golang" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/graphqlschema_highlight_rules" { - export const GraphQLSchemaHighlightRules: new () => import(".").Ace.HighlightRules; + export const GraphQLSchemaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/graphqlschema" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/groovy_highlight_rules" { - export const GroovyHighlightRules: new () => import(".").Ace.HighlightRules; + export const GroovyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/groovy" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/haml_highlight_rules" { - export const HamlHighlightRules: new () => import(".").Ace.HighlightRules; + export const HamlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/haml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/handlebars_highlight_rules" { - export const HandlebarsHighlightRules: new () => import(".").Ace.HighlightRules; + export const HandlebarsHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/handlebars" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/haskell_cabal_highlight_rules" { - export const CabalHighlightRules: new () => import(".").Ace.HighlightRules; + export const CabalHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/haskell_cabal" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/haskell_highlight_rules" { - export const HaskellHighlightRules: new () => import(".").Ace.HighlightRules; + export const HaskellHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/haskell" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/haxe_highlight_rules" { - export const HaxeHighlightRules: new () => import(".").Ace.HighlightRules; + export const HaxeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/haxe" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/hjson_highlight_rules" { - export const HjsonHighlightRules: new () => import(".").Ace.HighlightRules; + export const HjsonHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/hjson" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/html_completions" { - export const HtmlCompletions: new () => import(".").Ace.Completion; + export const HtmlCompletions: new () => import("ace-code").Ace.Completion; } declare module "ace-code/src/mode/html_elixir_highlight_rules" { - export const HtmlElixirHighlightRules: new () => import(".").Ace.HighlightRules; + export const HtmlElixirHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/html_elixir" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/html_highlight_rules" { - export const HtmlHighlightRules: new () => import(".").Ace.HighlightRules; + export const HtmlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/html_ruby_highlight_rules" { - export const HtmlRubyHighlightRules: new () => import(".").Ace.HighlightRules; + export const HtmlRubyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/html_ruby" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/html" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ini_highlight_rules" { - export const IniHighlightRules: new () => import(".").Ace.HighlightRules; + export const IniHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ini" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/io_highlight_rules" { - export const IoHighlightRules: new () => import(".").Ace.HighlightRules; + export const IoHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/io" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ion_highlight_rules" { - export const IonHighlightRules: new () => import(".").Ace.HighlightRules; + export const IonHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ion" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jack_highlight_rules" { - export const JackHighlightRules: new () => import(".").Ace.HighlightRules; + export const JackHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jack" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jade_highlight_rules" { - export const JadeHighlightRules: new () => import(".").Ace.HighlightRules; + export const JadeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jade" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/java_highlight_rules" { - export const JavaHighlightRules: new () => import(".").Ace.HighlightRules; + export const JavaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/java" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/javascript_highlight_rules" { - export const JavaScriptHighlightRules: new () => import(".").Ace.HighlightRules; + export const JavaScriptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/javascript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jexl_highlight_rules" { - export const JexlHighlightRules: new () => import(".").Ace.HighlightRules; + export const JexlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jexl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/js_regex_highlight_rules" { - export const JsRegexHighlightRules: new () => import(".").Ace.HighlightRules; + export const JsRegexHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jsdoc_comment_highlight_rules" { - export const JsDocCommentHighlightRules: new () => import(".").Ace.HighlightRules; + export const JsDocCommentHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/json_highlight_rules" { - export const JsonHighlightRules: new () => import(".").Ace.HighlightRules; + export const JsonHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/json" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/json5_highlight_rules" { - export const Json5HighlightRules: new () => import(".").Ace.HighlightRules; + export const Json5HighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/json5" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jsp_highlight_rules" { - export const JspHighlightRules: new () => import(".").Ace.HighlightRules; + export const JspHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jsp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jssm_highlight_rules" { - export const JSSMHighlightRules: new () => import(".").Ace.HighlightRules; + export const JSSMHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jssm" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/jsx_highlight_rules" { - export const JsxHighlightRules: new () => import(".").Ace.HighlightRules; + export const JsxHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/jsx" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/julia_highlight_rules" { - export const JuliaHighlightRules: new () => import(".").Ace.HighlightRules; + export const JuliaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/julia" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/kotlin_highlight_rules" { - export const KotlinHighlightRules: new () => import(".").Ace.HighlightRules; + export const KotlinHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/kotlin" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/latex_highlight_rules" { - export const LatexHighlightRules: new () => import(".").Ace.HighlightRules; + export const LatexHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/latex" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/latte_highlight_rules" { - export const LatteHighlightRules: new () => import(".").Ace.HighlightRules; + export const LatteHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/latte" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/less_highlight_rules" { - export const LessHighlightRules: new () => import(".").Ace.HighlightRules; + export const LessHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/less" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/liquid_highlight_rules" { - export const LiquidHighlightRules: new () => import(".").Ace.HighlightRules; + export const LiquidHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/liquid" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/lisp_highlight_rules" { - export const LispHighlightRules: new () => import(".").Ace.HighlightRules; + export const LispHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/lisp" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/livescript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/logiql_highlight_rules" { - export const LogiQLHighlightRules: new () => import(".").Ace.HighlightRules; + export const LogiQLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/logiql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/logtalk_highlight_rules" { - export const LogtalkHighlightRules: new () => import(".").Ace.HighlightRules; + export const LogtalkHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/logtalk" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/lsl_highlight_rules" { - export const LSLHighlightRules: new () => import(".").Ace.HighlightRules; + export const LSLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/lsl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/lua_highlight_rules" { - export const LuaHighlightRules: new () => import(".").Ace.HighlightRules; + export const LuaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/lua" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/luapage_highlight_rules" { - export const LuaPageHighlightRules: new () => import(".").Ace.HighlightRules; + export const LuaPageHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/luapage" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/lucene_highlight_rules" { - export const LuceneHighlightRules: new () => import(".").Ace.HighlightRules; + export const LuceneHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/lucene" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/makefile_highlight_rules" { - export const MakefileHighlightRules: new () => import(".").Ace.HighlightRules; + export const MakefileHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/makefile" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/markdown_highlight_rules" { - export const MarkdownHighlightRules: new () => import(".").Ace.HighlightRules; + export const MarkdownHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/markdown" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mask_highlight_rules" { - export const MaskHighlightRules: new () => import(".").Ace.HighlightRules; + export const MaskHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mask" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/matching_brace_outdent" { - export const MatchingBraceOutdent: new () => import(".").Ace.Outdent; + export const MatchingBraceOutdent: new () => import("ace-code").Ace.Outdent; } declare module "ace-code/src/mode/matching_parens_outdent" { - export const MatchingParensOutdent: new () => import(".").Ace.Outdent; + export const MatchingParensOutdent: new () => import("ace-code").Ace.Outdent; } declare module "ace-code/src/mode/matlab_highlight_rules" { - export const MatlabHighlightRules: new () => import(".").Ace.HighlightRules; + export const MatlabHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/matlab" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/maze_highlight_rules" { - export const MazeHighlightRules: new () => import(".").Ace.HighlightRules; + export const MazeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/maze" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mediawiki_highlight_rules" { - export const MediaWikiHighlightRules: new () => import(".").Ace.HighlightRules; + export const MediaWikiHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mediawiki" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mel_highlight_rules" { - export const MELHighlightRules: new () => import(".").Ace.HighlightRules; + export const MELHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mel" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mips_highlight_rules" { - export const MIPSHighlightRules: new () => import(".").Ace.HighlightRules; + export const MIPSHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mips" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mixal_highlight_rules" { - export const MixalHighlightRules: new () => import(".").Ace.HighlightRules; + export const MixalHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mixal" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mushcode_highlight_rules" { - export const MushCodeRules: new () => import(".").Ace.HighlightRules; + export const MushCodeRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mushcode" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/mysql_highlight_rules" { - export const MysqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const MysqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/mysql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nasal_highlight_rules" { - export const NasalHighlightRules: new () => import(".").Ace.HighlightRules; + export const NasalHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nasal" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nginx_highlight_rules" { - export const NginxHighlightRules: new () => import(".").Ace.HighlightRules; + export const NginxHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nginx" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nim_highlight_rules" { - export const NimHighlightRules: new () => import(".").Ace.HighlightRules; + export const NimHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nim" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nix_highlight_rules" { - export const NixHighlightRules: new () => import(".").Ace.HighlightRules; + export const NixHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nix" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nsis_highlight_rules" { - export const NSISHighlightRules: new () => import(".").Ace.HighlightRules; + export const NSISHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nsis" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/nunjucks_highlight_rules" { - export const NunjucksHighlightRules: new () => import(".").Ace.HighlightRules; + export const NunjucksHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/nunjucks" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/objectivec_highlight_rules" { - export const ObjectiveCHighlightRules: new () => import(".").Ace.HighlightRules; + export const ObjectiveCHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/objectivec" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ocaml_highlight_rules" { - export const OcamlHighlightRules: new () => import(".").Ace.HighlightRules; + export const OcamlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ocaml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/odin_highlight_rules" { - export const OdinHighlightRules: new () => import(".").Ace.HighlightRules; + export const OdinHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/odin" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/partiql_highlight_rules" { - export const PartiqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const PartiqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/partiql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/pascal_highlight_rules" { - export const PascalHighlightRules: new () => import(".").Ace.HighlightRules; + export const PascalHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/pascal" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/perl_highlight_rules" { - export const PerlHighlightRules: new () => import(".").Ace.HighlightRules; + export const PerlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/perl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/pgsql_highlight_rules" { - export const PgsqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const PgsqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/pgsql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/php_completions" { - export const PhpCompletions: new () => import(".").Ace.Completion; + export const PhpCompletions: new () => import("ace-code").Ace.Completion; } declare module "ace-code/src/mode/php_highlight_rules" { - export const PhpHighlightRules: new () => import(".").Ace.HighlightRules; - export const PhpLangHighlightRules: new () => import(".").Ace.HighlightRules; + export const PhpHighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const PhpLangHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/php_laravel_blade_highlight_rules" { - export const PHPLaravelBladeHighlightRules: new () => import(".").Ace.HighlightRules; + export const PHPLaravelBladeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/php_laravel_blade" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/php" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/pig_highlight_rules" { - export const PigHighlightRules: new () => import(".").Ace.HighlightRules; + export const PigHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/pig" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/plain_text" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/plsql_highlight_rules" { - export const plsqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const plsqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/plsql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/powershell_highlight_rules" { - export const PowershellHighlightRules: new () => import(".").Ace.HighlightRules; + export const PowershellHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/powershell" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/praat_highlight_rules" { - export const PraatHighlightRules: new () => import(".").Ace.HighlightRules; + export const PraatHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/praat" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/prisma_highlight_rules" { - export const PrismaHighlightRules: new () => import(".").Ace.HighlightRules; + export const PrismaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/prisma" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/prolog_highlight_rules" { - export const PrologHighlightRules: new () => import(".").Ace.HighlightRules; + export const PrologHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/prolog" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/properties_highlight_rules" { - export const PropertiesHighlightRules: new () => import(".").Ace.HighlightRules; + export const PropertiesHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/properties" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/protobuf_highlight_rules" { - export const ProtobufHighlightRules: new () => import(".").Ace.HighlightRules; + export const ProtobufHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/protobuf" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/prql_highlight_rules" { - export const PrqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const PrqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/prql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/puppet_highlight_rules" { - export const PuppetHighlightRules: new () => import(".").Ace.HighlightRules; + export const PuppetHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/puppet" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/python_highlight_rules" { - export const PythonHighlightRules: new () => import(".").Ace.HighlightRules; + export const PythonHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/python" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/qml_highlight_rules" { - export const QmlHighlightRules: new () => import(".").Ace.HighlightRules; + export const QmlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/qml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/r_highlight_rules" { - export const RHighlightRules: new () => import(".").Ace.HighlightRules; + export const RHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/r" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/raku_highlight_rules" { - export const RakuHighlightRules: new () => import(".").Ace.HighlightRules; + export const RakuHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/raku" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/razor_completions" { - export const RazorCompletions: new () => import(".").Ace.Completion; + export const RazorCompletions: new () => import("ace-code").Ace.Completion; } declare module "ace-code/src/mode/razor_highlight_rules" { - export const RazorHighlightRules: new () => import(".").Ace.HighlightRules; - export const RazorLangHighlightRules: new () => import(".").Ace.HighlightRules; + export const RazorHighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const RazorLangHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/razor" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/rdoc_highlight_rules" { - export const RDocHighlightRules: new () => import(".").Ace.HighlightRules; + export const RDocHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/rdoc" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/red_highlight_rules" { - export const RedHighlightRules: new () => import(".").Ace.HighlightRules; + export const RedHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/red" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/redshift_highlight_rules" { - export const RedshiftHighlightRules: new () => import(".").Ace.HighlightRules; + export const RedshiftHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/redshift" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/rhtml_highlight_rules" { - export const RHtmlHighlightRules: new () => import(".").Ace.HighlightRules; + export const RHtmlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/rhtml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/robot_highlight_rules" { - export const RobotHighlightRules: new () => import(".").Ace.HighlightRules; + export const RobotHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/robot" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/rst_highlight_rules" { - export const RSTHighlightRules: new () => import(".").Ace.HighlightRules; + export const RSTHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/rst" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/ruby_highlight_rules" { @@ -1203,362 +1327,362 @@ declare module "ace-code/src/mode/ruby_highlight_rules" { export const constantNumericComplex: { token: string; regex: RegExp; }; export const constantNumericFloat: { token: string; regex: string; }; export const instanceVariable: { token: string; regex: string; }; - export const RubyHighlightRules: new () => import(".").Ace.HighlightRules; + export const RubyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/ruby" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/rust_highlight_rules" { - export const RustHighlightRules: new () => import(".").Ace.HighlightRules; + export const RustHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/rust" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sac_highlight_rules" { - export const sacHighlightRules: new () => import(".").Ace.HighlightRules; + export const sacHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sac" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sass_highlight_rules" { - export const SassHighlightRules: new () => import(".").Ace.HighlightRules; + export const SassHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sass" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/scad_highlight_rules" { - export const scadHighlightRules: new () => import(".").Ace.HighlightRules; + export const scadHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/scad" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/scala_highlight_rules" { - export const ScalaHighlightRules: new () => import(".").Ace.HighlightRules; + export const ScalaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/scala" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/scheme_highlight_rules" { - export const SchemeHighlightRules: new () => import(".").Ace.HighlightRules; + export const SchemeHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/scheme" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/scrypt_highlight_rules" { - export const scryptHighlightRules: new () => import(".").Ace.HighlightRules; + export const scryptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/scrypt" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/scss_highlight_rules" { - export const ScssHighlightRules: new () => import(".").Ace.HighlightRules; + export const ScssHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/scss" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sh_highlight_rules" { export const reservedKeywords: string; export const languageConstructs: string; - export const ShHighlightRules: new () => import(".").Ace.HighlightRules; + export const ShHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sh" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sjs_highlight_rules" { - export const SJSHighlightRules: new () => import(".").Ace.HighlightRules; + export const SJSHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sjs" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/slim_highlight_rules" { - export const SlimHighlightRules: new () => import(".").Ace.HighlightRules; + export const SlimHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/slim" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/smarty_highlight_rules" { - export const SmartyHighlightRules: new () => import(".").Ace.HighlightRules; + export const SmartyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/smarty" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/smithy_highlight_rules" { - export const SmithyHighlightRules: new () => import(".").Ace.HighlightRules; + export const SmithyHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/smithy" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/snippets" { - export const SnippetHighlightRules: new () => import(".").Ace.HighlightRules; - export const SnippetGroupHighlightRules: new () => import(".").Ace.HighlightRules; - export const Mode: new () => import(".").Ace.SyntaxMode; + export const SnippetHighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const SnippetGroupHighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/soy_template_highlight_rules" { - export const SoyTemplateHighlightRules: new () => import(".").Ace.HighlightRules; + export const SoyTemplateHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/soy_template" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/space_highlight_rules" { - export const SpaceHighlightRules: new () => import(".").Ace.HighlightRules; + export const SpaceHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/space" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sparql_highlight_rules" { - export const SPARQLHighlightRules: new () => import(".").Ace.HighlightRules; + export const SPARQLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sparql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sql_highlight_rules" { - export const SqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const SqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sql" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/sqlserver_highlight_rules" { - export const SqlHighlightRules: new () => import(".").Ace.HighlightRules; + export const SqlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/sqlserver" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/stylus_highlight_rules" { - export const StylusHighlightRules: new () => import(".").Ace.HighlightRules; + export const StylusHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/stylus" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/svg_highlight_rules" { - export const SvgHighlightRules: new () => import(".").Ace.HighlightRules; + export const SvgHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/svg" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/swift_highlight_rules" { - export const HighlightRules: new () => import(".").Ace.HighlightRules; - export const SwiftHighlightRules: new () => import(".").Ace.HighlightRules; + export const HighlightRules: new () => import("ace-code").Ace.HighlightRules; + export const SwiftHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/swift" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/tcl_highlight_rules" { - export const TclHighlightRules: new () => import(".").Ace.HighlightRules; + export const TclHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/tcl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/terraform_highlight_rules" { - export const TerraformHighlightRules: new () => import(".").Ace.HighlightRules; + export const TerraformHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/terraform" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/tex_highlight_rules" { - export const TexHighlightRules: new () => import(".").Ace.HighlightRules; + export const TexHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/tex" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/text_highlight_rules" { - export const TextHighlightRules: new () => import(".").Ace.HighlightRules; + export const TextHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/text" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/textile_highlight_rules" { - export const TextileHighlightRules: new () => import(".").Ace.HighlightRules; + export const TextileHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/textile" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/toml_highlight_rules" { - export const TomlHighlightRules: new () => import(".").Ace.HighlightRules; + export const TomlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/toml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/tsx_highlight_rules" { - export const TsxHighlightRules: new () => import(".").Ace.HighlightRules; + export const TsxHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/tsx" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/turtle_highlight_rules" { - export const TurtleHighlightRules: new () => import(".").Ace.HighlightRules; + export const TurtleHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/turtle" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/twig_highlight_rules" { - export const TwigHighlightRules: new () => import(".").Ace.HighlightRules; + export const TwigHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/twig" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/typescript_highlight_rules" { - export const TypeScriptHighlightRules: new () => import(".").Ace.HighlightRules; + export const TypeScriptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/typescript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/vala_highlight_rules" { - export const ValaHighlightRules: new () => import(".").Ace.HighlightRules; + export const ValaHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/vala" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/vbscript_highlight_rules" { - export const VBScriptHighlightRules: new () => import(".").Ace.HighlightRules; + export const VBScriptHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/vbscript" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/velocity_highlight_rules" { - export const VelocityHighlightRules: new () => import(".").Ace.HighlightRules; + export const VelocityHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/velocity" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/verilog_highlight_rules" { - export const VerilogHighlightRules: new () => import(".").Ace.HighlightRules; + export const VerilogHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/verilog" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/vhdl_highlight_rules" { - export const VHDLHighlightRules: new () => import(".").Ace.HighlightRules; + export const VHDLHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/vhdl" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/visualforce_highlight_rules" { - export const VisualforceHighlightRules: new () => import(".").Ace.HighlightRules; + export const VisualforceHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/visualforce" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/vue_highlight_rules" { - export const VueHighlightRules: new () => import(".").Ace.HighlightRules; + export const VueHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/vue" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/wollok_highlight_rules" { - export const WollokHighlightRules: new () => import(".").Ace.HighlightRules; + export const WollokHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/wollok" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/xml_highlight_rules" { - export const XmlHighlightRules: new () => import(".").Ace.HighlightRules; + export const XmlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/xml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/yaml_highlight_rules" { - export const YamlHighlightRules: new () => import(".").Ace.HighlightRules; + export const YamlHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/yaml" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/zeek_highlight_rules" { - export const ZeekHighlightRules: new () => import(".").Ace.HighlightRules; + export const ZeekHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/zeek" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/zig_highlight_rules" { - export const ZigHighlightRules: new () => import(".").Ace.HighlightRules; + export const ZigHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/zig" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } \ No newline at end of file diff --git a/ace-modules.d.ts b/ace-modules.d.ts new file mode 100644 index 00000000000..b50e0ff5a0d --- /dev/null +++ b/ace-modules.d.ts @@ -0,0 +1,7870 @@ +declare module "ace-code/src/lib/useragent" { + export namespace OS { + let LINUX: string; + let MAC: string; + let WINDOWS: string; + } + + export function getOS(): string; + + export const isWin: boolean; + export const isMac: boolean; + export const isLinux: boolean; + export const isIE: number; + export const isOldIE: boolean; + export const isGecko: any; + export const isMozilla: any; + export const isOpera: boolean; + export const isWebKit: number; + export const isChrome: number; + export const isSafari: true; + export const isEdge: number; + export const isAIR: boolean; + export const isAndroid: boolean; + export const isChromeOS: boolean; + export const isIOS: boolean; + export const isMobile: boolean; +} +declare module "ace-code/src/lib/dom" { + export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; + + export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; + + export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; + + export function removeChildren(element: HTMLElement): void; + + export function createTextNode(textContent: string, element?: HTMLElement): Text; + + export function createFragment(element?: HTMLElement): DocumentFragment; + + export function hasCssClass(el: HTMLElement, name: string): boolean; + + export function addCssClass(el: HTMLElement, name: string): void; + + export function removeCssClass(el: HTMLElement, name: string): void; + + export function toggleCssClass(el: HTMLElement, name: string): boolean; + + export function setCssClass(node: HTMLElement, className: string, include: boolean): void; + + export function hasCssString(id: string, doc?: Document): boolean; + + export function removeElementById(id: string, doc?: Document): void; + + export function useStrictCSP(value: any): void; + + export function importCssStylsheet(uri: string, doc?: Document): void; + + export function scrollbarWidth(doc?: Document): number; + + export function computedStyle(element: Element, style?: any): Partial; + + export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; + + export const HAS_CSS_ANIMATION: boolean; + export const HAS_CSS_TRANSFORMS: boolean; + export const HI_DPI: boolean; + + export function translate(element: any, tx: any, ty: any): void; + + export function importCssString(cssText: any, id: any, target: any): number; +} +declare module "ace-code/src/lib/oop" { + export function inherits(ctor: any, superCtor: any): void; + + export function mixin(obj: T, mixin: any): any; + + export function implement(proto: T, mixin: any): any; +} +declare module "ace-code/src/lib/deep_copy" { + export function deepCopy(obj: any): any; +} +declare module "ace-code/src/lib/lang" { + export function last(a: any): any; + + export function stringReverse(string: any): any; + + export function stringRepeat(string: any, count: any): string; + + export function stringTrimLeft(string: any): any; + + export function stringTrimRight(string: any): any; + + export function copyObject(obj: any): {}; + + export function copyArray(array: any): any[]; + + export const deepCopy: (obj: any) => any; + + export function arrayToMap(arr: any): {}; + + export function createMap(props: any): any; + + export function arrayRemove(array: any, value: any): void; + + export function escapeRegExp(str: any): any; + + export function escapeHTML(str: any): string; + + export function getMatchOffsets(string: any, regExp: any): any[]; + + export function deferredCall(fcn: any): { + (timeout: any): any; + schedule: any; + call(): any; + cancel(): any; + isPending(): any; + }; + + export function delayedCall(fcn: any, defaultTimeout: any): { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; + isPending(): any; + }; + + export function supportsLookbehind(): boolean; + + export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; +} +declare module "ace-code/src/lib/keys" { +} +declare module "ace-code/src/lib/event" { + export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; + + export function removeListener(elem: any, type: any, callback: any): void; + + export function stopEvent(e: any): boolean; + + export function stopPropagation(e: any): void; + + export function preventDefault(e: any): void; + + export function getButton(e: any): any; + + export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; + + export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; + + export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; + + export function getModifierString(e: KeyboardEvent | MouseEvent): any; + + export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; + + export function nextTick(callback: any, win: any): void; + + export function onIdle(cb: any, timeout: any): number; + + export function blockIdle(delay: any): void; + + export const nextFrame: any; +} +declare module "ace-code/src/lib/event_emitter" { + /**@type {any}*/ + export var EventEmitter: any; +} +declare module "ace-code/src/layer/font_metrics" { + const FontMetrics_base: undefined; + + export class FontMetrics { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + + el: HTMLDivElement; + + /** + * @param size + */ + checkForSizeChanges(size: any): void; + + charSizes: any; + allowBoldFonts: boolean; + + /** + * @param {boolean} val + */ + setPolling(val: boolean): void; + + getCharacterWidth(ch: any): any; + + destroy(): void; + + els: any[] | HTMLElement | Text; + + transformCoordinates(clientPos: any, elPos: any): any[]; + } + + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface FontMetrics extends Ace.EventEmitter { + } +} +declare module "ace-code/src/apply_delta" { + export function applyDelta(docLines: string[], delta: import("ace-code").Ace.Delta, doNotValidate?: any): void; +} +declare module "ace-code/src/document" { + const Document_base: undefined; + + /** + * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. + * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. + **/ + export class Document { + /** + * + * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty. + * @param {String | String[]} textOrLines text The starting text + **/ + constructor(textOrLines: string | string[]); + + /** + * Replaces all the lines in the current `Document` with the value of `text`. + * + * @param {String} text The text to use + **/ + setValue(text: string): void; + + /** + * Returns all the lines in the document as a single string, joined by the new line character. + * @returns {String} + **/ + getValue(): string; + + /** + * Creates a new `Anchor` to define a floating point in the document. + * @param {Number} row The row number to use + * @param {Number} column The column number to use + * @returns {Anchor} + **/ + createAnchor(row: number, column: number): Anchor; + + /** + * Returns the newline character that's being used, depending on the value of `newLineMode`. + * @returns {String} If `newLineMode == windows`, `\r\n` is returned. + * If `newLineMode == unix`, `\n` is returned. + * If `newLineMode == auto`, the value of `autoNewLine` is returned. + * + **/ + getNewLineCharacter(): string; + + /** + * [Sets the new line mode.]{: #Document.setNewLineMode.desc} + * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} + + **/ + setNewLineMode(newLineMode: NewLineMode): void; + + /** + * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} + * @returns {NewLineMode} + **/ + getNewLineMode(): NewLineMode; + + /** + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * @param {String} text The text to check + * @returns {boolean} + **/ + isNewLine(text: string): boolean; + + /** + * Returns a verbatim copy of the given line as it is in the document + * @param {Number} row The row index to retrieve + * @returns {string} + **/ + getLine(row: number): string; + + /** + * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. + * @param {Number} firstRow The first row index to retrieve + * @param {Number} lastRow The final row index to retrieve + * @returns {string[]} + **/ + getLines(firstRow: number, lastRow: number): string[]; + + /** + * Returns all lines in the document as string array. + * @returns {string[]} + **/ + getAllLines(): string[]; + + /** + * Returns the number of rows in the document. + * @returns {Number} + **/ + getLength(): number; + + /** + * Returns all the text within `range` as a single string. + * @param {IRange} range The range to work with. + * + * @returns {String} + **/ + getTextRange(range: IRange): string; + + /** + * Returns all the text within `range` as an array of lines. + * @param {IRange} range The range to work with. + * + * @returns {string[]} + **/ + getLinesForRange(range: IRange): string[]; + + /** + * @param row + * @param lines + + * @deprecated + */ + insertLines(row: any, lines: any): void; + + /** + * @param firstRow + * @param lastRow + * @returns {String[]} + + * @deprecated + */ + removeLines(firstRow: any, lastRow: any): string[]; + + /** + * @param position + * @returns {Point} + + * @deprecated + */ + insertNewLine(position: any): Point; + + /** + * Inserts a block of `text` at the indicated `position`. + * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` + * @param {String} text A chunk of text to insert + * @returns {Point} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + + **/ + insert(position: Point, text: string): Point; + + /** + * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event. + * + * This differs from the `insert` method in two ways: + * 1. This does NOT handle newline characters (single-line text only). + * 2. This is faster than the `insert` method for single-line text insertions. + * + * @param {Point} position The position to insert at; it's an object that looks like `{ row: row, column: column}` + * @param {String} text A chunk of text without new lines + * @returns {Point} Returns the position of the end of the inserted text + **/ + insertInLine(position: Point, text: string): Point; + + /** + * + * @param {number} row + * @param {number} column + * @return {Point} + */ + clippedPos(row: number, column: number): Point; + + /** + * @param {Point} pos + * @return {Point} + */ + clonePos(pos: Point): Point; + + /** + * @param {number} row + * @param {number} column + * @return {Point} + */ + pos(row: number, column: number): Point; + + /** + * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. + * @param {Number} row The index of the row to insert at + * @param {string[]} lines An array of strings + + **/ + insertFullLines(row: number, lines: string[]): void; + + /** + * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. + * @param {Point} position + * @param {string[]} lines An array of strings + * @returns {Point} Contains the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If `lines` is empty, this function returns an object containing the current row, and column, like this: + * ``` + * {row: row, column: 0} + * ``` + **/ + insertMergedLines(position: Point, lines: string[]): Point; + + /** + * Removes the `range` from the document. + * @param {IRange} range A specified Range to remove + * @returns {Point} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + + **/ + remove(range: IRange): Point; + + /** + * Removes the specified columns from the `row`. This method also triggers a `"change"` event. + * @param {Number} row The row to remove from + * @param {Number} startColumn The column to start removing at + * @param {Number} endColumn The column to stop removing at + * @returns {Point} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. + + **/ + removeInLine(row: number, startColumn: number, endColumn: number): Point; + + /** + * Removes a range of full lines. This method also triggers the `"change"` event. + * @param {Number} firstRow The first row to be removed + * @param {Number} lastRow The last row to be removed + * @returns {String[]} Returns all the removed lines. + + **/ + removeFullLines(firstRow: number, lastRow: number): string[]; + + /** + * Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event. + * @param {Number} row The row to check + * + **/ + removeNewLine(row: number): void; + + /** + * Replaces a range in the document with the new `text`. + * @param {Range | IRange} range A specified Range to replace + * @param {String} text The new text to use as a replacement + * @returns {Point} Returns an object containing the final row and column, like this: + * {row: endRow, column: 0} + * If the text and range are empty, this function returns an object containing the current `range.start` value. + * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. + * + **/ + replace(range: Range | IRange, text: string): Point; + + /** + * Applies all changes in `deltas` to the document. + * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) + **/ + applyDeltas(deltas: Delta[]): void; + + /** + * Reverts all changes in `deltas` from the document. + * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) + **/ + revertDeltas(deltas: Delta[]): void; + + /** + * Applies `delta` to the document. + * @param {Delta} delta A delta object (can include "insert" and "remove" actions) + * @param {boolean} [doNotValidate] + **/ + applyDelta(delta: Delta, doNotValidate?: boolean): void; + + /** + * Reverts `delta` from the document. + * @param {Delta} delta A delta object (can include "insert" and "remove" actions) + **/ + revertDelta(delta: Delta): void; + + /** + * Converts an index position in a document to a `{row, column}` object. + * + * Index refers to the "absolute position" of a character in the document. For example: + * + * ```javascript + * var x = 0; // 10 characters, plus one for newline + * var y = -1; + * ``` + * + * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. + * + * @param {Number} index An index to convert + * @param {Number} [startRow=0] The row from which to start the conversion + * @returns {Point} A `{row, column}` object of the `index` position + */ + indexToPosition(index: number, startRow?: number): Point; + + /** + * Converts the `{row, column}` position in a document to the character's index. + * + * Index refers to the "absolute position" of a character in the document. For example: + * + * ```javascript + * var x = 0; // 10 characters, plus one for newline + * var y = -1; + * ``` + * + * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. + * + * @param {Point} pos The `{row, column}` to convert + * @param {Number} [startRow=0] The row from which to start the conversion + * @returns {Number} The index position in the document + */ + positionToIndex(pos: Point, startRow?: number): number; + } + + export type Delta = import("ace-code").Ace.Delta; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + export type NewLineMode = import("ace-code").Ace.NewLineMode; + import Anchor_1 = require("ace-code/src/anchor"); + import Anchor = Anchor_1.Anchor; + import Range_1 = require("ace-code/src/range"); + import Range = Range_1.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type DocumentEvents = import("ace-code").Ace.DocumentEvents; + } + + export interface Document extends Ace.EventEmitter { + } +} +declare module "ace-code/src/anchor" { + const Anchor_base: undefined; + + /** + * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. + **/ + export class Anchor { + /** + * Creates a new `Anchor` and associates it with a document. + * + * @param {Document} doc The document to associate with the anchor + * @param {Number|import("ace-code").Ace.Point} row The starting row position + * @param {Number} [column] The starting column position + **/ + constructor(doc: Document, row: number | import("ace-code").Ace.Point, column?: number); + + /** + * Returns an object identifying the `row` and `column` position of the current anchor. + * @returns {import("ace-code").Ace.Point} + **/ + getPosition(): import("ace-code").Ace.Point; + + /** + * + * Returns the current document. + * @returns {Document} + **/ + getDocument(): Document; + + /** + * Internal function called when `"change"` event fired. + * @param {import("ace-code").Ace.Delta} delta + */ + onChange(delta: import("ace-code").Ace.Delta): void; + + /** + * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. + * @param {Number} row The row index to move the anchor to + * @param {Number} column The column index to move the anchor to + * @param {Boolean} [noClip] Identifies if you want the position to be clipped + **/ + setPosition(row: number, column: number, noClip?: boolean): void; + + row: any; + column: number; + + /** + * When called, the `"change"` event listener is removed. + * + **/ + detach(): void; + + /** + * When called, the `"change"` event listener is appended. + * @param {Document} doc The document to associate with + * + **/ + attach(doc: Document): void; + + /**@type{Document}*/ + document: Document; + markerId?: number; + } + + export type Document = import("ace-code/src/document").Document; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type AnchorEvents = import("ace-code").Ace.AnchorEvents; + type Document = import("ace-code").Ace.Document; + } + + export interface Anchor extends Ace.EventEmitter { + markerId?: number; + document: Ace.Document; + } +} +declare module "ace-code/src/lib/net" { + export function get(url: any, callback: any): void; + + export function loadScript(path: any, callback: any): void; + + export function qualifyURL(url: any): string; +} +declare module "ace-code/src/lib/report_error" { + export function reportError(msg: any, data: any): void; +} +declare module "ace-code/src/lib/default_english_messages" { + export var defaultEnglishMessages: { + "autocomplete.popup.aria-roledescription": string; + "autocomplete.popup.aria-label": string; + "autocomplete.popup.item.aria-roledescription": string; + "autocomplete.loading": string; + "editor.scroller.aria-roledescription": string; + "editor.scroller.aria-label": string; + "editor.gutter.aria-roledescription": string; + "editor.gutter.aria-label": string; + "error-marker.good-state": string; + "prompt.recently-used": string; + "prompt.other-commands": string; + "prompt.no-matching-commands": string; + "search-box.find.placeholder": string; + "search-box.find-all.text": string; + "search-box.replace.placeholder": string; + "search-box.replace-next.text": string; + "search-box.replace-all.text": string; + "search-box.toggle-replace.title": string; + "search-box.toggle-regexp.title": string; + "search-box.toggle-case.title": string; + "search-box.toggle-whole-word.title": string; + "search-box.toggle-in-selection.title": string; + "search-box.search-counter": string; + "text-input.aria-roledescription": string; + "text-input.aria-label": string; + "gutter.code-folding.range.aria-label": string; + "gutter.code-folding.closed.aria-label": string; + "gutter.code-folding.open.aria-label": string; + "gutter.code-folding.closed.title": string; + "gutter.code-folding.open.title": string; + "gutter.annotation.aria-label.error": string; + "gutter.annotation.aria-label.warning": string; + "gutter.annotation.aria-label.info": string; + "inline-fold.closed.title": string; + "gutter-tooltip.aria-label.error.singular": string; + "gutter-tooltip.aria-label.error.plural": string; + "gutter-tooltip.aria-label.warning.singular": string; + "gutter-tooltip.aria-label.warning.plural": string; + "gutter-tooltip.aria-label.info.singular": string; + "gutter-tooltip.aria-label.info.plural": string; + }; +} +declare module "ace-code/src/lib/app_config" { + const AppConfig_base: undefined; + + export class AppConfig { + /** + * @param {Object} obj + * @param {string} path + * @param {{ [key: string]: any }} options + * @returns {AppConfig} + */ + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + + /** + * @param {Object} obj + */ + resetOptions(obj: any): void; + + /** + * @param {string} path + * @param {string} name + * @param {any} value + */ + setDefaultValue(path: string, name: string, value: any): boolean; + + /** + * @param {string} path + * @param {{ [key: string]: any; }} optionHash + */ + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + + /** + * @param {any} value + */ + setMessages(value: any): void; + + /** + * @param {string} key + * @param {string} defaultString + * @param {{ [x: string]: any; }} [params] + */ + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + + warn: typeof warn; + reportError: (msg: any, data: any) => void; + } + + function warn(message: any, ...args: any[]): void; + + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface AppConfig extends Ace.EventEmitter { + } +} +declare module "ace-code/src/config" { + const _exports: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K_1, callback: any, capturing?: boolean): any; + addEventListener(name: K_2, callback: any, capturing?: boolean): any; + off(name: K_3, callback: any): void; + removeListener(name: K_4, callback: any): void; + removeEventListener(name: K_5, callback: any): void; + removeAllListeners(name?: string): void; + /** + * @param {string} key + * @return {*} + */ + get: (key: string) => any; + /** + * @param {string} key + * @param value + */ + set: (key: string, value: any) => void; + /** + * @return {{[key: string]: any}} + */ + all: () => { + [key: string]: any; + }; + /** + * module loading + * @param {string} name + * @param {string} [component] + * @returns {string} + */ + moduleUrl: (name: string, component?: string) => string; + /** + * @param {string} name + * @param {string} subst + * @returns {string} + */ + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + /** + * @param {string | [string, string]} moduleId + * @param {(module: any) => void} onLoad + */ + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.32.9"; + }; + export = _exports; + import AppConfig_1 = require("ace-code/src/lib/app_config"); + import AppConfig = AppConfig_1.AppConfig; +} +declare module "ace-code/src/layer/lines" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + + export class Lines { + /** + * @param {HTMLElement} element + * @param {number} [canvasHeight] + */ + constructor(element: HTMLElement, canvasHeight?: number); + + element: HTMLElement; + canvasHeight: number; + cells: any[]; + cellCache: any[]; + + /** + * @param {LayerConfig} config + */ + moveContainer(config: LayerConfig): void; + + /** + * @param {LayerConfig} oldConfig + * @param {LayerConfig} newConfig + */ + pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; + + /** + * @param {number} row + * @param {Partial} config + * @param {EditSession} session + */ + computeLineTop(row: number, config: Partial, session: EditSession): number; + + /** + * @param {number} row + * @param {LayerConfig} config + * @param {EditSession} session + */ + computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; + + getLength(): number; + + /** + * @param {number} index + */ + get(index: number): any; + + shift(): void; + + pop(): void; + + push(cell: any): void; + + unshift(cell: any): void; + + last(): any; + + createCell(row: any, config: any, session: any, initElement: any): any; + } +} +declare module "ace-code/src/layer/gutter" { + const Gutter_base: undefined; + + export class Gutter { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + + element: HTMLDivElement; + gutterWidth: number; + + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + + session: import("ace-code/src/edit_session").EditSession; + + /** + * @param {number} row + * @param {string} className + */ + addGutterDecoration(row: number, className: string): void; + + /** + * @param {number} row + * @param {string} className + */ + removeGutterDecoration(row: number, className: string): void; + + /** + * @param {any[]} annotations + */ + setAnnotations(annotations: any[]): void; + + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + + config: import("ace-code").Ace.LayerConfig; + oldLastRow: number; + + updateLineHighlight(): void; + + /** + * @param {LayerConfig} config + */ + scrollLines(config: LayerConfig): void; + + /** + * @param {boolean} highlightGutterLine + */ + setHighlightGutterLine(highlightGutterLine: boolean): void; + + /** + * @param {boolean} show + */ + setShowLineNumbers(show: boolean): void; + + getShowLineNumbers(): boolean; + + /** + * @param {boolean} [show] + */ + setShowFoldWidgets(show?: boolean): void; + + getShowFoldWidgets(): boolean; + + /** + * @param {{ x: number; }} point + */ + getRegion(point: { + x: number; + }): "markers" | "foldWidgets"; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + import Lines_1 = require("ace-code/src/layer/lines"); + import Lines = Lines_1.Lines; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type GutterEvents = import("ace-code").Ace.GutterEvents; + } + + export interface Gutter extends Ace.EventEmitter { + } +} +declare module "ace-code/src/layer/marker" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type LayerConfig = import("ace-code").Ace.LayerConfig; + + export class Marker { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + + element: HTMLDivElement; + + /** + * @param {number} padding + */ + setPadding(padding: number): void; + + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + + session: import("ace-code/src/edit_session").EditSession; + + /** + * @param {{ [x: number]: import("ace-code").Ace.MarkerLike; }} markers + */ + setMarkers(markers: { + [x: number]: import("ace-code").Ace.MarkerLike; + }): void; + + markers: { + [x: number]: import("ace-code").Ace.MarkerLike; + }; + + /** + * @param {string} className + * @param {string} css + */ + elt(className: string, css: string): void; + + i: number; + + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + + config: import("ace-code").Ace.LayerConfig; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} layerConfig + * @param {string} [extraStyle] + */ + drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {LayerConfig} config + * @param {string} [extraStyle] + */ + drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {number} [extraLength] + * @param {string} [extraStyle] + */ + drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {number} extraLength + * @param {string} extraStyle + */ + drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {undefined} [extraStyle] + */ + drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; + + /** + * @param {undefined} stringBuilder + * @param {Range} range + * @param {string} clazz + * @param {Partial} config + * @param {undefined} [extraStyle] + */ + drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; + } + + import Range_2 = require("ace-code/src/range"); + import Range = Range_2.Range; +} +declare module "ace-code/src/layer/text_util" { + export function isTextToken(tokenType: any): boolean; +} +declare module "ace-code/src/layer/text" { + const Text_base: undefined; + + export class Text { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + + dom: typeof dom; + element: HTMLDivElement; + EOL_CHAR: any; + + /** + * @param {number} padding + */ + setPadding(padding: number): void; + + /** + * @returns {number} + */ + getLineHeight(): number; + + /** + * @returns {number} + */ + getCharacterWidth(): number; + + checkForSizeChanges(): void; + + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + + /**@type {EditSession}*/ + session: EditSession; + + /** + * @param {string} showInvisibles + */ + setShowInvisibles(showInvisibles: string): boolean; + + showInvisibles: any; + showSpaces: boolean; + showTabs: boolean; + showEOL: boolean; + + /** + * @param {boolean} display + */ + setDisplayIndentGuides(display: boolean): boolean; + + displayIndentGuides: any; + + /** + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): boolean; + + tabSize: number; + + /** + * @param {LayerConfig} config + * @param {number} firstRow + * @param {number} lastRow + */ + updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; + + config?: import("ace-code").Ace.LayerConfig; + + /** + * @param {LayerConfig} config + */ + scrollLines(config: LayerConfig): void; + + /** + * @param {LayerConfig} config + */ + update(config: LayerConfig): void; + + renderIndentGuide(parent: any, value: any, max: any): any; + + EOF_CHAR: string; + EOL_CHAR_LF: string; + EOL_CHAR_CRLF: string; + TAB_CHAR: string; + SPACE_CHAR: string; + MAX_LINE_LENGTH: number; + destroy: {}; + onChangeTabSize: () => void; + } + + export type LayerConfig = import("ace-code").Ace.LayerConfig; + export type EditSession = import("ace-code/src/edit_session").EditSession; + import dom = require("ace-code/src/lib/dom"); + import Lines_2 = require("ace-code/src/layer/lines"); + import Lines = Lines_2.Lines; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type TextEvents = import("ace-code").Ace.TextEvents; + type LayerConfig = import("ace-code").Ace.LayerConfig; + } + + export interface Text extends Ace.EventEmitter { + config?: Ace.LayerConfig; + } +} +declare module "ace-code/src/layer/cursor" { + export class Cursor { + /** + * @param {HTMLElement} parentEl + */ + constructor(parentEl: HTMLElement); + + element: HTMLDivElement; + isVisible: boolean; + isBlinking: boolean; + blinkInterval: number; + smoothBlinking: boolean; + cursors: any[]; + cursor: HTMLDivElement; + + /** + * @param {number} padding + */ + setPadding(padding: number): void; + + /** + * @param {EditSession} session + */ + setSession(session: EditSession): void; + + session: import("ace-code/src/edit_session").EditSession; + + /** + * @param {boolean} blinking + */ + setBlinking(blinking: boolean): void; + + /** + * @param {number} blinkInterval + */ + setBlinkInterval(blinkInterval: number): void; + + /** + * @param {boolean} smoothBlinking + */ + setSmoothBlinking(smoothBlinking: boolean): void; + + addCursor(): HTMLDivElement; + + removeCursor(): any; + + hideCursor(): void; + + showCursor(): void; + + restartTimer(): void; + + intervalId: number; + + /** + * @param {import("ace-code").Ace.Point} [position] + * @param {boolean} [onScreen] + */ + getPixelPosition(position?: import("ace-code").Ace.Point, onScreen?: boolean): { + left: number; + top: number; + }; + + isCursorInView(pixelPos: any, config: any): boolean; + + update(config: any): void; + + config: any; + overwrite: any; + + destroy(): void; + + drawCursor: any; + timeoutId?: number; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + + export interface Cursor { + timeoutId?: number; + } +} +declare module "ace-code/src/scrollbar" { + const VScrollBar_base: typeof Scrollbar; + + /** + * Represents a vertical scroll bar. + **/ + export class VScrollBar extends Scrollbar { + /** + * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + + scrollTop: number; + scrollHeight: number; + width: number; + + /** + * Emitted when the scroll bar, well, scrolls. + * @event scroll + **/ + onScroll(): void; + + /** + * Returns the width of the scroll bar. + * @returns {Number} + **/ + getWidth(): number; + + /** + * Sets the height of the scroll bar, in pixels. + * @param {Number} height The new height + **/ + setHeight(height: number): void; + + /** + * Sets the scroll height of the scroll bar, in pixels. + * @param {Number} height The new scroll height + **/ + setScrollHeight(height: number): void; + + /** + * Sets the scroll top of the scroll bar. + * @param {Number} scrollTop The new scroll top + **/ + setScrollTop(scrollTop: number): void; + + /** + * Sets the inner height of the scroll bar, in pixels. + * @param {Number} height The new inner height + * @deprecated Use setScrollHeight instead + **/ + setInnerHeight: (height: number) => void; + } + + const HScrollBar_base: typeof Scrollbar; + + /** + * Represents a horisontal scroll bar. + **/ + export class HScrollBar extends Scrollbar { + /** + * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + + scrollLeft: number; + height: any; + + /** + * Emitted when the scroll bar, well, scrolls. + * @event scroll + **/ + onScroll(): void; + + /** + * Returns the height of the scroll bar. + * @returns {Number} + **/ + getHeight(): number; + + /** + * Sets the width of the scroll bar, in pixels. + * @param {Number} width The new width + **/ + setWidth(width: number): void; + + /** + * Sets the inner width of the scroll bar, in pixels. + * @param {Number} width The new inner width + * @deprecated Use setScrollWidth instead + **/ + setInnerWidth(width: number): void; + + /** + * Sets the scroll width of the scroll bar, in pixels. + * @param {Number} width The new scroll width + **/ + setScrollWidth(width: number): void; + + /** + * Sets the scroll left of the scroll bar. + * @param {Number} scrollLeft The new scroll left + **/ + setScrollLeft(scrollLeft: number): void; + } + + /** + * An abstract class representing a native scrollbar control. + **/ + class Scrollbar { + /** + * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {string} classSuffix + **/ + constructor(parent: Element, classSuffix: string); + + element: HTMLDivElement; + inner: HTMLDivElement; + skipEvent: boolean; + + setVisible(isVisible: any): void; + + isVisible: any; + coeff: number; + } + + export {VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface VScrollBar extends Ace.EventEmitter { + } + + export interface HScrollBar extends Ace.EventEmitter { + } +} +declare module "ace-code/src/scrollbar_custom" { + const VScrollBar_base: typeof ScrollBar; + + /** + * Represents a vertical scroll bar. + * @class VScrollBar + **/ + /** + * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + * + * @constructor + **/ + export class VScrollBar extends ScrollBar { + constructor(parent: any, renderer: any); + + scrollTop: number; + scrollHeight: number; + parent: any; + width: number; + renderer: any; + + /** + * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + **/ + onMouseDown(eType: any, e: any): void; + + getHeight(): number; + + /** + * Returns new top for scroll thumb + * @param {Number}thumbTop + * @returns {Number} + **/ + scrollTopFromThumbTop(thumbTop: number): number; + + /** + * Returns the width of the scroll bar. + * @returns {Number} + **/ + getWidth(): number; + + /** + * Sets the height of the scroll bar, in pixels. + * @param {Number} height The new height + **/ + setHeight(height: number): void; + + height: number; + slideHeight: number; + viewHeight: number; + + /** + * Sets the inner and scroll height of the scroll bar, in pixels. + * @param {Number} height The new inner height + * + * @param {boolean} force Forcely update height + **/ + setScrollHeight(height: number, force: boolean): void; + + pageHeight: any; + thumbHeight: number; + + /** + * Sets the scroll top of the scroll bar. + * @param {Number} scrollTop The new scroll top + **/ + setScrollTop(scrollTop: number): void; + + thumbTop: number; + setInnerHeight: (height: number, force: boolean) => void; + } + + const HScrollBar_base: typeof ScrollBar; + + /** + * Represents a horizontal scroll bar. + **/ + export class HScrollBar extends ScrollBar { + /** + * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {Object} renderer An editor renderer + **/ + constructor(parent: Element, renderer: any); + + scrollLeft: number; + scrollWidth: number; + height: number; + renderer: any; + + /** + * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + **/ + onMouseDown(eType: any, e: any): void; + + /** + * Returns the height of the scroll bar. + * @returns {Number} + **/ + getHeight(): number; + + /** + * Returns new left for scroll thumb + * @param {Number} thumbLeft + * @returns {Number} + **/ + scrollLeftFromThumbLeft(thumbLeft: number): number; + + /** + * Sets the width of the scroll bar, in pixels. + * @param {Number} width The new width + **/ + setWidth(width: number): void; + + width: number; + slideWidth: number; + viewWidth: number; + + /** + * Sets the inner and scroll width of the scroll bar, in pixels. + * @param {Number} width The new inner width + * @param {boolean} force Forcely update width + **/ + setScrollWidth(width: number, force: boolean): void; + + pageWidth: any; + thumbWidth: number; + + /** + * Sets the scroll left of the scroll bar. + * @param {Number} scrollLeft The new scroll left + **/ + setScrollLeft(scrollLeft: number): void; + + thumbLeft: number; + setInnerWidth: (width: number, force: boolean) => void; + } + + /** + * An abstract class representing a native scrollbar control. + **/ + class ScrollBar { + /** + * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. + * @param {Element} parent A DOM element + * @param {string} classSuffix + **/ + constructor(parent: Element, classSuffix: string); + + element: HTMLDivElement; + inner: HTMLDivElement; + VScrollWidth: number; + HScrollHeight: number; + skipEvent: boolean; + + setVisible(isVisible: any): void; + + isVisible: any; + coeff: number; + } + + export {VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface VScrollBar extends Ace.EventEmitter { + } + + export interface HScrollBar extends Ace.EventEmitter { + } +} +declare module "ace-code/src/renderloop" { + /** + * Batches changes (that force something to be redrawn) in the background. + **/ + export class RenderLoop { + constructor(onRender: any, win: any); + + onRender: any; + pending: boolean; + changes: number; + window: any; + + schedule(change: any): void; + + clear(change: any): number; + } +} +declare module "ace-code/src/css/editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/layer/decorators" { + export class Decorator { + constructor(parent: any, renderer: any); + + canvas: HTMLCanvasElement; + renderer: any; + pixelRatio: number; + maxHeight: any; + lineHeight: any; + canvasHeight: any; + heightRatio: number; + canvasWidth: any; + minDecorationHeight: number; + halfMinDecorationHeight: number; + colors: {}; + + compensateFoldRows(row: any, foldData: any): number; + } +} +declare module "ace-code/src/virtual_renderer" { + const VirtualRenderer_base: undefined; + const VirtualRenderer_base_1: undefined; + + /** + * The class that is responsible for drawing everything you see on the screen! + * @related editor.renderer + **/ + export class VirtualRenderer { + /** + * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. + * @param {HTMLElement | null} [container] The root element of the editor + * @param {String} [theme] The starting theme + + **/ + constructor(container?: HTMLElement | null, theme?: string); + + container: HTMLElement; + /**@type {HTMLElement}*/ + scroller: HTMLElement; + /**@type {HTMLElement}*/ + content: HTMLElement; + canvas: HTMLDivElement; + scrollBar: VScrollBar; + scrollBarV: import("ace-code").Ace.VScrollbar; + scrollBarH: import("ace-code").Ace.HScrollbar; + scrollTop: number; + scrollLeft: number; + cursorPos: { + row: number; + column: number; + }; + layerConfig: { + width: number; + padding: number; + firstRow: number; + firstRowScreen: number; + lastRow: number; + lineHeight: number; + characterWidth: number; + minHeight: number; + maxHeight: number; + offset: number; + height: number; + gutterOffset: number; + }; + scrollMargin: { + left: number; + right: number; + top: number; + bottom: number; + v: number; + h: number; + }; + margin: { + left: number; + right: number; + top: number; + bottom: number; + v: number; + h: number; + }; + + updateCharacterSize(): void; + + characterWidth: number; + lineHeight: number; + + /** + * + * Associates the renderer with an [[EditSession `EditSession`]]. + * @param {EditSession} session The session to associate with + **/ + setSession(session: EditSession): void; + + session: import("ace-code/src/edit_session").EditSession; + + onChangeNewLineMode(): void; + + /** + * Triggers a partial update of the text, from the range given by the two parameters. + * @param {Number} firstRow The first row to update + * @param {Number} lastRow The last row to update + * @param {boolean} [force] + **/ + updateLines(firstRow: number, lastRow: number, force?: boolean): void; + + onChangeTabSize(): void; + + /** + * Triggers a full update of the text, for all the rows. + **/ + updateText(): void; + + /** + * Triggers a full update of all the layers, for all the rows. + * @param {Boolean} [force] If `true`, forces the changes through + + **/ + updateFull(force?: boolean): void; + + /** + * Updates the font size. + **/ + updateFontSize(): void; + + /** + * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} + * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed + * @param {Number} [gutterWidth] The width of the gutter in pixels + * @param {Number} [width] The width of the editor in pixels + * @param {Number} [height] The hiehgt of the editor, in pixels + + **/ + onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; + + resizing: number; + gutterWidth: any; + + /** + * + * @param {number} width + + */ + onGutterResize(width: number): void; + + /** + * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. + + **/ + adjustWrapLimit(): boolean; + + /** + * Identifies whether you want to have an animated scroll or not. + * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls + + **/ + setAnimatedScroll(shouldAnimate: boolean): void; + + /** + * Returns whether an animated scroll happens or not. + * @returns {Boolean} + + **/ + getAnimatedScroll(): boolean; + + /** + * Identifies whether you want to show invisible characters or not. + * @param {Boolean} showInvisibles Set to `true` to show invisibles + + **/ + setShowInvisibles(showInvisibles: boolean): void; + + /** + * Returns whether invisible characters are being shown or not. + * @returns {Boolean} + + **/ + getShowInvisibles(): boolean; + + /** + * @return {boolean} + + */ + getDisplayIndentGuides(): boolean; + + /** + * @param {boolean} display + + */ + setDisplayIndentGuides(display: boolean): void; + + /** + + * @return {boolean} + */ + getHighlightIndentGuides(): boolean; + + /** + + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): void; + + /** + * Identifies whether you want to show the print margin or not. + * @param {Boolean} showPrintMargin Set to `true` to show the print margin + + **/ + setShowPrintMargin(showPrintMargin: boolean): void; + + /** + * Returns whether the print margin is being shown or not. + * @returns {Boolean} + + **/ + getShowPrintMargin(): boolean; + + /** + * Identifies whether you want to show the print margin column or not. + * @param {number} printMarginColumn Set to `true` to show the print margin column + + **/ + setPrintMarginColumn(printMarginColumn: number): void; + + /** + * Returns whether the print margin column is being shown or not. + * @returns {number} + + **/ + getPrintMarginColumn(): number; + + /** + * Returns `true` if the gutter is being shown. + * @returns {Boolean} + + **/ + getShowGutter(): boolean; + + /** + * Identifies whether you want to show the gutter or not. + * @param {Boolean} show Set to `true` to show the gutter + + **/ + setShowGutter(show: boolean): void; + + /** + + * @returns {boolean} + */ + getFadeFoldWidgets(): boolean; + + /** + + * @param {boolean} show + */ + setFadeFoldWidgets(show: boolean): void; + + /** + * + * @param {boolean} shouldHighlight + */ + setHighlightGutterLine(shouldHighlight: boolean): void; + + /** + + * @returns {boolean} + */ + getHighlightGutterLine(): boolean; + + /** + * + * Returns the root element containing this renderer. + * @returns {HTMLElement} + **/ + getContainerElement(): HTMLElement; + + /** + * + * Returns the element that the mouse events are attached to + * @returns {HTMLElement} + **/ + getMouseEventTarget(): HTMLElement; + + /** + * + * Returns the element to which the hidden text area is added. + * @returns {HTMLElement} + **/ + getTextAreaContainer(): HTMLElement; + + /** + * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} + * @returns {Number} + **/ + getFirstVisibleRow(): number; + + /** + * + * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. + * @returns {Number} + **/ + getFirstFullyVisibleRow(): number; + + /** + * + * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. + * @returns {Number} + **/ + getLastFullyVisibleRow(): number; + + /** + * + * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} + * @returns {Number} + **/ + getLastVisibleRow(): number; + + /** + * Sets the padding for all the layers. + * @param {Number} padding A new padding value (in pixels) + + **/ + setPadding(padding: number): void; + + /** + * + * @param {number} [top] + * @param {number} [bottom] + * @param {number} [left] + * @param {number} [right] + + */ + setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; + + /** + * + * @param {number} [top] + * @param {number} [bottom] + * @param {number} [left] + * @param {number} [right] + + */ + setMargin(top?: number, bottom?: number, left?: number, right?: number): void; + + /** + * Returns whether the horizontal scrollbar is set to be always visible. + * @returns {Boolean} + + **/ + getHScrollBarAlwaysVisible(): boolean; + + /** + * Identifies whether you want to show the horizontal scrollbar or not. + * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible + + **/ + setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; + + /** + * Returns whether the horizontal scrollbar is set to be always visible. + * @returns {Boolean} + + **/ + getVScrollBarAlwaysVisible(): boolean; + + /** + * Identifies whether you want to show the horizontal scrollbar or not. + * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible + **/ + setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; + + freeze(): void; + + unfreeze(): void; + + desiredHeight: any; + + /** + * Schedules an update to all the front markers in the document. + **/ + updateFrontMarkers(): void; + + /** + * + * Schedules an update to all the back markers in the document. + **/ + updateBackMarkers(): void; + + /** + * + * Deprecated; (moved to [[EditSession]]) + * @deprecated + **/ + addGutterDecoration(row: any, className: any): void; + + /** + * Deprecated; (moved to [[EditSession]]) + * @deprecated + **/ + removeGutterDecoration(row: any, className: any): void; + + /** + * + * Redraw breakpoints. + * @param {any} [rows] + */ + updateBreakpoints(rows?: any): void; + + /** + * Sets annotations for the gutter. + * @param {import("ace-code").Ace.Annotation[]} annotations An array containing annotations + * + **/ + setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; + + /** + * + * Updates the cursor icon. + **/ + updateCursor(): void; + + /** + * + * Hides the cursor icon. + **/ + hideCursor(): void; + + /** + * + * Shows the cursor icon. + **/ + showCursor(): void; + + /** + * + * @param {Point} anchor + * @param {Point} lead + * @param {number} [offset] + */ + scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; + + /** + * + * Scrolls the cursor into the first visibile area of the editor + * @param {Point} [cursor] + * @param {number} [offset] + * @param {{ top?: any; bottom?: any; }} [$viewMargin] + */ + scrollCursorIntoView(cursor?: Point, offset?: number, $viewMargin?: { + top?: any; + bottom?: any; + }): void; + + /** + * {:EditSession.getScrollTop} + * @related EditSession.getScrollTop + * @returns {Number} + **/ + getScrollTop(): number; + + /** + * {:EditSession.getScrollLeft} + * @related EditSession.getScrollLeft + * @returns {Number} + **/ + getScrollLeft(): number; + + /** + * Returns the first visible row, regardless of whether it's fully visible or not. + * @returns {Number} + **/ + getScrollTopRow(): number; + + /** + * Returns the last visible row, regardless of whether it's fully visible or not. + * @returns {Number} + **/ + getScrollBottomRow(): number; + + /** + * Gracefully scrolls from the top of the editor to the row indicated. + * @param {Number} row A row id + * + * @related EditSession.setScrollTop + **/ + scrollToRow(row: number): void; + + /** + * + * @param {Point} cursor + * @param {number} [alignment] + * @returns {number} + */ + alignCursor(cursor: Point, alignment?: number): number; + + /** + * Gracefully scrolls the editor to the row indicated. + * @param {Number} line A line number + * @param {Boolean} center If `true`, centers the editor the to indicated line + * @param {Boolean} animate If `true` animates scrolling + * @param {() => void} [callback] Function to be called after the animation has finished + + **/ + scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; + + /** + * + * @param fromValue + * @param [callback] + + */ + animateScrolling(fromValue: any, callback?: any): void; + + /** + * Scrolls the editor to the y pixel indicated. + * @param {Number} scrollTop The position to scroll to + **/ + scrollToY(scrollTop: number): void; + + /** + * Scrolls the editor across the x-axis to the pixel indicated. + * @param {Number} scrollLeft The position to scroll to + **/ + scrollToX(scrollLeft: number): void; + + /** + * Scrolls the editor across both x- and y-axes. + * @param {Number} x The x value to scroll to + * @param {Number} y The y value to scroll to + **/ + scrollTo(x: number, y: number): void; + + /** + * Scrolls the editor across both x- and y-axes. + * @param {Number} deltaX The x value to scroll by + * @param {Number} deltaY The y value to scroll by + **/ + scrollBy(deltaX: number, deltaY: number): void; + + /** + * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. + * @param {Number} deltaX The x value to scroll by + * @param {Number} deltaY The y value to scroll by + * + * @returns {Boolean} + **/ + isScrollableBy(deltaX: number, deltaY: number): boolean; + + /** + * + * @param {number} x + * @param {number} y + * @returns {import("ace-code").Ace.ScreenCoordinates} + + */ + pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; + + /** + * + * @param {number} x + * @param {number} y + * @returns {Point} + + */ + screenToTextCoordinates(x: number, y: number): Point; + + /** + * Returns an object containing the `pageX` and `pageY` coordinates of the document position. + * @param {Number} row The document row position + * @param {Number} column The document column position + * + * @returns {{ pageX: number, pageY: number}} + **/ + textToScreenCoordinates(row: number, column: number): { + pageX: number; + pageY: number; + }; + + /** + * + * Focuses the current container. + **/ + visualizeFocus(): void; + + /** + * + * Blurs the current container. + **/ + visualizeBlur(): void; + + /** + * @param {Object} composition + + **/ + showComposition(composition: any): void; + + /** + * @param {String} text A string of text to use + * + * Sets the inner text of the current composition to `text`. + + **/ + setCompositionText(text: string): void; + + /** + * + * Hides the current composition. + + **/ + hideComposition(): void; + + /** + * @param {string} text + * @param {Point} [position] + */ + setGhostText(text: string, position?: Point): void; + + removeGhostText(): void; + + /** + * @param {string} text + * @param {string} type + * @param {number} row + * @param {number} [column] + */ + addToken(text: string, type: string, row: number, column?: number): void; + + removeExtraToken(row: any, column: any): void; + + /** + * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} + * @param {String | Theme} [theme] The path to a theme + * @param {() => void} [cb] optional callback + + **/ + setTheme(theme?: string | Theme, cb?: () => void): void; + + /** + * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} + * @returns {String} + **/ + getTheme(): string; + + /** + * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} + * @param {String} style A class name + * @param {boolean}[include] + **/ + setStyle(style: string, include?: boolean): void; + + /** + * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} + * @param {String} style A class name + * + **/ + unsetStyle(style: string): void; + + /** + * @param {string} style + */ + setCursorStyle(style: string): void; + + /** + * @param {String} cursorStyle A css cursor style + **/ + setMouseCursor(cursorStyle: string): void; + + attachToShadowRoot(): void; + + /** + * Destroys the text and cursor layers for this renderer. + + **/ + destroy(): void; + + CHANGE_CURSOR: number; + CHANGE_MARKER: number; + CHANGE_GUTTER: number; + CHANGE_SCROLL: number; + CHANGE_LINES: number; + CHANGE_TEXT: number; + CHANGE_SIZE: number; + CHANGE_MARKER_BACK: number; + CHANGE_MARKER_FRONT: number; + CHANGE_FULL: number; + CHANGE_H_SCROLL: number; + STEPS: number; + textarea?: HTMLTextAreaElement; + enableKeyboardAccessibility?: boolean; + keyboardFocusClassName?: string; + showInvisibles?: boolean; + theme?: any; + destroyed?: boolean; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code").Ace.Point; + export type Theme = import("ace-code").Ace.Theme; + import GutterLayer_1 = require("ace-code/src/layer/gutter"); + import GutterLayer = GutterLayer_1.Gutter; + import MarkerLayer_1 = require("ace-code/src/layer/marker"); + import MarkerLayer = MarkerLayer_1.Marker; + import TextLayer_1 = require("ace-code/src/layer/text"); + import TextLayer = TextLayer_1.Text; + import CursorLayer_1 = require("ace-code/src/layer/cursor"); + import CursorLayer = CursorLayer_1.Cursor; + import VScrollBar_1 = require("ace-code/src/scrollbar"); + import VScrollBar = VScrollBar_1.VScrollBar; + import FontMetrics_1 = require("ace-code/src/layer/font_metrics"); + import FontMetrics = FontMetrics_1.FontMetrics; + import RenderLoop_1 = require("ace-code/src/renderloop"); + import RenderLoop = RenderLoop_1.RenderLoop; + import Decorator_1 = require("ace-code/src/layer/decorators"); + import Decorator = Decorator_1.Decorator; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type VirtualRendererOptions = import("ace-code").Ace.VirtualRendererOptions; + type EditSession = import("ace-code").Ace.EditSession; + } + + export interface VirtualRenderer extends Ace.EventEmitter, Ace.OptionsProvider { + textarea?: HTMLTextAreaElement; + enableKeyboardAccessibility?: boolean; + keyboardFocusClassName?: string; + showInvisibles?: boolean; + theme?: any; + destroyed?: boolean; + session: Ace.EditSession; + } +} +declare module "ace-code/src/selection" { + const Selection_base: undefined; + const Selection_base_1: undefined; + + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code/src/anchor").Anchor} Anchor + * @typedef {import("ace-code").Ace.Point} Point + */ + export class Selection { + /** + * Creates a new `Selection` object. + * @param {EditSession} session The session to use + * @constructor + **/ + constructor(session: EditSession); + + /**@type {EditSession}*/ + session: EditSession; + /**@type {import("ace-code/src/document").Document}*/ + doc: import("ace-code/src/document").Document; + /**@type {Anchor}*/ + cursor: Anchor; + lead: Anchor; + /**@type {Anchor}*/ + anchor: Anchor; + + /** + * Returns `true` if the selection is empty. + * @returns {Boolean} + **/ + isEmpty(): boolean; + + /** + * Returns `true` if the selection is a multi-line. + * @returns {Boolean} + **/ + isMultiLine(): boolean; + + /** + * Returns an object containing the `row` and `column` current position of the cursor. + * @returns {Point} + **/ + getCursor(): Point; + + /** + * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. + * @param {Number} row The new row + * @param {Number} column The new column + * + **/ + setAnchor(row: number, column: number): void; + + /** + * Returns an object containing the `row` and `column` of the calling selection anchor. + * + * @returns {Point} + * @related Anchor.getPosition + **/ + getAnchor(): Point; + + /** + * Returns an object containing the `row` and `column` of the calling selection lead. + * @returns {Object} + **/ + getSelectionLead(): any; + + /** + * Returns `true` if the selection is going backwards in the document. + * @returns {Boolean} + **/ + isBackwards(): boolean; + + /** + * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} + * @returns {Range} + **/ + getRange(): Range; + + /** + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ + clearSelection(): void; + + /** + * Selects all the text in the document. + **/ + selectAll(): void; + + /** + * Sets the selection to the provided range. + * @param {import("ace-code").Ace.IRange} range The range of text to select + * @param {Boolean} [reverse] Indicates if the range should go backwards (`true`) or not + **/ + setRange(range: import("ace-code").Ace.IRange, reverse?: boolean): void; + + /** + * Moves the selection cursor to the indicated row and column. + * @param {Number} row The row to select to + * @param {Number} column The column to select to + **/ + selectTo(row: number, column: number): void; + + /** + * Moves the selection cursor to the row and column indicated by `pos`. + * @param {Point} pos An object containing the row and column + **/ + selectToPosition(pos: Point): void; + + /** + * Moves the selection cursor to the indicated row and column. + * @param {Number} row The row to select to + * @param {Number} column The column to select to + **/ + moveTo(row: number, column: number): void; + + /** + * Moves the selection cursor to the row and column indicated by `pos`. + * @param {Object} pos An object containing the row and column + **/ + moveToPosition(pos: any): void; + + /** + * Moves the selection up one row. + **/ + selectUp(): void; + + /** + * Moves the selection down one row. + **/ + selectDown(): void; + + /** + * Moves the selection right one column. + **/ + selectRight(): void; + + /** + * Moves the selection left one column. + **/ + selectLeft(): void; + + /** + * Moves the selection to the beginning of the current line. + **/ + selectLineStart(): void; + + /** + * Moves the selection to the end of the current line. + **/ + selectLineEnd(): void; + + /** + * Moves the selection to the end of the file. + **/ + selectFileEnd(): void; + + /** + * Moves the selection to the start of the file. + **/ + selectFileStart(): void; + + /** + * Moves the selection to the first word on the right. + **/ + selectWordRight(): void; + + /** + * Moves the selection to the first word on the left. + **/ + selectWordLeft(): void; + + /** + * Moves the selection to highlight the entire word. + * @related EditSession.getWordRange + **/ + getWordRange(row: any, column: any): Range; + + /** + * Selects an entire word boundary. + **/ + selectWord(): void; + + /** + * Selects a word, including its right whitespace. + * @related EditSession.getAWordRange + **/ + selectAWord(): void; + + getLineRange(row: any, excludeLastChar: any): Range; + + /** + * Selects the entire line. + **/ + selectLine(): void; + + /** + * Moves the cursor up one row. + **/ + moveCursorUp(): void; + + /** + * Moves the cursor down one row. + **/ + moveCursorDown(): void; + + /** + * + * Returns `true` if moving the character next to the cursor in the specified direction is a soft tab. + * @param {Point} cursor the current cursor position + * @param {Number} tabSize the tab size + * @param {Number} direction 1 for right, -1 for left + */ + wouldMoveIntoSoftTab(cursor: Point, tabSize: number, direction: number): boolean; + + /** + * Moves the cursor left one column. + **/ + moveCursorLeft(): void; + + /** + * Moves the cursor right one column. + **/ + moveCursorRight(): void; + + /** + * Moves the cursor to the start of the line. + **/ + moveCursorLineStart(): void; + + /** + * Moves the cursor to the end of the line. + **/ + moveCursorLineEnd(): void; + + /** + * Moves the cursor to the end of the file. + **/ + moveCursorFileEnd(): void; + + /** + * Moves the cursor to the start of the file. + **/ + moveCursorFileStart(): void; + + /** + * Moves the cursor to the word on the right. + **/ + moveCursorLongWordRight(): void; + + /** + * + * Moves the cursor to the word on the left. + **/ + moveCursorLongWordLeft(): void; + + moveCursorShortWordRight(): void; + + moveCursorShortWordLeft(): void; + + moveCursorWordRight(): void; + + moveCursorWordLeft(): void; + + /** + * Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document. + * @param {Number} rows The number of rows to move by + * @param {Number} chars The number of characters to move by + * + * @related EditSession.documentToScreenPosition + **/ + moveCursorBy(rows: number, chars: number): void; + + /** + * Moves the selection to the position indicated by its `row` and `column`. + * @param {Point} position The position to move to + **/ + moveCursorToPosition(position: Point): void; + + /** + * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} + * @param {Number} row The row to move to + * @param {Number} column The column to move to + * @param {Boolean} [keepDesiredColumn] [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} + **/ + moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; + + /** + * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} + * @param {Number} row The row to move to + * @param {Number} column The column to move to + * @param {Boolean} keepDesiredColumn {:preventUpdateBool} + **/ + moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; + + detach(): void; + + /** + * @param {Range & {desiredColumn?: number}} range + */ + fromOrientedRange(range: Range & { + desiredColumn?: number; + }): void; + + /** + * @param {Range & {desiredColumn?: number}} [range] + */ + toOrientedRange(range?: Range & { + desiredColumn?: number; + }): Range & { + desiredColumn?: number; + }; + + /** + * Saves the current cursor position and calls `func` that can change the cursor + * postion. The result is the range of the starting and eventual cursor position. + * Will reset the cursor position. + * @param {Function} func The callback that should change the cursor position + * @returns {Range} + **/ + getRangeOfMovements(func: Function): Range; + + /** + * + * @returns {Range|Range[]} + */ + toJSON(): Range | Range[]; + + /** + * + * @param data + */ + fromJSON(data: any): void; + + /** + * + * @param data + * @return {boolean} + */ + isEqual(data: any): boolean; + + /** + * Left for backward compatibility + * @deprecated + */ + setSelectionAnchor: (row: number, column: number) => void; + /** + * Left for backward compatibility + * @deprecated + */ + getSelectionAnchor: () => Point; + setSelectionRange: (range: import("ace-code").Ace.IRange, reverse?: boolean) => void; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Anchor = import("ace-code/src/anchor").Anchor; + export type Point = import("ace-code").Ace.Point; + import Range_3 = require("ace-code/src/range"); + import Range = Range_3.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type SelectionEvents = import("ace-code").Ace.SelectionEvents; + type MultiSelectProperties = import("ace-code").Ace.MultiSelectProperties; + } + + export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { + } +} +declare module "ace-code/src/clipboard" { + export let lineMode: string | false; + + export function pasteCancelled(): boolean; + + export function cancel(): void; +} +declare module "ace-code/src/keyboard/textinput" { + export function $setUserAgentForTests(_isMobile: any, _isIOS: any): void; + + export var TextInput: any; +} +declare module "ace-code/src/mouse/mouse_event" { + export class MouseEvent { + constructor(domEvent: any, editor: any); + + /** @type {number} */ speed: number; + /** @type {number} */ wheelX: number; + /** @type {number} */ wheelY: number; + domEvent: any; + editor: any; + x: any; + clientX: any; + y: any; + clientY: any; + propagationStopped: boolean; + defaultPrevented: boolean; + + stopPropagation(): void; + + preventDefault(): void; + + stop(): void; + + /** + * Get the document position below the mouse cursor + * + * @return {Object} 'row' and 'column' of the document position + */ + getDocumentPosition(): any; + + /** + * Get the relative position within the gutter. + * + * @return {Number} 'row' within the gutter. + */ + getGutterRow(): number; + + /** + * Check if the mouse cursor is inside of the text selection + * + * @return {Boolean} whether the mouse cursor is inside of the selection + */ + inSelection(): boolean; + + /** + * Get the clicked mouse button + * + * @return {Number} 0 for left button, 1 for middle button, 2 for right button + */ + getButton(): number; + + /** + * @return {Boolean} whether the shift key was pressed when the event was emitted + */ + getShiftKey(): boolean; + + getAccelKey(): any; + + time?: number; + } + + export interface MouseEvent { + time?: number; + } +} +declare module "ace-code/src/mouse/default_handlers" { + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + + export class DefaultHandlers { + /** + * @param {MouseHandler} mouseHandler + */ + constructor(mouseHandler: MouseHandler); + + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + + mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; + + /** + * + * @param {import("ace-code").Ace.Position} [pos] + * @param {boolean} [waitForClickSelection] + * @this {MouseHandler} + */ + startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; + + /** + * @this {MouseHandler} + */ + select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + + /** + * @param {string | number} unitName + * @this {MouseHandler} + */ + extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; + + /** + * @this {MouseHandler} + */ + selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + + /** + * @this {MouseHandler} + */ + focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; + + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + + /** + * @param {MouseEvent} ev + * @this {MouseHandler} + */ + onMouseWheel(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; + + selectEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + selectAllEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + selectByWordsEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; + } +} +declare module "ace-code/src/lib/scroll" { + export function preventParentScroll(event: any): void; +} +declare module "ace-code/src/tooltip" { + export class HoverTooltip extends Tooltip { + constructor(parentNode?: HTMLElement); + + timeout: number; + lastT: number; + idleTime: number; + lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; + + onMouseOut(e: any): void; + + /** + * @param {MouseEvent} e + * @param {Editor} editor + */ + onMouseMove(e: MouseEvent, editor: Editor): void; + + waitForHover(): void; + + /** + * @param {Editor} editor + */ + addToEditor(editor: Editor): void; + + /** + * @param {Editor} editor + */ + removeFromEditor(editor: Editor): void; + + /** + * @param {MouseEvent} e + */ + isOutsideOfText(e: MouseEvent): boolean; + + /** + * @param {any} value + */ + setDataProvider(value: any): void; + + /** + * @param {Editor} editor + * @param {Range} range + * @param {any} domNode + * @param {MouseEvent} startingEvent + */ + showForRange(editor: Editor, range: Range, domNode: any, startingEvent: MouseEvent): void; + + range: Range; + + /** + * @param {Range} range + * @param {EditSession} [session] + */ + addMarker(range: Range, session?: EditSession): void; + + marker: number; + row: number; + } + + export type Editor = import("ace-code/src/editor").Editor; + export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export var popupManager: PopupManager; + + export class Tooltip { + /** + * @param {Element} parentNode + **/ + constructor(parentNode: Element); + + isOpen: boolean; + + /** + * @returns {HTMLElement} + **/ + getElement(): HTMLElement; + + /** + * @param {String} text + **/ + setText(text: string): void; + + /** + * @param {String} html + **/ + setHtml(html: string): void; + + /** + * @param {Number} x + * @param {Number} y + **/ + setPosition(x: number, y: number): void; + + /** + * @param {String} className + **/ + setClassName(className: string): void; + + /** + * @param {import("ace-code").Ace.Theme} theme + */ + setTheme(theme: import("ace-code").Ace.Theme): void; + + /** + * @param {String} [text] + * @param {Number} [x] + * @param {Number} [y] + **/ + show(text?: string, x?: number, y?: number): void; + + hide(e: any): void; + + /** + * @returns {Number} + **/ + getHeight(): number; + + /** + * @returns {Number} + **/ + getWidth(): number; + + destroy(): void; + } + + import Range_4 = require("ace-code/src/range"); + import Range = Range_4.Range; + + class PopupManager { + /**@type{Tooltip[]} */ + popups: Tooltip[]; + + /** + * @param {Tooltip} popup + */ + addPopup(popup: Tooltip): void; + + /** + * @param {Tooltip} popup + */ + removePopup(popup: Tooltip): void; + + updatePopups(): void; + + /** + * @param {Tooltip} popupA + * @param {Tooltip} popupB + * @return {boolean} + */ + doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; + } + + export {}; + + export interface HoverTooltip { + row: number; + } +} +declare module "ace-code/src/mouse/default_gutter_handler" { + /** + * @param {MouseHandler} mouseHandler + * @this {MouseHandler} + */ + export function GutterHandler(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, mouseHandler: MouseHandler): void; + + export interface GutterHandler { + } + + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + + export class GutterTooltip extends Tooltip { + static get annotationLabels(): { + error: { + singular: any; + plural: any; + }; + warning: { + singular: any; + plural: any; + }; + info: { + singular: any; + plural: any; + }; + }; + + static annotationsToSummaryString(annotations: any): string; + + constructor(editor: any); + + editor: any; + + setPosition(x: any, y: any): void; + + showTooltip(row: any): void; + + hideTooltip(): void; + } + + import Tooltip_1 = require("ace-code/src/tooltip"); + import Tooltip = Tooltip_1.Tooltip; + + export interface GutterHandler { + } +} +declare module "ace-code/src/mouse/dragdrop_handler" { + export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; + + /** + * @param {MouseHandler} mouseHandler + */ + export function DragdropHandler(mouseHandler: MouseHandler): void; + + export class DragdropHandler { + /** + * @param {MouseHandler} mouseHandler + */ + constructor(mouseHandler: MouseHandler); + + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragStart: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragEnter: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDragOver: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + onDragLeave: (e: any) => void; + /** + * @param e + * @this {MouseHandler} + * @return {*} + */ + onDrop: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; + } +} +declare module "ace-code/src/mouse/touch_handler" { + export function addTouchListeners(el: any, editor: any): void; +} +declare module "ace-code/src/mouse/mouse_handler" { + export class MouseHandler { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + + /** @type {MouseEvent} */ mouseEvent: MouseEvent; + editor: import("ace-code/src/editor").Editor; + + onMouseEvent(name: any, e: any): void; + + onMouseMove(name: any, e: any): void; + + /** + * @param {string} name + * @param {{ wheelX: number; wheelY: number; }} e + */ + onMouseWheel(name: string, e: { + wheelX: number; + wheelY: number; + }): void; + + setState(state: any): void; + + state: any; + + captureMouse(ev: any, mouseMoveHandler: any): number; + + x: any; + y: any; + isMousePressed: boolean; + releaseMouse: (e: any) => void; + + cancelContextMenu(): void; + + destroy(): void; + + cancelDrag?: boolean; + mousedownEvent?: MouseEvent; + startSelect?: (pos?: import("ace-code").Ace.Point, waitForClickSelection?: boolean) => void; + select?: () => void; + selectEnd?: () => void; + } + + export type Editor = import("ace-code/src/editor").Editor; + import MouseEvent_1 = require("ace-code/src/mouse/mouse_event"); + import MouseEvent = MouseEvent_1.MouseEvent; + namespace Ace { + type Range = import("ace-code").Ace.Range; + type MouseEvent = import("ace-code").Ace.MouseEvent; + type Point = import("ace-code").Ace.Point; + } + + export interface MouseHandler { + cancelDrag?: boolean; + mousedownEvent?: Ace.MouseEvent; + startSelect?: (pos?: Ace.Point, waitForClickSelection?: boolean) => void; + select?: () => void; + selectEnd?: () => void; + } +} +declare module "ace-code/src/mouse/fold_handler" { + export class FoldHandler { + constructor(editor: any); + } +} +declare module "ace-code/src/keyboard/keybinding" { + export type Editor = import("ace-code/src/editor").Editor; + export type KeyboardHandler = import("ace-code").Ace.KeyboardHandler; + + export class KeyBinding { + /** + * @param {Editor} editor + */ + constructor(editor: Editor); + + /** + * @param {KeyboardHandler} kb + */ + setDefaultHandler(kb: KeyboardHandler): void; + + /** + * @param {KeyboardHandler} kb + */ + setKeyboardHandler(kb: KeyboardHandler): void; + + /** + * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] + * @param {number} [pos] + */ + addKeyboardHandler(kb?: Partial & { + attach?: (editor: import("ace-code/src/editor").Editor) => void; + detach?: (editor: import("ace-code/src/editor").Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + } & { + attach?: (editor: any) => void; + detach?: (editor: any) => void; + }, pos?: number): void; + + /** + * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb + * @returns {boolean} + */ + removeKeyboardHandler(kb: Partial & { + attach?: (editor: import("ace-code/src/editor").Editor) => void; + detach?: (editor: import("ace-code/src/editor").Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + } & { + attach?: (editor: any) => void; + detach?: (editor: any) => void; + }): boolean; + + /** + * @return {KeyboardHandler} + */ + getKeyboardHandler(): KeyboardHandler; + + getStatusText(): string; + + /** + * @param {any} e + * @param {number} hashId + * @param {number} keyCode + * @return {boolean} + */ + onCommandKey(e: any, hashId: number, keyCode: number): boolean; + + /** + * @param {string} text + * @return {boolean} + */ + onTextInput(text: string): boolean; + } +} +declare module "ace-code/src/search" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + + /** + * A class designed to handle all sorts of text searches within a [[Document `Document`]]. + **/ + export class Search { + /** + * Sets the search options via the `options` parameter. + * @param {Partial} options An object containing all the new search properties + * @returns {Search} + * @chainable + **/ + set(options: Partial): Search; + + /** + * [Returns an object containing all the search options.]{: #Search.getOptions} + * @returns {Partial} + **/ + getOptions(): Partial; + + /** + * Sets the search options via the `options` parameter. + * @param {SearchOptions} options object containing all the search propertie + * @related Search.set + **/ + setOptions(options: { + /** + * - The string or regular expression you're looking for + */ + needle?: string | RegExp; + /** + * - Whether to search backwards from where cursor currently is + */ + backwards?: boolean; + /** + * - Whether to wrap the search back to the beginning when it hits the end + */ + wrap?: boolean; + /** + * - Whether the search ought to be case-sensitive + */ + caseSensitive?: boolean; + /** + * - Whether the search matches only on whole words + */ + wholeWord?: boolean; + /** + * - The [[Range]] to search within. Set this to `null` for the whole document + */ + range?: Range | null; + /** + * - Whether the search is a regular expression or not + */ + regExp?: boolean; + /** + * - The starting [[Range]] or cursor position to begin the search + */ + start?: Range | import("ace-code").Ace.Position; + /** + * - Whether or not to include the current line in the search + */ + skipCurrent?: boolean; + preserveCase?: boolean; + preventScroll?: boolean; + /** + * ** + */ + re?: any; + }): void; + + /** + * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. + * @param {EditSession} session The session to search with + * @returns {Range|false} + **/ + find(session: EditSession): Range | false; + + /** + * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. + * @param {EditSession} session The session to search with + * @returns {Range[]} + **/ + findAll(session: EditSession): Range[]; + + /** + * Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`. + * @param {String} input The text to search in + * @param {any} replacement The replacing text + * + (String): If `options.regExp` is `true`, this function returns `input` with the replacement already made. Otherwise, this function just returns `replacement`.
+ * If `options.needle` was not found, this function returns `null`. + * + * + * @returns {String} + **/ + replace(input: string, replacement: any): string; + } + + import Range_5 = require("ace-code/src/range"); + import Range = Range_5.Range; +} +declare module "ace-code/src/keyboard/hash_handler" { + export type Command = import("ace-code").Ace.Command; + export type CommandLike = import("ace-code").Ace.CommandLike; + + export class HashHandler extends MultiHashHandler { + } + + export namespace HashHandler { + function call(thisArg: any, config: any, platform: any): void; + } + + export class MultiHashHandler { + /** + * @param {Record | Command[]} [config] + * @param {string} [platform] + */ + constructor(config?: Record | Command[], platform?: string); + + platform: string; + /**@type {Record}*/ + commands: Record; + commandKeyBinding: {}; + + /** + * @param {Command} command + */ + addCommand(command: Command): void; + + /** + * @param {Command | string} command + * @param {boolean} [keepCommand] + */ + removeCommand(command: Command | string, keepCommand?: boolean): void; + + /** + * @param {string | { win?: string; mac?: string; position?:number}} key + * @param {CommandLike | string} command + * @param {number} [position] + */ + bindKey(key: string | { + win?: string; + mac?: string; + position?: number; + }, command: CommandLike | string, position?: number): void; + + /** + * @param {Record | Command[]} [commands] + */ + addCommands(commands?: Record | Command[]): void; + + /** + * @param {Record} commands + */ + removeCommands(commands: Record): void; + + /** + * @param {Record} keyList + */ + bindKeys(keyList: Record): void; + + /** + * Accepts keys in the form ctrl+Enter or ctrl-Enter + * keys without modifiers or shift only + * @param {string} keys + * @returns {{key: string, hashId: number} | false} + */ + parseKeys(keys: string): { + key: string; + hashId: number; + } | false; + + /** + * @param {number} hashId + * @param {string} keyString + * @returns {Command} + */ + findKeyCommand(hashId: number, keyString: string): Command; + + /** + * @param {{ $keyChain: string | any[]; }} data + * @param {number} hashId + * @param {string} keyString + * @param {number} keyCode + * @returns {{command: string} | void} + */ + handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: number): { + command: string; + } | void; + + /** + * @param {any} [editor] + * @param {any} [data] + * @returns {string} + */ + getStatusText(editor?: any, data?: any): string; + } + + export namespace MultiHashHandler { + function call(thisArg: any, config: any, platform: any): void; + } +} +declare module "ace-code/src/commands/command_manager" { + const CommandManager_base: typeof MultiHashHandler; + + export class CommandManager extends MultiHashHandler { + /** + * new CommandManager(platform, commands) + * @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"` + * @param {any[]} commands A list of commands + **/ + constructor(platform: string, commands: any[]); + + byName: Record; + + /** + * + * @param {string | string[] | import("ace-code").Ace.Command} command + * @param {Editor} editor + * @param {any} args + * @returns {boolean} + */ + exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; + + /** + * @param {Editor} editor + * @returns {boolean} + */ + toggleRecording(editor: Editor): boolean; + + macro: any; + recording: boolean; + oldMacro: any; + + /** + * @param {Editor} editor + */ + replay(editor: Editor): boolean; + + trimMacro(m: any): any; + } + + export type Editor = import("ace-code/src/editor").Editor; + import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); + import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface CommandManager extends Ace + .EventEmitter { + } +} +declare module "ace-code/src/commands/default_commands" { + export const commands: import("ace-code").Ace.Command[]; +} +declare module "ace-code/src/token_iterator" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + + /** + * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens. + **/ + export class TokenIterator { + /** + * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. + * @param {EditSession} session The session to associate with + * @param {Number} initialRow The row to start the tokenizing at + * @param {Number} initialColumn The column to start the tokenizing at + **/ + constructor(session: EditSession, initialRow: number, initialColumn: number); + + /** + * Moves iterator position to the start of previous token. + * @returns {import("ace-code").Ace.Token|null} + **/ + stepBackward(): import("ace-code").Ace.Token | null; + + /** + * Moves iterator position to the start of next token. + * @returns {import("ace-code").Ace.Token|null} + **/ + stepForward(): import("ace-code").Ace.Token | null; + + /** + * + * Returns current token. + * @returns {import("ace-code").Ace.Token} + **/ + getCurrentToken(): import("ace-code").Ace.Token; + + /** + * + * Returns the current row. + * @returns {Number} + **/ + getCurrentTokenRow(): number; + + /** + * + * Returns the current column. + * @returns {Number} + **/ + getCurrentTokenColumn(): number; + + /** + * Return the current token position. + * @returns {import("ace-code").Ace.Point} + */ + getCurrentTokenPosition(): import("ace-code").Ace.Point; + + /** + * Return the current token range. + * @returns {Range} + */ + getCurrentTokenRange(): Range; + } + + import Range_6 = require("ace-code/src/range"); + import Range = Range_6.Range; +} +declare module "ace-code/src/line_widgets" { + export class LineWidgets { + /** + * @param {EditSession} session + */ + constructor(session: EditSession); + + session: import("ace-code/src/edit_session").EditSession; + + /** + * + * @param {import("ace-code").Ace.Delta} delta + */ + updateOnChange(delta: import("ace-code").Ace.Delta): void; + + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + renderWidgets(e: any, renderer: VirtualRenderer): void; + + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + measureWidgets(e: any, renderer: VirtualRenderer): void; + + /** + * @param {number} row + * @return {number} + */ + getRowLength(row: number): number; + + /** + * + * @param {Editor} editor + */ + attach(editor: Editor): void; + + /**@type {Editor} */ + editor: Editor; + + detach(e: any): void; + + /** + * + * @param e + * @param {EditSession} session + */ + updateOnFold(e: any, session: EditSession): void; + + /** + * + * @param {LineWidget} w + * @return {LineWidget} + */ + addLineWidget(w: LineWidget): LineWidget; + + /** + * @param {LineWidget} w + */ + removeLineWidget(w: LineWidget): void; + + /** + * + * @param {number} row + * @return {LineWidget[]} + */ + getWidgetsAtRow(row: number): LineWidget[]; + + /** + * @param {LineWidget} w + */ + onWidgetChanged(w: LineWidget): void; + + firstRow: number; + lastRow: number; + lineWidgets: import("ace-code").Ace.LineWidget[]; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Editor = import("ace-code/src/editor").Editor; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + export type LineWidget = import("ace-code").Ace.LineWidget; + namespace Ace { + type LineWidget = import("ace-code").Ace.LineWidget; + type Editor = import("ace-code").Ace.Editor; + } + + export interface LineWidgets { + lineWidgets: Ace.LineWidget[]; + editor: Ace.Editor; + } +} +declare module "ace-code/src/keyboard/gutter_handler" { + export class GutterKeyboardHandler { + constructor(editor: any); + + editor: any; + gutterLayer: any; + element: any; + lines: any; + activeRowIndex: any; + activeLane: string; + annotationTooltip: GutterTooltip; + + addListener(): void; + + removeListener(): void; + + lane: any; + } + + export class GutterKeyboardEvent { + constructor(domEvent: any, gutterKeyboardHandler: any); + + gutterKeyboardHandler: any; + domEvent: any; + + /** + * Returns the key that was presssed. + * + * @return {string} the key that was pressed. + */ + getKey(): string; + + /** + * Returns the row in the gutter that was focused after the keyboard event was handled. + * + * @return {number} the key that was pressed. + */ + getRow(): number; + + /** + * Returns whether focus is on the annotation lane after the keyboard event was handled. + * + * @return {boolean} true if focus was on the annotation lane after the keyboard event. + */ + isInAnnotationLane(): boolean; + + /** + * Returns whether focus is on the fold lane after the keyboard event was handled. + * + * @return {boolean} true if focus was on the fold lane after the keyboard event. + */ + isInFoldLane(): boolean; + } + + import GutterTooltip_1 = require("ace-code/src/mouse/default_gutter_handler"); + import GutterTooltip = GutterTooltip_1.GutterTooltip; +} +declare module "ace-code/src/editor" { + const Editor_base: undefined; + const Editor_base_1: undefined; + const Editor_base_2: undefined; + const Editor_base_3: undefined; + const Editor_base_4: undefined; + const Editor_base_5: undefined; + const Editor_base_6: undefined; + const Editor_base_7: undefined; + + /** + * The main entry point into the Ace functionality. + * + * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. + * + * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. + **/ + export class Editor { + /** + * Creates a new `Editor` object. + * + * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything + * @param {EditSession} [session] The `EditSession` to refer to + * @param {Partial} [options] The default options + **/ + constructor(renderer: VirtualRenderer, session?: EditSession, options?: Partial); + + /**@type{EditSession}*/ session: EditSession; + /**@type {HTMLElement & {env?:any, value?:any}}*/ + container: HTMLElement & { + env?: any; + value?: any; + }; + /**@type {VirtualRenderer}*/ + renderer: VirtualRenderer; + /**@type {string}*/ + id: string; + commands: CommandManager; + textInput: any; + /**@type {KeyBinding}*/ + keyBinding: KeyBinding; + + startOperation(commandEvent: any): void; + + prevOp: {}; + previousCommand: any; + /** + * @type {{[key: string]: any;}} + */ + curOp: { + [key: string]: any; + }; + + /** + * @arg e + */ + endOperation(e: any): any; + + mergeNextCommand: boolean; + sequenceStartTime: number; + + /** + * Sets a new key handler, such as "vim" or "windows". + * @param {String | import("ace-code").Ace.KeyboardHandler | null} keyboardHandler The new key handler + * @param {() => void} [cb] + **/ + setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; + + /** + * Returns the keyboard handler, such as "vim" or "windows". + * @returns {Object} + **/ + getKeyboardHandler(): any; + + /** + * Sets a new editsession to use. This method also emits the `'changeSession'` event. + * @param {EditSession} [session] The new session to use + **/ + setSession(session?: EditSession): void; + + selection: import("ace-code/src/selection").Selection; + + /** + * Returns the current session being used. + * @returns {EditSession} + **/ + getSession(): EditSession; + + /** + * Sets the current document to `val`. + * @param {String} val The new value to set for the document + * @param {Number} [cursorPos] Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end + * + * @returns {String} The current document value + * @related Document.setValue + **/ + setValue(val: string, cursorPos?: number): string; + + /** + * Returns the current session's content. + * + * @returns {String} + * @related EditSession.getValue + **/ + getValue(): string; + + /** + * + * Returns the currently highlighted selection. + * @returns {Selection} The selection object + **/ + getSelection(): Selection; + + /** + * {:VirtualRenderer.onResize} + * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed + * @related VirtualRenderer.onResize + **/ + resize(force?: boolean): void; + + /** + * {:VirtualRenderer.setTheme} + * @param {string | import("ace-code").Ace.Theme} theme The path to a theme + * @param {() => void} [cb] optional callback called when theme is loaded + **/ + setTheme(theme: string | import("ace-code").Ace.Theme, cb?: () => void): void; + + /** + * {:VirtualRenderer.getTheme} + * + * @returns {String} The set theme + * @related VirtualRenderer.getTheme + **/ + getTheme(): string; + + /** + * {:VirtualRenderer.setStyle} + * @param {String} style A class name + * @related VirtualRenderer.setStyle + **/ + setStyle(style: string): void; + + /** + * {:VirtualRenderer.unsetStyle} + * @related VirtualRenderer.unsetStyle + * @param {string} style + */ + unsetStyle(style: string): void; + + /** + * Gets the current font size of the editor text. + * @return {string} + */ + getFontSize(): string; + + /** + * Set a new font size (in pixels) for the editor text. + * @param {String} size A font size ( _e.g._ "12px") + **/ + setFontSize(size: string): void; + + /** + * + * Brings the current `textInput` into focus. + **/ + focus(): void; + + /** + * Returns `true` if the current `textInput` is in focus. + * @return {Boolean} + **/ + isFocused(): boolean; + + /** + * + * Blurs the current `textInput`. + **/ + blur(): void; + + /** + * Emitted once the editor comes into focus. + **/ + onFocus(e: any): void; + + /** + * Emitted once the editor has been blurred. + **/ + onBlur(e: any): void; + + /** + * Emitted whenever the document is changed. + * @param {import("ace-code").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes + **/ + onDocumentChange(delta: import("ace-code").Ace.Delta): void; + + onTokenizerUpdate(e: any): void; + + onScrollTopChange(): void; + + onScrollLeftChange(): void; + + /** + * Emitted when the selection changes. + **/ + onCursorChange(): void; + + /** + * + * @param e + */ + onSelectionChange(e: any): void; + + onChangeFrontMarker(): void; + + onChangeBackMarker(): void; + + onChangeBreakpoint(): void; + + onChangeAnnotation(): void; + + /** + * @param e + */ + onChangeMode(e: any): void; + + onChangeWrapLimit(): void; + + onChangeWrapMode(): void; + + /** + */ + onChangeFold(): void; + + /** + * Returns the string of text currently highlighted. + * @returns {String} + **/ + getCopyText(): string; + + /** + * Called whenever a text "copy" happens. + **/ + onCopy(): void; + + /** + * Called whenever a text "cut" happens. + **/ + onCut(): void; + + /** + * Called whenever a text "paste" happens. + * @param {String} text The pasted text + * @param {any} event + **/ + onPaste(text: string, event: any): void; + + /** + * + * @param {string | string[]} command + * @param [args] + * @return {boolean} + */ + execCommand(command: string | string[], args?: any): boolean; + + /** + * Inserts `text` into wherever the cursor is pointing. + * @param {String} text The new text to add + * @param {boolean} [pasted] + **/ + insert(text: string, pasted?: boolean): void; + + autoIndent(): void; + + /** + * + * @param text + * @param composition + * @returns {*} + */ + onTextInput(text: any, composition: any): any; + + /** + * @param {string} [text] + * @param {any} [composition] + */ + applyComposition(text?: string, composition?: any): void; + + onCommandKey(e: any, hashId: any, keyCode: any): boolean; + + /** + * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. + * @param {Boolean} overwrite Defines whether or not to set overwrites + * @related EditSession.setOverwrite + **/ + setOverwrite(overwrite: boolean): void; + + /** + * Returns `true` if overwrites are enabled; `false` otherwise. + * @returns {Boolean} + * @related EditSession.getOverwrite + **/ + getOverwrite(): boolean; + + /** + * Sets the value of overwrite to the opposite of whatever it currently is. + * @related EditSession.toggleOverwrite + **/ + toggleOverwrite(): void; + + /** + * Sets how fast the mouse scrolling should do. + * @param {Number} speed A value indicating the new speed (in milliseconds) + **/ + setScrollSpeed(speed: number): void; + + /** + * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). + * @returns {Number} + **/ + getScrollSpeed(): number; + + /** + * Sets the delay (in milliseconds) of the mouse drag. + * @param {Number} dragDelay A value indicating the new delay + **/ + setDragDelay(dragDelay: number): void; + + /** + * Returns the current mouse drag delay. + * @returns {Number} + **/ + getDragDelay(): number; + + /** + * Draw selection markers spanning whole line, or only over selected text. Default value is "line" + * @param {"fullLine" | "screenLine" | "text" | "line"} val The new selection style "line"|"text" + **/ + setSelectionStyle(val: "fullLine" | "screenLine" | "text" | "line"): void; + + /** + * Returns the current selection style. + * @returns {import("ace-code").Ace.EditorOptions["selectionStyle"]} + **/ + getSelectionStyle(): import("ace-code").Ace.EditorOptions["selectionStyle"]; + + /** + * Determines whether or not the current line should be highlighted. + * @param {Boolean} shouldHighlight Set to `true` to highlight the current line + **/ + setHighlightActiveLine(shouldHighlight: boolean): void; + + /** + * Returns `true` if current lines are always highlighted. + * @return {Boolean} + **/ + getHighlightActiveLine(): boolean; + + /** + * @param {boolean} shouldHighlight + */ + setHighlightGutterLine(shouldHighlight: boolean): void; + + /** + * @returns {Boolean} + */ + getHighlightGutterLine(): boolean; + + /** + * Determines if the currently selected word should be highlighted. + * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word + **/ + setHighlightSelectedWord(shouldHighlight: boolean): void; + + /** + * Returns `true` if currently highlighted words are to be highlighted. + * @returns {Boolean} + **/ + getHighlightSelectedWord(): boolean; + + /** + * @param {boolean} shouldAnimate + */ + setAnimatedScroll(shouldAnimate: boolean): void; + + /** + * @return {boolean} + */ + getAnimatedScroll(): boolean; + + /** + * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. + * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters + **/ + setShowInvisibles(showInvisibles: boolean): void; + + /** + * Returns `true` if invisible characters are being shown. + * @returns {Boolean} + **/ + getShowInvisibles(): boolean; + + /** + * @param {boolean} display + */ + setDisplayIndentGuides(display: boolean): void; + + /** + * @return {boolean} + */ + getDisplayIndentGuides(): boolean; + + /** + * @param {boolean} highlight + */ + setHighlightIndentGuides(highlight: boolean): void; + + /** + * @return {boolean} + */ + getHighlightIndentGuides(): boolean; + + /** + * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. + * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin + * + **/ + setShowPrintMargin(showPrintMargin: boolean): void; + + /** + * Returns `true` if the print margin is being shown. + * @returns {Boolean} + **/ + getShowPrintMargin(): boolean; + + /** + * Sets the column defining where the print margin should be. + * @param {Number} showPrintMargin Specifies the new print margin + * + **/ + setPrintMarginColumn(showPrintMargin: number): void; + + /** + * Returns the column number of where the print margin is. + * @returns {Number} + **/ + getPrintMarginColumn(): number; + + /** + * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. + * @param {Boolean} readOnly Specifies whether the editor can be modified or not + **/ + setReadOnly(readOnly: boolean): void; + + /** + * Returns `true` if the editor is set to read-only mode. + * @returns {Boolean} + **/ + getReadOnly(): boolean; + + /** + * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} + * @param {Boolean} enabled Enables or disables behaviors + **/ + setBehavioursEnabled(enabled: boolean): void; + + /** + * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} + * @returns {Boolean} + **/ + getBehavioursEnabled(): boolean; + + /** + * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets + * when such a character is typed in. + * @param {Boolean} enabled Enables or disables wrapping behaviors + **/ + setWrapBehavioursEnabled(enabled: boolean): void; + + /** + * Returns `true` if the wrapping behaviors are currently enabled. + * @returns {boolean} + **/ + getWrapBehavioursEnabled(): boolean; + + /** + * Indicates whether the fold widgets should be shown or not. + * @param {Boolean} show Specifies whether the fold widgets are shown + **/ + setShowFoldWidgets(show: boolean): void; + + /** + * Returns `true` if the fold widgets are shown. + * @return {Boolean} + **/ + getShowFoldWidgets(): boolean; + + /** + * @param {boolean} fade + */ + setFadeFoldWidgets(fade: boolean): void; + + /** + * @returns {boolean} + */ + getFadeFoldWidgets(): boolean; + + /** + * Removes the current selection or one character. + * @param {'left' | 'right'} [dir] The direction of the deletion to occur, either "left" or "right" + **/ + remove(dir?: 'left' | 'right'): void; + + /** + * Removes the word directly to the right of the current selection. + **/ + removeWordRight(): void; + + /** + * Removes the word directly to the left of the current selection. + **/ + removeWordLeft(): void; + + /** + * Removes all the words to the left of the current selection, until the start of the line. + **/ + removeToLineStart(): void; + + /** + * Removes all the words to the right of the current selection, until the end of the line. + **/ + removeToLineEnd(): void; + + /** + * Splits the line at the current selection (by inserting an `'\n'`). + **/ + splitLine(): void; + + /** + * Set the "ghost" text in provided position. "Ghost" text is a kind of + * preview text inside the editor which can be used to preview some code + * inline in the editor such as, for example, code completions. + * + * @param {String} text Text to be inserted as "ghost" text + * @param {Point} [position] Position to insert text to + */ + setGhostText(text: string, position?: Point): void; + + /** + * Removes "ghost" text currently displayed in the editor. + */ + removeGhostText(): void; + + /** + * Transposes current line. + **/ + transposeLetters(): void; + + /** + * Converts the current selection entirely into lowercase. + **/ + toLowerCase(): void; + + /** + * Converts the current selection entirely into uppercase. + **/ + toUpperCase(): void; + + /** + * Inserts an indentation into the current cursor position or indents the selected lines. + * + * @related EditSession.indentRows + **/ + indent(): void; + + /** + * Indents the current line. + * @related EditSession.indentRows + **/ + blockIndent(): void; + + /** + * Outdents the current line. + * @related EditSession.outdentRows + **/ + blockOutdent(): void; + + sortLines(): void; + + /** + * Given the currently selected range, this function either comments all the lines, or uncomments all of them. + **/ + toggleCommentLines(): void; + + toggleBlockComment(): void; + + /** + * Works like [[EditSession.getTokenAt]], except it returns a number. + * @returns {any} + **/ + getNumberAt(row: any, column: any): any; + + /** + * If the character before the cursor is a number, this functions changes its value by `amount`. + * @param {Number} amount The value to change the numeral by (can be negative to decrease value) + **/ + modifyNumber(amount: number): void; + + /** + */ + toggleWord(): void; + + /** + * Finds link at defined {row} and {column} + * @returns {String} + **/ + findLinkAt(row: any, column: any): string; + + /** + * Open valid url under cursor in another tab + * @returns {Boolean} + **/ + openLink(): boolean; + + /** + * Removes all the lines in the current selection + * @related EditSession.remove + **/ + removeLines(): void; + + duplicateSelection(): void; + + /** + * Shifts all the selected lines down one row. + * + * @related EditSession.moveLinesUp + **/ + moveLinesDown(): void; + + /** + * Shifts all the selected lines up one row. + * @related EditSession.moveLinesDown + **/ + moveLinesUp(): void; + + /** + * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: + * ```json + * { row: newRowLocation, column: newColumnLocation } + * ``` + * @param {Range} range The range of text you want moved within the document + * @param {Point} toPosition The location (row and column) where you want to move the text to + * @param {boolean} [copy] + * + * @returns {Range} The new range where the text was moved to. + * @related EditSession.moveText + **/ + moveText(range: Range, toPosition: Point, copy?: boolean): Range; + + /** + * Copies all the selected lines up one row. + * + **/ + copyLinesUp(): void; + + /** + * Copies all the selected lines down one row. + * @related EditSession.duplicateLines + * + **/ + copyLinesDown(): void; + + inVirtualSelectionMode: boolean; + + onCompositionStart(compositionState: any): void; + + onCompositionUpdate(text: any): void; + + onCompositionEnd(): void; + + /** + * {:VirtualRenderer.getFirstVisibleRow} + * + * @returns {Number} + * @related VirtualRenderer.getFirstVisibleRow + **/ + getFirstVisibleRow(): number; + + /** + * {:VirtualRenderer.getLastVisibleRow} + * + * @returns {Number} + * @related VirtualRenderer.getLastVisibleRow + **/ + getLastVisibleRow(): number; + + /** + * Indicates if the row is currently visible on the screen. + * @param {Number} row The row to check + * + * @returns {Boolean} + **/ + isRowVisible(row: number): boolean; + + /** + * Indicates if the entire row is currently visible on the screen. + * @param {Number} row The row to check + * + * + * @returns {Boolean} + **/ + isRowFullyVisible(row: number): boolean; + + /** + * Selects the text from the current position of the document until where a "page down" finishes. + **/ + selectPageDown(): void; + + /** + * Selects the text from the current position of the document until where a "page up" finishes. + **/ + selectPageUp(): void; + + /** + * Shifts the document to wherever "page down" is, as well as moving the cursor position. + **/ + gotoPageDown(): void; + + /** + * Shifts the document to wherever "page up" is, as well as moving the cursor position. + **/ + gotoPageUp(): void; + + /** + * Scrolls the document to wherever "page down" is, without changing the cursor position. + **/ + scrollPageDown(): void; + + /** + * Scrolls the document to wherever "page up" is, without changing the cursor position. + **/ + scrollPageUp(): void; + + /** + * Moves the editor to the specified row. + * @related VirtualRenderer.scrollToRow + * @param {number} row + */ + scrollToRow(row: number): void; + + /** + * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). + * @param {Number} line The line to scroll to + * @param {Boolean} center If `true` + * @param {Boolean} animate If `true` animates scrolling + * @param {() => void} [callback] Function to be called when the animation has finished + * + * @related VirtualRenderer.scrollToLine + **/ + scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; + + /** + * Attempts to center the current selection on the screen. + **/ + centerSelection(): void; + + /** + * Gets the current position of the cursor. + * @returns {Point} An object that looks something like this: + * + * ```json + * { row: currRow, column: currCol } + * ``` + * + * @related Selection.getCursor + **/ + getCursorPosition(): Point; + + /** + * Returns the screen position of the cursor. + * @returns {Point} + * @related EditSession.documentToScreenPosition + **/ + getCursorPositionScreen(): Point; + + /** + * {:Selection.getRange} + * @returns {Range} + * @related Selection.getRange + **/ + getSelectionRange(): Range; + + /** + * Selects all the text in editor. + * @related Selection.selectAll + **/ + selectAll(): void; + + /** + * {:Selection.clearSelection} + * @related Selection.clearSelection + **/ + clearSelection(): void; + + /** + * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. + * @param {Number} row The new row number + * @param {Number} column The new column number + * @related Selection.moveCursorTo + **/ + moveCursorTo(row: number, column: number): void; + + /** + * Moves the cursor to the position indicated by `pos.row` and `pos.column`. + * @param {Point} pos An object with two properties, row and column + * @related Selection.moveCursorToPosition + **/ + moveCursorToPosition(pos: Point): void; + + /** + * Moves the cursor's row and column to the next matching bracket or HTML tag. + * @param {boolean} [select] + * @param {boolean} [expand] + */ + jumpToMatching(select?: boolean, expand?: boolean): void; + + /** + * Moves the cursor to the specified line number, and also into the indicated column. + * @param {Number} lineNumber The line number to go to + * @param {Number} [column] A column number to go to + * @param {Boolean} [animate] If `true` animates scolling + **/ + gotoLine(lineNumber: number, column?: number, animate?: boolean): void; + + /** + * Moves the cursor to the specified row and column. Note that this does de-select the current selection. + * @param {Number} row The new row number + * @param {Number} column The new column number + * + * @related Editor.moveCursorTo + **/ + navigateTo(row: number, column: number): void; + + /** + * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateUp(times?: number): void; + + /** + * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateDown(times?: number): void; + + /** + * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateLeft(times?: number): void; + + /** + * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection. + * @param {Number} [times] The number of times to change navigation + * + **/ + navigateRight(times?: number): void; + + /** + * + * Moves the cursor to the start of the current line. Note that this does de-select the current selection. + **/ + navigateLineStart(): void; + + /** + * + * Moves the cursor to the end of the current line. Note that this does de-select the current selection. + **/ + navigateLineEnd(): void; + + /** + * + * Moves the cursor to the end of the current file. Note that this does de-select the current selection. + **/ + navigateFileEnd(): void; + + /** + * + * Moves the cursor to the start of the current file. Note that this does de-select the current selection. + **/ + navigateFileStart(): void; + + /** + * + * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection. + **/ + navigateWordRight(): void; + + /** + * + * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection. + **/ + navigateWordLeft(): void; + + /** + * Replaces the first occurrence of `options.needle` with the value in `replacement`. + * @param {String} [replacement] The text to replace with + * @param {Partial} [options] The [[Search `Search`]] options to use + * @return {number} + **/ + replace(replacement?: string, options?: Partial): number; + + /** + * Replaces all occurrences of `options.needle` with the value in `replacement`. + * @param {String} [replacement] The text to replace with + * @param {Partial} [options] The [[Search `Search`]] options to use + * @return {number} + **/ + replaceAll(replacement?: string, options?: Partial): number; + + /** + * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. + * @related Search.getOptions + * @returns {Partial} + **/ + getLastSearchOptions(): Partial; + + /** + * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. + * @param {String|RegExp|Object} needle The text to search for (optional) + * @param {Partial} [options] An object defining various search properties + * @param {Boolean} [animate] If `true` animate scrolling + * @related Search.find + **/ + find(needle: string | RegExp | any, options?: Partial, animate?: boolean): false | Range; + + /** + * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. + * @param {Partial} [options] search options + * @param {Boolean} [animate] If `true` animate scrolling + * + * @related Editor.find + **/ + findNext(options?: Partial, animate?: boolean): void; + + /** + * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. + * @param {Partial} [options] search options + * @param {Boolean} [animate] If `true` animate scrolling + * + * @related Editor.find + **/ + findPrevious(options?: Partial, animate?: boolean): void; + + /** + * + * @param {Range} range + * @param {boolean} [animate] + */ + revealRange(range: Range, animate?: boolean): void; + + /** + * {:UndoManager.undo} + * @related UndoManager.undo + **/ + undo(): void; + + /** + * {:UndoManager.redo} + * @related UndoManager.redo + **/ + redo(): void; + + /** + * + * Cleans up the entire editor. + **/ + destroy(): void; + + /** + * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element + * @param {Boolean} enable default true + **/ + setAutoScrollEditorIntoView(enable: boolean): void; + + /** + * opens a prompt displaying message + **/ + prompt(message: any, options: any, callback: any): void; + + env?: any; + widgetManager?: LineWidgets; + completer?: import("ace-code/src/autocomplete").Autocomplete | import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + completers: import("ace-code").Ace.Completer[]; + showKeyboardShortcuts?: () => void; + showSettingsMenu?: () => void; + searchBox?: import("ace-code/src/ext/searchbox").SearchBox; + } + + export namespace Editor { + export {$uid}; + } + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + export type Selection = import("ace-code/src/selection").Selection; + export type Point = import("ace-code").Ace.Point; + export type SearchOptions = import("ace-code").Ace.SearchOptions; + import EditSession_1 = require("ace-code/src/edit_session"); + import EditSession = EditSession_1.EditSession; + import CommandManager_1 = require("ace-code/src/commands/command_manager"); + import CommandManager = CommandManager_1.CommandManager; + import MouseHandler_1 = require("ace-code/src/mouse/mouse_handler"); + import MouseHandler = MouseHandler_1.MouseHandler; + import KeyBinding_1 = require("ace-code/src/keyboard/keybinding"); + import KeyBinding = KeyBinding_1.KeyBinding; + import Search_1 = require("ace-code/src/search"); + import Search = Search_1.Search; + import Range_7 = require("ace-code/src/range"); + import Range = Range_7.Range; + import LineWidgets_1 = require("ace-code/src/line_widgets"); + import LineWidgets = LineWidgets_1.LineWidgets; + var $uid: number; + export {}; + namespace Ace { + type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type EditorOptions = import("ace-code").Ace.EditorOptions; + type EventEmitter = import("ace-code").Ace.EventEmitter; + type EditorEvents = import("ace-code").Ace.EditorEvents; + type CodeLenseEditorExtension = import("ace-code").Ace.CodeLenseEditorExtension; + type ElasticTabstopsEditorExtension = import("ace-code").Ace.ElasticTabstopsEditorExtension; + type TextareaEditorExtension = import("ace-code").Ace.TextareaEditorExtension; + type PromptEditorExtension = import("ace-code").Ace.PromptEditorExtension; + type OptionsEditorExtension = import("ace-code").Ace.OptionsEditorExtension; + type EditSession = import("ace-code").Ace.EditSession; + type LineWidgets = import("ace-code").Ace.LineWidgets; + type Autocomplete = import("ace-code").Ace.Autocomplete; + type InlineAutocomplete = import("ace-code").Ace.InlineAutocomplete; + type Completer = import("ace-code").Ace.Completer; + type SearchBox = import("ace-code").Ace.SearchBox; + } + + export interface Editor extends Ace.EditorMultiSelectProperties, Ace.OptionsProvider, Ace.EventEmitter, Ace.CodeLenseEditorExtension, Ace.ElasticTabstopsEditorExtension, Ace.TextareaEditorExtension, Ace.PromptEditorExtension, Ace.OptionsEditorExtension { + session: Ace.EditSession; + env?: any; + widgetManager?: Ace.LineWidgets; + completer?: Ace.Autocomplete | Ace.InlineAutocomplete; + completers: Ace.Completer[]; + showKeyboardShortcuts?: () => void; + showSettingsMenu?: () => void; + searchBox?: Ace.SearchBox; + } +} +declare module "ace-code/src/undomanager" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Delta = import("ace-code").Ace.Delta; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code").Ace.Delta} Delta + * @typedef {import("ace-code").Ace.Point} Point + * @typedef {import("ace-code").Ace.IRange} IRange + */ + /** + * This object maintains the undo stack for an [[EditSession `EditSession`]]. + **/ + export class UndoManager { + /** + * + * @param {EditSession} session + */ + addSession(session: EditSession): void; + + /** + * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: + * + * - `args[0]` is an array of deltas + * - `args[1]` is the document to associate with + * + * @param {import("ace-code").Ace.Delta} delta + * @param {boolean} allowMerge + * @param {EditSession} [session] + **/ + add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; + + lastDeltas: any[]; + + /** + * + * @param {any} selection + * @param {number} [rev] + */ + addSelection(selection: any, rev?: number): void; + + startNewGroup(): any; + + /** + * + * @param {number} from + * @param {number} [to] + */ + markIgnored(from: number, to?: number): void; + + /** + * + * @param {number} rev + * @param {boolean} [after] + * @return {{ value: string, rev: number }} + */ + getSelection(rev: number, after?: boolean): { + value: string; + rev: number; + }; + + /** + * @return {number} + */ + getRevision(): number; + + /** + * + * @param {number} from + * @param {number} [to] + * @return {import("ace-code").Ace.Delta[]} + */ + getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; + + /** + * + * @param {number} from + * @param {number} [to] + */ + getChangedRanges(from: number, to?: number): void; + + /** + * + * @param {number} from + * @param {number} [to] + */ + getChangedLines(from: number, to?: number): void; + + /** + * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} + * @param {EditSession} session + * @param {Boolean} [dontSelect] {:dontSelect} + **/ + undo(session: EditSession, dontSelect?: boolean): void; + + /** + * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} + * @param {EditSession} session + * @param {Boolean} [dontSelect] {:dontSelect} + * + **/ + redo(session: EditSession, dontSelect?: boolean): void; + + /** + * Destroys the stack of undo and redo redo operations. + **/ + reset(): void; + + mark: number; + selections: any[]; + + /** + * Returns `true` if there are undo operations left to perform. + * @returns {Boolean} + **/ + canUndo(): boolean; + + /** + * Returns `true` if there are redo operations left to perform. + * @returns {Boolean} + **/ + canRedo(): boolean; + + /** + * Marks the current status clean + * @param {number} [rev] + */ + bookmark(rev?: number): void; + + /** + * Returns if the current status is clean + * @returns {Boolean} + **/ + isAtBookmark(): boolean; + + /** + * Returns an object which can be safely stringified into JSON + * @returns {object} + */ + toJSON(): object; + + /** + * Takes in an object which was returned from the toJSON method above, + * and resets the current undoManager instance to use the previously exported + * instance state. + * @param {object} json + */ + fromJSON(json: object): void; + + hasUndo: () => boolean; + hasRedo: () => boolean; + isClean: () => boolean; + markClean: (rev?: number) => void; + } +} +declare module "ace-code/src/tokenizer" { + /** + * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). + **/ + export class Tokenizer { + /** + * Constructs a new tokenizer based on the given rules and flags. + * @param {Object} rules The highlighting rules + **/ + constructor(rules: any); + + /**@type {RegExp}*/ + splitRegex: RegExp; + states: any; + regExps: {}; + matchMappings: {}; + + /** + * @param {string} src + * @returns {string} + */ + removeCapturingGroups(src: string): string; + + /** + * @param {string} src + * @param {string} flag + */ + createSplitterRegexp(src: string, flag: string): RegExp; + + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @param {string} line + * @param {string | string[]} startState + * @returns {{tokens:import("ace-code").Ace.Token[], state: string|string[]}} + */ + getLineTokens(line: string, startState: string | string[]): { + tokens: import("ace-code").Ace.Token[]; + state: string | string[]; + }; + + reportError: (msg: any, data: any) => void; + } +} +declare module "ace-code/src/autocomplete/popup" { + const AcePopup_base: undefined; + + /** + * This object is used in some places where needed to show popups - like prompt; autocomplete etc. + */ + export class AcePopup { + /** + * Creates and renders single line editor in popup window. If `parentNode` param is isset, then attaching it to this element. + * @param {Element} [parentNode] + */ + constructor(parentNode?: Element); + + setSelectOnHover: (val: boolean) => void; + setRow: (line: number) => void; + getRow: () => number; + getHoveredRow: () => number; + filterText: string; + isOpen: boolean; + isTopdown: boolean; + autoSelect: boolean; + data: import("ace-code/src/autocomplete").Completion[]; + setData: (data: import("ace-code/src/autocomplete").Completion[], filterText: string) => void; + getData: (row: number) => import("ace-code/src/autocomplete").Completion; + hide: () => void; + anchor: "bottom" | "top"; + anchorPosition: import("ace-code").Ace.Point; + tryShow: (pos: any, lineHeight: number, anchor: "bottom" | "top", forceShow?: boolean) => boolean; + show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; + goTo: (where: import("ace-code").Ace.AcePopupNavigation) => void; + getTextLeftOffset: () => number; + anchorPos: any; + isMouseOver?: boolean; + selectedNode?: HTMLElement; + } + + /** + * + * @param {HTMLElement} [el] + * @return {Editor} + */ + export function $singleLineEditor(el?: HTMLElement): Editor; + + export function getAriaId(index: any): string; + + import Editor_1 = require("ace-code/src/editor"); + import Editor = Editor_1.Editor; + export {}; + namespace Ace { + type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; + type Completion = import("ace-code").Ace.Completion; + type Point = import("ace-code").Ace.Point; + type AcePopupNavigation = import("ace-code").Ace.AcePopupNavigation; + } + + export interface AcePopup extends Ace.AcePopupWithEditor { + setSelectOnHover: (val: boolean) => void; + setRow: (line: number) => void; + getRow: () => number; + getHoveredRow: () => number; + filterText: string; + isOpen: boolean; + isTopdown: boolean; + autoSelect: boolean; + data: Ace.Completion[]; + setData: (data: Ace.Completion[], filterText: string) => void; + getData: (row: number) => Ace.Completion; + hide: () => void; + anchor: "top" | "bottom"; + anchorPosition: Ace.Point; + tryShow: (pos: any, lineHeight: number, anchor: "top" | "bottom", forceShow?: boolean) => boolean; + show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; + goTo: (where: Ace.AcePopupNavigation) => void; + getTextLeftOffset: () => number; + anchorPos: any; + isMouseOver?: boolean; + selectedNode?: HTMLElement; + } +} +declare module "ace-code/src/range_list" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code").Ace.Point; + + export class RangeList { + ranges: any[]; + + /** + * @param {Point} pos + * @param {boolean} [excludeEdges] + * @param {number} [startIndex] + * @return {number} + */ + pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; + + /** + * @param {Range} range + */ + add(range: Range): any[]; + + /** + * @param {Range[]} list + */ + addList(list: Range[]): any[]; + + /** + * @param {Point} pos + */ + substractPoint(pos: Point): any[]; + + merge(): any[]; + + /** + * @param {number} row + * @param {number} column + */ + contains(row: number, column: number): boolean; + + /** + * @param {Point} pos + */ + containsPoint(pos: Point): boolean; + + /** + * @param {Point} pos + */ + rangeAtPoint(pos: Point): any; + + /** + * @param {number} startRow + * @param {number} endRow + */ + clipRows(startRow: number, endRow: number): any[]; + + removeAll(): any[]; + + /** + * @param {EditSession} session + */ + attach(session: EditSession): void; + + session: import("ace-code/src/edit_session").EditSession; + onChange: any; + + detach(): void; + + comparePoints: (p1: import("ace-code").Ace.Point, p2: import("ace-code").Ace.Point) => number; + } + + import Range_8 = require("ace-code/src/range"); + import Range = Range_8.Range; +} +declare module "ace-code/src/snippets" { + export const snippetManager: SnippetManager; + export type Snippet = { + content?: string; + replaceBefore?: string; + replaceAfter?: string; + startRe?: RegExp; + endRe?: RegExp; + triggerRe?: RegExp; + endTriggerRe?: RegExp; + trigger?: string; + endTrigger?: string; + matchBefore?: string[]; + matchAfter?: string[]; + name?: string; + tabTrigger?: string; + guard?: string; + endGuard?: string; + }; + + class SnippetManager { + snippetMap: {}; + snippetNameMap: {}; + variables: { + CURRENT_WORD: (editor: any) => any; + SELECTION: (editor: any, name: any, indentation: any) => any; + CURRENT_LINE: (editor: any) => any; + PREV_LINE: (editor: any) => any; + LINE_INDEX: (editor: any) => any; + LINE_NUMBER: (editor: any) => any; + SOFT_TABS: (editor: any) => "YES" | "NO"; + TAB_SIZE: (editor: any) => any; + CLIPBOARD: (editor: any) => any; + FILENAME: (editor: any) => string; + FILENAME_BASE: (editor: any) => string; + DIRECTORY: (editor: any) => string; + FILEPATH: (editor: any) => string; + WORKSPACE_NAME: () => string; + FULLNAME: () => string; + BLOCK_COMMENT_START: (editor: any) => any; + BLOCK_COMMENT_END: (editor: any) => any; + LINE_COMMENT: (editor: any) => any; + CURRENT_YEAR: any; + CURRENT_YEAR_SHORT: any; + CURRENT_MONTH: any; + CURRENT_MONTH_NAME: any; + CURRENT_MONTH_NAME_SHORT: any; + CURRENT_DATE: any; + CURRENT_DAY_NAME: any; + CURRENT_DAY_NAME_SHORT: any; + CURRENT_HOUR: any; + CURRENT_MINUTE: any; + CURRENT_SECOND: any; + }; + + /** + * @return {Tokenizer} + */ + getTokenizer(): Tokenizer; + + createTokenizer(): any; + + tokenizeTmSnippet(str: any, startState: any): (string | import("ace-code").Ace.Token)[]; + + getVariableValue(editor: any, name: any, indentation: any): any; + + tmStrFormat(str: any, ch: any, editor: any): any; + + tmFormatFunction(str: any, ch: any, editor: any): any; + + resolveVariables(snippet: any, editor: any): any[]; + + getDisplayTextForSnippet(editor: any, snippetText: any): any; + + insertSnippetForSelection(editor: any, snippetText: any, options?: {}): void; + + insertSnippet(editor: any, snippetText: any, options?: {}): void; + + getActiveScopes(editor: any): any[]; + + expandWithTab(editor: any, options: any): any; + + expandSnippetForSelection(editor: any, options: any): boolean; + + /** + * @param {Snippet[]} snippetList + * @param {string} before + * @param {string} after + * @return {Snippet} + */ + findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; + + /** + * @param {any[]} snippets + * @param {string} scope + */ + register(snippets: any[], scope: string): void; + + unregister(snippets: any, scope: any): void; + + parseSnippetFile(str: any): Snippet[]; + + getSnippetByName(name: any, editor: any): undefined; + } + + import Tokenizer_1 = require("ace-code/src/tokenizer"); + import Tokenizer = Tokenizer_1.Tokenizer; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + interface SnippetManager extends Ace.EventEmitter { + } +} +declare module "ace-code/src/autocomplete/inline_screenreader" { + /** + * This object is used to communicate inline code completions rendered into an editor with ghost text to screen reader users. + */ + export class AceInlineScreenReader { + /** + * Creates the off-screen div in which the ghost text content in redered and which the screen reader reads. + * @param {import("ace-code/src/editor").Editor} editor + */ + constructor(editor: import("ace-code/src/editor").Editor); + + editor: import("ace-code/src/editor").Editor; + screenReaderDiv: HTMLDivElement; + + /** + * Set the ghost text content to the screen reader div + * @param {string} content + */ + setScreenReaderContent(content: string): void; + + popup: import("ace-code/src/autocomplete/popup").AcePopup; + + destroy(): void; + + /** + * Take this._lines, render it as blocks and add those to the screen reader div. + */ + createCodeBlock(): HTMLPreElement; + } +} +declare module "ace-code/src/autocomplete/inline" { + export type Editor = import("ace-code/src/editor").Editor; + + /** + * This object is used to manage inline code completions rendered into an editor with ghost text. + */ + export class AceInline { + editor: any; + + /** + * Renders the completion as ghost text to the current cursor position + * @param {Editor} editor + * @param {import("ace-code").Ace.Completion} completion + * @param {string} prefix + * @returns {boolean} True if the completion could be rendered to the editor, false otherwise + */ + show(editor: Editor, completion: import("ace-code").Ace.Completion, prefix: string): boolean; + + inlineScreenReader: AceInlineScreenReader; + + isOpen(): boolean; + + hide(): boolean; + + destroy(): void; + } + + import AceInlineScreenReader_1 = require("ace-code/src/autocomplete/inline_screenreader"); + import AceInlineScreenReader = AceInlineScreenReader_1.AceInlineScreenReader; +} +declare module "ace-code/src/autocomplete/util" { + export function parForEach(array: any, fn: any, callback: any): void; + + export function retrievePrecedingIdentifier(text: any, pos: any, regex: any): string; + + export function retrieveFollowingIdentifier(text: any, pos: any, regex: any): any[]; + + export function getCompletionPrefix(editor: any): string; + + export function triggerAutocomplete(editor: Editor, previousChar?: string): boolean; + + export type Editor = import("ace-code/src/editor").Editor; +} +declare module "ace-code/src/autocomplete" { + /** + * This object controls the autocompletion components and their lifecycle. + * There is an autocompletion popup, an optional inline ghost text renderer and a docuent tooltip popup inside. + */ + export class Autocomplete { + static get completionsForLoading(): { + caption: any; + value: string; + }[]; + + /** + * @param {Editor} editor + * @return {Autocomplete} + */ + static for(editor: Editor): Autocomplete; + + autoInsert: boolean; + autoSelect: boolean; + autoShown: boolean; + exactMatch: boolean; + inlineEnabled: boolean; + keyboardHandler: HashHandler; + parentNode: any; + setSelectOnHover: boolean; + hasSeen: Set; + /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + showLoadingState: boolean; + /** + * @property {number} stickySelectionDelay - a numerical value that determines after how many ms the popup selection will become 'sticky'. + * Normally, when new elements are added to an open popup, the selection is reset to the first row of the popup. If sticky, the focus will remain + * on the currently selected item when new items are added to the popup. Set to a negative value to disable this feature and never set selection to sticky. + */ + stickySelectionDelay: number; + + blurListener(e: any): void; + + changeListener(e: any): void; + + mousedownListener(e: any): void; + + mousewheelListener(e: any): void; + + onLayoutChange(): void; + + changeTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + cancel(): void; + isPending(): any; + }; + tooltipTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + cancel(): void; + isPending(): any; + }; + popupTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + cancel(): void; + isPending(): any; + }; + stickySelectionTimer: { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; /** + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * it shows a loading indicator on the popup while autocomplete is loading. + * + * Experimental: This visualisation is not yet considered stable and might change in the future. + */ + cancel(): void; + isPending(): any; + }; + /**@type {AcePopup}**/ + popup: AcePopup; + inlineRenderer: AceInline; + + /** + * @return {AcePopup} + */ + getPopup(): AcePopup; + + stickySelection: boolean; + + observeLayoutChanges(): void; + + unObserveLayoutChanges(): void; + + /** + * @param {Editor} editor + * @param {string} prefix + * @param {boolean} [keepPopupPosition] + */ + openPopup(editor: Editor, prefix: string, keepPopupPosition?: boolean): void; + + /** + * Detaches all elements from the editor, and cleans up the data for the session + */ + detach(): void; + + activated: boolean; + completionProvider: CompletionProvider; + completions: FilteredList; + base: import("ace-code/src/anchor").Anchor; + + mouseOutListener(e: any): void; + + goTo(where: any): void; + + /** + * @param {Completion} data + * @param {undefined} [options] + * @return {boolean | void} + */ + insertMatch(data: Completion, options?: undefined): boolean | void; + + /** + * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions + * @param {Editor} editor + * @param {CompletionOptions} [options] + */ + showPopup(editor: Editor, options?: CompletionOptions): void; + + editor: import("ace-code/src/editor").Editor; + + getCompletionProvider(initialPosition: any): CompletionProvider; + + /** + * This method is deprecated, it is only kept for backwards compatibility. + * Use the same method include CompletionProvider instead for the same functionality. + * @deprecated + */ + gatherCompletions(editor: any, callback: any): boolean; + + /** + * @param {boolean} keepPopupPosition + * @param {CompletionOptions} [options] + */ + updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; + + cancelContextMenu(): void; + + updateDocTooltip(): void; + + showDocTooltip(item: any): void; + + tooltipNode: HTMLDivElement; + + hideDocTooltip(): void; + + onTooltipClick(e: any): void; + + destroy(): void; + + commands: { + Up: (editor: any) => void; + Down: (editor: any) => void; + "Ctrl-Up|Ctrl-Home": (editor: any) => void; + "Ctrl-Down|Ctrl-End": (editor: any) => void; + Esc: (editor: any) => void; + Return: (editor: any) => any; + "Shift-Return": (editor: any) => void; + Tab: (editor: any) => any; + Backspace: (editor: any) => void; + PageUp: (editor: any) => void; + PageDown: (editor: any) => void; + }; + emptyMessage?: Function; + } + + /** + * This class is responsible for providing completions and inserting them to the editor + */ + export class CompletionProvider { + /** + * @param {{pos: import("ace-code").Ace.Position, prefix: string}} initialPosition + */ + constructor(initialPosition: { + pos: import("ace-code").Ace.Position; + prefix: string; + }); + + initialPosition: { + pos: import("ace-code").Ace.Position; + prefix: string; + }; + active: boolean; + + /** + * @param {Editor} editor + * @param {number} index + * @param {CompletionProviderOptions} [options] + * @returns {boolean} + */ + insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; + + /** + * @param {Editor} editor + * @param {Completion} data + * @param {CompletionProviderOptions} [options] + * @returns {boolean} + */ + insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; + + /** + * @param {Editor} editor + * @param {import("ace-code").Ace.CompletionCallbackFunction} callback + */ + gatherCompletions(editor: Editor, callback: import("ace-code").Ace.CompletionCallbackFunction): boolean; + + completers: import("ace-code").Ace.Completer[]; + + /** + * This is the entry point to the class, it gathers, then provides the completions asynchronously via callback. + * The callback function may be called multiple times, the last invokation is marked with a `finished` flag + * @param {Editor} editor + * @param {CompletionProviderOptions} options + * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback + */ + provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [], finished: boolean) => void): void; + + detach(): void; + + completions: FilteredList; + } + + export type Editor = import("ace-code/src/editor").Editor; + export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; + export type CompletionOptions = import("ace-code").Ace.CompletionOptions; + export type BaseCompletion = { + /** + * - a numerical value that determines the order in which completions would be displayed. + * A lower score means that the completion would be displayed further from the start + */ + score?: number; + /** + * - a short description of the completion + */ + meta?: string; + /** + * - the text that would be displayed in the completion list. If omitted, value or snippet + * would be shown instead. + */ + caption?: string; + /** + * - an HTML string that would be displayed as an additional popup + */ + docHTML?: string; + /** + * - a plain text that would be displayed as an additional popup. If `docHTML` exists, + * it would be used instead of `docText`. + */ + docText?: string; + /** + * - the identifier of the completer + */ + completerId?: string; + /** + * - An object specifying the range of text to be replaced with the new completion value (experimental) + */ + range?: import("ace-code").Ace.IRange; + /** + * - A command to be executed after the completion is inserted (experimental) + */ + command?: string; + /** + * - a text snippet that would be inserted when the completion is selected + */ + snippet?: string; + /** + * - The text that would be inserted when selecting this completion. + */ + value?: string; + completer?: import("ace-code").Ace.Completer & { + insertMatch: (editor: Editor, data: Completion) => void; + }; + hideInlinePreview?: boolean; + }; + export type SnippetCompletion = BaseCompletion & { + snippet: string; + }; + export type ValueCompletion = BaseCompletion & { + value: string; + }; + /** + * Represents a suggested text snippet intended to complete a user's input + */ + export type Completion = SnippetCompletion | ValueCompletion; + import HashHandler_1 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_1.HashHandler; + import AcePopup_1 = require("ace-code/src/autocomplete/popup"); + import AcePopup = AcePopup_1.AcePopup; + import AceInline_1 = require("ace-code/src/autocomplete/inline"); + import AceInline = AceInline_1.AceInline; + + export class FilteredList { + constructor(array: any, filterText: any); + + all: any; + filtered: any; + filterText: any; + exactMatch: boolean; + ignoreCaption: boolean; + + setFilter(str: any): void; + + filterCompletions(items: any, needle: any): any[]; + } + + export namespace startCommand { + let name: string; + + function exec(editor: any, options: any): void; + + let bindKey: string; + } + export {}; + namespace Ace { + type AcePopup = import("ace-code").Ace.AcePopup; + type FilteredList = import("ace-code").Ace.FilteredList; + } + + export interface Autocomplete { + popup: Ace.AcePopup; + emptyMessage?: Function; + } + + export interface CompletionProvider { + completions: Ace.FilteredList; + } +} +declare module "ace-code/src/autocomplete/text_completer" { + export function getCompletions(editor: any, session: any, pos: any, prefix: any, callback: any): void; +} +declare module "ace-code/src/search_highlight" { + export type Marker = import("ace-code/src/layer/marker").Marker; + export type EditSession = import("ace-code/src/edit_session").EditSession; + + export class SearchHighlight { + /** + * @param {any} regExp + * @param {string} clazz + */ + constructor(regExp: any, clazz: string, type?: string); + + clazz: string; + type: string; + + setRegexp(regExp: any): void; + + regExp: any; + cache: any[]; + + /** + * @param {any} html + * @param {Marker} markerLayer + * @param {EditSession} session + * @param {Partial} config + */ + update(html: any, markerLayer: Marker, session: EditSession, config: Partial): void; + + MAX_RANGES: number; + } +} +declare module "ace-code/src/occur" { + export type Editor = import("ace-code/src/editor").Editor; + export type Point = import("ace-code").Ace.Point; + export type SearchOptions = import("ace-code").Ace.SearchOptions; + + /** + * Finds all lines matching a search term in the current [[Document + * `Document`]] and displays them instead of the original `Document`. Keeps + * track of the mapping between the occur doc and the original doc. + **/ + export class Occur extends Search { + /** + * Enables occur mode. expects that `options.needle` is a search term. + * This search term is used to filter out all the lines that include it + * and these are then used as the content of a new [[Document + * `Document`]]. The current cursor position of editor will be translated + * so that the cursor is on the matching row/column as it was before. + * @param {Editor} editor + * @param {Object} options options.needle should be a String + * @return {Boolean} Whether occur activation was successful + * + **/ + enter(editor: Editor, options: any): boolean; + + /** + * Disables occur mode. Resets the [[Sessions `EditSession`]] [[Document + * `Document`]] back to the original doc. If options.translatePosition is + * truthy also maps the [[Editors `Editor`]] cursor position accordingly. + * @param {Editor} editor + * @param {Object} options options.translatePosition + * @return {Boolean} Whether occur deactivation was successful + * + **/ + exit(editor: Editor, options: any): boolean; + + /** + * @param {EditSession} sess + * @param {RegExp} regexp + */ + highlight(sess: EditSession, regexp: RegExp): void; + + /** + * @param {Editor} editor + * @param {Partial} options + */ + displayOccurContent(editor: Editor, options: Partial): void; + + /** + * @param {Editor} editor + */ + displayOriginalContent(editor: Editor): void; + + /** + * Translates the position from the original document to the occur lines in + * the document or the beginning if the doc {row: 0, column: 0} if not + * found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the original document + * @return {Point} position in occur doc + **/ + originalToOccurPosition(session: EditSession, pos: Point): Point; + + /** + * Translates the position from the occur document to the original document + * or `pos` if not found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the occur session document + * @return {Point} position + **/ + occurToOriginalPosition(session: EditSession, pos: Point): Point; + + /** + * @param {EditSession} session + * @param {Partial} options + */ + matchingLines(session: EditSession, options: Partial): any[]; + } + + import Search_2 = require("ace-code/src/search"); + import Search = Search_2.Search; + import EditSession_2 = require("ace-code/src/edit_session"); + import EditSession = EditSession_2.EditSession; +} +declare module "ace-code/src/marker_group" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type MarkerGroupItem = { + range: import("ace-code/src/range").Range; + className: string; + }; + export type Marker = import("ace-code/src/layer/marker").Marker; + + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem + */ + /** + * @typedef {import("ace-code/src/layer/marker").Marker} Marker + */ + export class MarkerGroup { + /** + * @param {EditSession} session + */ + constructor(session: EditSession); + + markers: any[]; + /**@type {EditSession}*/ + session: EditSession; + + /** + * Finds the first marker containing pos + * @param {import("ace-code").Ace.Point} pos + * @returns import("ace-code").Ace.MarkerGroupItem + */ + getMarkerAtPosition(pos: import("ace-code").Ace.Point): any; + + /** + * Comparator for Array.sort function, which sorts marker definitions by their positions + * + * @param {MarkerGroupItem} a first marker. + * @param {MarkerGroupItem} b second marker. + * @returns {number} negative number if a should be before b, positive number if b should be before a, 0 otherwise. + */ + markersComparator(a: MarkerGroupItem, b: MarkerGroupItem): number; + + /** + * Sets marker definitions to be rendered. Limits the number of markers at MAX_MARKERS. + * @param {MarkerGroupItem[]} markers an array of marker definitions. + */ + setMarkers(markers: MarkerGroupItem[]): void; + + /** + * @param {any} html + * @param {Marker} markerLayer + * @param {EditSession} session + * @param {{ firstRow: any; lastRow: any; }} config + */ + update(html: any, markerLayer: Marker, session: EditSession, config: { + firstRow: any; + lastRow: any; + }): void; + + MAX_MARKERS: number; + } +} +declare module "ace-code/src/edit_session/fold" { + export class Fold extends RangeList { + /** + * @param {Range} range + * @param {any} placeholder + */ + constructor(range: Range, placeholder: any); + + foldLine: import("ace-code/src/edit_session/fold_line").FoldLine; + placeholder: any; + range: import("ace-code/src/range").Range; + start: import("ace-code").Ace.Point; + end: import("ace-code").Ace.Point; + sameRow: boolean; + /**@type {Fold[]}*/ + subFolds: Fold[]; + + /** + * @param {FoldLine} foldLine + */ + setFoldLine(foldLine: FoldLine): void; + + clone(): Fold; + + /** + * @param {Fold} fold + */ + addSubFold(fold: Fold): any; + + /** + * @param {IRange} range + */ + restoreRange(range: IRange): void; + + collapseChildren?: number; + } + + export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + export type Range = import("ace-code/src/range").Range; + export type Point = import("ace-code").Ace.Point; + export type IRange = import("ace-code").Ace.IRange; + import RangeList_1 = require("ace-code/src/range_list"); + import RangeList = RangeList_1.RangeList; + + export interface Fold { + collapseChildren?: number; + } +} +declare module "ace-code/src/edit_session/fold_line" { + export type Fold = import("ace-code/src/edit_session/fold").Fold; + + export class FoldLine { + /** + * If an array is passed in, the folds are expected to be sorted already. + * @param {FoldLine[]} foldData + * @param {Fold[]|Fold} folds + */ + constructor(foldData: FoldLine[], folds: Fold[] | Fold); + + foldData: FoldLine[]; + /**@type {Fold[]} */ + folds: Fold[]; + range: Range; + start: import("ace-code").Ace.Point; + end: import("ace-code").Ace.Point; + + /** + * Note: This doesn't update wrapData! + * @param {number} shift + */ + shiftRow(shift: number): void; + + /** + * @param {Fold} fold + */ + addFold(fold: Fold): void; + + /** + * @param {number} row + */ + containsRow(row: number): boolean; + + /** + * @param {Function} callback + * @param {number} endRow + * @param {number} endColumn + */ + walk(callback: Function, endRow: number, endColumn: number): void; + + /** + * @param {number} row + * @param {number} column + * @return {{ fold: Fold, kind: string } | null} + */ + getNextFoldTo(row: number, column: number): { + fold: Fold; + kind: string; + } | null; + + /** + * @param {number} row + * @param {number} column + * @param {number} len + */ + addRemoveChars(row: number, column: number, len: number): void; + + /** + * @param {number} row + * @param {number} column + * @return {FoldLine | null} + */ + split(row: number, column: number): FoldLine | null; + + /** + * @param {FoldLine} foldLineNext + */ + merge(foldLineNext: FoldLine): void; + + toString(): string; + + /** + * @param {number} idx + * @return {import("ace-code").Ace.Point} + */ + idxToPosition(idx: number): import("ace-code").Ace.Point; + } + + import Range_9 = require("ace-code/src/range"); + import Range = Range_9.Range; +} +declare module "ace-code/src/lib/bidiutil" { + export const ON_R: 3; + export const AN: 4; + export const R_H: 5; + export const B: 6; + export const RLE: 7; + export const DOT: "·"; + + export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; + + export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; + + export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; + + export var L: number; + export var R: number; + export var EN: number; +} +declare module "ace-code/src/bidihandler" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + + /** + * This object is used to ensure Bi-Directional support (for languages with text flowing from right to left, like Arabic or Hebrew) + * including correct caret positioning, text selection mouse and keyboard arrows functioning + **/ + export class BidiHandler { + /** + * Creates a new `BidiHandler` object + * @param {EditSession} session The session to use + **/ + constructor(session: EditSession); + + session: import("ace-code/src/edit_session").EditSession; + bidiMap: {}; + currentRow: any; + bidiUtil: typeof bidiUtil; + charWidths: any[]; + EOL: string; + showInvisibles: boolean; + isRtlDir: boolean; + line: string; + wrapIndent: number; + EOF: string; + RLE: string; + contentWidth: number; + fontMetrics: any; + rtlLineOffset: number; + wrapOffset: number; + isMoveLeftOperation: boolean; + seenBidi: boolean; + + /** + * Returns 'true' if row contains Bidi characters, in such case + * creates Bidi map to be used in operations related to selection + * (keyboard arrays, mouse click, select) + * @param {Number} screenRow the screen row to be checked + * @param {Number} [docRow] the document row to be checked [optional] + * @param {Number} [splitIndex] the wrapped screen line index [ optional] + **/ + isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; + + onChange(delta: any): void; + + getDocumentRow(): number; + + getSplitIndex(): number; + + updateRowLine(docRow: any, splitIndex: any): void; + + updateBidiMap(): void; + + /** + * Resets stored info related to current screen row + **/ + markAsDirty(): void; + + /** + * Updates array of character widths + * @param {Object} fontMetrics metrics + * + **/ + updateCharacterWidths(fontMetrics: any): void; + + characterWidth: any; + + setShowInvisibles(showInvisibles: any): void; + + setEolChar(eolChar: any): void; + + setContentWidth(width: any): void; + + isRtlLine(row: any): boolean; + + setRtlDirection(editor: any, isRtlDir: any): void; + + /** + * Returns offset of character at position defined by column. + * @param {Number} col the screen column position + * + * @return {Number} horizontal pixel offset of given screen column + **/ + getPosLeft(col: number): number; + + /** + * Returns 'selections' - array of objects defining set of selection rectangles + * @param {Number} startCol the start column position + * @param {Number} endCol the end column position + * + * @return {Object[]} Each object contains 'left' and 'width' values defining selection rectangle. + **/ + getSelections(startCol: number, endCol: number): any[]; + + /** + * Converts character coordinates on the screen to respective document column number + * @param {Number} posX character horizontal offset + * + * @return {Number} screen column number corresponding to given pixel offset + **/ + offsetToCol(posX: number): number; + } + + import bidiUtil = require("ace-code/src/lib/bidiutil"); +} +declare module "ace-code/src/background_tokenizer" { + const BackgroundTokenizer_base: undefined; + + /** + * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. + * + * If a certain row is changed, everything below that row is re-tokenized. + **/ + export class BackgroundTokenizer { + /** + * Creates a new `BackgroundTokenizer` object. + * @param {Tokenizer} tokenizer The tokenizer to use + * @param {EditSession} [session] The editor session to associate with + **/ + constructor(tokenizer: Tokenizer, session?: EditSession); + + /**@type {false|number}*/ + running: false | number; + lines: any[]; + states: any[]; + currentLine: number; + tokenizer: import("ace-code/src/tokenizer").Tokenizer; + + /** + * Sets a new tokenizer for this object. + * @param {Tokenizer} tokenizer The new tokenizer to use + **/ + setTokenizer(tokenizer: Tokenizer): void; + + /** + * Sets a new document to associate with this object. + * @param {Document} doc The new document to associate with + **/ + setDocument(doc: Document): void; + + doc: import("ace-code/src/document").Document; + + /** + * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. + * @param {Number} firstRow The starting row region + * @param {Number} lastRow The final row region + **/ + fireUpdateEvent(firstRow: number, lastRow: number): void; + + /** + * Starts tokenizing at the row indicated. + * @param {Number} startRow The row to start at + **/ + start(startRow: number): void; + + /** + * Sets pretty long delay to prevent the tokenizer from interfering with the user + */ + scheduleStart(): void; + + /** + * Stops tokenizing. + **/ + stop(): void; + + /** + * Gives list of [[Token]]'s of the row. (tokens are cached) + * @param {Number} row The row to get tokens at + * @returns {import("ace-code").Ace.Token[]} + **/ + getTokens(row: number): import("ace-code").Ace.Token[]; + + /** + * Returns the state of tokenization at the end of a row. + * @param {Number} row The row to get state at + * @returns {string} + **/ + getState(row: number): string; + + cleanup(): void; + } + + export type Document = import("ace-code/src/document").Document; + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; + } + + export interface BackgroundTokenizer extends Ace.EventEmitter { + } +} +declare module "ace-code/src/edit_session/folding" { + export type IFolding = import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding; + export type Delta = import("ace-code").Ace.Delta; + + /** + * @typedef {import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding} IFolding + * @typedef {import("ace-code").Ace.Delta } Delta + */ + /** + * @this {IFolding} + * @type {IFolding} + */ + export function Folding(this: IFolding): void; + + export class Folding { + /** + * Looks up a fold at a given row/column. Possible values for side: + * -1: ignore a fold if fold.start = row/column + * +1: ignore a fold if fold.end = row/column + * @param {number} row + * @param {number} column + * @param {number} [side] + * @return {Fold} + **/ + getFoldAt: (row: number, column: number, side?: number) => Fold; + /** + * Returns all folds in the given range. Note, that this will return folds + * @param {Range| Delta} range + * @returns {Fold[]} + **/ + getFoldsInRange: (range: import("ace-code").Ace.Delta | Range) => Fold[]; + /** + * + * @param {Range[]|Range}ranges + * @returns {Fold[]} + */ + getFoldsInRangeList: (ranges: Range | Range[]) => Fold[]; + /** + * Returns all folds in the document + * @returns {Fold[]} + */ + getAllFolds: () => Fold[]; + /** + * Returns the string between folds at the given position. + * E.g. + * foob|arwolrd -> "bar" + * foobarwol|rd -> "world" + * foobarwolrd -> + * + * where | means the position of row/column + * + * The trim option determs if the return string should be trimed according + * to the "side" passed with the trim value: + * + * E.g. + * foob|arwolrd -trim=-1> "b" + * foobarwol|rd -trim=+1> "rld" + * fo|obarwolrd -trim=00> "foo" + * @param {number} row + * @param {number} column + * @param {number} [trim] + * @param {FoldLine} [foldLine] + * @returns {string | null} + */ + getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: FoldLine) => string; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldLine] + * @returns {null|FoldLine} + */ + getFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + /** + * Returns the fold which starts after or contains docRow + * @param {number} docRow + * @param {FoldLine} [startFoldLine] + * @returns {null|FoldLine} + */ + getNextFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + /** + * + * @param {number} first + * @param {number} last + * @return {number} + */ + getFoldedRowCount: (first: number, last: number) => number; + /** + * Adds a new fold. + * + * @param {Fold|string} placeholder + * @param {Range} [range] + * @returns {Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + * @this {IFolding} + */ + addFold: (placeholder: string | Fold, range?: Range) => Fold; + /** + * @param {Fold[]} folds + */ + addFolds: (folds: Fold[]) => void; + /** + * + * @param {Fold} fold + */ + removeFold: (fold: Fold) => void; + /** + * + * @param {Fold[]} folds + */ + removeFolds: (folds: Fold[]) => void; + /** + * @param {Fold} fold + */ + expandFold: (fold: Fold) => void; + /** + * @param {Fold[]}folds + */ + expandFolds: (folds: Fold[]) => void; + /** + * + * @param {number|null|import("ace-code").Ace.Point|Range|Range[]} [location] + * @param {boolean} [expandInner] + * @return {Fold[]| undefined} + */ + unfold: (location?: number | import("ace-code").Ace.Point | Range | Range[], expandInner?: boolean) => Fold[]; + /** + * Checks if a given documentRow is folded. This is true if there are some + * folded parts such that some parts of the line is still visible. + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @returns {boolean} + **/ + isRowFolded: (docRow: number, startFoldRow?: FoldLine) => boolean; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @return {number} + */ + getRowFoldEnd: (docRow: number, startFoldRow?: FoldLine) => number; + /** + * + * @param {number} docRow + * @param {FoldLine} [startFoldRow] + * @returns {number} + */ + getRowFoldStart: (docRow: number, startFoldRow?: FoldLine) => number; + /** + * + * @param {FoldLine} foldLine + * @param {number | null} [endRow] + * @param {number | null} [endColumn] + * @param {number | null} [startRow] + * @param {number | null} [startColumn] + * @return {string} + */ + getFoldDisplayLine: (foldLine: FoldLine, endRow?: number, endColumn?: number, startRow?: number, startColumn?: number) => string; + /** + * + * @param {number} row + * @param {number | null} endColumn + * @param {number | null} startRow + * @param {number | null} startColumn + * @return {string} + */ + getDisplayLine: (row: number, endColumn: number, startRow: number, startColumn: number) => string; + /** + * @param {boolean} [tryToUnfold] + */ + toggleFold: (tryToUnfold?: boolean) => void; + /** + * + * @param {number} row + * @param {number} column + * @param {number} [dir] + * @return {Range | undefined} + */ + getCommentFoldRange: (row: number, column: number, dir?: number) => Range; + /** + * + * @param {number | null} [startRow] + * @param {number | null} [endRow] + * @param {number | null} [depth] + * @param {Function} [test] + */ + foldAll: (startRow?: number, endRow?: number, depth?: number, test?: Function) => void; + /** + * + * @param {number} level + */ + foldToLevel: (level: number) => void; + /** + * + */ + foldAllComments: () => void; + /** + * @param {string} style + */ + setFoldStyle: (style: string) => void; + /** + * @param {number} row + * @param {boolean} [ignoreCurrent] + * @return {{range?: Range, firstRange?: Range}} + */ + getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { + range?: Range; + firstRange?: Range; + }; + /** + * + * @param {number} row + * @param {any} e + */ + onFoldWidgetClick: (row: number, e: any) => void; + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget: (toggleParent?: boolean) => void; + /** + * @param {Delta} delta + */ + updateFoldWidgets: (delta: import("ace-code").Ace.Delta) => void; + /** + * @param e + */ + tokenizerUpdateFoldWidgets: (e: any) => void; + } + + import Fold_1 = require("ace-code/src/edit_session/fold"); + import Fold = Fold_1.Fold; + import Range_10 = require("ace-code/src/range"); + import Range = Range_10.Range; + import FoldLine_1 = require("ace-code/src/edit_session/fold_line"); + import FoldLine = FoldLine_1.FoldLine; +} +declare module "ace-code/src/edit_session/bracket_match" { + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Point = import("ace-code/src/edit_session").Point; + + export function BracketMatch(): void; + + export class BracketMatch { + /** + * + * @param {Point} position + * @param {string} [chr] + * @this {EditSession} + */ + findMatchingBracket: (this: import("ace-code/src/edit_session").EditSession, position: Point, chr?: string) => import("ace-code").Ace.Point; + /** + * @param {Point} pos + * @return {null|Range} + * @this {EditSession} + */ + getBracketRange: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => null | Range; + /** + * Returns: + * * null if there is no any bracket at `pos`; + * * two Ranges if there is opening and closing brackets; + * * one Range if there is only one bracket + * + * @param {Point} pos + * @param {boolean} [isBackwards] + * @returns {null|Range[]} + * @this {EditSession} + */ + getMatchingBracketRanges: (this: import("ace-code/src/edit_session").EditSession, pos: Point, isBackwards?: boolean) => null | Range[]; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + * @param {Point} pos + * @returns {{closeTag: Range, closeTagName: Range, openTag: Range, openTagName: Range} | undefined} + * @this {EditSession} + */ + getMatchingTags: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + } | undefined; + } + + import Range_11 = require("ace-code/src/range"); + import Range = Range_11.Range; +} +declare module "ace-code/src/edit_session" { + const EditSession_base: undefined; + const EditSession_base_1: undefined; + const EditSession_base_2: undefined; + const EditSession_base_3: undefined; + + /** + * @typedef TextMode + * @type {SyntaxMode} + */ + /** + * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. + * + * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. + **/ + export class EditSession { + /** + * Returns a new instance of EditSession with state from JSON. + * @method fromJSON + * @param {string|object} session The EditSession state. + * @returns {EditSession} + */ + static fromJSON(session: string | object): EditSession; + + /** + * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. + * @param {Document | String} [text] [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} + * @param {SyntaxMode} [mode] [The initial language mode to use for the document]{: #modeParam} + **/ + constructor(text?: Document | string, mode?: SyntaxMode); + + /**@type {Document}*/ doc: Document; + id: string; + bgTokenizer: BackgroundTokenizer; + selection: Selection; + destroyed: boolean; + + /** + * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. + * + * @param {Document} doc The new `Document` to use + * + **/ + setDocument(doc: Document): void; + + /** + * Returns the `Document` associated with this session. + * @return {Document} + **/ + getDocument(): Document; + + resetCaches(): void; + + onChangeFold(e: any): void; + + /** + * + * @param {Delta} delta + */ + onChange(delta: Delta): void; + + mergeUndoDeltas: boolean; + + /** + * Sets the session text. + * @param {String} text The new text to place + **/ + setValue(text: string): void; + + /** + * Returns the current edit session. + * @method toJSON + * @returns {Object} + */ + toJSON(): any; + + /** + * Returns selection object. + * @returns {Selection} + **/ + getSelection(): Selection; + + /** + * {:BackgroundTokenizer.getState} + * @param {Number} row The row to start at + * @returns {string} + * @related BackgroundTokenizer.getState + **/ + getState(row: number): string; + + /** + * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. + * @param {Number} row The row to start at + * @returns {import("ace-code").Ace.Token[]} + **/ + getTokens(row: number): import("ace-code").Ace.Token[]; + + /** + * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. + * @param {Number} row The row number to retrieve from + * @param {Number} column The column number to retrieve from + * @returns {import("ace-code").Ace.Token} + * + **/ + getTokenAt(row: number, column: number): import("ace-code").Ace.Token; + + /** + * Sets the undo manager. + * @param {UndoManager} undoManager The new undo manager + **/ + setUndoManager(undoManager: UndoManager): void; + + /** + * starts a new group in undo history + **/ + markUndoGroup(): void; + + /** + * Returns the current undo manager. + * @returns {UndoManager} + **/ + getUndoManager(): UndoManager; + + /** + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + * @returns {String} + **/ + getTabString(): string; + + /** + * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). + * @param {Boolean} val Value indicating whether or not to use soft tabs + **/ + setUseSoftTabs(val: boolean): void; + + /** + * Returns `true` if soft tabs are being used, `false` otherwise. + * @returns {Boolean} + **/ + getUseSoftTabs(): boolean; + + /** + * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. + * @param {Number} tabSize The new tab size + **/ + setTabSize(tabSize: number): void; + + /** + * Returns the current tab size. + * @return {number} + **/ + getTabSize(): number; + + /** + * Returns `true` if the character at the position is a soft tab. + * @param {Point} position The position to check + **/ + isTabStop(position: Point): boolean; + + /** + * Set whether keyboard navigation of soft tabs moves the cursor within the soft tab, rather than over + * @param {Boolean} navigateWithinSoftTabs Value indicating whether or not to navigate within soft tabs + **/ + setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; + + /** + * Returns `true` if keyboard navigation moves the cursor within soft tabs, `false` if it moves the cursor over soft tabs. + * @returns {Boolean} + **/ + getNavigateWithinSoftTabs(): boolean; + + /** + * Pass in `true` to enable overwrites in your session, or `false` to disable. + * + * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. + * + * @param {Boolean} overwrite Defines whether or not to set overwrites + * + **/ + setOverwrite(overwrite: boolean): void; + + /** + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ + getOverwrite(): boolean; + + /** + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ + toggleOverwrite(): void; + + /** + * Adds `className` to the `row`, to be used for CSS stylings and whatnot. + * @param {Number} row The row number + * @param {String} className The class to add + **/ + addGutterDecoration(row: number, className: string): void; + + /** + * Removes `className` from the `row`. + * @param {Number} row The row number + * @param {String} className The class to add + **/ + removeGutterDecoration(row: number, className: string): void; + + /** + * Returns an array of strings, indicating the breakpoint class (if any) applied to each row. + * @returns {String[]} + **/ + getBreakpoints(): string[]; + + /** + * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. + * @param {number[]} rows An array of row indices + **/ + setBreakpoints(rows: number[]): void; + + /** + * Removes all breakpoints on the rows. This function also emits the `'changeBreakpoint'` event. + **/ + clearBreakpoints(): void; + + /** + * Sets a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. + * @param {Number} row A row index + * @param {String} className Class of the breakpoint + **/ + setBreakpoint(row: number, className: string): void; + + /** + * Removes a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. + * @param {Number} row A row index + **/ + clearBreakpoint(row: number): void; + + /** + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * @param {Range} range Define the range of the marker + * @param {String} clazz Set the CSS class for the marker + * @param {import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line"} [type] Identify the renderer type of the marker. If string provided, corresponding built-in renderer is used. Supported string types are "fullLine", "screenLine", "text" or "line". If a Function is provided, that Function is used as renderer. + * @param {Boolean} [inFront] Set to `true` to establish a front marker + * + * @return {Number} The new marker id + **/ + addMarker(range: Range, clazz: string, type?: import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line", inFront?: boolean): number; + + /** + * Adds a dynamic marker to the session. + * @param {import("ace-code").Ace.MarkerLike} marker object with update method + * @param {Boolean} [inFront] Set to `true` to establish a front marker + * + * @return {import("ace-code").Ace.MarkerLike} The added marker + **/ + addDynamicMarker(marker: import("ace-code").Ace.MarkerLike, inFront?: boolean): import("ace-code").Ace.MarkerLike; + + /** + * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. + * @param {Number} markerId A number representing a marker + **/ + removeMarker(markerId: number): void; + + /** + * Returns an object containing all of the markers, either front or back. + * @param {Boolean} [inFront] If `true`, indicates you only want front markers; `false` indicates only back markers + * + * @returns {{[id: number]: import("ace-code").Ace.MarkerLike}} + **/ + getMarkers(inFront?: boolean): { + [id: number]: import("ace-code").Ace.MarkerLike; + }; + + /** + * @param {RegExp} re + */ + highlight(re: RegExp): void; + + /** + * experimental + * @param {number} startRow + * @param {number} endRow + * @param {string} clazz + * @param {boolean} [inFront] + * @return {Range} + */ + highlightLines(startRow: number, endRow: number, clazz: string, inFront?: boolean): Range; + + /** + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + * @param {import("ace-code").Ace.Annotation[]} annotations A list of annotations + **/ + setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; + + /** + * Returns the annotations for the `EditSession`. + * @returns {import("ace-code").Ace.Annotation[]} + **/ + getAnnotations(): import("ace-code").Ace.Annotation[]; + + /** + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ + clearAnnotations(): void; + + /** + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * @param {Number} row The row to start at + * @param {Number} column The column to start at + * + * @returns {Range} + **/ + getWordRange(row: number, column: number): Range; + + /** + * Gets the range of a word, including its right whitespace. + * @param {Number} row The row number to start from + * @param {Number} column The column number to start from + * + * @return {Range} + **/ + getAWordRange(row: number, column: number): Range; + + /** + * {:Document.setNewLineMode.desc} + * @param {import("ace-code").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} + * + * + * @related Document.setNewLineMode + **/ + setNewLineMode(newLineMode: import("ace-code").Ace.NewLineMode): void; + + /** + * + * Returns the current new line mode. + * @returns {import("ace-code").Ace.NewLineMode} + * @related Document.getNewLineMode + **/ + getNewLineMode(): import("ace-code").Ace.NewLineMode; + + /** + * Identifies if you want to use a worker for the `EditSession`. + * @param {Boolean} useWorker Set to `true` to use a worker + **/ + setUseWorker(useWorker: boolean): void; + + /** + * Returns `true` if workers are being used. + **/ + getUseWorker(): boolean; + + /** + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ + onReloadTokenizer(e: any): void; + + /** + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * @param {SyntaxMode | string} mode Set a new text mode + * @param {() => void} [cb] optional callback + **/ + setMode(mode: SyntaxMode | string, cb?: () => void): void; + + /**@type {RegExp}*/ + tokenRe: RegExp; + /**@type {RegExp}*/ + nonTokenRe: RegExp; + + /** + * Returns the current text mode. + * @returns {TextMode} The current text mode + **/ + getMode(): TextMode; + + /** + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + * @param {Number} scrollTop The new scroll top value + **/ + setScrollTop(scrollTop: number): void; + + /** + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + * @returns {Number} + **/ + getScrollTop(): number; + + /** + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + * @param {number} scrollLeft + */ + setScrollLeft(scrollLeft: number): void; + + /** + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + * @returns {Number} + **/ + getScrollLeft(): number; + + /** + * Returns the width of the screen. + * @returns {Number} + **/ + getScreenWidth(): number; + + /** + * @return {number} + */ + getLineWidgetMaxWidth(): number; + + lineWidgetWidth: number; + screenWidth: any; + + /** + * Returns a verbatim copy of the given line as it is in the document + * @param {Number} row The row to retrieve from + * @returns {String} + **/ + getLine(row: number): string; + + /** + * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. + * @param {Number} firstRow The first row index to retrieve + * @param {Number} lastRow The final row index to retrieve + * + * @returns {String[]} + * + **/ + getLines(firstRow: number, lastRow: number): string[]; + + /** + * Returns the number of rows in the document. + * @returns {Number} + **/ + getLength(): number; + + /** + * {:Document.getTextRange.desc} + * @param {IRange} [range] The range to work with + * + * @returns {String} + **/ + getTextRange(range?: IRange): string; + + /** + * Inserts a block of `text` and the indicated `position`. + * @param {Point} position The position {row, column} to start inserting at + * @param {String} text A chunk of text to insert + * @returns {Point} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + **/ + insert(position: Point, text: string): Point; + + /** + * Removes the `range` from the document. + * @param {IRange} range A specified Range to remove + * @returns {Point} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + **/ + remove(range: IRange): Point; + + /** + * Removes a range of full lines. This method also triggers the `'change'` event. + * @param {Number} firstRow The first row to be removed + * @param {Number} lastRow The last row to be removed + * @returns {String[]} Returns all the removed lines. + * + * @related Document.removeFullLines + * + **/ + removeFullLines(firstRow: number, lastRow: number): string[]; + + /** + * Reverts previous changes to your document. + * @param {Delta[]} deltas An array of previous changes + * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} + **/ + undoChanges(deltas: Delta[], dontSelect?: boolean): void; + + /** + * Re-implements a previously undone change to your document. + * @param {Delta[]} deltas An array of previous changes + * @param {Boolean} [dontSelect] {:dontSelect} + **/ + redoChanges(deltas: Delta[], dontSelect?: boolean): void; + + /** + * Enables or disables highlighting of the range where an undo occurred. + * @param {Boolean} enable If `true`, selects the range of the reinserted change + * + **/ + setUndoSelect(enable: boolean): void; + + /** + * Replaces a range in the document with the new `text`. + * + * @param {IRange} range A specified Range to replace + * @param {String} text The new text to use as a replacement + * @returns {Point} An object containing the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If the text and range are empty, this function returns an object containing the current `range.start` value. + * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. + * + * @related Document.replace + **/ + replace(range: IRange, text: string): Point; + + /** + * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: + * ```json + * { row: newRowLocation, column: newColumnLocation } + * ``` + * @param {Range} fromRange The range of text you want moved within the document + * @param {Point} toPosition The location (row and column) where you want to move the text to + * @param {boolean} [copy] + * @returns {Range} The new range where the text was moved to. + **/ + moveText(fromRange: Range, toPosition: Point, copy?: boolean): Range; + + /** + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * + * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. + * @param {Number} startRow Starting row + * @param {Number} endRow Ending row + * @param {String} indentString The indent token + **/ + indentRows(startRow: number, endRow: number, indentString: string): void; + + /** + * Outdents all the rows defined by the `start` and `end` properties of `range`. + * @param {Range} range A range of rows + **/ + outdentRows(range: Range): void; + + /** + * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. + * @param {Number} firstRow The starting row to move up + * @param {Number} lastRow The final row to move up + * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + **/ + moveLinesUp(firstRow: number, lastRow: number): number; + + /** + * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. + * @param {Number} firstRow The starting row to move down + * @param {Number} lastRow The final row to move down + * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + **/ + moveLinesDown(firstRow: number, lastRow: number): number; + + /** + * Duplicates all the text between `firstRow` and `lastRow`. + * @param {Number} firstRow The starting row to duplicate + * @param {Number} lastRow The final row to duplicate + * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + **/ + duplicateLines(firstRow: number, lastRow: number): number; + + /** + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + * @param {Boolean} useWrapMode Enable (or disable) wrap mode + **/ + setUseWrapMode(useWrapMode: boolean): void; + + /** + * Returns `true` if wrap mode is being used; `false` otherwise. + * @returns {Boolean} + **/ + getUseWrapMode(): boolean; + + /** + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + * @param {Number} min The minimum wrap value (the left side wrap) + * @param {Number} max The maximum wrap value (the right side wrap) + **/ + setWrapLimitRange(min: number, max: number): void; + + /** + * This should generally only be called by the renderer when a resize is detected. + * @param {Number} desiredLimit The new wrap limit + * @param [$printMargin] + * @returns {Boolean} + **/ + adjustWrapLimit(desiredLimit: number, $printMargin?: any): boolean; + + /** + * Returns the value of wrap limit. + * @returns {Number} The wrap limit. + **/ + getWrapLimit(): number; + + /** + * Sets the line length for soft wrap in the editor. Lines will break + * at a minimum of the given length minus 20 chars and at a maximum + * of the given number of chars. + * @param {number} limit The maximum line length in chars, for soft wrapping lines. + */ + setWrapLimit(limit: number): void; + + /** + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * + * { min: wrapLimitRange_min, max: wrapLimitRange_max } + * + * @returns {{ min: number, max: number }} + **/ + getWrapLimitRange(): { + min: number; + max: number; + }; + + /** + * Returns number of screenrows in a wrapped line. + * @param {Number} row The row number to check + * @returns {Number} + **/ + getRowLength(row: number): number; + + /** + * @param {Number} row + * @returns {Number} + **/ + getRowLineCount(row: number): number; + + /** + * @param {Number} screenRow + * @returns {Number} + **/ + getRowWrapIndent(screenRow: number): number; + + /** + * Returns the position (on screen) for the last character in the provided screen row. + * @param {Number} screenRow The screen row to check + * @returns {Number} + * + * @related EditSession.documentToScreenColumn + **/ + getScreenLastRowColumn(screenRow: number): number; + + /** + * For the given document row and column, this returns the column position of the last screen row. + * @param {Number} docRow + * @param {Number} docColumn + * @returns {number} + **/ + getDocumentLastRowColumn(docRow: number, docColumn: number): number; + + /** + * For the given document row and column, this returns the document position of the last row. + * @param {Number} docRow + * @param {Number} docColumn + * @returns {Point} + **/ + getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; + + /** + * For the given row, this returns the split data. + * @param {number} row + * @returns {String | undefined} + */ + getRowSplitData(row: number): string | undefined; + + /** + * The distance to the next tab stop at the specified screen column. + * @param {Number} screenColumn The screen column to check + * + * @returns {Number} + **/ + getScreenTabSize(screenColumn: number): number; + + /** + * @param {number} screenRow + * @param {number} screenColumn + * @returns {number} + */ + screenToDocumentRow(screenRow: number, screenColumn: number): number; + + /** + * @param {number} screenRow + * @param {number} screenColumn + * @returns {number} + */ + screenToDocumentColumn(screenRow: number, screenColumn: number): number; + + /** + * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} + * @param {Number} screenRow The screen row to check + * @param {Number} screenColumn The screen column to check + * @param {Number} [offsetX] screen character x-offset [optional] + * + * @returns {Point} The object returned has two properties: `row` and `column`. + * + * @related EditSession.documentToScreenPosition + **/ + screenToDocumentPosition(screenRow: number, screenColumn: number, offsetX?: number): Point; + + /** + * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * @param {Number|Point} docRow The document row to check + * @param {Number|undefined} [docColumn] The document column to check + * @returns {Point} The object returned by this method has two properties: `row` and `column`. + * + * @related EditSession.screenToDocumentPosition + **/ + documentToScreenPosition(docRow: number | Point, docColumn?: number | undefined): Point; + + /** + * For the given document row and column, returns the screen column. + * @param {Number|Point} row + * @param {Number} [docColumn] + * @returns {Number} + **/ + documentToScreenColumn(row: number | Point, docColumn?: number): number; + + /** + * For the given document row and column, returns the screen row. + * @param {Number|Point} docRow + * @param {Number} [docColumn] + * @returns {number} + **/ + documentToScreenRow(docRow: number | Point, docColumn?: number): number; + + /** + * Returns the length of the screen. + * @returns {Number} + **/ + getScreenLength(): number; + + /** + * @returns {string} the last character preceding the cursor in the editor + */ + getPrecedingCharacter(): string; + + destroy(): void; + + /** + * Returns the current [[Document `Document`]] as a string. + * @method getValue + * @returns {String} + * @alias EditSession.toString + **/ + getValue: () => string; + /** + * + * @type {null | import("ace-code").Ace.LineWidget[]} + */ + lineWidgets: null | import("ace-code").Ace.LineWidget[]; + isFullWidth: typeof isFullWidth; + widgetManager?: any; + curOp?: { + [key: string]: any; + command: {}; + args: string; + scrollTop: number; + }; + lineWidgetsWidth?: number; + + getSelectionMarkers(): any[]; + + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; + } + + export namespace EditSession { + export {$uid}; + } + export type FontMetrics = import("ace-code/src/layer/font_metrics").FontMetrics; + export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + export type Point = import("ace-code").Ace.Point; + export type Delta = import("ace-code").Ace.Delta; + export type IRange = import("ace-code").Ace.IRange; + export type SyntaxMode = import("ace-code").Ace.SyntaxMode; + export type TextMode = SyntaxMode; + import Document_1 = require("ace-code/src/document"); + import Document = Document_1.Document; + import BackgroundTokenizer_1 = require("ace-code/src/background_tokenizer"); + import BackgroundTokenizer = BackgroundTokenizer_1.BackgroundTokenizer; + import Selection_1 = require("ace-code/src/selection"); + import Selection = Selection_1.Selection; + import BidiHandler_1 = require("ace-code/src/bidihandler"); + import BidiHandler = BidiHandler_1.BidiHandler; + import UndoManager_1 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_1.UndoManager; + import Range_12 = require("ace-code/src/range"); + import Range = Range_12.Range; + + function isFullWidth(c: any): boolean; + + var $uid: number; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type EditSessionEvents = import("ace-code").Ace.EditSessionEvents; + type OptionsProvider = import("ace-code").Ace.OptionsProvider; + type EditSessionOptions = import("ace-code").Ace.EditSessionOptions; + type Folding = import("ace-code").Ace.Folding; + type BracketMatch = import("ace-code").Ace.BracketMatch; + type Document = import("ace-code").Ace.Document; + type Point = import("ace-code").Ace.Point; + type Occur = import("ace-code").Ace.Occur; + } + + export interface EditSession extends Ace.EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace.BracketMatch { + doc: Ace.Document; + widgetManager?: any; + curOp?: { + command: {}; + args: string; + scrollTop: number; + [key: string]: any; + }; + lineWidgetsWidth?: number; + + getSelectionMarkers(): any[]; + + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; + } +} +declare module "ace-code/src/range" { + /** + * @typedef {import("ace-code/src/edit_session").EditSession} EditSession + * @typedef {import("ace-code").Ace.IRange} IRange + * @typedef {import("ace-code").Ace.Point} Point + */ + /** + * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogous to a range, as ranges contain a starting row and starting column, and an ending row, and ending column. + **/ + export class Range { + /** + * Creates a new `Range` object with the given starting and ending rows and columns. + * @param {Number} [startRow] The starting row + * @param {Number} [startColumn] The starting column + * @param {Number} [endRow] The ending row + * @param {Number} [endColumn] The ending column + * @constructor + **/ + constructor(startRow?: number, startColumn?: number, endRow?: number, endColumn?: number); + + /**@type {Point}*/ + start: Point; + /**@type {Point}*/ + end: Point; + + /** + * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. + * @param {IRange} range A range to check against + * @return {Boolean} + **/ + isEqual(range: IRange): boolean; + + /** + * Returns a string containing the range's row and column information, given like this: + * ``` + * [start.row/start.column] -> [end.row/end.column] + * ``` + * @return {String} + **/ + toString(): string; + + /** + * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if: + * ```javascript + * this.start.row <= row <= this.end.row && + * this.start.column <= column <= this.end.column + * ``` + * @param {Number} row A row to check for + * @param {Number} column A column to check for + * @returns {Boolean} + * @related [[Range.compare]] + **/ + contains(row: number, column: number): boolean; + + /** + * Compares `this` range (A) with another range (B). + * @param {IRange} range A range to compare with + * @related [[Range.compare]] + * @returns {Number} This method returns one of the following numbers: + * * `-2`: (B) is in front of (A), and doesn't intersect with (A) + * * `-1`: (B) begins before (A) but ends inside of (A) + * * `0`: (B) is completely inside of (A) + * * `+1`: (B) begins inside of (A) but ends outside of (A) + * * `+2`: (B) is after (A) and doesn't intersect with (A) + * * `42`: FTW state: (B) ends in (A) but starts outside of (A) + **/ + compareRange(range: IRange): number; + + /** + * Compares the row and column of `p` with the starting and ending [[Point]]'s of the calling range (by calling [[Range.compare]]). + * @param {Point} p A point to compare with + * @related [[Range.compare]] + * @returns {Number} + **/ + comparePoint(p: Point): number; + + /** + * Checks the start and end [[Point]]'s of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range. + * @param {IRange} range A range to compare with + * @returns {Boolean} + * @related [[Range.comparePoint]] + **/ + containsRange(range: IRange): boolean; + + /** + * Returns `true` if passed in `range` intersects with the one calling this method. + * @param {IRange} range A range to compare with + * @returns {Boolean} + **/ + intersects(range: IRange): boolean; + + /** + * Returns `true` if the caller's ending row is the same as `row`, and if the caller's ending column is the same as `column`. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + **/ + isEnd(row: number, column: number): boolean; + + /** + * Returns `true` if the caller's starting row is the same as `row`, and if the caller's starting column is the same as `column`. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + **/ + isStart(row: number, column: number): boolean; + + /** + * Sets the starting row and column for the range. + * @param {Number|Point} row A row to set + * @param {Number} [column] A column to set + * + **/ + setStart(row: number | Point, column?: number): void; + + /** + * Sets the starting row and column for the range. + * @param {Number|Point} row A row to set + * @param {Number} [column] A column to set + * + **/ + setEnd(row: number | Point, column?: number): void; + + /** + * Returns `true` if the `row` and `column` are within the given range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + **/ + inside(row: number, column: number): boolean; + + /** + * Returns `true` if the `row` and `column` are within the given range's starting [[Point]]. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + **/ + insideStart(row: number, column: number): boolean; + + /** + * Returns `true` if the `row` and `column` are within the given range's ending [[Point]]. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Boolean} + * @related [[Range.compare]] + * + **/ + insideEnd(row: number, column: number): boolean; + + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if `row` is greater than the calling range + * * `-1` if `row` is less then the calling range + * * `0` otherwise + * + * If the starting row of the calling range is equal to `row`, and: + * * `column` is greater than or equal to the calling range's starting column, this returns `0` + * * Otherwise, it returns -1 + * + * If the ending row of the calling range is equal to `row`, and: + * * `column` is less than or equal to the calling range's ending column, this returns `0` + * * Otherwise, it returns 1 + **/ + compare(row: number, column: number): number; + + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `-1` if calling range's starting column and calling range's starting row are equal `row` and `column` + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + **/ + compareStart(row: number, column: number): number; + + /** + * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if calling range's ending column and calling range's ending row are equal `row` and `column`. + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + */ + compareEnd(row: number, column: number): number; + + /** + * Compares the `row` and `column` with the start and end [[Point]]'s of the calling range. + * @param {Number} row A row to compare with + * @param {Number} column A column to compare with + * @returns {Number} This method returns one of the following numbers: + * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column` + * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column` + * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. + **/ + compareInside(row: number, column: number): number; + + /** + * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object. + * @param {Number} firstRow The starting row + * @param {Number} lastRow The ending row + * @returns {Range} + **/ + clipRows(firstRow: number, lastRow: number): Range; + + /** + * Changes the `row` and `column` for the calling range for both the starting and ending [[Point]]'s. + * @param {Number} row A new row to extend to + * @param {Number} column A new column to extend to + * @returns {Range} The original range with the new row + **/ + extend(row: number, column: number): Range; + + /** + * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). + * @returns {Boolean} + **/ + isEmpty(): boolean; + + /** + * Returns `true` if the range spans across multiple lines. + * @returns {Boolean} + **/ + isMultiLine(): boolean; + + /** + * Returns a duplicate of the calling range. + * @returns {Range} + **/ + clone(): Range; + + /** + * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. + * @returns {Range} + **/ + collapseRows(): Range; + + /** + * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. + * @param {EditSession} session The `EditSession` to retrieve coordinates from + * @returns {Range} + **/ + toScreenRange(session: EditSession): Range; + + /** + * Shift the calling range by `row` and `column` values. + * @param {Number} row + * @param {Number} column + * @experimental + */ + moveBy(row: number, column: number): void; + + id?: number; + cursor?: import("ace-code").Ace.Point; + isBackwards?: boolean; + } + + export namespace Range { + export {fromPoints, comparePoints}; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type IRange = import("ace-code").Ace.IRange; + export type Point = import("ace-code").Ace.Point; + + /** + * Creates and returns a new `Range` based on the `start` [[Point]] and `end` [[Point]] of the given parameters. + * @param {Point} start A starting point to use + * @param {Point} end An ending point to use + * @returns {Range} + **/ + function fromPoints(start: Point, end: Point): Range; + + /** + * Compares `p1` and `p2` [[Point]]'s, useful for sorting + * @param {Point} p1 + * @param {Point} p2 + * @returns {Number} + */ + function comparePoints(p1: Point, p2: Point): number; + + export {}; + namespace Ace { + type Point = import("ace-code").Ace.Point; + } + + export interface Range { + id?: number; + cursor?: Ace.Point; + isBackwards?: boolean; + } +} +declare module "ace-code/src/worker/worker_client" { + export var WorkerClient: any; +} +declare module "ace-code/src/placeholder" { + const PlaceHolder_base: undefined; + + export class PlaceHolder { + /** + * @param {EditSession} session + * @param {Number} length + * @param {import("ace-code").Ace.Point} pos + * @param {any[]} others + * @param {String} mainClass + * @param {String} othersClass + **/ + constructor(session: EditSession, length: number, pos: import("ace-code").Ace.Point, others: any[], mainClass: string, othersClass: string); + + length: number; + session: import("ace-code/src/edit_session").EditSession; + doc: import("ace-code/src/document").Document; + mainClass: string; + othersClass: string; + + /** + * PlaceHolder.setup() + * + * TODO + * + **/ + setup(): void; + + selectionBefore: Range | Range[]; + pos: import("ace-code/src/anchor").Anchor; + others: any[]; + + /** + * PlaceHolder.showOtherMarkers() + * + * TODO + * + **/ + showOtherMarkers(): void; + + othersActive: boolean; + + /** + * PlaceHolder.hideOtherMarkers() + * + * Hides all over markers in the [[EditSession `EditSession`]] that are not the currently selected one. + * + **/ + hideOtherMarkers(): void; + + /** + * PlaceHolder@onUpdate(e) + * + * Emitted when the place holder updates. + * @param {import("ace-code").Ace.Delta} delta + */ + onUpdate(delta: import("ace-code").Ace.Delta): void; + + /** + * @param {import("ace-code").Ace.Delta} delta + */ + updateAnchors(delta: import("ace-code").Ace.Delta): void; + + updateMarkers(): void; + + /** + * PlaceHolder@onCursorChange(e) + * + * Emitted when the cursor changes. + * @param {any} [event] + */ + onCursorChange(event?: any): void; + + /** + * PlaceHolder.detach() + * + * TODO + * + **/ + detach(): void; + + /** + * PlaceHolder.cancel() + * + * TODO + * + **/ + cancel(): void; + } + + export type EditSession = import("ace-code/src/edit_session").EditSession; + import Range_13 = require("ace-code/src/range"); + import Range = Range_13.Range; + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; + } + + export interface PlaceHolder extends Ace.EventEmitter { + } +} +declare module "ace-code/src/mouse/multi_select_handler" { + export function onMouseDown(e: any): any; +} +declare module "ace-code/src/commands/multi_select_commands" { + export const defaultCommands: import("ace-code").Ace.Command[]; + export const multiSelectCommands: import("ace-code").Ace.Command[]; + export const keyboardHandler: HashHandler; + import HashHandler_4 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_4.HashHandler; +} +declare module "ace-code/src/multi_select" { + export const commands: import("ace-code").Ace.Command[]; + export const onSessionChange: (e: any) => void; + export type Anchor = import("ace-code/src/anchor").Anchor; + export type Point = import("ace-code").Ace.Point; + export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; + + /** + * @param {Editor} editor + */ + export function MultiSelect(editor: Editor): void; + + import Editor_4 = require("ace-code/src/editor"); + import Editor = Editor_4.Editor; +} +declare module "ace-code/src/commands/occur_commands" { + export namespace occurStartCommand { + let name: string; + + function exec(editor: any, options: any): void; + + let readOnly: boolean; + } +} +declare module "ace-code/src/commands/incremental_search_commands" { + export const iSearchStartCommands: ({ + name: string; + bindKey: { + win: string; + mac: string; + }; + exec: (editor: any, options: any) => void; + readOnly: boolean; + } | { + name: string; + exec: (editor: any, jumpToNext: any) => void; + readOnly: boolean; + bindKey?: undefined; + })[]; + export const iSearchCommands: ({ + name: string; + bindKey: { + win: string; + mac: string; + }; + exec: (iSearch: any, options: any) => void; + } | { + name: string; + exec: (iSearch: any, string: any) => void; + bindKey?: undefined; + } | { + name: string; + bindKey: string; + exec: (iSearch: any) => void; + })[]; + + export function IncrementalSearchKeyboardHandler(iSearch: any): void; + + export class IncrementalSearchKeyboardHandler { + constructor(iSearch: any); + } +} +declare module "ace-code/src/incremental_search" { + /** + * Implements immediate searching while the user is typing. When incremental + * search is activated, keystrokes into the editor will be used for composing + * a search term. Immediately after every keystroke the search is updated: + * - so-far-matching characters are highlighted + * - the cursor is moved to the next match + * + **/ + export class IncrementalSearch extends Search { + /** + * @param {boolean} backwards + */ + activate(editor: any, backwards: boolean): void; + + /** + * @param {boolean} [reset] + */ + deactivate(reset?: boolean): void; + + /** + * @param {Editor} editor + */ + selectionFix(editor: Editor): void; + + /** + * @param {RegExp} regexp + */ + highlight(regexp: RegExp): void; + + /** + * @param {boolean} [reset] + */ + cancelSearch(reset?: boolean): Range; + + /** + * @param {boolean} moveToNext + * @param {Function} needleUpdateFunc + */ + highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; + + /** + * @param {string} s + */ + addString(s: string): false | Range; + + /** + * @param {any} c + */ + removeChar(c: any): false | Range; + + next(options: any): false | Range; + + onMouseDown(evt: any): boolean; + + /** + * @param {string} text + */ + onPaste(text: string): void; + + convertNeedleToRegExp(): false | Range; + + convertNeedleToString(): false | Range; + + statusMessage(found: any): void; + + message(msg: any): void; + } + + import Search_3 = require("ace-code/src/search"); + import Search = Search_3.Search; + import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); + import Editor_6 = require("ace-code/src/editor"); + import Editor = Editor_6.Editor; + import Range_15 = require("ace-code/src/range"); + import Range = Range_15.Range; +} +declare module "ace-code/src/split" { + export type ISplit = import("ace-code").Ace.EventEmitter & { + [key: string]: any; + }; + /** + * @typedef {import("ace-code").Ace.EventEmitter & {[key: string]: any}} ISplit + */ + export var Split: any; +} +declare module "ace-code/src/tokenizer_dev" { + export class Tokenizer extends BaseTokenizer { + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @returns {Object} + **/ + getLineTokens(line: any, startState: any): any; + } + + import BaseTokenizer_1 = require("ace-code/src/tokenizer"); + import BaseTokenizer = BaseTokenizer_1.Tokenizer; +} +declare module "ace-code/src/unicode" { + export const wordChars: any; +} +declare module "ace-code/src/keyboard/textarea" { + import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); + import HashHandler = HashHandler_6.HashHandler; +} +declare module "ace-code/src/lib/fixoldbrowsers" { + export {}; +} diff --git a/ace-snippets.d.ts b/ace-snippets.d.ts new file mode 100644 index 00000000000..1f1085da24a --- /dev/null +++ b/ace-snippets.d.ts @@ -0,0 +1,400 @@ +declare module "ace-code/src/snippets/abc.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/abc" { + export const snippetText: string; + export const scope: "abc"; +} +declare module "ace-code/src/snippets/actionscript.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/actionscript" { + export const snippetText: string; + export const scope: "actionscript"; +} +declare module "ace-code/src/snippets/c_cpp.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/c_cpp" { + export const snippetText: string; + export const scope: "c_cpp"; +} +declare module "ace-code/src/snippets/clojure.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/clojure" { + export const snippetText: string; + export const scope: "clojure"; +} +declare module "ace-code/src/snippets/coffee.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/coffee" { + export const snippetText: string; + export const scope: "coffee"; +} +declare module "ace-code/src/snippets/csound_document.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/csound_document" { + export const snippetText: string; + export const scope: "csound_document"; +} +declare module "ace-code/src/snippets/csound_orchestra.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/csound_orchestra" { + export const snippetText: string; + export const scope: "csound_orchestra"; +} +declare module "ace-code/src/snippets/css.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/css" { + export const snippetText: string; + export const scope: "css"; +} +declare module "ace-code/src/snippets/dart.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/dart" { + export const snippetText: string; + export const scope: "dart"; +} +declare module "ace-code/src/snippets/diff.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/diff" { + export const snippetText: string; + export const scope: "diff"; +} +declare module "ace-code/src/snippets/django.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/django" { + export const snippetText: string; + export const scope: "django"; +} +declare module "ace-code/src/snippets/drools.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/drools" { + export const snippetText: string; + export const scope: "drools"; +} +declare module "ace-code/src/snippets/edifact.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/edifact" { + export const snippetText: string; + export const scope: "edifact"; +} +declare module "ace-code/src/snippets/erlang.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/erlang" { + export const snippetText: string; + export const scope: "erlang"; +} +declare module "ace-code/src/snippets/fsl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/fsl" { + export const snippetText: string; + export const scope: "fsl"; +} +declare module "ace-code/src/snippets/gobstones.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/gobstones" { + export const snippetText: string; + export const scope: "gobstones"; +} +declare module "ace-code/src/snippets/graphqlschema.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/graphqlschema" { + export const snippetText: string; + export const scope: "graphqlschema"; +} +declare module "ace-code/src/snippets/haml.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/haml" { + export const snippetText: string; + export const scope: "haml"; +} +declare module "ace-code/src/snippets/haskell.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/haskell" { + export const snippetText: string; + export const scope: "haskell"; +} +declare module "ace-code/src/snippets/html.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/html" { + export const snippetText: string; + export const scope: "html"; +} +declare module "ace-code/src/snippets/io" { + export const snippets: ({ + content: string; + name: string; + scope: string; + tabTrigger: string; + keyEquivalent?: undefined; + } | { + content: string; + keyEquivalent: string; + name: string; + scope: string; + tabTrigger: string; + } | { + content: string; + keyEquivalent: string; + name: string; + scope: string; + tabTrigger?: undefined; + })[]; + export const scope: "io"; +} +declare module "ace-code/src/snippets/java.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/java" { + export const snippetText: string; + export const scope: "java"; +} +declare module "ace-code/src/snippets/javascript.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/javascript" { + export const snippetText: string; + export const scope: "javascript"; +} +declare module "ace-code/src/snippets/jsp.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/jsp" { + export const snippetText: string; + export const scope: "jsp"; +} +declare module "ace-code/src/snippets/liquid.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/liquid" { + export const snippetText: string; + export const scope: "liquid"; +} +declare module "ace-code/src/snippets/lsl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/lsl" { + export const snippetText: string; + export const scope: "lsl"; +} +declare module "ace-code/src/snippets/lua.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/lua" { + export const snippetText: string; + export const scope: "lua"; +} +declare module "ace-code/src/snippets/makefile.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/makefile" { + export const snippetText: string; + export const scope: "makefile"; +} +declare module "ace-code/src/snippets/markdown.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/markdown" { + export const snippetText: string; + export const scope: "markdown"; +} +declare module "ace-code/src/snippets/maze.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/maze" { + export const snippetText: string; + export const scope: "maze"; +} +declare module "ace-code/src/snippets/perl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/perl" { + export const snippetText: string; + export const scope: "perl"; +} +declare module "ace-code/src/snippets/php.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/php" { + export const snippetText: string; + export const scope: "php"; +} +declare module "ace-code/src/snippets/python.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/python" { + export const snippetText: string; + export const scope: "python"; +} +declare module "ace-code/src/snippets/r.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/r" { + export const snippetText: string; + export const scope: "r"; +} +declare module "ace-code/src/snippets/razor.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/razor" { + export const snippetText: string; + export const scope: "razor"; +} +declare module "ace-code/src/snippets/robot.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/robot" { + export const snippetText: string; + export const scope: "robot"; +} +declare module "ace-code/src/snippets/rst.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/rst" { + export const snippetText: string; + export const scope: "rst"; +} +declare module "ace-code/src/snippets/ruby.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/ruby" { + export const snippetText: string; + export const scope: "ruby"; +} +declare module "ace-code/src/snippets/sh.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sh" { + export const snippetText: string; + export const scope: "sh"; +} +declare module "ace-code/src/snippets/snippets.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/snippets" { + export const snippetText: string; + export const scope: "snippets"; +} +declare module "ace-code/src/snippets/sql.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sql" { + export const snippetText: string; + export const scope: "sql"; +} +declare module "ace-code/src/snippets/sqlserver.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/sqlserver" { + export const snippetText: string; + export const scope: "sqlserver"; +} +declare module "ace-code/src/snippets/tcl.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/tcl" { + export const snippetText: string; + export const scope: "tcl"; +} +declare module "ace-code/src/snippets/tex.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/tex" { + export const snippetText: string; + export const scope: "tex"; +} +declare module "ace-code/src/snippets/textile.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/textile" { + export const snippetText: string; + export const scope: "textile"; +} +declare module "ace-code/src/snippets/vala" { + export const snippets: { + content: string; + name: string; + scope: string; + tabTrigger: string; + }[]; + export const scope: ""; +} +declare module "ace-code/src/snippets/velocity.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/velocity" { + export const snippetText: string; + export const scope: "velocity"; + export const includeScopes: string[]; +} +declare module "ace-code/src/snippets/wollok.snippets" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/snippets/wollok" { + export const snippetText: string; + export const scope: "wollok"; +} diff --git a/ace-theme.d.ts b/ace-theme.d.ts new file mode 100644 index 00000000000..53901f77936 --- /dev/null +++ b/ace-theme.d.ts @@ -0,0 +1,423 @@ +declare module "ace-code/src/theme/textmate-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/textmate" { + export const isDark: false; + export const cssClass: "ace-tm"; + export const cssText: string; +} +declare module "ace-code/src/theme/ambiance-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/ambiance" { + export const isDark: true; + export const cssClass: "ace-ambiance"; + export const cssText: string; +} +declare module "ace-code/src/theme/chaos-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/chaos" { + export const isDark: true; + export const cssClass: "ace-chaos"; + export const cssText: string; +} +declare module "ace-code/src/theme/chrome-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/chrome" { + export const isDark: false; + export const cssClass: "ace-chrome"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_day-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_day" { + export const isDark: false; + export const cssClass: "ace-cloud9-day"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_night-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_night" { + export const isDark: true; + export const cssClass: "ace-cloud9-night"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud9_night_low_color-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud9_night_low_color" { + export const isDark: true; + export const cssClass: "ace-cloud9-night-low-color"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud_editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud_editor" { + export const isDark: false; + export const cssClass: "ace-cloud_editor"; + export const cssText: string; +} +declare module "ace-code/src/theme/cloud_editor_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cloud_editor_dark" { + export const isDark: true; + export const cssClass: "ace-cloud_editor_dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/clouds-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/clouds" { + export const isDark: false; + export const cssClass: "ace-clouds"; + export const cssText: string; +} +declare module "ace-code/src/theme/clouds_midnight-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/clouds_midnight" { + export const isDark: true; + export const cssClass: "ace-clouds-midnight"; + export const cssText: string; +} +declare module "ace-code/src/theme/cobalt-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/cobalt" { + export const isDark: true; + export const cssClass: "ace-cobalt"; + export const cssText: string; +} +declare module "ace-code/src/theme/crimson_editor-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/crimson_editor" { + export const isDark: false; + export const cssText: string; + export const cssClass: "ace-crimson-editor"; +} +declare module "ace-code/src/theme/dawn-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dawn" { + export const isDark: false; + export const cssClass: "ace-dawn"; + export const cssText: string; +} +declare module "ace-code/src/theme/dracula-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dracula" { + export const isDark: true; + export const cssClass: "ace-dracula"; + export const cssText: string; +} +declare module "ace-code/src/theme/dreamweaver-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/dreamweaver" { + export const isDark: false; + export const cssClass: "ace-dreamweaver"; + export const cssText: string; +} +declare module "ace-code/src/theme/eclipse-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/eclipse" { + export const isDark: false; + export const cssText: string; + export const cssClass: "ace-eclipse"; +} +declare module "ace-code/src/theme/github-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/github" { + export const isDark: false; + export const cssClass: "ace-github"; + export const cssText: string; +} +declare module "ace-code/src/theme/github_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/github_dark" { + export const isDark: true; + export const cssClass: "ace-github-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/gob-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gob" { + export const isDark: true; + export const cssClass: "ace-gob"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox" { + export const isDark: true; + export const cssClass: "ace-gruvbox"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox_dark_hard-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox_dark_hard" { + export const isDark: true; + export const cssClass: "ace-gruvbox-dark-hard"; + export const cssText: string; +} +declare module "ace-code/src/theme/gruvbox_light_hard-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/gruvbox_light_hard" { + export const isDark: false; + export const cssClass: "ace-gruvbox-light-hard"; + export const cssText: string; +} +declare module "ace-code/src/theme/idle_fingers-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/idle_fingers" { + export const isDark: true; + export const cssClass: "ace-idle-fingers"; + export const cssText: string; +} +declare module "ace-code/src/theme/iplastic-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/iplastic" { + export const isDark: false; + export const cssClass: "ace-iplastic"; + export const cssText: string; +} +declare module "ace-code/src/theme/katzenmilch-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/katzenmilch" { + export const isDark: false; + export const cssClass: "ace-katzenmilch"; + export const cssText: string; +} +declare module "ace-code/src/theme/kr_theme-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/kr_theme" { + export const isDark: true; + export const cssClass: "ace-kr-theme"; + export const cssText: string; +} +declare module "ace-code/src/theme/kuroir-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/kuroir" { + export const isDark: false; + export const cssClass: "ace-kuroir"; + export const cssText: string; +} +declare module "ace-code/src/theme/merbivore-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/merbivore" { + export const isDark: true; + export const cssClass: "ace-merbivore"; + export const cssText: string; +} +declare module "ace-code/src/theme/merbivore_soft-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/merbivore_soft" { + export const isDark: true; + export const cssClass: "ace-merbivore-soft"; + export const cssText: string; +} +declare module "ace-code/src/theme/mono_industrial-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/mono_industrial" { + export const isDark: true; + export const cssClass: "ace-mono-industrial"; + export const cssText: string; +} +declare module "ace-code/src/theme/monokai-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/monokai" { + export const isDark: true; + export const cssClass: "ace-monokai"; + export const cssText: string; +} +declare module "ace-code/src/theme/nord_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/nord_dark" { + export const isDark: true; + export const cssClass: "ace-nord-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/one_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/one_dark" { + export const isDark: true; + export const cssClass: "ace-one-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/pastel_on_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/pastel_on_dark" { + export const isDark: true; + export const cssClass: "ace-pastel-on-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/solarized_dark-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/solarized_dark" { + export const isDark: true; + export const cssClass: "ace-solarized-dark"; + export const cssText: string; +} +declare module "ace-code/src/theme/solarized_light-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/solarized_light" { + export const isDark: false; + export const cssClass: "ace-solarized-light"; + export const cssText: string; +} +declare module "ace-code/src/theme/sqlserver-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/sqlserver" { + export const isDark: false; + export const cssClass: "ace-sqlserver"; + export const cssText: string; +} +declare module "ace-code/src/theme/terminal-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/terminal" { + export const isDark: true; + export const cssClass: "ace-terminal-theme"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow" { + export const isDark: false; + export const cssClass: "ace-tomorrow"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_blue-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_blue" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-blue"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_bright-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_bright" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-bright"; + export const cssText: string; +} +declare module "ace-code/src/theme/tomorrow_night_eighties-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/tomorrow_night_eighties" { + export const isDark: true; + export const cssClass: "ace-tomorrow-night-eighties"; + export const cssText: string; +} +declare module "ace-code/src/theme/twilight-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/twilight" { + export const isDark: true; + export const cssClass: "ace-twilight"; + export const cssText: string; +} +declare module "ace-code/src/theme/vibrant_ink-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/vibrant_ink" { + export const isDark: true; + export const cssClass: "ace-vibrant-ink"; + export const cssText: string; +} +declare module "ace-code/src/theme/xcode-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/xcode" { + export const isDark: false; + export const cssClass: "ace-xcode"; + export const cssText: string; +} diff --git a/ace.d.ts b/ace.d.ts index 68d6bfac577..b406c305356 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,6953 +1,83 @@ +/// +/// +/// +/// /// -declare module "ace-code/src/lib/useragent" { - export namespace OS { - let LINUX: string; - let MAC: string; - let WINDOWS: string; - } - export function getOS(): string; - export const isWin: boolean; - export const isMac: boolean; - export const isLinux: boolean; - export const isIE: number; - export const isOldIE: boolean; - export const isGecko: any; - export const isMozilla: any; - export const isOpera: boolean; - export const isWebKit: number; - export const isChrome: number; - export const isSafari: true; - export const isEdge: number; - export const isAIR: boolean; - export const isAndroid: boolean; - export const isChromeOS: boolean; - export const isIOS: boolean; - export const isMobile: boolean; -} -declare module "ace-code/src/lib/dom" { - export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; - export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; - export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; - export function removeChildren(element: HTMLElement): void; - export function createTextNode(textContent: string, element?: HTMLElement): Text; - export function createFragment(element?: HTMLElement): DocumentFragment; - export function hasCssClass(el: HTMLElement, name: string): boolean; - export function addCssClass(el: HTMLElement, name: string): void; - export function removeCssClass(el: HTMLElement, name: string): void; - export function toggleCssClass(el: HTMLElement, name: string): boolean; - export function setCssClass(node: HTMLElement, className: string, include: boolean): void; - export function hasCssString(id: string, doc?: Document): boolean; - export function removeElementById(id: string, doc?: Document): void; - export function useStrictCSP(value: any): void; - export function importCssStylsheet(uri: string, doc?: Document): void; - export function scrollbarWidth(doc?: Document): number; - export function computedStyle(element: Element, style?: any): Partial; - export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; - export const HAS_CSS_ANIMATION: boolean; - export const HAS_CSS_TRANSFORMS: boolean; - export const HI_DPI: boolean; - export function translate(element: any, tx: any, ty: any): void; - export function importCssString(cssText: any, id: any, target: any): number; -} -declare module "ace-code/src/lib/oop" { - export function inherits(ctor: any, superCtor: any): void; - export function mixin(obj: T, mixin: any): any; - export function implement(proto: T, mixin: any): any; -} -declare module "ace-code/src/lib/deep_copy" { - export function deepCopy(obj: any): any; -} -declare module "ace-code/src/lib/lang" { - export function last(a: any): any; - export function stringReverse(string: any): any; - export function stringRepeat(string: any, count: any): string; - export function stringTrimLeft(string: any): any; - export function stringTrimRight(string: any): any; - export function copyObject(obj: any): {}; - export function copyArray(array: any): any[]; - export const deepCopy: (obj: any) => any; - export function arrayToMap(arr: any): {}; - export function createMap(props: any): any; - export function arrayRemove(array: any, value: any): void; - export function escapeRegExp(str: any): any; - export function escapeHTML(str: any): string; - export function getMatchOffsets(string: any, regExp: any): any[]; - export function deferredCall(fcn: any): { - (timeout: any): any; - schedule: any; - call(): any; - cancel(): any; - isPending(): any; - }; - export function delayedCall(fcn: any, defaultTimeout: any): { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - export function supportsLookbehind(): boolean; - export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; -} -declare module "ace-code/src/lib/keys" { } -declare module "ace-code/src/lib/event" { - export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; - export function removeListener(elem: any, type: any, callback: any): void; - export function stopEvent(e: any): boolean; - export function stopPropagation(e: any): void; - export function preventDefault(e: any): void; - export function getButton(e: any): any; - export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; - export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; - export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; - export function getModifierString(e: KeyboardEvent | MouseEvent): any; - export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; - export function nextTick(callback: any, win: any): void; - export function onIdle(cb: any, timeout: any): number; - export function blockIdle(delay: any): void; - export const nextFrame: any; -} -declare module "ace-code/src/lib/event_emitter" { - /**@type {any}*/ - export var EventEmitter: any; -} -declare module "ace-code/src/layer/font_metrics" { - const FontMetrics_base: undefined; - export class FontMetrics { - /** - * @param {HTMLElement} parentEl - */ - constructor(parentEl: HTMLElement); - el: HTMLDivElement; - /** - * @param size - */ - checkForSizeChanges(size: any): void; - charSizes: any; - allowBoldFonts: boolean; - /** - * @param {boolean} val - */ - setPolling(val: boolean): void; - getCharacterWidth(ch: any): any; - destroy(): void; - els: any[] | HTMLElement | Text; - transformCoordinates(clientPos: any, elPos: any): any[]; - } - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface FontMetrics extends Ace.EventEmitter { - } -} -declare module "ace-code/src/apply_delta" { - export function applyDelta(docLines: string[], delta: import("ace-code").Ace.Delta, doNotValidate?: any): void; -} -declare module "ace-code/src/document" { - const Document_base: undefined; - /** - * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. - * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. - **/ - export class Document { - /** - * - * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty. - * @param {String | String[]} textOrLines text The starting text - **/ - constructor(textOrLines: string | string[]); - /** - * Replaces all the lines in the current `Document` with the value of `text`. - * - * @param {String} text The text to use - **/ - setValue(text: string): void; - /** - * Returns all the lines in the document as a single string, joined by the new line character. - * @returns {String} - **/ - getValue(): string; - /** - * Creates a new `Anchor` to define a floating point in the document. - * @param {Number} row The row number to use - * @param {Number} column The column number to use - * @returns {Anchor} - **/ - createAnchor(row: number, column: number): Anchor; - /** - * Returns the newline character that's being used, depending on the value of `newLineMode`. - * @returns {String} If `newLineMode == windows`, `\r\n` is returned. - * If `newLineMode == unix`, `\n` is returned. - * If `newLineMode == auto`, the value of `autoNewLine` is returned. - * - **/ - getNewLineCharacter(): string; - /** - * [Sets the new line mode.]{: #Document.setNewLineMode.desc} - * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} - - **/ - setNewLineMode(newLineMode: NewLineMode): void; - /** - * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} - * @returns {NewLineMode} - **/ - getNewLineMode(): NewLineMode; - /** - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). - * @param {String} text The text to check - * @returns {boolean} - **/ - isNewLine(text: string): boolean; - /** - * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row index to retrieve - * @returns {string} - **/ - getLine(row: number): string; - /** - * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve - * @returns {string[]} - **/ - getLines(firstRow: number, lastRow: number): string[]; - /** - * Returns all lines in the document as string array. - * @returns {string[]} - **/ - getAllLines(): string[]; - /** - * Returns the number of rows in the document. - * @returns {Number} - **/ - getLength(): number; - /** - * Returns all the text within `range` as a single string. - * @param {IRange} range The range to work with. - * - * @returns {String} - **/ - getTextRange(range: IRange): string; - /** - * Returns all the text within `range` as an array of lines. - * @param {IRange} range The range to work with. - * - * @returns {string[]} - **/ - getLinesForRange(range: IRange): string[]; - /** - * @param row - * @param lines - - * @deprecated - */ - insertLines(row: any, lines: any): void; - /** - * @param firstRow - * @param lastRow - * @returns {String[]} - - * @deprecated - */ - removeLines(firstRow: any, lastRow: any): string[]; - /** - * @param position - * @returns {Point} - - * @deprecated - */ - insertNewLine(position: any): Point; - /** - * Inserts a block of `text` at the indicated `position`. - * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text to insert - * @returns {Point} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - - **/ - insert(position: Point, text: string): Point; - /** - * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event. - * - * This differs from the `insert` method in two ways: - * 1. This does NOT handle newline characters (single-line text only). - * 2. This is faster than the `insert` method for single-line text insertions. - * - * @param {Point} position The position to insert at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text without new lines - * @returns {Point} Returns the position of the end of the inserted text - **/ - insertInLine(position: Point, text: string): Point; - /** - * - * @param {number} row - * @param {number} column - * @return {Point} - */ - clippedPos(row: number, column: number): Point; - /** - * @param {Point} pos - * @return {Point} - */ - clonePos(pos: Point): Point; - /** - * @param {number} row - * @param {number} column - * @return {Point} - */ - pos(row: number, column: number): Point; - /** - * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. - * @param {Number} row The index of the row to insert at - * @param {string[]} lines An array of strings - - **/ - insertFullLines(row: number, lines: string[]): void; - /** - * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. - * @param {Point} position - * @param {string[]} lines An array of strings - * @returns {Point} Contains the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If `lines` is empty, this function returns an object containing the current row, and column, like this: - * ``` - * {row: row, column: 0} - * ``` - **/ - insertMergedLines(position: Point, lines: string[]): Point; - /** - * Removes the `range` from the document. - * @param {IRange} range A specified Range to remove - * @returns {Point} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - - **/ - remove(range: IRange): Point; - /** - * Removes the specified columns from the `row`. This method also triggers a `"change"` event. - * @param {Number} row The row to remove from - * @param {Number} startColumn The column to start removing at - * @param {Number} endColumn The column to stop removing at - * @returns {Point} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. - - **/ - removeInLine(row: number, startColumn: number, endColumn: number): Point; - /** - * Removes a range of full lines. This method also triggers the `"change"` event. - * @param {Number} firstRow The first row to be removed - * @param {Number} lastRow The last row to be removed - * @returns {String[]} Returns all the removed lines. - - **/ - removeFullLines(firstRow: number, lastRow: number): string[]; - /** - * Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event. - * @param {Number} row The row to check - * - **/ - removeNewLine(row: number): void; - /** - * Replaces a range in the document with the new `text`. - * @param {Range | IRange} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Point} Returns an object containing the final row and column, like this: - * {row: endRow, column: 0} - * If the text and range are empty, this function returns an object containing the current `range.start` value. - * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. - * - **/ - replace(range: Range | IRange, text: string): Point; - /** - * Applies all changes in `deltas` to the document. - * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) - **/ - applyDeltas(deltas: Delta[]): void; - /** - * Reverts all changes in `deltas` from the document. - * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) - **/ - revertDeltas(deltas: Delta[]): void; - /** - * Applies `delta` to the document. - * @param {Delta} delta A delta object (can include "insert" and "remove" actions) - * @param {boolean} [doNotValidate] - **/ - applyDelta(delta: Delta, doNotValidate?: boolean): void; - /** - * Reverts `delta` from the document. - * @param {Delta} delta A delta object (can include "insert" and "remove" actions) - **/ - revertDelta(delta: Delta): void; - /** - * Converts an index position in a document to a `{row, column}` object. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Number} index An index to convert - * @param {Number} [startRow=0] The row from which to start the conversion - * @returns {Point} A `{row, column}` object of the `index` position - */ - indexToPosition(index: number, startRow?: number): Point; - /** - * Converts the `{row, column}` position in a document to the character's index. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Point} pos The `{row, column}` to convert - * @param {Number} [startRow=0] The row from which to start the conversion - * @returns {Number} The index position in the document - */ - positionToIndex(pos: Point, startRow?: number): number; - } - export type Delta = import("ace-code").Ace.Delta; - export type Point = import("ace-code").Ace.Point; - export type IRange = import("ace-code").Ace.IRange; - export type NewLineMode = import("ace-code").Ace.NewLineMode; - import Anchor_1 = require("ace-code/src/anchor"); - import Anchor = Anchor_1.Anchor; - import Range_1 = require("ace-code/src/range"); - import Range = Range_1.Range; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type DocumentEvents = import("ace-code").Ace.DocumentEvents; - } - export interface Document extends Ace.EventEmitter { - } -} -declare module "ace-code/src/anchor" { - const Anchor_base: undefined; - /** - * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. - **/ - export class Anchor { - /** - * Creates a new `Anchor` and associates it with a document. - * - * @param {Document} doc The document to associate with the anchor - * @param {Number|import("ace-code").Ace.Point} row The starting row position - * @param {Number} [column] The starting column position - **/ - constructor(doc: Document, row: number | import("ace-code").Ace.Point, column?: number); - /** - * Returns an object identifying the `row` and `column` position of the current anchor. - * @returns {import("ace-code").Ace.Point} - **/ - getPosition(): import("ace-code").Ace.Point; - /** - * - * Returns the current document. - * @returns {Document} - **/ - getDocument(): Document; - /** - * Internal function called when `"change"` event fired. - * @param {import("ace-code").Ace.Delta} delta - */ - onChange(delta: import("ace-code").Ace.Delta): void; - /** - * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. - * @param {Number} row The row index to move the anchor to - * @param {Number} column The column index to move the anchor to - * @param {Boolean} [noClip] Identifies if you want the position to be clipped - **/ - setPosition(row: number, column: number, noClip?: boolean): void; - row: any; - column: number; - /** - * When called, the `"change"` event listener is removed. - * - **/ - detach(): void; - /** - * When called, the `"change"` event listener is appended. - * @param {Document} doc The document to associate with - * - **/ - attach(doc: Document): void; - /**@type{Document}*/ - document: Document; - markerId?: number; - } - export type Document = import("ace-code/src/document").Document; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type AnchorEvents = import("ace-code").Ace.AnchorEvents; - type Document = import("ace-code").Ace.Document; - } - export interface Anchor extends Ace.EventEmitter { - markerId?: number; - document: Ace.Document; - } -} -declare module "ace-code/src/lib/net" { - export function get(url: any, callback: any): void; - export function loadScript(path: any, callback: any): void; - export function qualifyURL(url: any): string; -} -declare module "ace-code/src/lib/report_error" { - export function reportError(msg: any, data: any): void; -} -declare module "ace-code/src/lib/default_english_messages" { - export var defaultEnglishMessages: { - "autocomplete.popup.aria-roledescription": string; - "autocomplete.popup.aria-label": string; - "autocomplete.popup.item.aria-roledescription": string; - "autocomplete.loading": string; - "editor.scroller.aria-roledescription": string; - "editor.scroller.aria-label": string; - "editor.gutter.aria-roledescription": string; - "editor.gutter.aria-label": string; - "error-marker.good-state": string; - "prompt.recently-used": string; - "prompt.other-commands": string; - "prompt.no-matching-commands": string; - "search-box.find.placeholder": string; - "search-box.find-all.text": string; - "search-box.replace.placeholder": string; - "search-box.replace-next.text": string; - "search-box.replace-all.text": string; - "search-box.toggle-replace.title": string; - "search-box.toggle-regexp.title": string; - "search-box.toggle-case.title": string; - "search-box.toggle-whole-word.title": string; - "search-box.toggle-in-selection.title": string; - "search-box.search-counter": string; - "text-input.aria-roledescription": string; - "text-input.aria-label": string; - "gutter.code-folding.range.aria-label": string; - "gutter.code-folding.closed.aria-label": string; - "gutter.code-folding.open.aria-label": string; - "gutter.code-folding.closed.title": string; - "gutter.code-folding.open.title": string; - "gutter.annotation.aria-label.error": string; - "gutter.annotation.aria-label.warning": string; - "gutter.annotation.aria-label.info": string; - "inline-fold.closed.title": string; - "gutter-tooltip.aria-label.error.singular": string; - "gutter-tooltip.aria-label.error.plural": string; - "gutter-tooltip.aria-label.warning.singular": string; - "gutter-tooltip.aria-label.warning.plural": string; - "gutter-tooltip.aria-label.info.singular": string; - "gutter-tooltip.aria-label.info.plural": string; - }; -} -declare module "ace-code/src/lib/app_config" { - const AppConfig_base: undefined; - export class AppConfig { - /** - * @param {Object} obj - * @param {string} path - * @param {{ [key: string]: any }} options - * @returns {AppConfig} - */ - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): AppConfig; - /** - * @param {Object} obj - */ - resetOptions(obj: any): void; - /** - * @param {string} path - * @param {string} name - * @param {any} value - */ - setDefaultValue(path: string, name: string, value: any): boolean; - /** - * @param {string} path - * @param {{ [key: string]: any; }} optionHash - */ - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - /** - * @param {any} value - */ - setMessages(value: any): void; - /** - * @param {string} key - * @param {string} defaultString - * @param {{ [x: string]: any; }} [params] - */ - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - warn: typeof warn; - reportError: (msg: any, data: any) => void; - } - function warn(message: any, ...args: any[]): void; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface AppConfig extends Ace.EventEmitter { - } -} -declare module "ace-code/src/theme/textmate-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/textmate" { - export const isDark: false; - export const cssClass: "ace-tm"; - export const cssText: string; -} -declare module "ace-code/src/config" { - const _exports: { - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): boolean; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any): void; - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - warn: (message: any, ...args: any[]) => void; - reportError: (msg: any, data: any) => void; - once(name: K, callback: any): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: K_1, callback: any, capturing?: boolean): any; - addEventListener(name: K_2, callback: any, capturing?: boolean): any; - off(name: K_3, callback: any): void; - removeListener(name: K_4, callback: any): void; - removeEventListener(name: K_5, callback: any): void; - removeAllListeners(name?: string): void; - /** - * @param {string} key - * @return {*} - */ - get: (key: string) => any; - /** - * @param {string} key - * @param value - */ - set: (key: string, value: any) => void; - /** - * @return {{[key: string]: any}} - */ - all: () => { +declare module "ace-code" { + export namespace Ace { + type Anchor = import("ace-code/src/anchor").Anchor; + type Editor = import("ace-code/src/editor").Editor; + type EditSession = import("ace-code/src/edit_session").EditSession; + type Document = import("ace-code/src/document").Document; + type Fold = import("ace-code/src/edit_session/fold").Fold; + type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + type Range = import("ace-code/src/range").Range; + type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + type UndoManager = import("ace-code/src/undomanager").UndoManager; + type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + type TokenIterator = import("ace-code/src/token_iterator").TokenIterator; + type Selection = import("ace-code/src/selection").Selection; + type Autocomplete = import("ace-code/src/autocomplete").Autocomplete; + type InlineAutocomplete = import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + type CompletionProvider = import("ace-code/src/autocomplete").CompletionProvider; + type AcePopup = import("ace-code/src/autocomplete/popup").AcePopup; + type AceInline = import("ace-code/src/autocomplete/inline").AceInline; + type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + type RangeList = import("ace-code/src/range_list").RangeList; + type FilteredList = import("ace-code/src/autocomplete").FilteredList; + type LineWidgets = import("ace-code/src/line_widgets").LineWidgets; + type SearchBox = import("ace-code/src/ext/searchbox").SearchBox; + type Occur = import("ace-code/src/occur").Occur; + type DefaultHandlers = import("ace-code/src/mouse/default_handlers").DefaultHandlers; + type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; + type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; + type AppConfig = import("ace-code/src/lib/app_config").AppConfig; + type AfterLoadCallback = (err: Error | null, module: unknown) => void; + type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface Config { + get(key: string): any; + set(key: string, value: any): void; + all(): { + [key: string]: any; + }; + moduleUrl(name: string, component?: string): string; + setModuleUrl(name: string, subst: string): string; + setLoader(cb: LoaderFunction): void; + setModuleLoader(name: string, onLoad: Function): void; + loadModule(moduleName: string | [ + string, + string + ], onLoad?: (module: any) => void): void; + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): void; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(string: string, params?: { + [x: string]: any; + }): string; + } + interface Theme { + cssClass?: string; + cssText?: string; + padding?: number | string; + isDark?: boolean; + } + interface ScrollBar { + setVisible(visible: boolean): void; [key: string]: any; - }; - /** - * module loading - * @param {string} name - * @param {string} [component] - * @returns {string} - */ - moduleUrl: (name: string, component?: string) => string; - /** - * @param {string} name - * @param {string} subst - * @returns {string} - */ - setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: any) => void; - dynamicModules: any; - /** - * @param {string | [string, string]} moduleId - * @param {(module: any) => void} onLoad - */ - loadModule: (moduleId: string | [ - string, - string - ], onLoad: (module: any) => void) => void; - setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.32.9"; - }; - export = _exports; - import AppConfig_1 = require("ace-code/src/lib/app_config"); - import AppConfig = AppConfig_1.AppConfig; -} -declare module "ace-code/src/layer/lines" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type LayerConfig = import("ace-code").Ace.LayerConfig; - export class Lines { - /** - * @param {HTMLElement} element - * @param {number} [canvasHeight] - */ - constructor(element: HTMLElement, canvasHeight?: number); - element: HTMLElement; - canvasHeight: number; - cells: any[]; - cellCache: any[]; - /** - * @param {LayerConfig} config - */ - moveContainer(config: LayerConfig): void; - /** - * @param {LayerConfig} oldConfig - * @param {LayerConfig} newConfig - */ - pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; - /** - * @param {number} row - * @param {Partial} config - * @param {EditSession} session - */ - computeLineTop(row: number, config: Partial, session: EditSession): number; - /** - * @param {number} row - * @param {LayerConfig} config - * @param {EditSession} session - */ - computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; - getLength(): number; - /** - * @param {number} index - */ - get(index: number): any; - shift(): void; - pop(): void; - push(cell: any): void; - unshift(cell: any): void; - last(): any; - createCell(row: any, config: any, session: any, initElement: any): any; - } -} -declare module "ace-code/src/layer/gutter" { - const Gutter_base: undefined; - export class Gutter { - /** - * @param {HTMLElement} parentEl - */ - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - gutterWidth: number; - /** - * @param {EditSession} session - */ - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** - * @param {number} row - * @param {string} className - */ - addGutterDecoration(row: number, className: string): void; - /** - * @param {number} row - * @param {string} className - */ - removeGutterDecoration(row: number, className: string): void; - /** - * @param {any[]} annotations - */ - setAnnotations(annotations: any[]): void; - /** - * @param {LayerConfig} config - */ - update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; - oldLastRow: number; - updateLineHighlight(): void; - /** - * @param {LayerConfig} config - */ - scrollLines(config: LayerConfig): void; - /** - * @param {boolean} highlightGutterLine - */ - setHighlightGutterLine(highlightGutterLine: boolean): void; - /** - * @param {boolean} show - */ - setShowLineNumbers(show: boolean): void; - getShowLineNumbers(): boolean; - /** - * @param {boolean} [show] - */ - setShowFoldWidgets(show?: boolean): void; - getShowFoldWidgets(): boolean; - /** - * @param {{ x: number; }} point - */ - getRegion(point: { - x: number; - }): "markers" | "foldWidgets"; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type LayerConfig = import("ace-code").Ace.LayerConfig; - import Lines_1 = require("ace-code/src/layer/lines"); - import Lines = Lines_1.Lines; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type GutterEvents = import("ace-code").Ace.GutterEvents; - } - export interface Gutter extends Ace.EventEmitter { - } -} -declare module "ace-code/src/layer/marker" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type LayerConfig = import("ace-code").Ace.LayerConfig; - export class Marker { - /** - * @param {HTMLElement} parentEl - */ - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - /** - * @param {number} padding - */ - setPadding(padding: number): void; - /** - * @param {EditSession} session - */ - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** - * @param {{ [x: number]: import("ace-code").Ace.MarkerLike; }} markers - */ - setMarkers(markers: { - [x: number]: import("ace-code").Ace.MarkerLike; - }): void; - markers: { - [x: number]: import("ace-code").Ace.MarkerLike; - }; - /** - * @param {string} className - * @param {string} css - */ - elt(className: string, css: string): void; - i: number; - /** - * @param {LayerConfig} config - */ - update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} layerConfig - * @param {string} [extraStyle] - */ - drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {LayerConfig} config - * @param {string} [extraStyle] - */ - drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {number} [extraLength] - * @param {string} [extraStyle] - */ - drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {number} extraLength - * @param {string} extraStyle - */ - drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {undefined} [extraStyle] - */ - drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {undefined} [extraStyle] - */ - drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; - } - import Range_2 = require("ace-code/src/range"); - import Range = Range_2.Range; -} -declare module "ace-code/src/layer/text_util" { - export function isTextToken(tokenType: any): boolean; -} -declare module "ace-code/src/layer/text" { - const Text_base: undefined; - export class Text { - /** - * @param {HTMLElement} parentEl - */ - constructor(parentEl: HTMLElement); - dom: typeof dom; - element: HTMLDivElement; - EOL_CHAR: any; - /** - * @param {number} padding - */ - setPadding(padding: number): void; - /** - * @returns {number} - */ - getLineHeight(): number; - /** - * @returns {number} - */ - getCharacterWidth(): number; - checkForSizeChanges(): void; - /** - * @param {EditSession} session - */ - setSession(session: EditSession): void; - /**@type {EditSession}*/ - session: EditSession; - /** - * @param {string} showInvisibles - */ - setShowInvisibles(showInvisibles: string): boolean; - showInvisibles: any; - showSpaces: boolean; - showTabs: boolean; - showEOL: boolean; - /** - * @param {boolean} display - */ - setDisplayIndentGuides(display: boolean): boolean; - displayIndentGuides: any; - /** - * @param {boolean} highlight - */ - setHighlightIndentGuides(highlight: boolean): boolean; - tabSize: number; - /** - * @param {LayerConfig} config - * @param {number} firstRow - * @param {number} lastRow - */ - updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; - config?: import("ace-code").Ace.LayerConfig; - /** - * @param {LayerConfig} config - */ - scrollLines(config: LayerConfig): void; - /** - * @param {LayerConfig} config - */ - update(config: LayerConfig): void; - renderIndentGuide(parent: any, value: any, max: any): any; - EOF_CHAR: string; - EOL_CHAR_LF: string; - EOL_CHAR_CRLF: string; - TAB_CHAR: string; - SPACE_CHAR: string; - MAX_LINE_LENGTH: number; - destroy: {}; - onChangeTabSize: () => void; - } - export type LayerConfig = import("ace-code").Ace.LayerConfig; - export type EditSession = import("ace-code/src/edit_session").EditSession; - import dom = require("ace-code/src/lib/dom"); - import Lines_2 = require("ace-code/src/layer/lines"); - import Lines = Lines_2.Lines; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type TextEvents = import("ace-code").Ace.TextEvents; - type LayerConfig = import("ace-code").Ace.LayerConfig; - } - export interface Text extends Ace.EventEmitter { - config?: Ace.LayerConfig; - } -} -declare module "ace-code/src/layer/cursor" { - export class Cursor { - /** - * @param {HTMLElement} parentEl - */ - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - isVisible: boolean; - isBlinking: boolean; - blinkInterval: number; - smoothBlinking: boolean; - cursors: any[]; - cursor: HTMLDivElement; - /** - * @param {number} padding - */ - setPadding(padding: number): void; - /** - * @param {EditSession} session - */ - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** - * @param {boolean} blinking - */ - setBlinking(blinking: boolean): void; - /** - * @param {number} blinkInterval - */ - setBlinkInterval(blinkInterval: number): void; - /** - * @param {boolean} smoothBlinking - */ - setSmoothBlinking(smoothBlinking: boolean): void; - addCursor(): HTMLDivElement; - removeCursor(): any; - hideCursor(): void; - showCursor(): void; - restartTimer(): void; - intervalId: number; - /** - * @param {import("ace-code").Ace.Point} [position] - * @param {boolean} [onScreen] - */ - getPixelPosition(position?: import("ace-code").Ace.Point, onScreen?: boolean): { - left: number; - top: number; - }; - isCursorInView(pixelPos: any, config: any): boolean; - update(config: any): void; - config: any; - overwrite: any; - destroy(): void; - drawCursor: any; - timeoutId?: number; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export interface Cursor { - timeoutId?: number; - } -} -declare module "ace-code/src/scrollbar" { - const VScrollBar_base: typeof Scrollbar; - /** - * Represents a vertical scroll bar. - **/ - export class VScrollBar extends Scrollbar { - /** - * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {Object} renderer An editor renderer - **/ - constructor(parent: Element, renderer: any); - scrollTop: number; - scrollHeight: number; - width: number; - /** - * Emitted when the scroll bar, well, scrolls. - * @event scroll - **/ - onScroll(): void; - /** - * Returns the width of the scroll bar. - * @returns {Number} - **/ - getWidth(): number; - /** - * Sets the height of the scroll bar, in pixels. - * @param {Number} height The new height - **/ - setHeight(height: number): void; - /** - * Sets the scroll height of the scroll bar, in pixels. - * @param {Number} height The new scroll height - **/ - setScrollHeight(height: number): void; - /** - * Sets the scroll top of the scroll bar. - * @param {Number} scrollTop The new scroll top - **/ - setScrollTop(scrollTop: number): void; - /** - * Sets the inner height of the scroll bar, in pixels. - * @param {Number} height The new inner height - * @deprecated Use setScrollHeight instead - **/ - setInnerHeight: (height: number) => void; - } - const HScrollBar_base: typeof Scrollbar; - /** - * Represents a horisontal scroll bar. - **/ - export class HScrollBar extends Scrollbar { - /** - * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {Object} renderer An editor renderer - **/ - constructor(parent: Element, renderer: any); - scrollLeft: number; - height: any; - /** - * Emitted when the scroll bar, well, scrolls. - * @event scroll - **/ - onScroll(): void; - /** - * Returns the height of the scroll bar. - * @returns {Number} - **/ - getHeight(): number; - /** - * Sets the width of the scroll bar, in pixels. - * @param {Number} width The new width - **/ - setWidth(width: number): void; - /** - * Sets the inner width of the scroll bar, in pixels. - * @param {Number} width The new inner width - * @deprecated Use setScrollWidth instead - **/ - setInnerWidth(width: number): void; - /** - * Sets the scroll width of the scroll bar, in pixels. - * @param {Number} width The new scroll width - **/ - setScrollWidth(width: number): void; - /** - * Sets the scroll left of the scroll bar. - * @param {Number} scrollLeft The new scroll left - **/ - setScrollLeft(scrollLeft: number): void; - } - /** - * An abstract class representing a native scrollbar control. - **/ - class Scrollbar { - /** - * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {string} classSuffix - **/ - constructor(parent: Element, classSuffix: string); - element: HTMLDivElement; - inner: HTMLDivElement; - skipEvent: boolean; - setVisible(isVisible: any): void; - isVisible: any; - coeff: number; - } - export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface VScrollBar extends Ace.EventEmitter { - } - export interface HScrollBar extends Ace.EventEmitter { - } -} -declare module "ace-code/src/scrollbar_custom" { - const VScrollBar_base: typeof ScrollBar; - /** - * Represents a vertical scroll bar. - * @class VScrollBar - **/ - /** - * Creates a new `VScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {Object} renderer An editor renderer - * - * @constructor - **/ - export class VScrollBar extends ScrollBar { - constructor(parent: any, renderer: any); - scrollTop: number; - scrollHeight: number; - parent: any; - width: number; - renderer: any; - /** - * Emitted when the scroll thumb dragged or scrollbar canvas clicked. - **/ - onMouseDown(eType: any, e: any): void; - getHeight(): number; - /** - * Returns new top for scroll thumb - * @param {Number}thumbTop - * @returns {Number} - **/ - scrollTopFromThumbTop(thumbTop: number): number; - /** - * Returns the width of the scroll bar. - * @returns {Number} - **/ - getWidth(): number; - /** - * Sets the height of the scroll bar, in pixels. - * @param {Number} height The new height - **/ - setHeight(height: number): void; - height: number; - slideHeight: number; - viewHeight: number; - /** - * Sets the inner and scroll height of the scroll bar, in pixels. - * @param {Number} height The new inner height - * - * @param {boolean} force Forcely update height - **/ - setScrollHeight(height: number, force: boolean): void; - pageHeight: any; - thumbHeight: number; - /** - * Sets the scroll top of the scroll bar. - * @param {Number} scrollTop The new scroll top - **/ - setScrollTop(scrollTop: number): void; - thumbTop: number; - setInnerHeight: (height: number, force: boolean) => void; - } - const HScrollBar_base: typeof ScrollBar; - /** - * Represents a horizontal scroll bar. - **/ - export class HScrollBar extends ScrollBar { - /** - * Creates a new `HScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {Object} renderer An editor renderer - **/ - constructor(parent: Element, renderer: any); - scrollLeft: number; - scrollWidth: number; - height: number; - renderer: any; - /** - * Emitted when the scroll thumb dragged or scrollbar canvas clicked. - **/ - onMouseDown(eType: any, e: any): void; - /** - * Returns the height of the scroll bar. - * @returns {Number} - **/ - getHeight(): number; - /** - * Returns new left for scroll thumb - * @param {Number} thumbLeft - * @returns {Number} - **/ - scrollLeftFromThumbLeft(thumbLeft: number): number; - /** - * Sets the width of the scroll bar, in pixels. - * @param {Number} width The new width - **/ - setWidth(width: number): void; - width: number; - slideWidth: number; - viewWidth: number; - /** - * Sets the inner and scroll width of the scroll bar, in pixels. - * @param {Number} width The new inner width - * @param {boolean} force Forcely update width - **/ - setScrollWidth(width: number, force: boolean): void; - pageWidth: any; - thumbWidth: number; - /** - * Sets the scroll left of the scroll bar. - * @param {Number} scrollLeft The new scroll left - **/ - setScrollLeft(scrollLeft: number): void; - thumbLeft: number; - setInnerWidth: (width: number, force: boolean) => void; - } - /** - * An abstract class representing a native scrollbar control. - **/ - class ScrollBar { - /** - * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. - * @param {Element} parent A DOM element - * @param {string} classSuffix - **/ - constructor(parent: Element, classSuffix: string); - element: HTMLDivElement; - inner: HTMLDivElement; - VScrollWidth: number; - HScrollHeight: number; - skipEvent: boolean; - setVisible(isVisible: any): void; - isVisible: any; - coeff: number; - } - export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface VScrollBar extends Ace.EventEmitter { - } - export interface HScrollBar extends Ace.EventEmitter { - } -} -declare module "ace-code/src/renderloop" { - /** - * Batches changes (that force something to be redrawn) in the background. - **/ - export class RenderLoop { - constructor(onRender: any, win: any); - onRender: any; - pending: boolean; - changes: number; - window: any; - schedule(change: any): void; - clear(change: any): number; - } -} -declare module "ace-code/src/css/editor-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/layer/decorators" { - export class Decorator { - constructor(parent: any, renderer: any); - canvas: HTMLCanvasElement; - renderer: any; - pixelRatio: number; - maxHeight: any; - lineHeight: any; - canvasHeight: any; - heightRatio: number; - canvasWidth: any; - minDecorationHeight: number; - halfMinDecorationHeight: number; - colors: {}; - compensateFoldRows(row: any, foldData: any): number; - } -} -declare module "ace-code/src/virtual_renderer" { - const VirtualRenderer_base: undefined; - const VirtualRenderer_base_1: undefined; - /** - * The class that is responsible for drawing everything you see on the screen! - * @related editor.renderer - **/ - export class VirtualRenderer { - /** - * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. - * @param {HTMLElement | null} [container] The root element of the editor - * @param {String} [theme] The starting theme - - **/ - constructor(container?: HTMLElement | null, theme?: string); - container: HTMLElement; - /**@type {HTMLElement}*/ - scroller: HTMLElement; - /**@type {HTMLElement}*/ - content: HTMLElement; - canvas: HTMLDivElement; - scrollBar: VScrollBar; - scrollBarV: import("ace-code").Ace.VScrollbar; - scrollBarH: import("ace-code").Ace.HScrollbar; - scrollTop: number; - scrollLeft: number; - cursorPos: { - row: number; - column: number; - }; - layerConfig: { - width: number; - padding: number; - firstRow: number; - firstRowScreen: number; - lastRow: number; - lineHeight: number; - characterWidth: number; - minHeight: number; - maxHeight: number; - offset: number; - height: number; - gutterOffset: number; - }; - scrollMargin: { - left: number; - right: number; - top: number; - bottom: number; - v: number; - h: number; - }; - margin: { - left: number; - right: number; - top: number; - bottom: number; - v: number; - h: number; - }; - updateCharacterSize(): void; - characterWidth: number; - lineHeight: number; - /** - * - * Associates the renderer with an [[EditSession `EditSession`]]. - * @param {EditSession} session The session to associate with - **/ - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - onChangeNewLineMode(): void; - /** - * Triggers a partial update of the text, from the range given by the two parameters. - * @param {Number} firstRow The first row to update - * @param {Number} lastRow The last row to update - * @param {boolean} [force] - **/ - updateLines(firstRow: number, lastRow: number, force?: boolean): void; - onChangeTabSize(): void; - /** - * Triggers a full update of the text, for all the rows. - **/ - updateText(): void; - /** - * Triggers a full update of all the layers, for all the rows. - * @param {Boolean} [force] If `true`, forces the changes through - - **/ - updateFull(force?: boolean): void; - /** - * Updates the font size. - **/ - updateFontSize(): void; - /** - * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} - * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed - * @param {Number} [gutterWidth] The width of the gutter in pixels - * @param {Number} [width] The width of the editor in pixels - * @param {Number} [height] The hiehgt of the editor, in pixels - - **/ - onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; - resizing: number; - gutterWidth: any; - /** - * - * @param {number} width - - */ - onGutterResize(width: number): void; - /** - * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. - - **/ - adjustWrapLimit(): boolean; - /** - * Identifies whether you want to have an animated scroll or not. - * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls - - **/ - setAnimatedScroll(shouldAnimate: boolean): void; - /** - * Returns whether an animated scroll happens or not. - * @returns {Boolean} - - **/ - getAnimatedScroll(): boolean; - /** - * Identifies whether you want to show invisible characters or not. - * @param {Boolean} showInvisibles Set to `true` to show invisibles - - **/ - setShowInvisibles(showInvisibles: boolean): void; - /** - * Returns whether invisible characters are being shown or not. - * @returns {Boolean} - - **/ - getShowInvisibles(): boolean; - /** - * @return {boolean} - - */ - getDisplayIndentGuides(): boolean; - /** - * @param {boolean} display - - */ - setDisplayIndentGuides(display: boolean): void; - /** - - * @return {boolean} - */ - getHighlightIndentGuides(): boolean; - /** - - * @param {boolean} highlight - */ - setHighlightIndentGuides(highlight: boolean): void; - /** - * Identifies whether you want to show the print margin or not. - * @param {Boolean} showPrintMargin Set to `true` to show the print margin - - **/ - setShowPrintMargin(showPrintMargin: boolean): void; - /** - * Returns whether the print margin is being shown or not. - * @returns {Boolean} - - **/ - getShowPrintMargin(): boolean; - /** - * Identifies whether you want to show the print margin column or not. - * @param {number} printMarginColumn Set to `true` to show the print margin column - - **/ - setPrintMarginColumn(printMarginColumn: number): void; - /** - * Returns whether the print margin column is being shown or not. - * @returns {number} - - **/ - getPrintMarginColumn(): number; - /** - * Returns `true` if the gutter is being shown. - * @returns {Boolean} - - **/ - getShowGutter(): boolean; - /** - * Identifies whether you want to show the gutter or not. - * @param {Boolean} show Set to `true` to show the gutter - - **/ - setShowGutter(show: boolean): void; - /** - - * @returns {boolean} - */ - getFadeFoldWidgets(): boolean; - /** - - * @param {boolean} show - */ - setFadeFoldWidgets(show: boolean): void; - /** - * - * @param {boolean} shouldHighlight - */ - setHighlightGutterLine(shouldHighlight: boolean): void; - /** - - * @returns {boolean} - */ - getHighlightGutterLine(): boolean; - /** - * - * Returns the root element containing this renderer. - * @returns {HTMLElement} - **/ - getContainerElement(): HTMLElement; - /** - * - * Returns the element that the mouse events are attached to - * @returns {HTMLElement} - **/ - getMouseEventTarget(): HTMLElement; - /** - * - * Returns the element to which the hidden text area is added. - * @returns {HTMLElement} - **/ - getTextAreaContainer(): HTMLElement; - /** - * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} - * @returns {Number} - **/ - getFirstVisibleRow(): number; - /** - * - * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} - **/ - getFirstFullyVisibleRow(): number; - /** - * - * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} - **/ - getLastFullyVisibleRow(): number; - /** - * - * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} - * @returns {Number} - **/ - getLastVisibleRow(): number; - /** - * Sets the padding for all the layers. - * @param {Number} padding A new padding value (in pixels) - - **/ - setPadding(padding: number): void; - /** - * - * @param {number} [top] - * @param {number} [bottom] - * @param {number} [left] - * @param {number} [right] - - */ - setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** - * - * @param {number} [top] - * @param {number} [bottom] - * @param {number} [left] - * @param {number} [right] - - */ - setMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - - **/ - getHScrollBarAlwaysVisible(): boolean; - /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - - **/ - setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; - /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - - **/ - getVScrollBarAlwaysVisible(): boolean; - /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ - setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; - freeze(): void; - unfreeze(): void; - desiredHeight: any; - /** - * Schedules an update to all the front markers in the document. - **/ - updateFrontMarkers(): void; - /** - * - * Schedules an update to all the back markers in the document. - **/ - updateBackMarkers(): void; - /** - * - * Deprecated; (moved to [[EditSession]]) - * @deprecated - **/ - addGutterDecoration(row: any, className: any): void; - /** - * Deprecated; (moved to [[EditSession]]) - * @deprecated - **/ - removeGutterDecoration(row: any, className: any): void; - /** - * - * Redraw breakpoints. - * @param {any} [rows] - */ - updateBreakpoints(rows?: any): void; - /** - * Sets annotations for the gutter. - * @param {import("ace-code").Ace.Annotation[]} annotations An array containing annotations - * - **/ - setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; - /** - * - * Updates the cursor icon. - **/ - updateCursor(): void; - /** - * - * Hides the cursor icon. - **/ - hideCursor(): void; - /** - * - * Shows the cursor icon. - **/ - showCursor(): void; - /** - * - * @param {Point} anchor - * @param {Point} lead - * @param {number} [offset] - */ - scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; - /** - * - * Scrolls the cursor into the first visibile area of the editor - * @param {Point} [cursor] - * @param {number} [offset] - * @param {{ top?: any; bottom?: any; }} [$viewMargin] - */ - scrollCursorIntoView(cursor?: Point, offset?: number, $viewMargin?: { - top?: any; - bottom?: any; - }): void; - /** - * {:EditSession.getScrollTop} - * @related EditSession.getScrollTop - * @returns {Number} - **/ - getScrollTop(): number; - /** - * {:EditSession.getScrollLeft} - * @related EditSession.getScrollLeft - * @returns {Number} - **/ - getScrollLeft(): number; - /** - * Returns the first visible row, regardless of whether it's fully visible or not. - * @returns {Number} - **/ - getScrollTopRow(): number; - /** - * Returns the last visible row, regardless of whether it's fully visible or not. - * @returns {Number} - **/ - getScrollBottomRow(): number; - /** - * Gracefully scrolls from the top of the editor to the row indicated. - * @param {Number} row A row id - * - * @related EditSession.setScrollTop - **/ - scrollToRow(row: number): void; - /** - * - * @param {Point} cursor - * @param {number} [alignment] - * @returns {number} - */ - alignCursor(cursor: Point, alignment?: number): number; - /** - * Gracefully scrolls the editor to the row indicated. - * @param {Number} line A line number - * @param {Boolean} center If `true`, centers the editor the to indicated line - * @param {Boolean} animate If `true` animates scrolling - * @param {() => void} [callback] Function to be called after the animation has finished - - **/ - scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; - /** - * - * @param fromValue - * @param [callback] - - */ - animateScrolling(fromValue: any, callback?: any): void; - /** - * Scrolls the editor to the y pixel indicated. - * @param {Number} scrollTop The position to scroll to - **/ - scrollToY(scrollTop: number): void; - /** - * Scrolls the editor across the x-axis to the pixel indicated. - * @param {Number} scrollLeft The position to scroll to - **/ - scrollToX(scrollLeft: number): void; - /** - * Scrolls the editor across both x- and y-axes. - * @param {Number} x The x value to scroll to - * @param {Number} y The y value to scroll to - **/ - scrollTo(x: number, y: number): void; - /** - * Scrolls the editor across both x- and y-axes. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by - **/ - scrollBy(deltaX: number, deltaY: number): void; - /** - * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by - * - * @returns {Boolean} - **/ - isScrollableBy(deltaX: number, deltaY: number): boolean; - /** - * - * @param {number} x - * @param {number} y - * @returns {import("ace-code").Ace.ScreenCoordinates} - - */ - pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; - /** - * - * @param {number} x - * @param {number} y - * @returns {Point} - - */ - screenToTextCoordinates(x: number, y: number): Point; - /** - * Returns an object containing the `pageX` and `pageY` coordinates of the document position. - * @param {Number} row The document row position - * @param {Number} column The document column position - * - * @returns {{ pageX: number, pageY: number}} - **/ - textToScreenCoordinates(row: number, column: number): { - pageX: number; - pageY: number; - }; - /** - * - * Focuses the current container. - **/ - visualizeFocus(): void; - /** - * - * Blurs the current container. - **/ - visualizeBlur(): void; - /** - * @param {Object} composition - - **/ - showComposition(composition: any): void; - /** - * @param {String} text A string of text to use - * - * Sets the inner text of the current composition to `text`. - - **/ - setCompositionText(text: string): void; - /** - * - * Hides the current composition. - - **/ - hideComposition(): void; - /** - * @param {string} text - * @param {Point} [position] - */ - setGhostText(text: string, position?: Point): void; - removeGhostText(): void; - /** - * @param {string} text - * @param {string} type - * @param {number} row - * @param {number} [column] - */ - addToken(text: string, type: string, row: number, column?: number): void; - removeExtraToken(row: any, column: any): void; - /** - * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} - * @param {String | Theme} [theme] The path to a theme - * @param {() => void} [cb] optional callback - - **/ - setTheme(theme?: string | Theme, cb?: () => void): void; - /** - * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} - * @returns {String} - **/ - getTheme(): string; - /** - * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} - * @param {String} style A class name - * @param {boolean}[include] - **/ - setStyle(style: string, include?: boolean): void; - /** - * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} - * @param {String} style A class name - * - **/ - unsetStyle(style: string): void; - /** - * @param {string} style - */ - setCursorStyle(style: string): void; - /** - * @param {String} cursorStyle A css cursor style - **/ - setMouseCursor(cursorStyle: string): void; - attachToShadowRoot(): void; - /** - * Destroys the text and cursor layers for this renderer. - - **/ - destroy(): void; - CHANGE_CURSOR: number; - CHANGE_MARKER: number; - CHANGE_GUTTER: number; - CHANGE_SCROLL: number; - CHANGE_LINES: number; - CHANGE_TEXT: number; - CHANGE_SIZE: number; - CHANGE_MARKER_BACK: number; - CHANGE_MARKER_FRONT: number; - CHANGE_FULL: number; - CHANGE_H_SCROLL: number; - STEPS: number; - textarea?: HTMLTextAreaElement; - enableKeyboardAccessibility?: boolean; - keyboardFocusClassName?: string; - showInvisibles?: boolean; - theme?: any; - destroyed?: boolean; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Point = import("ace-code").Ace.Point; - export type Theme = import("ace-code").Ace.Theme; - import GutterLayer_1 = require("ace-code/src/layer/gutter"); - import GutterLayer = GutterLayer_1.Gutter; - import MarkerLayer_1 = require("ace-code/src/layer/marker"); - import MarkerLayer = MarkerLayer_1.Marker; - import TextLayer_1 = require("ace-code/src/layer/text"); - import TextLayer = TextLayer_1.Text; - import CursorLayer_1 = require("ace-code/src/layer/cursor"); - import CursorLayer = CursorLayer_1.Cursor; - import VScrollBar_1 = require("ace-code/src/scrollbar"); - import VScrollBar = VScrollBar_1.VScrollBar; - import FontMetrics_1 = require("ace-code/src/layer/font_metrics"); - import FontMetrics = FontMetrics_1.FontMetrics; - import RenderLoop_1 = require("ace-code/src/renderloop"); - import RenderLoop = RenderLoop_1.RenderLoop; - import Decorator_1 = require("ace-code/src/layer/decorators"); - import Decorator = Decorator_1.Decorator; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; - type OptionsProvider = import("ace-code").Ace.OptionsProvider; - type VirtualRendererOptions = import("ace-code").Ace.VirtualRendererOptions; - type EditSession = import("ace-code").Ace.EditSession; - } - export interface VirtualRenderer extends Ace - .EventEmitter, Ace.OptionsProvider { - textarea?: HTMLTextAreaElement; - enableKeyboardAccessibility?: boolean; - keyboardFocusClassName?: string; - showInvisibles?: boolean; - theme?: any; - destroyed?: boolean; - session: Ace.EditSession; - } -} -declare module "ace-code/src/selection" { - const Selection_base: undefined; - const Selection_base_1: undefined; - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code/src/anchor").Anchor} Anchor - * @typedef {import("ace-code").Ace.Point} Point - */ - export class Selection { - /** - * Creates a new `Selection` object. - * @param {EditSession} session The session to use - * @constructor - **/ - constructor(session: EditSession); - /**@type {EditSession}*/ - session: EditSession; - /**@type {import("ace-code/src/document").Document}*/ - doc: import("ace-code/src/document").Document; - /**@type {Anchor}*/ - cursor: Anchor; - lead: Anchor; - /**@type {Anchor}*/ - anchor: Anchor; - /** - * Returns `true` if the selection is empty. - * @returns {Boolean} - **/ - isEmpty(): boolean; - /** - * Returns `true` if the selection is a multi-line. - * @returns {Boolean} - **/ - isMultiLine(): boolean; - /** - * Returns an object containing the `row` and `column` current position of the cursor. - * @returns {Point} - **/ - getCursor(): Point; - /** - * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. - * @param {Number} row The new row - * @param {Number} column The new column - * - **/ - setAnchor(row: number, column: number): void; - /** - * Returns an object containing the `row` and `column` of the calling selection anchor. - * - * @returns {Point} - * @related Anchor.getPosition - **/ - getAnchor(): Point; - /** - * Returns an object containing the `row` and `column` of the calling selection lead. - * @returns {Object} - **/ - getSelectionLead(): any; - /** - * Returns `true` if the selection is going backwards in the document. - * @returns {Boolean} - **/ - isBackwards(): boolean; - /** - * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} - * @returns {Range} - **/ - getRange(): Range; - /** - * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} - **/ - clearSelection(): void; - /** - * Selects all the text in the document. - **/ - selectAll(): void; - /** - * Sets the selection to the provided range. - * @param {import("ace-code").Ace.IRange} range The range of text to select - * @param {Boolean} [reverse] Indicates if the range should go backwards (`true`) or not - **/ - setRange(range: import("ace-code").Ace.IRange, reverse?: boolean): void; - /** - * Moves the selection cursor to the indicated row and column. - * @param {Number} row The row to select to - * @param {Number} column The column to select to - **/ - selectTo(row: number, column: number): void; - /** - * Moves the selection cursor to the row and column indicated by `pos`. - * @param {Point} pos An object containing the row and column - **/ - selectToPosition(pos: Point): void; - /** - * Moves the selection cursor to the indicated row and column. - * @param {Number} row The row to select to - * @param {Number} column The column to select to - **/ - moveTo(row: number, column: number): void; - /** - * Moves the selection cursor to the row and column indicated by `pos`. - * @param {Object} pos An object containing the row and column - **/ - moveToPosition(pos: any): void; - /** - * Moves the selection up one row. - **/ - selectUp(): void; - /** - * Moves the selection down one row. - **/ - selectDown(): void; - /** - * Moves the selection right one column. - **/ - selectRight(): void; - /** - * Moves the selection left one column. - **/ - selectLeft(): void; - /** - * Moves the selection to the beginning of the current line. - **/ - selectLineStart(): void; - /** - * Moves the selection to the end of the current line. - **/ - selectLineEnd(): void; - /** - * Moves the selection to the end of the file. - **/ - selectFileEnd(): void; - /** - * Moves the selection to the start of the file. - **/ - selectFileStart(): void; - /** - * Moves the selection to the first word on the right. - **/ - selectWordRight(): void; - /** - * Moves the selection to the first word on the left. - **/ - selectWordLeft(): void; - /** - * Moves the selection to highlight the entire word. - * @related EditSession.getWordRange - **/ - getWordRange(row: any, column: any): Range; - /** - * Selects an entire word boundary. - **/ - selectWord(): void; - /** - * Selects a word, including its right whitespace. - * @related EditSession.getAWordRange - **/ - selectAWord(): void; - getLineRange(row: any, excludeLastChar: any): Range; - /** - * Selects the entire line. - **/ - selectLine(): void; - /** - * Moves the cursor up one row. - **/ - moveCursorUp(): void; - /** - * Moves the cursor down one row. - **/ - moveCursorDown(): void; - /** - * - * Returns `true` if moving the character next to the cursor in the specified direction is a soft tab. - * @param {Point} cursor the current cursor position - * @param {Number} tabSize the tab size - * @param {Number} direction 1 for right, -1 for left - */ - wouldMoveIntoSoftTab(cursor: Point, tabSize: number, direction: number): boolean; - /** - * Moves the cursor left one column. - **/ - moveCursorLeft(): void; - /** - * Moves the cursor right one column. - **/ - moveCursorRight(): void; - /** - * Moves the cursor to the start of the line. - **/ - moveCursorLineStart(): void; - /** - * Moves the cursor to the end of the line. - **/ - moveCursorLineEnd(): void; - /** - * Moves the cursor to the end of the file. - **/ - moveCursorFileEnd(): void; - /** - * Moves the cursor to the start of the file. - **/ - moveCursorFileStart(): void; - /** - * Moves the cursor to the word on the right. - **/ - moveCursorLongWordRight(): void; - /** - * - * Moves the cursor to the word on the left. - **/ - moveCursorLongWordLeft(): void; - moveCursorShortWordRight(): void; - moveCursorShortWordLeft(): void; - moveCursorWordRight(): void; - moveCursorWordLeft(): void; - /** - * Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document. - * @param {Number} rows The number of rows to move by - * @param {Number} chars The number of characters to move by - * - * @related EditSession.documentToScreenPosition - **/ - moveCursorBy(rows: number, chars: number): void; - /** - * Moves the selection to the position indicated by its `row` and `column`. - * @param {Point} position The position to move to - **/ - moveCursorToPosition(position: Point): void; - /** - * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} - * @param {Number} row The row to move to - * @param {Number} column The column to move to - * @param {Boolean} [keepDesiredColumn] [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} - **/ - moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; - /** - * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} - * @param {Number} row The row to move to - * @param {Number} column The column to move to - * @param {Boolean} keepDesiredColumn {:preventUpdateBool} - **/ - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - detach(): void; - /** - * @param {Range & {desiredColumn?: number}} range - */ - fromOrientedRange(range: Range & { - desiredColumn?: number; - }): void; - /** - * @param {Range & {desiredColumn?: number}} [range] - */ - toOrientedRange(range?: Range & { - desiredColumn?: number; - }): Range & { - desiredColumn?: number; - }; - /** - * Saves the current cursor position and calls `func` that can change the cursor - * postion. The result is the range of the starting and eventual cursor position. - * Will reset the cursor position. - * @param {Function} func The callback that should change the cursor position - * @returns {Range} - **/ - getRangeOfMovements(func: Function): Range; - /** - * - * @returns {Range|Range[]} - */ - toJSON(): Range | Range[]; - /** - * - * @param data - */ - fromJSON(data: any): void; - /** - * - * @param data - * @return {boolean} - */ - isEqual(data: any): boolean; - /** - * Left for backward compatibility - * @deprecated - */ - setSelectionAnchor: (row: number, column: number) => void; - /** - * Left for backward compatibility - * @deprecated - */ - getSelectionAnchor: () => Point; - setSelectionRange: (range: import("ace-code").Ace.IRange, reverse?: boolean) => void; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Anchor = import("ace-code/src/anchor").Anchor; - export type Point = import("ace-code").Ace.Point; - import Range_3 = require("ace-code/src/range"); - import Range = Range_3.Range; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type SelectionEvents = import("ace-code").Ace.SelectionEvents; - type MultiSelectProperties = import("ace-code").Ace.MultiSelectProperties; - } - export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { - } -} -declare module "ace-code/src/clipboard" { - export let lineMode: string | false; - export function pasteCancelled(): boolean; - export function cancel(): void; -} -declare module "ace-code/src/keyboard/textinput" { - export function $setUserAgentForTests(_isMobile: any, _isIOS: any): void; - export var TextInput: any; -} -declare module "ace-code/src/mouse/mouse_event" { - export class MouseEvent { - constructor(domEvent: any, editor: any); - /** @type {number} */ speed: number; - /** @type {number} */ wheelX: number; - /** @type {number} */ wheelY: number; - domEvent: any; - editor: any; - x: any; - clientX: any; - y: any; - clientY: any; - propagationStopped: boolean; - defaultPrevented: boolean; - stopPropagation(): void; - preventDefault(): void; - stop(): void; - /** - * Get the document position below the mouse cursor - * - * @return {Object} 'row' and 'column' of the document position - */ - getDocumentPosition(): any; - /** - * Get the relative position within the gutter. - * - * @return {Number} 'row' within the gutter. - */ - getGutterRow(): number; - /** - * Check if the mouse cursor is inside of the text selection - * - * @return {Boolean} whether the mouse cursor is inside of the selection - */ - inSelection(): boolean; - /** - * Get the clicked mouse button - * - * @return {Number} 0 for left button, 1 for middle button, 2 for right button - */ - getButton(): number; - /** - * @return {Boolean} whether the shift key was pressed when the event was emitted - */ - getShiftKey(): boolean; - getAccelKey(): any; - time?: number; - } - export interface MouseEvent { - time?: number; - } -} -declare module "ace-code/src/mouse/default_handlers" { - export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; - export class DefaultHandlers { - /** - * @param {MouseHandler} mouseHandler - */ - constructor(mouseHandler: MouseHandler); - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ - onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - /** - * - * @param {import("ace-code").Ace.Position} [pos] - * @param {boolean} [waitForClickSelection] - * @this {MouseHandler} - */ - startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; - /** - * @this {MouseHandler} - */ - select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @param {string | number} unitName - * @this {MouseHandler} - */ - extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; - /** - * @this {MouseHandler} - */ - selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @this {MouseHandler} - */ - focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ - onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ - onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ - onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ - onMouseWheel(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - selectEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; - selectAllEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; - selectByWordsEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; - } -} -declare module "ace-code/src/lib/scroll" { - export function preventParentScroll(event: any): void; -} -declare module "ace-code/src/tooltip" { - export class HoverTooltip extends Tooltip { - constructor(parentNode?: HTMLElement); - timeout: number; - lastT: number; - idleTime: number; - lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - onMouseOut(e: any): void; - /** - * @param {MouseEvent} e - * @param {Editor} editor - */ - onMouseMove(e: MouseEvent, editor: Editor): void; - waitForHover(): void; - /** - * @param {Editor} editor - */ - addToEditor(editor: Editor): void; - /** - * @param {Editor} editor - */ - removeFromEditor(editor: Editor): void; - /** - * @param {MouseEvent} e - */ - isOutsideOfText(e: MouseEvent): boolean; - /** - * @param {any} value - */ - setDataProvider(value: any): void; - /** - * @param {Editor} editor - * @param {Range} range - * @param {any} domNode - * @param {MouseEvent} startingEvent - */ - showForRange(editor: Editor, range: Range, domNode: any, startingEvent: MouseEvent): void; - range: Range; - /** - * @param {Range} range - * @param {EditSession} [session] - */ - addMarker(range: Range, session?: EditSession): void; - marker: number; - row: number; - } - export type Editor = import("ace-code/src/editor").Editor; - export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; - export type EditSession = import("ace-code/src/edit_session").EditSession; - export var popupManager: PopupManager; - export class Tooltip { - /** - * @param {Element} parentNode - **/ - constructor(parentNode: Element); - isOpen: boolean; - /** - * @returns {HTMLElement} - **/ - getElement(): HTMLElement; - /** - * @param {String} text - **/ - setText(text: string): void; - /** - * @param {String} html - **/ - setHtml(html: string): void; - /** - * @param {Number} x - * @param {Number} y - **/ - setPosition(x: number, y: number): void; - /** - * @param {String} className - **/ - setClassName(className: string): void; - /** - * @param {import("ace-code").Ace.Theme} theme - */ - setTheme(theme: import("ace-code").Ace.Theme): void; - /** - * @param {String} [text] - * @param {Number} [x] - * @param {Number} [y] - **/ - show(text?: string, x?: number, y?: number): void; - hide(e: any): void; - /** - * @returns {Number} - **/ - getHeight(): number; - /** - * @returns {Number} - **/ - getWidth(): number; - destroy(): void; - } - import Range_4 = require("ace-code/src/range"); - import Range = Range_4.Range; - class PopupManager { - /**@type{Tooltip[]} */ - popups: Tooltip[]; - /** - * @param {Tooltip} popup - */ - addPopup(popup: Tooltip): void; - /** - * @param {Tooltip} popup - */ - removePopup(popup: Tooltip): void; - updatePopups(): void; - /** - * @param {Tooltip} popupA - * @param {Tooltip} popupB - * @return {boolean} - */ - doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; - } - export {}; - export interface HoverTooltip { - row: number; - } -} -declare module "ace-code/src/mouse/default_gutter_handler" { - /** - * @param {MouseHandler} mouseHandler - * @this {MouseHandler} - */ - export function GutterHandler(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, mouseHandler: MouseHandler): void; - export interface GutterHandler { - } - export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - export class GutterTooltip extends Tooltip { - static get annotationLabels(): { - error: { - singular: any; - plural: any; - }; - warning: { - singular: any; - plural: any; - }; - info: { - singular: any; - plural: any; - }; - }; - static annotationsToSummaryString(annotations: any): string; - constructor(editor: any); - editor: any; - setPosition(x: any, y: any): void; - showTooltip(row: any): void; - hideTooltip(): void; - } - import Tooltip_1 = require("ace-code/src/tooltip"); - import Tooltip = Tooltip_1.Tooltip; - export interface GutterHandler { - } -} -declare module "ace-code/src/mouse/dragdrop_handler" { - export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - /** - * @param {MouseHandler} mouseHandler - */ - export function DragdropHandler(mouseHandler: MouseHandler): void; - export class DragdropHandler { - /** - * @param {MouseHandler} mouseHandler - */ - constructor(mouseHandler: MouseHandler); - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ - onDragStart: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ - onDragEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ - onDragEnter: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ - onDragOver: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - onDragLeave: (e: any) => void; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ - onDrop: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - } -} -declare module "ace-code/src/mouse/touch_handler" { - export function addTouchListeners(el: any, editor: any): void; -} -declare module "ace-code/src/mouse/mouse_handler" { - export class MouseHandler { - /** - * @param {Editor} editor - */ - constructor(editor: Editor); - /** @type {MouseEvent} */ mouseEvent: MouseEvent; - editor: import("ace-code/src/editor").Editor; - onMouseEvent(name: any, e: any): void; - onMouseMove(name: any, e: any): void; - /** - * @param {string} name - * @param {{ wheelX: number; wheelY: number; }} e - */ - onMouseWheel(name: string, e: { - wheelX: number; - wheelY: number; - }): void; - setState(state: any): void; - state: any; - captureMouse(ev: any, mouseMoveHandler: any): number; - x: any; - y: any; - isMousePressed: boolean; - releaseMouse: (e: any) => void; - cancelContextMenu(): void; - destroy(): void; - cancelDrag?: boolean; - mousedownEvent?: MouseEvent; - startSelect?: (pos?: import("ace-code").Ace.Point, waitForClickSelection?: boolean) => void; - select?: () => void; - selectEnd?: () => void; - } - export type Editor = import("ace-code/src/editor").Editor; - import MouseEvent_1 = require("ace-code/src/mouse/mouse_event"); - import MouseEvent = MouseEvent_1.MouseEvent; - namespace Ace { - type Range = import("ace-code").Ace.Range; - type MouseEvent = import("ace-code").Ace.MouseEvent; - type Point = import("ace-code").Ace.Point; - } - export interface MouseHandler { - cancelDrag?: boolean; - mousedownEvent?: Ace.MouseEvent; - startSelect?: (pos?: Ace.Point, waitForClickSelection?: boolean) => void; - select?: () => void; - selectEnd?: () => void; - } -} -declare module "ace-code/src/mouse/fold_handler" { - export class FoldHandler { - constructor(editor: any); - } -} -declare module "ace-code/src/keyboard/keybinding" { - export type Editor = import("ace-code/src/editor").Editor; - export type KeyboardHandler = import("ace-code").Ace.KeyboardHandler; - export class KeyBinding { - /** - * @param {Editor} editor - */ - constructor(editor: Editor); - /** - * @param {KeyboardHandler} kb - */ - setDefaultHandler(kb: KeyboardHandler): void; - /** - * @param {KeyboardHandler} kb - */ - setKeyboardHandler(kb: KeyboardHandler): void; - /** - * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] - * @param {number} [pos] - */ - addKeyboardHandler(kb?: Partial & { - attach?: (editor: import("ace-code/src/editor").Editor) => void; - detach?: (editor: import("ace-code/src/editor").Editor) => void; - getStatusText?: (editor?: any, data?: any) => string; - } & { - attach?: (editor: any) => void; - detach?: (editor: any) => void; - }, pos?: number): void; - /** - * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb - * @returns {boolean} - */ - removeKeyboardHandler(kb: Partial & { - attach?: (editor: import("ace-code/src/editor").Editor) => void; - detach?: (editor: import("ace-code/src/editor").Editor) => void; - getStatusText?: (editor?: any, data?: any) => string; - } & { - attach?: (editor: any) => void; - detach?: (editor: any) => void; - }): boolean; - /** - * @return {KeyboardHandler} - */ - getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - /** - * @param {any} e - * @param {number} hashId - * @param {number} keyCode - * @return {boolean} - */ - onCommandKey(e: any, hashId: number, keyCode: number): boolean; - /** - * @param {string} text - * @return {boolean} - */ - onTextInput(text: string): boolean; - } -} -declare module "ace-code/src/search" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - /** - * A class designed to handle all sorts of text searches within a [[Document `Document`]]. - **/ - export class Search { - /** - * Sets the search options via the `options` parameter. - * @param {Partial} options An object containing all the new search properties - * @returns {Search} - * @chainable - **/ - set(options: Partial): Search; - /** - * [Returns an object containing all the search options.]{: #Search.getOptions} - * @returns {Partial} - **/ - getOptions(): Partial; - /** - * Sets the search options via the `options` parameter. - * @param {SearchOptions} options object containing all the search propertie - * @related Search.set - **/ - setOptions(options: { - /** - * - The string or regular expression you're looking for - */ - needle?: string | RegExp; - /** - * - Whether to search backwards from where cursor currently is - */ - backwards?: boolean; - /** - * - Whether to wrap the search back to the beginning when it hits the end - */ - wrap?: boolean; - /** - * - Whether the search ought to be case-sensitive - */ - caseSensitive?: boolean; - /** - * - Whether the search matches only on whole words - */ - wholeWord?: boolean; - /** - * - The [[Range]] to search within. Set this to `null` for the whole document - */ - range?: Range | null; - /** - * - Whether the search is a regular expression or not - */ - regExp?: boolean; - /** - * - The starting [[Range]] or cursor position to begin the search - */ - start?: Range | import("ace-code").Ace.Position; - /** - * - Whether or not to include the current line in the search - */ - skipCurrent?: boolean; - preserveCase?: boolean; - preventScroll?: boolean; - /** - * ** - */ - re?: any; - }): void; - /** - * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. - * @param {EditSession} session The session to search with - * @returns {Range|false} - **/ - find(session: EditSession): Range | false; - /** - * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. - * @param {EditSession} session The session to search with - * @returns {Range[]} - **/ - findAll(session: EditSession): Range[]; - /** - * Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`. - * @param {String} input The text to search in - * @param {any} replacement The replacing text - * + (String): If `options.regExp` is `true`, this function returns `input` with the replacement already made. Otherwise, this function just returns `replacement`.
- * If `options.needle` was not found, this function returns `null`. - * - * - * @returns {String} - **/ - replace(input: string, replacement: any): string; - } - import Range_5 = require("ace-code/src/range"); - import Range = Range_5.Range; -} -declare module "ace-code/src/keyboard/hash_handler" { - export type Command = import("ace-code").Ace.Command; - export type CommandLike = import("ace-code").Ace.CommandLike; - export class HashHandler extends MultiHashHandler { - } - export namespace HashHandler { - function call(thisArg: any, config: any, platform: any): void; - } - export class MultiHashHandler { - /** - * @param {Record | Command[]} [config] - * @param {string} [platform] - */ - constructor(config?: Record | Command[], platform?: string); - platform: string; - /**@type {Record}*/ - commands: Record; - commandKeyBinding: {}; - /** - * @param {Command} command - */ - addCommand(command: Command): void; - /** - * @param {Command | string} command - * @param {boolean} [keepCommand] - */ - removeCommand(command: Command | string, keepCommand?: boolean): void; - /** - * @param {string | { win?: string; mac?: string; position?:number}} key - * @param {CommandLike | string} command - * @param {number} [position] - */ - bindKey(key: string | { - win?: string; - mac?: string; - position?: number; - }, command: CommandLike | string, position?: number): void; - /** - * @param {Record | Command[]} [commands] - */ - addCommands(commands?: Record | Command[]): void; - /** - * @param {Record} commands - */ - removeCommands(commands: Record): void; - /** - * @param {Record} keyList - */ - bindKeys(keyList: Record): void; - /** - * Accepts keys in the form ctrl+Enter or ctrl-Enter - * keys without modifiers or shift only - * @param {string} keys - * @returns {{key: string, hashId: number} | false} - */ - parseKeys(keys: string): { - key: string; - hashId: number; - } | false; - /** - * @param {number} hashId - * @param {string} keyString - * @returns {Command} - */ - findKeyCommand(hashId: number, keyString: string): Command; - /** - * @param {{ $keyChain: string | any[]; }} data - * @param {number} hashId - * @param {string} keyString - * @param {number} keyCode - * @returns {{command: string} | void} - */ - handleKeyboard(data: { - }, hashId: number, keyString: string, keyCode: number): { - command: string; - } | void; - /** - * @param {any} [editor] - * @param {any} [data] - * @returns {string} - */ - getStatusText(editor?: any, data?: any): string; - } - export namespace MultiHashHandler { - function call(thisArg: any, config: any, platform: any): void; - } -} -declare module "ace-code/src/commands/command_manager" { - const CommandManager_base: typeof MultiHashHandler; - export class CommandManager extends MultiHashHandler { - /** - * new CommandManager(platform, commands) - * @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"` - * @param {any[]} commands A list of commands - **/ - constructor(platform: string, commands: any[]); - byName: Record; - /** - * - * @param {string | string[] | import("ace-code").Ace.Command} command - * @param {Editor} editor - * @param {any} args - * @returns {boolean} - */ - exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; - /** - * @param {Editor} editor - * @returns {boolean} - */ - toggleRecording(editor: Editor): boolean; - macro: any; - recording: boolean; - oldMacro: any; - /** - * @param {Editor} editor - */ - replay(editor: Editor): boolean; - trimMacro(m: any): any; - } - export type Editor = import("ace-code/src/editor").Editor; - import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); - import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface CommandManager extends Ace.EventEmitter { - } -} -declare module "ace-code/src/commands/default_commands" { - export const commands: import("ace-code").Ace.Command[]; -} -declare module "ace-code/src/token_iterator" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - /** - * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens. - **/ - export class TokenIterator { - /** - * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. - * @param {EditSession} session The session to associate with - * @param {Number} initialRow The row to start the tokenizing at - * @param {Number} initialColumn The column to start the tokenizing at - **/ - constructor(session: EditSession, initialRow: number, initialColumn: number); - /** - * Moves iterator position to the start of previous token. - * @returns {import("ace-code").Ace.Token|null} - **/ - stepBackward(): import("ace-code").Ace.Token | null; - /** - * Moves iterator position to the start of next token. - * @returns {import("ace-code").Ace.Token|null} - **/ - stepForward(): import("ace-code").Ace.Token | null; - /** - * - * Returns current token. - * @returns {import("ace-code").Ace.Token} - **/ - getCurrentToken(): import("ace-code").Ace.Token; - /** - * - * Returns the current row. - * @returns {Number} - **/ - getCurrentTokenRow(): number; - /** - * - * Returns the current column. - * @returns {Number} - **/ - getCurrentTokenColumn(): number; - /** - * Return the current token position. - * @returns {import("ace-code").Ace.Point} - */ - getCurrentTokenPosition(): import("ace-code").Ace.Point; - /** - * Return the current token range. - * @returns {Range} - */ - getCurrentTokenRange(): Range; - } - import Range_6 = require("ace-code/src/range"); - import Range = Range_6.Range; -} -declare module "ace-code/src/line_widgets" { - export class LineWidgets { - /** - * @param {EditSession} session - */ - constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; - /** - * - * @param {import("ace-code").Ace.Delta} delta - */ - updateOnChange(delta: import("ace-code").Ace.Delta): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ - renderWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ - measureWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {number} row - * @return {number} - */ - getRowLength(row: number): number; - /** - * - * @param {Editor} editor - */ - attach(editor: Editor): void; - /**@type {Editor} */ - editor: Editor; - detach(e: any): void; - /** - * - * @param e - * @param {EditSession} session - */ - updateOnFold(e: any, session: EditSession): void; - /** - * - * @param {LineWidget} w - * @return {LineWidget} - */ - addLineWidget(w: LineWidget): LineWidget; - /** - * @param {LineWidget} w - */ - removeLineWidget(w: LineWidget): void; - /** - * - * @param {number} row - * @return {LineWidget[]} - */ - getWidgetsAtRow(row: number): LineWidget[]; - /** - * @param {LineWidget} w - */ - onWidgetChanged(w: LineWidget): void; - firstRow: number; - lastRow: number; - lineWidgets: import("ace-code").Ace.LineWidget[]; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Editor = import("ace-code/src/editor").Editor; - export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; - export type LineWidget = import("ace-code").Ace.LineWidget; - namespace Ace { - type LineWidget = import("ace-code").Ace.LineWidget; - type Editor = import("ace-code").Ace.Editor; - } - export interface LineWidgets { - lineWidgets: Ace.LineWidget[]; - editor: Ace.Editor; - } -} -declare module "ace-code/src/keyboard/gutter_handler" { - export class GutterKeyboardHandler { - constructor(editor: any); - editor: any; - gutterLayer: any; - element: any; - lines: any; - activeRowIndex: any; - activeLane: string; - annotationTooltip: GutterTooltip; - addListener(): void; - removeListener(): void; - lane: any; - } - export class GutterKeyboardEvent { - constructor(domEvent: any, gutterKeyboardHandler: any); - gutterKeyboardHandler: any; - domEvent: any; - /** - * Returns the key that was presssed. - * - * @return {string} the key that was pressed. - */ - getKey(): string; - /** - * Returns the row in the gutter that was focused after the keyboard event was handled. - * - * @return {number} the key that was pressed. - */ - getRow(): number; - /** - * Returns whether focus is on the annotation lane after the keyboard event was handled. - * - * @return {boolean} true if focus was on the annotation lane after the keyboard event. - */ - isInAnnotationLane(): boolean; - /** - * Returns whether focus is on the fold lane after the keyboard event was handled. - * - * @return {boolean} true if focus was on the fold lane after the keyboard event. - */ - isInFoldLane(): boolean; - } - import GutterTooltip_1 = require("ace-code/src/mouse/default_gutter_handler"); - import GutterTooltip = GutterTooltip_1.GutterTooltip; -} -declare module "ace-code/src/editor" { - const Editor_base: undefined; - const Editor_base_1: undefined; - const Editor_base_2: undefined; - const Editor_base_3: undefined; - const Editor_base_4: undefined; - const Editor_base_5: undefined; - const Editor_base_6: undefined; - const Editor_base_7: undefined; - /** - * The main entry point into the Ace functionality. - * - * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. - * - * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. - **/ - export class Editor { - /** - * Creates a new `Editor` object. - * - * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything - * @param {EditSession} [session] The `EditSession` to refer to - * @param {Partial} [options] The default options - **/ - constructor(renderer: VirtualRenderer, session?: EditSession, options?: Partial); - /**@type{EditSession}*/ session: EditSession; - /**@type {HTMLElement & {env?:any, value?:any}}*/ - container: HTMLElement & { - env?: any; - value?: any; - }; - /**@type {VirtualRenderer}*/ - renderer: VirtualRenderer; - /**@type {string}*/ - id: string; - commands: CommandManager; - textInput: any; - /**@type {KeyBinding}*/ - keyBinding: KeyBinding; - startOperation(commandEvent: any): void; - prevOp: {}; - previousCommand: any; - /** - * @type {{[key: string]: any;}} - */ - curOp: { - [key: string]: any; - }; - /** - * @arg e - */ - endOperation(e: any): any; - mergeNextCommand: boolean; - sequenceStartTime: number; - /** - * Sets a new key handler, such as "vim" or "windows". - * @param {String | import("ace-code").Ace.KeyboardHandler | null} keyboardHandler The new key handler - * @param {() => void} [cb] - **/ - setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; - /** - * Returns the keyboard handler, such as "vim" or "windows". - * @returns {Object} - **/ - getKeyboardHandler(): any; - /** - * Sets a new editsession to use. This method also emits the `'changeSession'` event. - * @param {EditSession} [session] The new session to use - **/ - setSession(session?: EditSession): void; - selection: import("ace-code/src/selection").Selection; - /** - * Returns the current session being used. - * @returns {EditSession} - **/ - getSession(): EditSession; - /** - * Sets the current document to `val`. - * @param {String} val The new value to set for the document - * @param {Number} [cursorPos] Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end - * - * @returns {String} The current document value - * @related Document.setValue - **/ - setValue(val: string, cursorPos?: number): string; - /** - * Returns the current session's content. - * - * @returns {String} - * @related EditSession.getValue - **/ - getValue(): string; - /** - * - * Returns the currently highlighted selection. - * @returns {Selection} The selection object - **/ - getSelection(): Selection; - /** - * {:VirtualRenderer.onResize} - * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed - * @related VirtualRenderer.onResize - **/ - resize(force?: boolean): void; - /** - * {:VirtualRenderer.setTheme} - * @param {string | import("ace-code").Ace.Theme} theme The path to a theme - * @param {() => void} [cb] optional callback called when theme is loaded - **/ - setTheme(theme: string | import("ace-code").Ace.Theme, cb?: () => void): void; - /** - * {:VirtualRenderer.getTheme} - * - * @returns {String} The set theme - * @related VirtualRenderer.getTheme - **/ - getTheme(): string; - /** - * {:VirtualRenderer.setStyle} - * @param {String} style A class name - * @related VirtualRenderer.setStyle - **/ - setStyle(style: string): void; - /** - * {:VirtualRenderer.unsetStyle} - * @related VirtualRenderer.unsetStyle - * @param {string} style - */ - unsetStyle(style: string): void; - /** - * Gets the current font size of the editor text. - * @return {string} - */ - getFontSize(): string; - /** - * Set a new font size (in pixels) for the editor text. - * @param {String} size A font size ( _e.g._ "12px") - **/ - setFontSize(size: string): void; - /** - * - * Brings the current `textInput` into focus. - **/ - focus(): void; - /** - * Returns `true` if the current `textInput` is in focus. - * @return {Boolean} - **/ - isFocused(): boolean; - /** - * - * Blurs the current `textInput`. - **/ - blur(): void; - /** - * Emitted once the editor comes into focus. - **/ - onFocus(e: any): void; - /** - * Emitted once the editor has been blurred. - **/ - onBlur(e: any): void; - /** - * Emitted whenever the document is changed. - * @param {import("ace-code").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes - **/ - onDocumentChange(delta: import("ace-code").Ace.Delta): void; - onTokenizerUpdate(e: any): void; - onScrollTopChange(): void; - onScrollLeftChange(): void; - /** - * Emitted when the selection changes. - **/ - onCursorChange(): void; - /** - * - * @param e - */ - onSelectionChange(e: any): void; - onChangeFrontMarker(): void; - onChangeBackMarker(): void; - onChangeBreakpoint(): void; - onChangeAnnotation(): void; - /** - * @param e - */ - onChangeMode(e: any): void; - onChangeWrapLimit(): void; - onChangeWrapMode(): void; - /** - */ - onChangeFold(): void; - /** - * Returns the string of text currently highlighted. - * @returns {String} - **/ - getCopyText(): string; - /** - * Called whenever a text "copy" happens. - **/ - onCopy(): void; - /** - * Called whenever a text "cut" happens. - **/ - onCut(): void; - /** - * Called whenever a text "paste" happens. - * @param {String} text The pasted text - * @param {any} event - **/ - onPaste(text: string, event: any): void; - /** - * - * @param {string | string[]} command - * @param [args] - * @return {boolean} - */ - execCommand(command: string | string[], args?: any): boolean; - /** - * Inserts `text` into wherever the cursor is pointing. - * @param {String} text The new text to add - * @param {boolean} [pasted] - **/ - insert(text: string, pasted?: boolean): void; - autoIndent(): void; - /** - * - * @param text - * @param composition - * @returns {*} - */ - onTextInput(text: any, composition: any): any; - /** - * @param {string} [text] - * @param {any} [composition] - */ - applyComposition(text?: string, composition?: any): void; - onCommandKey(e: any, hashId: any, keyCode: any): boolean; - /** - * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. - * @param {Boolean} overwrite Defines whether or not to set overwrites - * @related EditSession.setOverwrite - **/ - setOverwrite(overwrite: boolean): void; - /** - * Returns `true` if overwrites are enabled; `false` otherwise. - * @returns {Boolean} - * @related EditSession.getOverwrite - **/ - getOverwrite(): boolean; - /** - * Sets the value of overwrite to the opposite of whatever it currently is. - * @related EditSession.toggleOverwrite - **/ - toggleOverwrite(): void; - /** - * Sets how fast the mouse scrolling should do. - * @param {Number} speed A value indicating the new speed (in milliseconds) - **/ - setScrollSpeed(speed: number): void; - /** - * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). - * @returns {Number} - **/ - getScrollSpeed(): number; - /** - * Sets the delay (in milliseconds) of the mouse drag. - * @param {Number} dragDelay A value indicating the new delay - **/ - setDragDelay(dragDelay: number): void; - /** - * Returns the current mouse drag delay. - * @returns {Number} - **/ - getDragDelay(): number; - /** - * Draw selection markers spanning whole line, or only over selected text. Default value is "line" - * @param {"fullLine" | "screenLine" | "text" | "line"} val The new selection style "line"|"text" - **/ - setSelectionStyle(val: "fullLine" | "screenLine" | "text" | "line"): void; - /** - * Returns the current selection style. - * @returns {import("ace-code").Ace.EditorOptions["selectionStyle"]} - **/ - getSelectionStyle(): import("ace-code").Ace.EditorOptions["selectionStyle"]; - /** - * Determines whether or not the current line should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the current line - **/ - setHighlightActiveLine(shouldHighlight: boolean): void; - /** - * Returns `true` if current lines are always highlighted. - * @return {Boolean} - **/ - getHighlightActiveLine(): boolean; - /** - * @param {boolean} shouldHighlight - */ - setHighlightGutterLine(shouldHighlight: boolean): void; - /** - * @returns {Boolean} - */ - getHighlightGutterLine(): boolean; - /** - * Determines if the currently selected word should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word - **/ - setHighlightSelectedWord(shouldHighlight: boolean): void; - /** - * Returns `true` if currently highlighted words are to be highlighted. - * @returns {Boolean} - **/ - getHighlightSelectedWord(): boolean; - /** - * @param {boolean} shouldAnimate - */ - setAnimatedScroll(shouldAnimate: boolean): void; - /** - * @return {boolean} - */ - getAnimatedScroll(): boolean; - /** - * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. - * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters - **/ - setShowInvisibles(showInvisibles: boolean): void; - /** - * Returns `true` if invisible characters are being shown. - * @returns {Boolean} - **/ - getShowInvisibles(): boolean; - /** - * @param {boolean} display - */ - setDisplayIndentGuides(display: boolean): void; - /** - * @return {boolean} - */ - getDisplayIndentGuides(): boolean; - /** - * @param {boolean} highlight - */ - setHighlightIndentGuides(highlight: boolean): void; - /** - * @return {boolean} - */ - getHighlightIndentGuides(): boolean; - /** - * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. - * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin - * - **/ - setShowPrintMargin(showPrintMargin: boolean): void; - /** - * Returns `true` if the print margin is being shown. - * @returns {Boolean} - **/ - getShowPrintMargin(): boolean; - /** - * Sets the column defining where the print margin should be. - * @param {Number} showPrintMargin Specifies the new print margin - * - **/ - setPrintMarginColumn(showPrintMargin: number): void; - /** - * Returns the column number of where the print margin is. - * @returns {Number} - **/ - getPrintMarginColumn(): number; - /** - * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. - * @param {Boolean} readOnly Specifies whether the editor can be modified or not - **/ - setReadOnly(readOnly: boolean): void; - /** - * Returns `true` if the editor is set to read-only mode. - * @returns {Boolean} - **/ - getReadOnly(): boolean; - /** - * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} - * @param {Boolean} enabled Enables or disables behaviors - **/ - setBehavioursEnabled(enabled: boolean): void; - /** - * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} - * @returns {Boolean} - **/ - getBehavioursEnabled(): boolean; - /** - * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets - * when such a character is typed in. - * @param {Boolean} enabled Enables or disables wrapping behaviors - **/ - setWrapBehavioursEnabled(enabled: boolean): void; - /** - * Returns `true` if the wrapping behaviors are currently enabled. - * @returns {boolean} - **/ - getWrapBehavioursEnabled(): boolean; - /** - * Indicates whether the fold widgets should be shown or not. - * @param {Boolean} show Specifies whether the fold widgets are shown - **/ - setShowFoldWidgets(show: boolean): void; - /** - * Returns `true` if the fold widgets are shown. - * @return {Boolean} - **/ - getShowFoldWidgets(): boolean; - /** - * @param {boolean} fade - */ - setFadeFoldWidgets(fade: boolean): void; - /** - * @returns {boolean} - */ - getFadeFoldWidgets(): boolean; - /** - * Removes the current selection or one character. - * @param {'left' | 'right'} [dir] The direction of the deletion to occur, either "left" or "right" - **/ - remove(dir?: 'left' | 'right'): void; - /** - * Removes the word directly to the right of the current selection. - **/ - removeWordRight(): void; - /** - * Removes the word directly to the left of the current selection. - **/ - removeWordLeft(): void; - /** - * Removes all the words to the left of the current selection, until the start of the line. - **/ - removeToLineStart(): void; - /** - * Removes all the words to the right of the current selection, until the end of the line. - **/ - removeToLineEnd(): void; - /** - * Splits the line at the current selection (by inserting an `'\n'`). - **/ - splitLine(): void; - /** - * Set the "ghost" text in provided position. "Ghost" text is a kind of - * preview text inside the editor which can be used to preview some code - * inline in the editor such as, for example, code completions. - * - * @param {String} text Text to be inserted as "ghost" text - * @param {Point} [position] Position to insert text to - */ - setGhostText(text: string, position?: Point): void; - /** - * Removes "ghost" text currently displayed in the editor. - */ - removeGhostText(): void; - /** - * Transposes current line. - **/ - transposeLetters(): void; - /** - * Converts the current selection entirely into lowercase. - **/ - toLowerCase(): void; - /** - * Converts the current selection entirely into uppercase. - **/ - toUpperCase(): void; - /** - * Inserts an indentation into the current cursor position or indents the selected lines. - * - * @related EditSession.indentRows - **/ - indent(): void; - /** - * Indents the current line. - * @related EditSession.indentRows - **/ - blockIndent(): void; - /** - * Outdents the current line. - * @related EditSession.outdentRows - **/ - blockOutdent(): void; - sortLines(): void; - /** - * Given the currently selected range, this function either comments all the lines, or uncomments all of them. - **/ - toggleCommentLines(): void; - toggleBlockComment(): void; - /** - * Works like [[EditSession.getTokenAt]], except it returns a number. - * @returns {any} - **/ - getNumberAt(row: any, column: any): any; - /** - * If the character before the cursor is a number, this functions changes its value by `amount`. - * @param {Number} amount The value to change the numeral by (can be negative to decrease value) - **/ - modifyNumber(amount: number): void; - /** - */ - toggleWord(): void; - /** - * Finds link at defined {row} and {column} - * @returns {String} - **/ - findLinkAt(row: any, column: any): string; - /** - * Open valid url under cursor in another tab - * @returns {Boolean} - **/ - openLink(): boolean; - /** - * Removes all the lines in the current selection - * @related EditSession.remove - **/ - removeLines(): void; - duplicateSelection(): void; - /** - * Shifts all the selected lines down one row. - * - * @related EditSession.moveLinesUp - **/ - moveLinesDown(): void; - /** - * Shifts all the selected lines up one row. - * @related EditSession.moveLinesDown - **/ - moveLinesUp(): void; - /** - * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json - * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} range The range of text you want moved within the document - * @param {Point} toPosition The location (row and column) where you want to move the text to - * @param {boolean} [copy] - * - * @returns {Range} The new range where the text was moved to. - * @related EditSession.moveText - **/ - moveText(range: Range, toPosition: Point, copy?: boolean): Range; - /** - * Copies all the selected lines up one row. - * - **/ - copyLinesUp(): void; - /** - * Copies all the selected lines down one row. - * @related EditSession.duplicateLines - * - **/ - copyLinesDown(): void; - inVirtualSelectionMode: boolean; - onCompositionStart(compositionState: any): void; - onCompositionUpdate(text: any): void; - onCompositionEnd(): void; - /** - * {:VirtualRenderer.getFirstVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getFirstVisibleRow - **/ - getFirstVisibleRow(): number; - /** - * {:VirtualRenderer.getLastVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getLastVisibleRow - **/ - getLastVisibleRow(): number; - /** - * Indicates if the row is currently visible on the screen. - * @param {Number} row The row to check - * - * @returns {Boolean} - **/ - isRowVisible(row: number): boolean; - /** - * Indicates if the entire row is currently visible on the screen. - * @param {Number} row The row to check - * - * - * @returns {Boolean} - **/ - isRowFullyVisible(row: number): boolean; - /** - * Selects the text from the current position of the document until where a "page down" finishes. - **/ - selectPageDown(): void; - /** - * Selects the text from the current position of the document until where a "page up" finishes. - **/ - selectPageUp(): void; - /** - * Shifts the document to wherever "page down" is, as well as moving the cursor position. - **/ - gotoPageDown(): void; - /** - * Shifts the document to wherever "page up" is, as well as moving the cursor position. - **/ - gotoPageUp(): void; - /** - * Scrolls the document to wherever "page down" is, without changing the cursor position. - **/ - scrollPageDown(): void; - /** - * Scrolls the document to wherever "page up" is, without changing the cursor position. - **/ - scrollPageUp(): void; - /** - * Moves the editor to the specified row. - * @related VirtualRenderer.scrollToRow - * @param {number} row - */ - scrollToRow(row: number): void; - /** - * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). - * @param {Number} line The line to scroll to - * @param {Boolean} center If `true` - * @param {Boolean} animate If `true` animates scrolling - * @param {() => void} [callback] Function to be called when the animation has finished - * - * @related VirtualRenderer.scrollToLine - **/ - scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; - /** - * Attempts to center the current selection on the screen. - **/ - centerSelection(): void; - /** - * Gets the current position of the cursor. - * @returns {Point} An object that looks something like this: - * - * ```json - * { row: currRow, column: currCol } - * ``` - * - * @related Selection.getCursor - **/ - getCursorPosition(): Point; - /** - * Returns the screen position of the cursor. - * @returns {Point} - * @related EditSession.documentToScreenPosition - **/ - getCursorPositionScreen(): Point; - /** - * {:Selection.getRange} - * @returns {Range} - * @related Selection.getRange - **/ - getSelectionRange(): Range; - /** - * Selects all the text in editor. - * @related Selection.selectAll - **/ - selectAll(): void; - /** - * {:Selection.clearSelection} - * @related Selection.clearSelection - **/ - clearSelection(): void; - /** - * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. - * @param {Number} row The new row number - * @param {Number} column The new column number - * @related Selection.moveCursorTo - **/ - moveCursorTo(row: number, column: number): void; - /** - * Moves the cursor to the position indicated by `pos.row` and `pos.column`. - * @param {Point} pos An object with two properties, row and column - * @related Selection.moveCursorToPosition - **/ - moveCursorToPosition(pos: Point): void; - /** - * Moves the cursor's row and column to the next matching bracket or HTML tag. - * @param {boolean} [select] - * @param {boolean} [expand] - */ - jumpToMatching(select?: boolean, expand?: boolean): void; - /** - * Moves the cursor to the specified line number, and also into the indicated column. - * @param {Number} lineNumber The line number to go to - * @param {Number} [column] A column number to go to - * @param {Boolean} [animate] If `true` animates scolling - **/ - gotoLine(lineNumber: number, column?: number, animate?: boolean): void; - /** - * Moves the cursor to the specified row and column. Note that this does de-select the current selection. - * @param {Number} row The new row number - * @param {Number} column The new column number - * - * @related Editor.moveCursorTo - **/ - navigateTo(row: number, column: number): void; - /** - * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection. - * @param {Number} [times] The number of times to change navigation - * - **/ - navigateUp(times?: number): void; - /** - * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection. - * @param {Number} [times] The number of times to change navigation - * - **/ - navigateDown(times?: number): void; - /** - * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection. - * @param {Number} [times] The number of times to change navigation - * - **/ - navigateLeft(times?: number): void; - /** - * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection. - * @param {Number} [times] The number of times to change navigation - * - **/ - navigateRight(times?: number): void; - /** - * - * Moves the cursor to the start of the current line. Note that this does de-select the current selection. - **/ - navigateLineStart(): void; - /** - * - * Moves the cursor to the end of the current line. Note that this does de-select the current selection. - **/ - navigateLineEnd(): void; - /** - * - * Moves the cursor to the end of the current file. Note that this does de-select the current selection. - **/ - navigateFileEnd(): void; - /** - * - * Moves the cursor to the start of the current file. Note that this does de-select the current selection. - **/ - navigateFileStart(): void; - /** - * - * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection. - **/ - navigateWordRight(): void; - /** - * - * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection. - **/ - navigateWordLeft(): void; - /** - * Replaces the first occurrence of `options.needle` with the value in `replacement`. - * @param {String} [replacement] The text to replace with - * @param {Partial} [options] The [[Search `Search`]] options to use - * @return {number} - **/ - replace(replacement?: string, options?: Partial): number; - /** - * Replaces all occurrences of `options.needle` with the value in `replacement`. - * @param {String} [replacement] The text to replace with - * @param {Partial} [options] The [[Search `Search`]] options to use - * @return {number} - **/ - replaceAll(replacement?: string, options?: Partial): number; - /** - * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. - * @related Search.getOptions - * @returns {Partial} - **/ - getLastSearchOptions(): Partial; - /** - * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. - * @param {String|RegExp|Object} needle The text to search for (optional) - * @param {Partial} [options] An object defining various search properties - * @param {Boolean} [animate] If `true` animate scrolling - * @related Search.find - **/ - find(needle: string | RegExp | any, options?: Partial, animate?: boolean): false | Range; - /** - * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. - * @param {Partial} [options] search options - * @param {Boolean} [animate] If `true` animate scrolling - * - * @related Editor.find - **/ - findNext(options?: Partial, animate?: boolean): void; - /** - * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. - * @param {Partial} [options] search options - * @param {Boolean} [animate] If `true` animate scrolling - * - * @related Editor.find - **/ - findPrevious(options?: Partial, animate?: boolean): void; - /** - * - * @param {Range} range - * @param {boolean} [animate] - */ - revealRange(range: Range, animate?: boolean): void; - /** - * {:UndoManager.undo} - * @related UndoManager.undo - **/ - undo(): void; - /** - * {:UndoManager.redo} - * @related UndoManager.redo - **/ - redo(): void; - /** - * - * Cleans up the entire editor. - **/ - destroy(): void; - /** - * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element - * @param {Boolean} enable default true - **/ - setAutoScrollEditorIntoView(enable: boolean): void; - /** - * opens a prompt displaying message - **/ - prompt(message: any, options: any, callback: any): void; - env?: any; - widgetManager?: LineWidgets; - completer?: import("ace-code/src/autocomplete").Autocomplete | import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; - completers: import("ace-code").Ace.Completer[]; - showKeyboardShortcuts?: () => void; - showSettingsMenu?: () => void; - searchBox?: import("ace-code/src/ext/searchbox").SearchBox; - } - export namespace Editor { - export { $uid }; - } - export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; - export type Selection = import("ace-code/src/selection").Selection; - export type Point = import("ace-code").Ace.Point; - export type SearchOptions = import("ace-code").Ace.SearchOptions; - import EditSession_1 = require("ace-code/src/edit_session"); - import EditSession = EditSession_1.EditSession; - import CommandManager_1 = require("ace-code/src/commands/command_manager"); - import CommandManager = CommandManager_1.CommandManager; - import MouseHandler_1 = require("ace-code/src/mouse/mouse_handler"); - import MouseHandler = MouseHandler_1.MouseHandler; - import KeyBinding_1 = require("ace-code/src/keyboard/keybinding"); - import KeyBinding = KeyBinding_1.KeyBinding; - import Search_1 = require("ace-code/src/search"); - import Search = Search_1.Search; - import Range_7 = require("ace-code/src/range"); - import Range = Range_7.Range; - import LineWidgets_1 = require("ace-code/src/line_widgets"); - import LineWidgets = LineWidgets_1.LineWidgets; - var $uid: number; - export {}; - namespace Ace { - type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; - type OptionsProvider = import("ace-code").Ace.OptionsProvider; - type EditorOptions = import("ace-code").Ace.EditorOptions; - type EventEmitter = import("ace-code").Ace.EventEmitter; - type EditorEvents = import("ace-code").Ace.EditorEvents; - type CodeLenseEditorExtension = import("ace-code").Ace.CodeLenseEditorExtension; - type ElasticTabstopsEditorExtension = import("ace-code").Ace.ElasticTabstopsEditorExtension; - type TextareaEditorExtension = import("ace-code").Ace.TextareaEditorExtension; - type PromptEditorExtension = import("ace-code").Ace.PromptEditorExtension; - type OptionsEditorExtension = import("ace-code").Ace.OptionsEditorExtension; - type EditSession = import("ace-code").Ace.EditSession; - type LineWidgets = import("ace-code").Ace.LineWidgets; - type Autocomplete = import("ace-code").Ace.Autocomplete; - type InlineAutocomplete = import("ace-code").Ace.InlineAutocomplete; - type Completer = import("ace-code").Ace.Completer; - type SearchBox = import("ace-code").Ace.SearchBox; - } - export interface Editor extends Ace.EditorMultiSelectProperties, Ace.OptionsProvider, Ace.EventEmitter, Ace.CodeLenseEditorExtension, Ace.ElasticTabstopsEditorExtension, Ace.TextareaEditorExtension, Ace.PromptEditorExtension, Ace.OptionsEditorExtension { - session: Ace.EditSession; - env?: any; - widgetManager?: Ace.LineWidgets; - completer?: Ace.Autocomplete | Ace.InlineAutocomplete; - completers: Ace.Completer[]; - showKeyboardShortcuts?: () => void; - showSettingsMenu?: () => void; - searchBox?: Ace.SearchBox; - } -} -declare module "ace-code/src/undomanager" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Delta = import("ace-code").Ace.Delta; - export type Point = import("ace-code").Ace.Point; - export type IRange = import("ace-code").Ace.IRange; - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code").Ace.Delta} Delta - * @typedef {import("ace-code").Ace.Point} Point - * @typedef {import("ace-code").Ace.IRange} IRange - */ - /** - * This object maintains the undo stack for an [[EditSession `EditSession`]]. - **/ - export class UndoManager { - /** - * - * @param {EditSession} session - */ - addSession(session: EditSession): void; - /** - * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: - * - * - `args[0]` is an array of deltas - * - `args[1]` is the document to associate with - * - * @param {import("ace-code").Ace.Delta} delta - * @param {boolean} allowMerge - * @param {EditSession} [session] - **/ - add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; - lastDeltas: any[]; - /** - * - * @param {any} selection - * @param {number} [rev] - */ - addSelection(selection: any, rev?: number): void; - startNewGroup(): any; - /** - * - * @param {number} from - * @param {number} [to] - */ - markIgnored(from: number, to?: number): void; - /** - * - * @param {number} rev - * @param {boolean} [after] - * @return {{ value: string, rev: number }} - */ - getSelection(rev: number, after?: boolean): { - value: string; - rev: number; - }; - /** - * @return {number} - */ - getRevision(): number; - /** - * - * @param {number} from - * @param {number} [to] - * @return {import("ace-code").Ace.Delta[]} - */ - getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; - /** - * - * @param {number} from - * @param {number} [to] - */ - getChangedRanges(from: number, to?: number): void; - /** - * - * @param {number} from - * @param {number} [to] - */ - getChangedLines(from: number, to?: number): void; - /** - * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} - * @param {EditSession} session - * @param {Boolean} [dontSelect] {:dontSelect} - **/ - undo(session: EditSession, dontSelect?: boolean): void; - /** - * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} - * @param {EditSession} session - * @param {Boolean} [dontSelect] {:dontSelect} - * - **/ - redo(session: EditSession, dontSelect?: boolean): void; - /** - * Destroys the stack of undo and redo redo operations. - **/ - reset(): void; - mark: number; - selections: any[]; - /** - * Returns `true` if there are undo operations left to perform. - * @returns {Boolean} - **/ - canUndo(): boolean; - /** - * Returns `true` if there are redo operations left to perform. - * @returns {Boolean} - **/ - canRedo(): boolean; - /** - * Marks the current status clean - * @param {number} [rev] - */ - bookmark(rev?: number): void; - /** - * Returns if the current status is clean - * @returns {Boolean} - **/ - isAtBookmark(): boolean; - /** - * Returns an object which can be safely stringified into JSON - * @returns {object} - */ - toJSON(): object; - /** - * Takes in an object which was returned from the toJSON method above, - * and resets the current undoManager instance to use the previously exported - * instance state. - * @param {object} json - */ - fromJSON(json: object): void; - hasUndo: () => boolean; - hasRedo: () => boolean; - isClean: () => boolean; - markClean: (rev?: number) => void; - } -} -declare module "ace-code/src/tokenizer" { - /** - * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). - **/ - export class Tokenizer { - /** - * Constructs a new tokenizer based on the given rules and flags. - * @param {Object} rules The highlighting rules - **/ - constructor(rules: any); - /**@type {RegExp}*/ - splitRegex: RegExp; - states: any; - regExps: {}; - matchMappings: {}; - /** - * @param {string} src - * @returns {string} - */ - removeCapturingGroups(src: string): string; - /** - * @param {string} src - * @param {string} flag - */ - createSplitterRegexp(src: string, flag: string): RegExp; - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @param {string} line - * @param {string | string[]} startState - * @returns {{tokens:import("ace-code").Ace.Token[], state: string|string[]}} - */ - getLineTokens(line: string, startState: string | string[]): { - tokens: import("ace-code").Ace.Token[]; - state: string | string[]; - }; - reportError: (msg: any, data: any) => void; - } -} -declare module "ace-code/src/autocomplete/popup" { - const AcePopup_base: undefined; - /** - * This object is used in some places where needed to show popups - like prompt; autocomplete etc. - */ - export class AcePopup { - /** - * Creates and renders single line editor in popup window. If `parentNode` param is isset, then attaching it to this element. - * @param {Element} [parentNode] - */ - constructor(parentNode?: Element); - setSelectOnHover: (val: boolean) => void; - setRow: (line: number) => void; - getRow: () => number; - getHoveredRow: () => number; - filterText: string; - isOpen: boolean; - isTopdown: boolean; - autoSelect: boolean; - data: import("ace-code/src/autocomplete").Completion[]; - setData: (data: import("ace-code/src/autocomplete").Completion[], filterText: string) => void; - getData: (row: number) => import("ace-code/src/autocomplete").Completion; - hide: () => void; - anchor: "bottom" | "top"; - anchorPosition: import("ace-code").Ace.Point; - tryShow: (pos: any, lineHeight: number, anchor: "bottom" | "top", forceShow?: boolean) => boolean; - show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; - goTo: (where: import("ace-code").Ace.AcePopupNavigation) => void; - getTextLeftOffset: () => number; - anchorPos: any; - isMouseOver?: boolean; - selectedNode?: HTMLElement; - } - /** - * - * @param {HTMLElement} [el] - * @return {Editor} - */ - export function $singleLineEditor(el?: HTMLElement): Editor; - export function getAriaId(index: any): string; - import Editor_1 = require("ace-code/src/editor"); - import Editor = Editor_1.Editor; - export {}; - namespace Ace { - type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; - type Completion = import("ace-code").Ace.Completion; - type Point = import("ace-code").Ace.Point; - type AcePopupNavigation = import("ace-code").Ace.AcePopupNavigation; - } - export interface AcePopup extends Ace.AcePopupWithEditor { - setSelectOnHover: (val: boolean) => void; - setRow: (line: number) => void; - getRow: () => number; - getHoveredRow: () => number; - filterText: string; - isOpen: boolean; - isTopdown: boolean; - autoSelect: boolean; - data: Ace.Completion[]; - setData: (data: Ace.Completion[], filterText: string) => void; - getData: (row: number) => Ace.Completion; - hide: () => void; - anchor: "top" | "bottom"; - anchorPosition: Ace.Point; - tryShow: (pos: any, lineHeight: number, anchor: "top" | "bottom", forceShow?: boolean) => boolean; - show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; - goTo: (where: Ace.AcePopupNavigation) => void; - getTextLeftOffset: () => number; - anchorPos: any; - isMouseOver?: boolean; - selectedNode?: HTMLElement; - } -} -declare module "ace-code/src/range_list" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Point = import("ace-code").Ace.Point; - export class RangeList { - ranges: any[]; - /** - * @param {Point} pos - * @param {boolean} [excludeEdges] - * @param {number} [startIndex] - * @return {number} - */ - pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; - /** - * @param {Range} range - */ - add(range: Range): any[]; - /** - * @param {Range[]} list - */ - addList(list: Range[]): any[]; - /** - * @param {Point} pos - */ - substractPoint(pos: Point): any[]; - merge(): any[]; - /** - * @param {number} row - * @param {number} column - */ - contains(row: number, column: number): boolean; - /** - * @param {Point} pos - */ - containsPoint(pos: Point): boolean; - /** - * @param {Point} pos - */ - rangeAtPoint(pos: Point): any; - /** - * @param {number} startRow - * @param {number} endRow - */ - clipRows(startRow: number, endRow: number): any[]; - removeAll(): any[]; - /** - * @param {EditSession} session - */ - attach(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - onChange: any; - detach(): void; - comparePoints: (p1: import("ace-code").Ace.Point, p2: import("ace-code").Ace.Point) => number; - } - import Range_8 = require("ace-code/src/range"); - import Range = Range_8.Range; -} -declare module "ace-code/src/snippets" { - export const snippetManager: SnippetManager; - export type Snippet = { - content?: string; - replaceBefore?: string; - replaceAfter?: string; - startRe?: RegExp; - endRe?: RegExp; - triggerRe?: RegExp; - endTriggerRe?: RegExp; - trigger?: string; - endTrigger?: string; - matchBefore?: string[]; - matchAfter?: string[]; - name?: string; - tabTrigger?: string; - guard?: string; - endGuard?: string; - }; - class SnippetManager { - snippetMap: {}; - snippetNameMap: {}; - variables: { - CURRENT_WORD: (editor: any) => any; - SELECTION: (editor: any, name: any, indentation: any) => any; - CURRENT_LINE: (editor: any) => any; - PREV_LINE: (editor: any) => any; - LINE_INDEX: (editor: any) => any; - LINE_NUMBER: (editor: any) => any; - SOFT_TABS: (editor: any) => "YES" | "NO"; - TAB_SIZE: (editor: any) => any; - CLIPBOARD: (editor: any) => any; - FILENAME: (editor: any) => string; - FILENAME_BASE: (editor: any) => string; - DIRECTORY: (editor: any) => string; - FILEPATH: (editor: any) => string; - WORKSPACE_NAME: () => string; - FULLNAME: () => string; - BLOCK_COMMENT_START: (editor: any) => any; - BLOCK_COMMENT_END: (editor: any) => any; - LINE_COMMENT: (editor: any) => any; - CURRENT_YEAR: any; - CURRENT_YEAR_SHORT: any; - CURRENT_MONTH: any; - CURRENT_MONTH_NAME: any; - CURRENT_MONTH_NAME_SHORT: any; - CURRENT_DATE: any; - CURRENT_DAY_NAME: any; - CURRENT_DAY_NAME_SHORT: any; - CURRENT_HOUR: any; - CURRENT_MINUTE: any; - CURRENT_SECOND: any; - }; - /** - * @return {Tokenizer} - */ - getTokenizer(): Tokenizer; - createTokenizer(): any; - tokenizeTmSnippet(str: any, startState: any): (string | import("ace-code").Ace.Token)[]; - getVariableValue(editor: any, name: any, indentation: any): any; - tmStrFormat(str: any, ch: any, editor: any): any; - tmFormatFunction(str: any, ch: any, editor: any): any; - resolveVariables(snippet: any, editor: any): any[]; - getDisplayTextForSnippet(editor: any, snippetText: any): any; - insertSnippetForSelection(editor: any, snippetText: any, options?: {}): void; - insertSnippet(editor: any, snippetText: any, options?: {}): void; - getActiveScopes(editor: any): any[]; - expandWithTab(editor: any, options: any): any; - expandSnippetForSelection(editor: any, options: any): boolean; - /** - * @param {Snippet[]} snippetList - * @param {string} before - * @param {string} after - * @return {Snippet} - */ - findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; - /** - * @param {any[]} snippets - * @param {string} scope - */ - register(snippets: any[], scope: string): void; - unregister(snippets: any, scope: any): void; - parseSnippetFile(str: any): Snippet[]; - getSnippetByName(name: any, editor: any): undefined; - } - import Tokenizer_1 = require("ace-code/src/tokenizer"); - import Tokenizer = Tokenizer_1.Tokenizer; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - interface SnippetManager extends Ace.EventEmitter { - } -} -declare module "ace-code/src/autocomplete/inline_screenreader" { - /** - * This object is used to communicate inline code completions rendered into an editor with ghost text to screen reader users. - */ - export class AceInlineScreenReader { - /** - * Creates the off-screen div in which the ghost text content in redered and which the screen reader reads. - * @param {import("ace-code/src/editor").Editor} editor - */ - constructor(editor: import("ace-code/src/editor").Editor); - editor: import("ace-code/src/editor").Editor; - screenReaderDiv: HTMLDivElement; - /** - * Set the ghost text content to the screen reader div - * @param {string} content - */ - setScreenReaderContent(content: string): void; - popup: import("ace-code/src/autocomplete/popup").AcePopup; - destroy(): void; - /** - * Take this._lines, render it as blocks and add those to the screen reader div. - */ - createCodeBlock(): HTMLPreElement; - } -} -declare module "ace-code/src/autocomplete/inline" { - export type Editor = import("ace-code/src/editor").Editor; - /** - * This object is used to manage inline code completions rendered into an editor with ghost text. - */ - export class AceInline { - editor: any; - /** - * Renders the completion as ghost text to the current cursor position - * @param {Editor} editor - * @param {import("ace-code").Ace.Completion} completion - * @param {string} prefix - * @returns {boolean} True if the completion could be rendered to the editor, false otherwise - */ - show(editor: Editor, completion: import("ace-code").Ace.Completion, prefix: string): boolean; - inlineScreenReader: AceInlineScreenReader; - isOpen(): boolean; - hide(): boolean; - destroy(): void; - } - import AceInlineScreenReader_1 = require("ace-code/src/autocomplete/inline_screenreader"); - import AceInlineScreenReader = AceInlineScreenReader_1.AceInlineScreenReader; -} -declare module "ace-code/src/autocomplete/util" { - export function parForEach(array: any, fn: any, callback: any): void; - export function retrievePrecedingIdentifier(text: any, pos: any, regex: any): string; - export function retrieveFollowingIdentifier(text: any, pos: any, regex: any): any[]; - export function getCompletionPrefix(editor: any): string; - export function triggerAutocomplete(editor: Editor, previousChar?: string): boolean; - export type Editor = import("ace-code/src/editor").Editor; -} -declare module "ace-code/src/autocomplete" { - /** - * This object controls the autocompletion components and their lifecycle. - * There is an autocompletion popup, an optional inline ghost text renderer and a docuent tooltip popup inside. - */ - export class Autocomplete { - static get completionsForLoading(): { - caption: any; - value: string; - }[]; - /** - * @param {Editor} editor - * @return {Autocomplete} - */ - static for(editor: Editor): Autocomplete; - autoInsert: boolean; - autoSelect: boolean; - autoShown: boolean; - exactMatch: boolean; - inlineEnabled: boolean; - keyboardHandler: HashHandler; - parentNode: any; - setSelectOnHover: boolean; - hasSeen: Set; - /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ - showLoadingState: boolean; - /** - * @property {number} stickySelectionDelay - a numerical value that determines after how many ms the popup selection will become 'sticky'. - * Normally, when new elements are added to an open popup, the selection is reset to the first row of the popup. If sticky, the focus will remain - * on the currently selected item when new items are added to the popup. Set to a negative value to disable this feature and never set selection to sticky. - */ - stickySelectionDelay: number; - blurListener(e: any): void; - changeListener(e: any): void; - mousedownListener(e: any): void; - mousewheelListener(e: any): void; - onLayoutChange(): void; - changeTimer: { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ - isPending(): any; - }; - tooltipTimer: { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ - isPending(): any; - }; - popupTimer: { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ - isPending(): any; - }; - stickySelectionTimer: { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ - isPending(): any; - }; - /**@type {AcePopup}**/ - popup: AcePopup; - inlineRenderer: AceInline; - /** - * @return {AcePopup} - */ - getPopup(): AcePopup; - stickySelection: boolean; - observeLayoutChanges(): void; - unObserveLayoutChanges(): void; - /** - * @param {Editor} editor - * @param {string} prefix - * @param {boolean} [keepPopupPosition] - */ - openPopup(editor: Editor, prefix: string, keepPopupPosition?: boolean): void; - /** - * Detaches all elements from the editor, and cleans up the data for the session - */ - detach(): void; - activated: boolean; - completionProvider: CompletionProvider; - completions: FilteredList; - base: import("ace-code/src/anchor").Anchor; - mouseOutListener(e: any): void; - goTo(where: any): void; - /** - * @param {Completion} data - * @param {undefined} [options] - * @return {boolean | void} - */ - insertMatch(data: Completion, options?: undefined): boolean | void; - /** - * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions - * @param {Editor} editor - * @param {CompletionOptions} [options] - */ - showPopup(editor: Editor, options?: CompletionOptions): void; - editor: import("ace-code/src/editor").Editor; - getCompletionProvider(initialPosition: any): CompletionProvider; - /** - * This method is deprecated, it is only kept for backwards compatibility. - * Use the same method include CompletionProvider instead for the same functionality. - * @deprecated - */ - gatherCompletions(editor: any, callback: any): boolean; - /** - * @param {boolean} keepPopupPosition - * @param {CompletionOptions} [options] - */ - updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; - cancelContextMenu(): void; - updateDocTooltip(): void; - showDocTooltip(item: any): void; - tooltipNode: HTMLDivElement; - hideDocTooltip(): void; - onTooltipClick(e: any): void; - destroy(): void; - commands: { - Up: (editor: any) => void; - Down: (editor: any) => void; - "Ctrl-Up|Ctrl-Home": (editor: any) => void; - "Ctrl-Down|Ctrl-End": (editor: any) => void; - Esc: (editor: any) => void; - Return: (editor: any) => any; - "Shift-Return": (editor: any) => void; - Tab: (editor: any) => any; - Backspace: (editor: any) => void; - PageUp: (editor: any) => void; - PageDown: (editor: any) => void; - }; - emptyMessage?: Function; - } - /** - * This class is responsible for providing completions and inserting them to the editor - */ - export class CompletionProvider { - /** - * @param {{pos: import("ace-code").Ace.Position, prefix: string}} initialPosition - */ - constructor(initialPosition: { - pos: import("ace-code").Ace.Position; - prefix: string; - }); - initialPosition: { - pos: import("ace-code").Ace.Position; - prefix: string; - }; - active: boolean; - /** - * @param {Editor} editor - * @param {number} index - * @param {CompletionProviderOptions} [options] - * @returns {boolean} - */ - insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; - /** - * @param {Editor} editor - * @param {Completion} data - * @param {CompletionProviderOptions} [options] - * @returns {boolean} - */ - insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; - /** - * @param {Editor} editor - * @param {import("ace-code").Ace.CompletionCallbackFunction} callback - */ - gatherCompletions(editor: Editor, callback: import("ace-code").Ace.CompletionCallbackFunction): boolean; - completers: import("ace-code").Ace.Completer[]; - /** - * This is the entry point to the class, it gathers, then provides the completions asynchronously via callback. - * The callback function may be called multiple times, the last invokation is marked with a `finished` flag - * @param {Editor} editor - * @param {CompletionProviderOptions} options - * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback - */ - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ - ], finished: boolean) => void): void; - detach(): void; - completions: FilteredList; - } - export type Editor = import("ace-code/src/editor").Editor; - export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; - export type CompletionOptions = import("ace-code").Ace.CompletionOptions; - export type BaseCompletion = { - /** - * - a numerical value that determines the order in which completions would be displayed. - * A lower score means that the completion would be displayed further from the start - */ - score?: number; - /** - * - a short description of the completion - */ - meta?: string; - /** - * - the text that would be displayed in the completion list. If omitted, value or snippet - * would be shown instead. - */ - caption?: string; - /** - * - an HTML string that would be displayed as an additional popup - */ - docHTML?: string; - /** - * - a plain text that would be displayed as an additional popup. If `docHTML` exists, - * it would be used instead of `docText`. - */ - docText?: string; - /** - * - the identifier of the completer - */ - completerId?: string; - /** - * - An object specifying the range of text to be replaced with the new completion value (experimental) - */ - range?: import("ace-code").Ace.IRange; - /** - * - A command to be executed after the completion is inserted (experimental) - */ - command?: string; - /** - * - a text snippet that would be inserted when the completion is selected - */ - snippet?: string; - /** - * - The text that would be inserted when selecting this completion. - */ - value?: string; - completer?: import("ace-code").Ace.Completer & { - insertMatch: (editor: Editor, data: Completion) => void; - }; - hideInlinePreview?: boolean; - }; - export type SnippetCompletion = BaseCompletion & { - snippet: string; - }; - export type ValueCompletion = BaseCompletion & { - value: string; - }; - /** - * Represents a suggested text snippet intended to complete a user's input - */ - export type Completion = SnippetCompletion | ValueCompletion; - import HashHandler_1 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_1.HashHandler; - import AcePopup_1 = require("ace-code/src/autocomplete/popup"); - import AcePopup = AcePopup_1.AcePopup; - import AceInline_1 = require("ace-code/src/autocomplete/inline"); - import AceInline = AceInline_1.AceInline; - export class FilteredList { - constructor(array: any, filterText: any); - all: any; - filtered: any; - filterText: any; - exactMatch: boolean; - ignoreCaption: boolean; - setFilter(str: any): void; - filterCompletions(items: any, needle: any): any[]; - } - export namespace startCommand { - let name: string; - function exec(editor: any, options: any): void; - let bindKey: string; - } - export {}; - namespace Ace { - type AcePopup = import("ace-code").Ace.AcePopup; - type FilteredList = import("ace-code").Ace.FilteredList; - } - export interface Autocomplete { - popup: Ace.AcePopup; - emptyMessage?: Function; - } - export interface CompletionProvider { - completions: Ace.FilteredList; - } -} -declare module "ace-code/src/ext/command_bar" { - const CommandBarTooltip_base: undefined; - /** - * Displays a command tooltip above the currently active line selection, with clickable elements. - * - * Internally it is a composite of two tooltips, one for the main tooltip and one for the - * overflowing commands. - * The commands are added sequentially in registration order. - * When attached to an editor, it is either always shown or only when the active line is hovered - * with mouse, depending on the alwaysShow property. - */ - export class CommandBarTooltip { - /** - * @param {HTMLElement} parentNode - * @param {Partial} [options] - */ - constructor(parentNode: HTMLElement, options?: Partial); - parentNode: HTMLElement; - tooltip: Tooltip; - moreOptions: Tooltip; - maxElementsOnTooltip: number; - eventListeners: {}; - elements: {}; - commands: {}; - tooltipEl: any[] | HTMLElement | Text; - moreOptionsEl: any[] | HTMLElement | Text; - /** - * Registers a command on the command bar tooltip. - * - * The commands are added in sequential order. If there is not enough space on the main - * toolbar, the remaining elements are added to the overflow menu. - * - * @param {string} id - * @param {TooltipCommand} command - */ - registerCommand(id: string, command: TooltipCommand): void; - isShown(): boolean; - isMoreOptionsShown(): boolean; - getAlwaysShow(): boolean; - /** - * Sets the display mode of the tooltip - * - * When true, the tooltip is always displayed while it is attached to an editor. - * When false, the tooltip is displayed only when the mouse hovers over the active editor line. - * - * @param {boolean} alwaysShow - */ - setAlwaysShow(alwaysShow: boolean): void; - /** - * Attaches the clickable command bar tooltip to an editor - * - * Depending on the alwaysShow parameter it either displays the tooltip immediately, - * or subscribes to the necessary events to display the tooltip on hover. - * - * @param {Editor} editor - */ - attach(editor: Editor): void; - editor: import("ace-code/src/editor").Editor; - /** - * Updates the position of the command bar tooltip. It aligns itself above the active line in the editor. - */ - updatePosition(): void; - /** - * Updates each command element in the tooltip. - * - * This is automatically called on certain events, but can be called manually as well. - */ - update(): void; - /** - * Detaches the tooltip from the editor. - */ - detach(): void; - destroy(): void; - } - export type Editor = import("ace-code/src/editor").Editor; - export type TooltipCommand = import("ace-code").Ace.TooltipCommand; - import Tooltip_2 = require("ace-code/src/tooltip"); - import Tooltip = Tooltip_2.Tooltip; - export var TOOLTIP_CLASS_NAME: string; - export var BUTTON_CLASS_NAME: string; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface CommandBarTooltip extends Ace.EventEmitter { - } -} -declare module "ace-code/src/autocomplete/text_completer" { - export function getCompletions(editor: any, session: any, pos: any, prefix: any, callback: any): void; -} -declare module "ace-code/src/ext/language_tools" { - export function setCompleters(val: any): void; - export function addCompleter(completer: any): void; - import textCompleter = require("ace-code/src/autocomplete/text_completer"); - /**@type {import("ace-code").Ace.Completer}*/ - export var keyWordCompleter: import("ace-code").Ace.Completer; - /**@type {import("ace-code").Ace.Completer} */ - export var snippetCompleter: import("ace-code").Ace.Completer; - export { textCompleter }; -} -declare module "ace-code/src/ext/inline_autocomplete" { - /** - * This class controls the inline-only autocompletion components and their lifecycle. - * This is more lightweight than the popup-based autocompletion, as it can only work with exact prefix matches. - * There is an inline ghost text renderer and an optional command bar tooltip inside. - */ - export class InlineAutocomplete { - /** - * @param {Editor} editor - */ - constructor(editor: Editor); - editor: Editor; - keyboardHandler: HashHandler; - blurListener(e: any): void; - changeListener(e: any): void; - changeTimer: { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - /** - * - * @return {AceInline} - */ - getInlineRenderer(): AceInline; - inlineRenderer: AceInline; - /** - * @return {CommandBarTooltip} - */ - getInlineTooltip(): CommandBarTooltip; - inlineTooltip: CommandBarTooltip; - /** - * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; - * @param {import("ace-code").Ace.CompletionOptions} options - */ - show(options: import("ace-code").Ace.CompletionOptions): void; - activated: boolean; - insertMatch(): boolean; - /** - * @param {import("ace-code").Ace.InlineAutocompleteAction} where - */ - goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; - getLength(): any; - /** - * @param {number} [index] - * @returns {import("ace-code").Ace.Completion | undefined} - */ - getData(index?: number): import("ace-code").Ace.Completion | undefined; - getIndex(): number; - isOpen(): boolean; - /** - * @param {number} value - */ - setIndex(value: number): void; - /** - * @return {CompletionProvider} - */ - getCompletionProvider(initialPosition: any): CompletionProvider; - completionProvider: CompletionProvider; - /** - * @param {import("ace-code").Ace.CompletionOptions} [options] - */ - updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; - base: import("ace-code/src/anchor").Anchor; - completions: FilteredList; - detach(): void; - destroy(): void; - updateDocTooltip(): void; - /** - * - * @type {{[key: string]: import("ace-code").Ace.Command}} - */ - commands: { - [key: string]: import("ace-code").Ace.Command; - }; - } - export namespace InlineAutocomplete { - function _for(editor: any): any; - export { _for as for }; - export namespace startCommand { - let name: string; - function exec(editor: any, options: any): void; - export namespace bindKey { - let win: string; - let mac: string; - } - } - /** - * Factory method to create a command bar tooltip for inline autocomplete. - * - * @param {HTMLElement} parentEl The parent element where the tooltip HTML elements will be added. - * @returns {CommandBarTooltip} The command bar tooltip for inline autocomplete - */ - export function createInlineTooltip(parentEl: HTMLElement): CommandBarTooltip; - } - import Editor_2 = require("ace-code/src/editor"); - import Editor = Editor_2.Editor; - import HashHandler_2 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_2.HashHandler; - import AceInline_2 = require("ace-code/src/autocomplete/inline"); - import AceInline = AceInline_2.AceInline; - import CommandBarTooltip_1 = require("ace-code/src/ext/command_bar"); - import CommandBarTooltip = CommandBarTooltip_1.CommandBarTooltip; - import CompletionProvider_1 = require("ace-code/src/autocomplete"); - import CompletionProvider = CompletionProvider_1.CompletionProvider; - import FilteredList_1 = require("ace-code/src/autocomplete"); - import FilteredList = FilteredList_1.FilteredList; -} -declare module "ace-code/src/ext/searchbox-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/ext/searchbox" { - export function Search(editor: Editor, isReplace?: boolean): void; - export type Editor = import("ace-code/src/editor").Editor; - export class SearchBox { - /** - * @param {Editor} editor - * @param {undefined} [range] - * @param {undefined} [showReplaceForm] - */ - constructor(editor: Editor, range?: undefined, showReplaceForm?: undefined); - /**@type {any}*/ - activeInput: any; - /**@type {any}*/ - element: any; - setSession(e: any): void; - /** - * @param {Editor} editor - */ - setEditor(editor: Editor): void; - /**@type {Editor}*/ - editor: Editor; - searchRange: any; - /**@type {HTMLElement}*/ - searchBox: HTMLElement; - /**@type {HTMLElement}*/ - replaceBox: HTMLElement; - /**@type {HTMLInputElement}*/ - searchOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ - replaceOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ - regExpOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ - caseSensitiveOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ - wholeWordOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ - searchInput: HTMLInputElement; - /**@type {HTMLInputElement}*/ - replaceInput: HTMLInputElement; - /**@type {HTMLElement}*/ - searchCounter: HTMLElement; - setSearchRange(range: any): void; - searchRangeMarker: number; - /** - * @param {RegExp} [re] - */ - highlight(re?: RegExp): void; - /** - * @param {boolean} skipCurrent - * @param {boolean} backwards - * @param {any} [preventScroll] - */ - find(skipCurrent: boolean, backwards: boolean, preventScroll?: any): void; - updateCounter(): void; - findNext(): void; - findPrev(): void; - findAll(): void; - replace(): void; - replaceAndFindNext(): void; - replaceAll(): void; - hide(): void; - active: boolean; - /** - * @param {string} value - * @param {boolean} [isReplace] - */ - show(value: string, isReplace?: boolean): void; - isFocused(): boolean; - } - import HashHandler_3 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_3.HashHandler; -} -declare module "ace-code/src/search_highlight" { - export type Marker = import("ace-code/src/layer/marker").Marker; - export type EditSession = import("ace-code/src/edit_session").EditSession; - export class SearchHighlight { - /** - * @param {any} regExp - * @param {string} clazz - */ - constructor(regExp: any, clazz: string, type?: string); - clazz: string; - type: string; - setRegexp(regExp: any): void; - regExp: any; - cache: any[]; - /** - * @param {any} html - * @param {Marker} markerLayer - * @param {EditSession} session - * @param {Partial} config - */ - update(html: any, markerLayer: Marker, session: EditSession, config: Partial): void; - MAX_RANGES: number; - } -} -declare module "ace-code/src/occur" { - export type Editor = import("ace-code/src/editor").Editor; - export type Point = import("ace-code").Ace.Point; - export type SearchOptions = import("ace-code").Ace.SearchOptions; - /** - * Finds all lines matching a search term in the current [[Document - * `Document`]] and displays them instead of the original `Document`. Keeps - * track of the mapping between the occur doc and the original doc. - **/ - export class Occur extends Search { - /** - * Enables occur mode. expects that `options.needle` is a search term. - * This search term is used to filter out all the lines that include it - * and these are then used as the content of a new [[Document - * `Document`]]. The current cursor position of editor will be translated - * so that the cursor is on the matching row/column as it was before. - * @param {Editor} editor - * @param {Object} options options.needle should be a String - * @return {Boolean} Whether occur activation was successful - * - **/ - enter(editor: Editor, options: any): boolean; - /** - * Disables occur mode. Resets the [[Sessions `EditSession`]] [[Document - * `Document`]] back to the original doc. If options.translatePosition is - * truthy also maps the [[Editors `Editor`]] cursor position accordingly. - * @param {Editor} editor - * @param {Object} options options.translatePosition - * @return {Boolean} Whether occur deactivation was successful - * - **/ - exit(editor: Editor, options: any): boolean; - /** - * @param {EditSession} sess - * @param {RegExp} regexp - */ - highlight(sess: EditSession, regexp: RegExp): void; - /** - * @param {Editor} editor - * @param {Partial} options - */ - displayOccurContent(editor: Editor, options: Partial): void; - /** - * @param {Editor} editor - */ - displayOriginalContent(editor: Editor): void; - /** - * Translates the position from the original document to the occur lines in - * the document or the beginning if the doc {row: 0, column: 0} if not - * found. - * @param {EditSession} session The occur session - * @param {Point} pos The position in the original document - * @return {Point} position in occur doc - **/ - originalToOccurPosition(session: EditSession, pos: Point): Point; - /** - * Translates the position from the occur document to the original document - * or `pos` if not found. - * @param {EditSession} session The occur session - * @param {Point} pos The position in the occur session document - * @return {Point} position - **/ - occurToOriginalPosition(session: EditSession, pos: Point): Point; - /** - * @param {EditSession} session - * @param {Partial} options - */ - matchingLines(session: EditSession, options: Partial): any[]; - } - import Search_2 = require("ace-code/src/search"); - import Search = Search_2.Search; - import EditSession_2 = require("ace-code/src/edit_session"); - import EditSession = EditSession_2.EditSession; -} -declare module "ace-code/src/marker_group" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type MarkerGroupItem = { - range: import("ace-code/src/range").Range; - className: string; - }; - export type Marker = import("ace-code/src/layer/marker").Marker; - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem - */ - /** - * @typedef {import("ace-code/src/layer/marker").Marker} Marker - */ - export class MarkerGroup { - /** - * @param {EditSession} session - */ - constructor(session: EditSession); - markers: any[]; - /**@type {EditSession}*/ - session: EditSession; - /** - * Finds the first marker containing pos - * @param {import("ace-code").Ace.Point} pos - * @returns import("ace-code").Ace.MarkerGroupItem - */ - getMarkerAtPosition(pos: import("ace-code").Ace.Point): any; - /** - * Comparator for Array.sort function, which sorts marker definitions by their positions - * - * @param {MarkerGroupItem} a first marker. - * @param {MarkerGroupItem} b second marker. - * @returns {number} negative number if a should be before b, positive number if b should be before a, 0 otherwise. - */ - markersComparator(a: MarkerGroupItem, b: MarkerGroupItem): number; - /** - * Sets marker definitions to be rendered. Limits the number of markers at MAX_MARKERS. - * @param {MarkerGroupItem[]} markers an array of marker definitions. - */ - setMarkers(markers: MarkerGroupItem[]): void; - /** - * @param {any} html - * @param {Marker} markerLayer - * @param {EditSession} session - * @param {{ firstRow: any; lastRow: any; }} config - */ - update(html: any, markerLayer: Marker, session: EditSession, config: { - firstRow: any; - lastRow: any; - }): void; - MAX_MARKERS: number; - } -} -declare module "ace-code/src/ext/elastic_tabstops_lite" { - export class ElasticTabstopsLite { - /** - * @param {Editor} editor - */ - constructor(editor: Editor); - onAfterExec: () => void; - onExec: () => void; - onChange: (delta: any) => void; - /** - * @param {number[]} rows - */ - processRows(rows: number[]): void; - } - import Editor_3 = require("ace-code/src/editor"); - import Editor = Editor_3.Editor; -} -declare module "ace-code/src/edit_session/fold" { - export class Fold extends RangeList { - /** - * @param {Range} range - * @param {any} placeholder - */ - constructor(range: Range, placeholder: any); - foldLine: import("ace-code/src/edit_session/fold_line").FoldLine; - placeholder: any; - range: import("ace-code/src/range").Range; - start: import("ace-code").Ace.Point; - end: import("ace-code").Ace.Point; - sameRow: boolean; - /**@type {Fold[]}*/ - subFolds: Fold[]; - /** - * @param {FoldLine} foldLine - */ - setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - /** - * @param {Fold} fold - */ - addSubFold(fold: Fold): any; - /** - * @param {IRange} range - */ - restoreRange(range: IRange): void; - collapseChildren?: number; - } - export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; - export type Range = import("ace-code/src/range").Range; - export type Point = import("ace-code").Ace.Point; - export type IRange = import("ace-code").Ace.IRange; - import RangeList_1 = require("ace-code/src/range_list"); - import RangeList = RangeList_1.RangeList; - export interface Fold { - collapseChildren?: number; - } -} -declare module "ace-code/src/edit_session/fold_line" { - export type Fold = import("ace-code/src/edit_session/fold").Fold; - export class FoldLine { - /** - * If an array is passed in, the folds are expected to be sorted already. - * @param {FoldLine[]} foldData - * @param {Fold[]|Fold} folds - */ - constructor(foldData: FoldLine[], folds: Fold[] | Fold); - foldData: FoldLine[]; - /**@type {Fold[]} */ - folds: Fold[]; - range: Range; - start: import("ace-code").Ace.Point; - end: import("ace-code").Ace.Point; - /** - * Note: This doesn't update wrapData! - * @param {number} shift - */ - shiftRow(shift: number): void; - /** - * @param {Fold} fold - */ - addFold(fold: Fold): void; - /** - * @param {number} row - */ - containsRow(row: number): boolean; - /** - * @param {Function} callback - * @param {number} endRow - * @param {number} endColumn - */ - walk(callback: Function, endRow: number, endColumn: number): void; - /** - * @param {number} row - * @param {number} column - * @return {{ fold: Fold, kind: string } | null} - */ - getNextFoldTo(row: number, column: number): { - fold: Fold; - kind: string; - } | null; - /** - * @param {number} row - * @param {number} column - * @param {number} len - */ - addRemoveChars(row: number, column: number, len: number): void; - /** - * @param {number} row - * @param {number} column - * @return {FoldLine | null} - */ - split(row: number, column: number): FoldLine | null; - /** - * @param {FoldLine} foldLineNext - */ - merge(foldLineNext: FoldLine): void; - toString(): string; - /** - * @param {number} idx - * @return {import("ace-code").Ace.Point} - */ - idxToPosition(idx: number): import("ace-code").Ace.Point; - } - import Range_9 = require("ace-code/src/range"); - import Range = Range_9.Range; -} -declare module "ace-code/src/lib/bidiutil" { - export const ON_R: 3; - export const AN: 4; - export const R_H: 5; - export const B: 6; - export const RLE: 7; - export const DOT: "·"; - export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; - export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; - export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; - export var L: number; - export var R: number; - export var EN: number; -} -declare module "ace-code/src/bidihandler" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - /** - * This object is used to ensure Bi-Directional support (for languages with text flowing from right to left, like Arabic or Hebrew) - * including correct caret positioning, text selection mouse and keyboard arrows functioning - **/ - export class BidiHandler { - /** - * Creates a new `BidiHandler` object - * @param {EditSession} session The session to use - **/ - constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; - bidiMap: {}; - currentRow: any; - bidiUtil: typeof bidiUtil; - charWidths: any[]; - EOL: string; - showInvisibles: boolean; - isRtlDir: boolean; - line: string; - wrapIndent: number; - EOF: string; - RLE: string; - contentWidth: number; - fontMetrics: any; - rtlLineOffset: number; - wrapOffset: number; - isMoveLeftOperation: boolean; - seenBidi: boolean; - /** - * Returns 'true' if row contains Bidi characters, in such case - * creates Bidi map to be used in operations related to selection - * (keyboard arrays, mouse click, select) - * @param {Number} screenRow the screen row to be checked - * @param {Number} [docRow] the document row to be checked [optional] - * @param {Number} [splitIndex] the wrapped screen line index [ optional] - **/ - isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; - onChange(delta: any): void; - getDocumentRow(): number; - getSplitIndex(): number; - updateRowLine(docRow: any, splitIndex: any): void; - updateBidiMap(): void; - /** - * Resets stored info related to current screen row - **/ - markAsDirty(): void; - /** - * Updates array of character widths - * @param {Object} fontMetrics metrics - * - **/ - updateCharacterWidths(fontMetrics: any): void; - characterWidth: any; - setShowInvisibles(showInvisibles: any): void; - setEolChar(eolChar: any): void; - setContentWidth(width: any): void; - isRtlLine(row: any): boolean; - setRtlDirection(editor: any, isRtlDir: any): void; - /** - * Returns offset of character at position defined by column. - * @param {Number} col the screen column position - * - * @return {Number} horizontal pixel offset of given screen column - **/ - getPosLeft(col: number): number; - /** - * Returns 'selections' - array of objects defining set of selection rectangles - * @param {Number} startCol the start column position - * @param {Number} endCol the end column position - * - * @return {Object[]} Each object contains 'left' and 'width' values defining selection rectangle. - **/ - getSelections(startCol: number, endCol: number): any[]; - /** - * Converts character coordinates on the screen to respective document column number - * @param {Number} posX character horizontal offset - * - * @return {Number} screen column number corresponding to given pixel offset - **/ - offsetToCol(posX: number): number; - } - import bidiUtil = require("ace-code/src/lib/bidiutil"); -} -declare module "ace-code/src/background_tokenizer" { - const BackgroundTokenizer_base: undefined; - /** - * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. - * - * If a certain row is changed, everything below that row is re-tokenized. - **/ - export class BackgroundTokenizer { - /** - * Creates a new `BackgroundTokenizer` object. - * @param {Tokenizer} tokenizer The tokenizer to use - * @param {EditSession} [session] The editor session to associate with - **/ - constructor(tokenizer: Tokenizer, session?: EditSession); - /**@type {false|number}*/ - running: false | number; - lines: any[]; - states: any[]; - currentLine: number; - tokenizer: import("ace-code/src/tokenizer").Tokenizer; - /** - * Sets a new tokenizer for this object. - * @param {Tokenizer} tokenizer The new tokenizer to use - **/ - setTokenizer(tokenizer: Tokenizer): void; - /** - * Sets a new document to associate with this object. - * @param {Document} doc The new document to associate with - **/ - setDocument(doc: Document): void; - doc: import("ace-code/src/document").Document; - /** - * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. - * @param {Number} firstRow The starting row region - * @param {Number} lastRow The final row region - **/ - fireUpdateEvent(firstRow: number, lastRow: number): void; - /** - * Starts tokenizing at the row indicated. - * @param {Number} startRow The row to start at - **/ - start(startRow: number): void; - /** - * Sets pretty long delay to prevent the tokenizer from interfering with the user - */ - scheduleStart(): void; - /** - * Stops tokenizing. - **/ - stop(): void; - /** - * Gives list of [[Token]]'s of the row. (tokens are cached) - * @param {Number} row The row to get tokens at - * @returns {import("ace-code").Ace.Token[]} - **/ - getTokens(row: number): import("ace-code").Ace.Token[]; - /** - * Returns the state of tokenization at the end of a row. - * @param {Number} row The row to get state at - * @returns {string} - **/ - getState(row: number): string; - cleanup(): void; - } - export type Document = import("ace-code/src/document").Document; - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; - } - export interface BackgroundTokenizer extends Ace.EventEmitter { - } -} -declare module "ace-code/src/edit_session/folding" { - export type IFolding = import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding; - export type Delta = import("ace-code").Ace.Delta; - /** - * @typedef {import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding} IFolding - * @typedef {import("ace-code").Ace.Delta } Delta - */ - /** - * @this {IFolding} - * @type {IFolding} - */ - export function Folding(this: IFolding): void; - export class Folding { - /** - * Looks up a fold at a given row/column. Possible values for side: - * -1: ignore a fold if fold.start = row/column - * +1: ignore a fold if fold.end = row/column - * @param {number} row - * @param {number} column - * @param {number} [side] - * @return {Fold} - **/ - getFoldAt: (row: number, column: number, side?: number) => Fold; - /** - * Returns all folds in the given range. Note, that this will return folds - * @param {Range| Delta} range - * @returns {Fold[]} - **/ - getFoldsInRange: (range: import("ace-code").Ace.Delta | Range) => Fold[]; - /** - * - * @param {Range[]|Range}ranges - * @returns {Fold[]} - */ - getFoldsInRangeList: (ranges: Range | Range[]) => Fold[]; - /** - * Returns all folds in the document - * @returns {Fold[]} - */ - getAllFolds: () => Fold[]; - /** - * Returns the string between folds at the given position. - * E.g. - * foob|arwolrd -> "bar" - * foobarwol|rd -> "world" - * foobarwolrd -> - * - * where | means the position of row/column - * - * The trim option determs if the return string should be trimed according - * to the "side" passed with the trim value: - * - * E.g. - * foob|arwolrd -trim=-1> "b" - * foobarwol|rd -trim=+1> "rld" - * fo|obarwolrd -trim=00> "foo" - * @param {number} row - * @param {number} column - * @param {number} [trim] - * @param {FoldLine} [foldLine] - * @returns {string | null} - */ - getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: FoldLine) => string; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldLine] - * @returns {null|FoldLine} - */ - getFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; - /** - * Returns the fold which starts after or contains docRow - * @param {number} docRow - * @param {FoldLine} [startFoldLine] - * @returns {null|FoldLine} - */ - getNextFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; - /** - * - * @param {number} first - * @param {number} last - * @return {number} - */ - getFoldedRowCount: (first: number, last: number) => number; - /** - * Adds a new fold. - * - * @param {Fold|string} placeholder - * @param {Range} [range] - * @returns {Fold} - * The new created Fold object or an existing fold object in case the - * passed in range fits an existing fold exactly. - * @this {IFolding} - */ - addFold: (placeholder: string | Fold, range?: Range) => Fold; - /** - * @param {Fold[]} folds - */ - addFolds: (folds: Fold[]) => void; - /** - * - * @param {Fold} fold - */ - removeFold: (fold: Fold) => void; - /** - * - * @param {Fold[]} folds - */ - removeFolds: (folds: Fold[]) => void; - /** - * @param {Fold} fold - */ - expandFold: (fold: Fold) => void; - /** - * @param {Fold[]}folds - */ - expandFolds: (folds: Fold[]) => void; - /** - * - * @param {number|null|import("ace-code").Ace.Point|Range|Range[]} [location] - * @param {boolean} [expandInner] - * @return {Fold[]| undefined} - */ - unfold: (location?: number | import("ace-code").Ace.Point | Range | Range[], expandInner?: boolean) => Fold[]; - /** - * Checks if a given documentRow is folded. This is true if there are some - * folded parts such that some parts of the line is still visible. - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @returns {boolean} - **/ - isRowFolded: (docRow: number, startFoldRow?: FoldLine) => boolean; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @return {number} - */ - getRowFoldEnd: (docRow: number, startFoldRow?: FoldLine) => number; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @returns {number} - */ - getRowFoldStart: (docRow: number, startFoldRow?: FoldLine) => number; - /** - * - * @param {FoldLine} foldLine - * @param {number | null} [endRow] - * @param {number | null} [endColumn] - * @param {number | null} [startRow] - * @param {number | null} [startColumn] - * @return {string} - */ - getFoldDisplayLine: (foldLine: FoldLine, endRow?: number, endColumn?: number, startRow?: number, startColumn?: number) => string; - /** - * - * @param {number} row - * @param {number | null} endColumn - * @param {number | null} startRow - * @param {number | null} startColumn - * @return {string} - */ - getDisplayLine: (row: number, endColumn: number, startRow: number, startColumn: number) => string; - /** - * @param {boolean} [tryToUnfold] - */ - toggleFold: (tryToUnfold?: boolean) => void; - /** - * - * @param {number} row - * @param {number} column - * @param {number} [dir] - * @return {Range | undefined} - */ - getCommentFoldRange: (row: number, column: number, dir?: number) => Range; - /** - * - * @param {number | null} [startRow] - * @param {number | null} [endRow] - * @param {number | null} [depth] - * @param {Function} [test] - */ - foldAll: (startRow?: number, endRow?: number, depth?: number, test?: Function) => void; - /** - * - * @param {number} level - */ - foldToLevel: (level: number) => void; - /** - * - */ - foldAllComments: () => void; - /** - * @param {string} style - */ - setFoldStyle: (style: string) => void; - /** - * @param {number} row - * @param {boolean} [ignoreCurrent] - * @return {{range?: Range, firstRange?: Range}} - */ - getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { - range?: Range; - firstRange?: Range; - }; - /** - * - * @param {number} row - * @param {any} e - */ - onFoldWidgetClick: (row: number, e: any) => void; - /** - * - * @param {boolean} [toggleParent] - */ - toggleFoldWidget: (toggleParent?: boolean) => void; - /** - * @param {Delta} delta - */ - updateFoldWidgets: (delta: import("ace-code").Ace.Delta) => void; - /** - * @param e - */ - tokenizerUpdateFoldWidgets: (e: any) => void; - } - import Fold_1 = require("ace-code/src/edit_session/fold"); - import Fold = Fold_1.Fold; - import Range_10 = require("ace-code/src/range"); - import Range = Range_10.Range; - import FoldLine_1 = require("ace-code/src/edit_session/fold_line"); - import FoldLine = FoldLine_1.FoldLine; -} -declare module "ace-code/src/edit_session/bracket_match" { - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Point = import("ace-code/src/edit_session").Point; - export function BracketMatch(): void; - export class BracketMatch { - /** - * - * @param {Point} position - * @param {string} [chr] - * @this {EditSession} - */ - findMatchingBracket: (this: import("ace-code/src/edit_session").EditSession, position: Point, chr?: string) => import("ace-code").Ace.Point; - /** - * @param {Point} pos - * @return {null|Range} - * @this {EditSession} - */ - getBracketRange: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => null | Range; - /** - * Returns: - * * null if there is no any bracket at `pos`; - * * two Ranges if there is opening and closing brackets; - * * one Range if there is only one bracket - * - * @param {Point} pos - * @param {boolean} [isBackwards] - * @returns {null|Range[]} - * @this {EditSession} - */ - getMatchingBracketRanges: (this: import("ace-code/src/edit_session").EditSession, pos: Point, isBackwards?: boolean) => null | Range[]; - /** - * Returns [[Range]]'s for matching tags and tag names, if there are any - * @param {Point} pos - * @returns {{closeTag: Range, closeTagName: Range, openTag: Range, openTagName: Range} | undefined} - * @this {EditSession} - */ - getMatchingTags: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => { - closeTag: Range; - closeTagName: Range; - openTag: Range; - openTagName: Range; - } | undefined; - } - import Range_11 = require("ace-code/src/range"); - import Range = Range_11.Range; -} -declare module "ace-code/src/edit_session" { - const EditSession_base: undefined; - const EditSession_base_1: undefined; - const EditSession_base_2: undefined; - const EditSession_base_3: undefined; - /** - * @typedef TextMode - * @type {SyntaxMode} - */ - /** - * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. - * - * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. - **/ - export class EditSession { - /** - * Returns a new instance of EditSession with state from JSON. - * @method fromJSON - * @param {string|object} session The EditSession state. - * @returns {EditSession} - */ - static fromJSON(session: string | object): EditSession; - /** - * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. - * @param {Document | String} [text] [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} - * @param {SyntaxMode} [mode] [The initial language mode to use for the document]{: #modeParam} - **/ - constructor(text?: Document | string, mode?: SyntaxMode); - /**@type {Document}*/ doc: Document; - id: string; - bgTokenizer: BackgroundTokenizer; - selection: Selection; - destroyed: boolean; - /** - * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. - * - * @param {Document} doc The new `Document` to use - * - **/ - setDocument(doc: Document): void; - /** - * Returns the `Document` associated with this session. - * @return {Document} - **/ - getDocument(): Document; - resetCaches(): void; - onChangeFold(e: any): void; - /** - * - * @param {Delta} delta - */ - onChange(delta: Delta): void; - mergeUndoDeltas: boolean; - /** - * Sets the session text. - * @param {String} text The new text to place - **/ - setValue(text: string): void; - /** - * Returns the current edit session. - * @method toJSON - * @returns {Object} - */ - toJSON(): any; - /** - * Returns selection object. - * @returns {Selection} - **/ - getSelection(): Selection; - /** - * {:BackgroundTokenizer.getState} - * @param {Number} row The row to start at - * @returns {string} - * @related BackgroundTokenizer.getState - **/ - getState(row: number): string; - /** - * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. - * @param {Number} row The row to start at - * @returns {import("ace-code").Ace.Token[]} - **/ - getTokens(row: number): import("ace-code").Ace.Token[]; - /** - * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. - * @param {Number} row The row number to retrieve from - * @param {Number} column The column number to retrieve from - * @returns {import("ace-code").Ace.Token} - * - **/ - getTokenAt(row: number, column: number): import("ace-code").Ace.Token; - /** - * Sets the undo manager. - * @param {UndoManager} undoManager The new undo manager - **/ - setUndoManager(undoManager: UndoManager): void; - /** - * starts a new group in undo history - **/ - markUndoGroup(): void; - /** - * Returns the current undo manager. - * @returns {UndoManager} - **/ - getUndoManager(): UndoManager; - /** - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - * @returns {String} - **/ - getTabString(): string; - /** - * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). - * @param {Boolean} val Value indicating whether or not to use soft tabs - **/ - setUseSoftTabs(val: boolean): void; - /** - * Returns `true` if soft tabs are being used, `false` otherwise. - * @returns {Boolean} - **/ - getUseSoftTabs(): boolean; - /** - * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - * @param {Number} tabSize The new tab size - **/ - setTabSize(tabSize: number): void; - /** - * Returns the current tab size. - * @return {number} - **/ - getTabSize(): number; - /** - * Returns `true` if the character at the position is a soft tab. - * @param {Point} position The position to check - **/ - isTabStop(position: Point): boolean; - /** - * Set whether keyboard navigation of soft tabs moves the cursor within the soft tab, rather than over - * @param {Boolean} navigateWithinSoftTabs Value indicating whether or not to navigate within soft tabs - **/ - setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; - /** - * Returns `true` if keyboard navigation moves the cursor within soft tabs, `false` if it moves the cursor over soft tabs. - * @returns {Boolean} - **/ - getNavigateWithinSoftTabs(): boolean; - /** - * Pass in `true` to enable overwrites in your session, or `false` to disable. - * - * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. - * - * @param {Boolean} overwrite Defines whether or not to set overwrites - * - **/ - setOverwrite(overwrite: boolean): void; - /** - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ - getOverwrite(): boolean; - /** - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ - toggleOverwrite(): void; - /** - * Adds `className` to the `row`, to be used for CSS stylings and whatnot. - * @param {Number} row The row number - * @param {String} className The class to add - **/ - addGutterDecoration(row: number, className: string): void; - /** - * Removes `className` from the `row`. - * @param {Number} row The row number - * @param {String} className The class to add - **/ - removeGutterDecoration(row: number, className: string): void; - /** - * Returns an array of strings, indicating the breakpoint class (if any) applied to each row. - * @returns {String[]} - **/ - getBreakpoints(): string[]; - /** - * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. - * @param {number[]} rows An array of row indices - **/ - setBreakpoints(rows: number[]): void; - /** - * Removes all breakpoints on the rows. This function also emits the `'changeBreakpoint'` event. - **/ - clearBreakpoints(): void; - /** - * Sets a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. - * @param {Number} row A row index - * @param {String} className Class of the breakpoint - **/ - setBreakpoint(row: number, className: string): void; - /** - * Removes a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. - * @param {Number} row A row index - **/ - clearBreakpoint(row: number): void; - /** - * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. - * @param {Range} range Define the range of the marker - * @param {String} clazz Set the CSS class for the marker - * @param {import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line"} [type] Identify the renderer type of the marker. If string provided, corresponding built-in renderer is used. Supported string types are "fullLine", "screenLine", "text" or "line". If a Function is provided, that Function is used as renderer. - * @param {Boolean} [inFront] Set to `true` to establish a front marker - * - * @return {Number} The new marker id - **/ - addMarker(range: Range, clazz: string, type?: import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line", inFront?: boolean): number; - /** - * Adds a dynamic marker to the session. - * @param {import("ace-code").Ace.MarkerLike} marker object with update method - * @param {Boolean} [inFront] Set to `true` to establish a front marker - * - * @return {import("ace-code").Ace.MarkerLike} The added marker - **/ - addDynamicMarker(marker: import("ace-code").Ace.MarkerLike, inFront?: boolean): import("ace-code").Ace.MarkerLike; - /** - * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * @param {Number} markerId A number representing a marker - **/ - removeMarker(markerId: number): void; - /** - * Returns an object containing all of the markers, either front or back. - * @param {Boolean} [inFront] If `true`, indicates you only want front markers; `false` indicates only back markers - * - * @returns {{[id: number]: import("ace-code").Ace.MarkerLike}} - **/ - getMarkers(inFront?: boolean): { - [id: number]: import("ace-code").Ace.MarkerLike; - }; - /** - * @param {RegExp} re - */ - highlight(re: RegExp): void; - /** - * experimental - * @param {number} startRow - * @param {number} endRow - * @param {string} clazz - * @param {boolean} [inFront] - * @return {Range} - */ - highlightLines(startRow: number, endRow: number, clazz: string, inFront?: boolean): Range; - /** - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - * @param {import("ace-code").Ace.Annotation[]} annotations A list of annotations - **/ - setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; - /** - * Returns the annotations for the `EditSession`. - * @returns {import("ace-code").Ace.Annotation[]} - **/ - getAnnotations(): import("ace-code").Ace.Annotation[]; - /** - * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. - **/ - clearAnnotations(): void; - /** - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. - * @param {Number} row The row to start at - * @param {Number} column The column to start at - * - * @returns {Range} - **/ - getWordRange(row: number, column: number): Range; - /** - * Gets the range of a word, including its right whitespace. - * @param {Number} row The row number to start from - * @param {Number} column The column number to start from - * - * @return {Range} - **/ - getAWordRange(row: number, column: number): Range; - /** - * {:Document.setNewLineMode.desc} - * @param {import("ace-code").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} - * - * - * @related Document.setNewLineMode - **/ - setNewLineMode(newLineMode: import("ace-code").Ace.NewLineMode): void; - /** - * - * Returns the current new line mode. - * @returns {import("ace-code").Ace.NewLineMode} - * @related Document.getNewLineMode - **/ - getNewLineMode(): import("ace-code").Ace.NewLineMode; - /** - * Identifies if you want to use a worker for the `EditSession`. - * @param {Boolean} useWorker Set to `true` to use a worker - **/ - setUseWorker(useWorker: boolean): void; - /** - * Returns `true` if workers are being used. - **/ - getUseWorker(): boolean; - /** - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ - onReloadTokenizer(e: any): void; - /** - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * @param {SyntaxMode | string} mode Set a new text mode - * @param {() => void} [cb] optional callback - **/ - setMode(mode: SyntaxMode | string, cb?: () => void): void; - /**@type {RegExp}*/ - tokenRe: RegExp; - /**@type {RegExp}*/ - nonTokenRe: RegExp; - /** - * Returns the current text mode. - * @returns {TextMode} The current text mode - **/ - getMode(): TextMode; - /** - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - * @param {Number} scrollTop The new scroll top value - **/ - setScrollTop(scrollTop: number): void; - /** - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - * @returns {Number} - **/ - getScrollTop(): number; - /** - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - * @param {number} scrollLeft - */ - setScrollLeft(scrollLeft: number): void; - /** - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - * @returns {Number} - **/ - getScrollLeft(): number; - /** - * Returns the width of the screen. - * @returns {Number} - **/ - getScreenWidth(): number; - /** - * @return {number} - */ - getLineWidgetMaxWidth(): number; - lineWidgetWidth: number; - screenWidth: any; - /** - * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row to retrieve from - * @returns {String} - **/ - getLine(row: number): string; - /** - * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve - * - * @returns {String[]} - * - **/ - getLines(firstRow: number, lastRow: number): string[]; - /** - * Returns the number of rows in the document. - * @returns {Number} - **/ - getLength(): number; - /** - * {:Document.getTextRange.desc} - * @param {IRange} [range] The range to work with - * - * @returns {String} - **/ - getTextRange(range?: IRange): string; - /** - * Inserts a block of `text` and the indicated `position`. - * @param {Point} position The position {row, column} to start inserting at - * @param {String} text A chunk of text to insert - * @returns {Point} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - **/ - insert(position: Point, text: string): Point; - /** - * Removes the `range` from the document. - * @param {IRange} range A specified Range to remove - * @returns {Point} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - **/ - remove(range: IRange): Point; - /** - * Removes a range of full lines. This method also triggers the `'change'` event. - * @param {Number} firstRow The first row to be removed - * @param {Number} lastRow The last row to be removed - * @returns {String[]} Returns all the removed lines. - * - * @related Document.removeFullLines - * - **/ - removeFullLines(firstRow: number, lastRow: number): string[]; - /** - * Reverts previous changes to your document. - * @param {Delta[]} deltas An array of previous changes - * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} - **/ - undoChanges(deltas: Delta[], dontSelect?: boolean): void; - /** - * Re-implements a previously undone change to your document. - * @param {Delta[]} deltas An array of previous changes - * @param {Boolean} [dontSelect] {:dontSelect} - **/ - redoChanges(deltas: Delta[], dontSelect?: boolean): void; - /** - * Enables or disables highlighting of the range where an undo occurred. - * @param {Boolean} enable If `true`, selects the range of the reinserted change - * - **/ - setUndoSelect(enable: boolean): void; - /** - * Replaces a range in the document with the new `text`. - * - * @param {IRange} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Point} An object containing the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If the text and range are empty, this function returns an object containing the current `range.start` value. - * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. - * - * @related Document.replace - **/ - replace(range: IRange, text: string): Point; - /** - * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json - * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} fromRange The range of text you want moved within the document - * @param {Point} toPosition The location (row and column) where you want to move the text to - * @param {boolean} [copy] - * @returns {Range} The new range where the text was moved to. - **/ - moveText(fromRange: Range, toPosition: Point, copy?: boolean): Range; - /** - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. - * - * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. - * @param {Number} startRow Starting row - * @param {Number} endRow Ending row - * @param {String} indentString The indent token - **/ - indentRows(startRow: number, endRow: number, indentString: string): void; - /** - * Outdents all the rows defined by the `start` and `end` properties of `range`. - * @param {Range} range A range of rows - **/ - outdentRows(range: Range): void; - /** - * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move up - * @param {Number} lastRow The final row to move up - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. - **/ - moveLinesUp(firstRow: number, lastRow: number): number; - /** - * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move down - * @param {Number} lastRow The final row to move down - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. - **/ - moveLinesDown(firstRow: number, lastRow: number): number; - /** - * Duplicates all the text between `firstRow` and `lastRow`. - * @param {Number} firstRow The starting row to duplicate - * @param {Number} lastRow The final row to duplicate - * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. - **/ - duplicateLines(firstRow: number, lastRow: number): number; - /** - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - * @param {Boolean} useWrapMode Enable (or disable) wrap mode - **/ - setUseWrapMode(useWrapMode: boolean): void; - /** - * Returns `true` if wrap mode is being used; `false` otherwise. - * @returns {Boolean} - **/ - getUseWrapMode(): boolean; - /** - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - * @param {Number} min The minimum wrap value (the left side wrap) - * @param {Number} max The maximum wrap value (the right side wrap) - **/ - setWrapLimitRange(min: number, max: number): void; - /** - * This should generally only be called by the renderer when a resize is detected. - * @param {Number} desiredLimit The new wrap limit - * @param [$printMargin] - * @returns {Boolean} - **/ - adjustWrapLimit(desiredLimit: number, $printMargin?: any): boolean; - /** - * Returns the value of wrap limit. - * @returns {Number} The wrap limit. - **/ - getWrapLimit(): number; - /** - * Sets the line length for soft wrap in the editor. Lines will break - * at a minimum of the given length minus 20 chars and at a maximum - * of the given number of chars. - * @param {number} limit The maximum line length in chars, for soft wrapping lines. - */ - setWrapLimit(limit: number): void; - /** - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: - * - * { min: wrapLimitRange_min, max: wrapLimitRange_max } - * - * @returns {{ min: number, max: number }} - **/ - getWrapLimitRange(): { - min: number; - max: number; - }; - /** - * Returns number of screenrows in a wrapped line. - * @param {Number} row The row number to check - * @returns {Number} - **/ - getRowLength(row: number): number; - /** - * @param {Number} row - * @returns {Number} - **/ - getRowLineCount(row: number): number; - /** - * @param {Number} screenRow - * @returns {Number} - **/ - getRowWrapIndent(screenRow: number): number; - /** - * Returns the position (on screen) for the last character in the provided screen row. - * @param {Number} screenRow The screen row to check - * @returns {Number} - * - * @related EditSession.documentToScreenColumn - **/ - getScreenLastRowColumn(screenRow: number): number; - /** - * For the given document row and column, this returns the column position of the last screen row. - * @param {Number} docRow - * @param {Number} docColumn - * @returns {number} - **/ - getDocumentLastRowColumn(docRow: number, docColumn: number): number; - /** - * For the given document row and column, this returns the document position of the last row. - * @param {Number} docRow - * @param {Number} docColumn - * @returns {Point} - **/ - getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; - /** - * For the given row, this returns the split data. - * @param {number} row - * @returns {String | undefined} - */ - getRowSplitData(row: number): string | undefined; - /** - * The distance to the next tab stop at the specified screen column. - * @param {Number} screenColumn The screen column to check - * - * @returns {Number} - **/ - getScreenTabSize(screenColumn: number): number; - /** - * @param {number} screenRow - * @param {number} screenColumn - * @returns {number} - */ - screenToDocumentRow(screenRow: number, screenColumn: number): number; - /** - * @param {number} screenRow - * @param {number} screenColumn - * @returns {number} - */ - screenToDocumentColumn(screenRow: number, screenColumn: number): number; - /** - * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * @param {Number} screenRow The screen row to check - * @param {Number} screenColumn The screen column to check - * @param {Number} [offsetX] screen character x-offset [optional] - * - * @returns {Point} The object returned has two properties: `row` and `column`. - * - * @related EditSession.documentToScreenPosition - **/ - screenToDocumentPosition(screenRow: number, screenColumn: number, offsetX?: number): Point; - /** - * Converts document coordinates to screen coordinates. {:conversionConsiderations} - * @param {Number|Point} docRow The document row to check - * @param {Number|undefined} [docColumn] The document column to check - * @returns {Point} The object returned by this method has two properties: `row` and `column`. - * - * @related EditSession.screenToDocumentPosition - **/ - documentToScreenPosition(docRow: number | Point, docColumn?: number | undefined): Point; - /** - * For the given document row and column, returns the screen column. - * @param {Number|Point} row - * @param {Number} [docColumn] - * @returns {Number} - **/ - documentToScreenColumn(row: number | Point, docColumn?: number): number; - /** - * For the given document row and column, returns the screen row. - * @param {Number|Point} docRow - * @param {Number} [docColumn] - * @returns {number} - **/ - documentToScreenRow(docRow: number | Point, docColumn?: number): number; - /** - * Returns the length of the screen. - * @returns {Number} - **/ - getScreenLength(): number; - /** - * @returns {string} the last character preceding the cursor in the editor - */ - getPrecedingCharacter(): string; - destroy(): void; - /** - * Returns the current [[Document `Document`]] as a string. - * @method getValue - * @returns {String} - * @alias EditSession.toString - **/ - getValue: () => string; - /** - * - * @type {null | import("ace-code").Ace.LineWidget[]} - */ - lineWidgets: null | import("ace-code").Ace.LineWidget[]; - isFullWidth: typeof isFullWidth; - widgetManager?: any; - curOp?: { - [key: string]: any; - command: {}; - args: string; - scrollTop: number; - }; - lineWidgetsWidth?: number; - getSelectionMarkers(): any[]; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; - } - export namespace EditSession { - export { $uid }; - } - export type FontMetrics = import("ace-code/src/layer/font_metrics").FontMetrics; - export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; - export type Point = import("ace-code").Ace.Point; - export type Delta = import("ace-code").Ace.Delta; - export type IRange = import("ace-code").Ace.IRange; - export type SyntaxMode = import("ace-code").Ace.SyntaxMode; - export type TextMode = SyntaxMode; - import Document_1 = require("ace-code/src/document"); - import Document = Document_1.Document; - import BackgroundTokenizer_1 = require("ace-code/src/background_tokenizer"); - import BackgroundTokenizer = BackgroundTokenizer_1.BackgroundTokenizer; - import Selection_1 = require("ace-code/src/selection"); - import Selection = Selection_1.Selection; - import BidiHandler_1 = require("ace-code/src/bidihandler"); - import BidiHandler = BidiHandler_1.BidiHandler; - import UndoManager_1 = require("ace-code/src/undomanager"); - import UndoManager = UndoManager_1.UndoManager; - import Range_12 = require("ace-code/src/range"); - import Range = Range_12.Range; - function isFullWidth(c: any): boolean; - var $uid: number; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type EditSessionEvents = import("ace-code").Ace.EditSessionEvents; - type OptionsProvider = import("ace-code").Ace.OptionsProvider; - type EditSessionOptions = import("ace-code").Ace.EditSessionOptions; - type Folding = import("ace-code").Ace.Folding; - type BracketMatch = import("ace-code").Ace.BracketMatch; - type Document = import("ace-code").Ace.Document; - type Point = import("ace-code").Ace.Point; - type Occur = import("ace-code").Ace.Occur; - } - export interface EditSession extends Ace. - EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace. - BracketMatch { - doc: Ace.Document; - widgetManager?: any; - curOp?: { - command: {}; - args: string; - scrollTop: number; - [key: string]: any; - }; - lineWidgetsWidth?: number; - getSelectionMarkers(): any[]; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; - } -} -declare module "ace-code/src/range" { - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code").Ace.IRange} IRange - * @typedef {import("ace-code").Ace.Point} Point - */ - /** - * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogous to a range, as ranges contain a starting row and starting column, and an ending row, and ending column. - **/ - export class Range { - /** - * Creates a new `Range` object with the given starting and ending rows and columns. - * @param {Number} [startRow] The starting row - * @param {Number} [startColumn] The starting column - * @param {Number} [endRow] The ending row - * @param {Number} [endColumn] The ending column - * @constructor - **/ - constructor(startRow?: number, startColumn?: number, endRow?: number, endColumn?: number); - /**@type {Point}*/ - start: Point; - /**@type {Point}*/ - end: Point; - /** - * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. - * @param {IRange} range A range to check against - * @return {Boolean} - **/ - isEqual(range: IRange): boolean; - /** - * Returns a string containing the range's row and column information, given like this: - * ``` - * [start.row/start.column] -> [end.row/end.column] - * ``` - * @return {String} - **/ - toString(): string; - /** - * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if: - * ```javascript - * this.start.row <= row <= this.end.row && - * this.start.column <= column <= this.end.column - * ``` - * @param {Number} row A row to check for - * @param {Number} column A column to check for - * @returns {Boolean} - * @related [[Range.compare]] - **/ - contains(row: number, column: number): boolean; - /** - * Compares `this` range (A) with another range (B). - * @param {IRange} range A range to compare with - * @related [[Range.compare]] - * @returns {Number} This method returns one of the following numbers: - * * `-2`: (B) is in front of (A), and doesn't intersect with (A) - * * `-1`: (B) begins before (A) but ends inside of (A) - * * `0`: (B) is completely inside of (A) - * * `+1`: (B) begins inside of (A) but ends outside of (A) - * * `+2`: (B) is after (A) and doesn't intersect with (A) - * * `42`: FTW state: (B) ends in (A) but starts outside of (A) - **/ - compareRange(range: IRange): number; - /** - * Compares the row and column of `p` with the starting and ending [[Point]]'s of the calling range (by calling [[Range.compare]]). - * @param {Point} p A point to compare with - * @related [[Range.compare]] - * @returns {Number} - **/ - comparePoint(p: Point): number; - /** - * Checks the start and end [[Point]]'s of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range. - * @param {IRange} range A range to compare with - * @returns {Boolean} - * @related [[Range.comparePoint]] - **/ - containsRange(range: IRange): boolean; - /** - * Returns `true` if passed in `range` intersects with the one calling this method. - * @param {IRange} range A range to compare with - * @returns {Boolean} - **/ - intersects(range: IRange): boolean; - /** - * Returns `true` if the caller's ending row is the same as `row`, and if the caller's ending column is the same as `column`. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Boolean} - **/ - isEnd(row: number, column: number): boolean; - /** - * Returns `true` if the caller's starting row is the same as `row`, and if the caller's starting column is the same as `column`. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Boolean} - **/ - isStart(row: number, column: number): boolean; - /** - * Sets the starting row and column for the range. - * @param {Number|Point} row A row to set - * @param {Number} [column] A column to set - * - **/ - setStart(row: number | Point, column?: number): void; - /** - * Sets the starting row and column for the range. - * @param {Number|Point} row A row to set - * @param {Number} [column] A column to set - * - **/ - setEnd(row: number | Point, column?: number): void; - /** - * Returns `true` if the `row` and `column` are within the given range. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Boolean} - * @related [[Range.compare]] - **/ - inside(row: number, column: number): boolean; - /** - * Returns `true` if the `row` and `column` are within the given range's starting [[Point]]. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Boolean} - * @related [[Range.compare]] - **/ - insideStart(row: number, column: number): boolean; - /** - * Returns `true` if the `row` and `column` are within the given range's ending [[Point]]. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Boolean} - * @related [[Range.compare]] - * - **/ - insideEnd(row: number, column: number): boolean; - /** - * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Number} This method returns one of the following numbers: - * * `1` if `row` is greater than the calling range - * * `-1` if `row` is less then the calling range - * * `0` otherwise - * - * If the starting row of the calling range is equal to `row`, and: - * * `column` is greater than or equal to the calling range's starting column, this returns `0` - * * Otherwise, it returns -1 - * - * If the ending row of the calling range is equal to `row`, and: - * * `column` is less than or equal to the calling range's ending column, this returns `0` - * * Otherwise, it returns 1 - **/ - compare(row: number, column: number): number; - /** - * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Number} This method returns one of the following numbers: - * * `-1` if calling range's starting column and calling range's starting row are equal `row` and `column` - * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. - **/ - compareStart(row: number, column: number): number; - /** - * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Number} This method returns one of the following numbers: - * * `1` if calling range's ending column and calling range's ending row are equal `row` and `column`. - * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. - */ - compareEnd(row: number, column: number): number; - /** - * Compares the `row` and `column` with the start and end [[Point]]'s of the calling range. - * @param {Number} row A row to compare with - * @param {Number} column A column to compare with - * @returns {Number} This method returns one of the following numbers: - * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column` - * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column` - * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. - **/ - compareInside(row: number, column: number): number; - /** - * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object. - * @param {Number} firstRow The starting row - * @param {Number} lastRow The ending row - * @returns {Range} - **/ - clipRows(firstRow: number, lastRow: number): Range; - /** - * Changes the `row` and `column` for the calling range for both the starting and ending [[Point]]'s. - * @param {Number} row A new row to extend to - * @param {Number} column A new column to extend to - * @returns {Range} The original range with the new row - **/ - extend(row: number, column: number): Range; - /** - * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). - * @returns {Boolean} - **/ - isEmpty(): boolean; - /** - * Returns `true` if the range spans across multiple lines. - * @returns {Boolean} - **/ - isMultiLine(): boolean; - /** - * Returns a duplicate of the calling range. - * @returns {Range} - **/ - clone(): Range; - /** - * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. - * @returns {Range} - **/ - collapseRows(): Range; - /** - * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. - * @param {EditSession} session The `EditSession` to retrieve coordinates from - * @returns {Range} - **/ - toScreenRange(session: EditSession): Range; - /** - * Shift the calling range by `row` and `column` values. - * @param {Number} row - * @param {Number} column - * @experimental - */ - moveBy(row: number, column: number): void; - id?: number; - cursor?: import("ace-code").Ace.Point; - isBackwards?: boolean; - } - export namespace Range { - export { fromPoints, comparePoints }; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type IRange = import("ace-code").Ace.IRange; - export type Point = import("ace-code").Ace.Point; - /** - * Creates and returns a new `Range` based on the `start` [[Point]] and `end` [[Point]] of the given parameters. - * @param {Point} start A starting point to use - * @param {Point} end An ending point to use - * @returns {Range} - **/ - function fromPoints(start: Point, end: Point): Range; - /** - * Compares `p1` and `p2` [[Point]]'s, useful for sorting - * @param {Point} p1 - * @param {Point} p2 - * @returns {Number} - */ - function comparePoints(p1: Point, p2: Point): number; - export {}; - namespace Ace { - type Point = import("ace-code").Ace.Point; - } - export interface Range { - id?: number; - cursor?: Ace.Point; - isBackwards?: boolean; - } -} -declare module "ace-code/src/worker/worker_client" { - export var WorkerClient: any; -} -declare module "ace-code/src/placeholder" { - const PlaceHolder_base: undefined; - export class PlaceHolder { - /** - * @param {EditSession} session - * @param {Number} length - * @param {import("ace-code").Ace.Point} pos - * @param {any[]} others - * @param {String} mainClass - * @param {String} othersClass - **/ - constructor(session: EditSession, length: number, pos: import("ace-code").Ace.Point, others: any[], mainClass: string, othersClass: string); - length: number; - session: import("ace-code/src/edit_session").EditSession; - doc: import("ace-code/src/document").Document; - mainClass: string; - othersClass: string; - /** - * PlaceHolder.setup() - * - * TODO - * - **/ - setup(): void; - selectionBefore: Range | Range[]; - pos: import("ace-code/src/anchor").Anchor; - others: any[]; - /** - * PlaceHolder.showOtherMarkers() - * - * TODO - * - **/ - showOtherMarkers(): void; - othersActive: boolean; - /** - * PlaceHolder.hideOtherMarkers() - * - * Hides all over markers in the [[EditSession `EditSession`]] that are not the currently selected one. - * - **/ - hideOtherMarkers(): void; - /** - * PlaceHolder@onUpdate(e) - * - * Emitted when the place holder updates. - * @param {import("ace-code").Ace.Delta} delta - */ - onUpdate(delta: import("ace-code").Ace.Delta): void; - /** - * @param {import("ace-code").Ace.Delta} delta - */ - updateAnchors(delta: import("ace-code").Ace.Delta): void; - updateMarkers(): void; - /** - * PlaceHolder@onCursorChange(e) - * - * Emitted when the cursor changes. - * @param {any} [event] - */ - onCursorChange(event?: any): void; - /** - * PlaceHolder.detach() - * - * TODO - * - **/ - detach(): void; - /** - * PlaceHolder.cancel() - * - * TODO - * - **/ - cancel(): void; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - import Range_13 = require("ace-code/src/range"); - import Range = Range_13.Range; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; - } - export interface PlaceHolder extends Ace.EventEmitter { - } -} -declare module "ace-code/src/mouse/multi_select_handler" { - export function onMouseDown(e: any): any; -} -declare module "ace-code/src/commands/multi_select_commands" { - export const defaultCommands: import("ace-code").Ace.Command[]; - export const multiSelectCommands: import("ace-code").Ace.Command[]; - export const keyboardHandler: HashHandler; - import HashHandler_4 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_4.HashHandler; -} -declare module "ace-code/src/multi_select" { - export const commands: import("ace-code").Ace.Command[]; - export const onSessionChange: (e: any) => void; - export type Anchor = import("ace-code/src/anchor").Anchor; - export type Point = import("ace-code").Ace.Point; - export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; - /** - * @param {Editor} editor - */ - export function MultiSelect(editor: Editor): void; - import Editor_4 = require("ace-code/src/editor"); - import Editor = Editor_4.Editor; -} -declare module "ace-code/src/ext/error_marker" { - export function showErrorMarker(editor: import("ace-code/src/editor").Editor, dir: number): void; -} -declare module "ace-code" { - export namespace Ace { - type Anchor = import("ace-code/src/anchor").Anchor; - type Editor = import("ace-code/src/editor").Editor; - type EditSession = import("ace-code/src/edit_session").EditSession; - type Document = import("ace-code/src/document").Document; - type Fold = import("ace-code/src/edit_session/fold").Fold; - type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; - type Range = import("ace-code/src/range").Range; - type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; - type UndoManager = import("ace-code/src/undomanager").UndoManager; - type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; - type TokenIterator = import("ace-code/src/token_iterator").TokenIterator; - type Selection = import("ace-code/src/selection").Selection; - type Autocomplete = import("ace-code/src/autocomplete").Autocomplete; - type InlineAutocomplete = import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; - type CompletionProvider = import("ace-code/src/autocomplete").CompletionProvider; - type AcePopup = import("ace-code/src/autocomplete/popup").AcePopup; - type AceInline = import("ace-code/src/autocomplete/inline").AceInline; - type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; - type RangeList = import("ace-code/src/range_list").RangeList; - type FilteredList = import("ace-code/src/autocomplete").FilteredList; - type LineWidgets = import("ace-code/src/line_widgets").LineWidgets; - type SearchBox = import("ace-code/src/ext/searchbox").SearchBox; - type Occur = import("ace-code/src/occur").Occur; - type DefaultHandlers = import("ace-code/src/mouse/default_handlers").DefaultHandlers; - type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; - type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; - type AppConfig = import("ace-code/src/lib/app_config").AppConfig; - type AfterLoadCallback = (err: Error | null, module: unknown) => void; - type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; - export interface Config { - get(key: string): any; - set(key: string, value: any): void; - all(): { - [key: string]: any; - }; - moduleUrl(name: string, component?: string): string; - setModuleUrl(name: string, subst: string): string; - setLoader(cb: LoaderFunction): void; - setModuleLoader(name: string, onLoad: Function): void; - loadModule(moduleName: string | [ - string, - string - ], onLoad?: (module: any) => void): void; - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): void; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any): void; - nls(string: string, params?: { - [x: string]: any; - }): string; - } - interface Theme { - cssClass?: string; - cssText?: string; - padding?: number | string; - isDark?: boolean; - } - interface ScrollBar { - setVisible(visible: boolean): void; - [key: string]: any; - } - interface HScrollbar extends ScrollBar { - setWidth(width: number): void; - } - interface VScrollbar extends ScrollBar { - setHeight(width: number): void; - } - interface LayerConfig { + } + interface HScrollbar extends ScrollBar { + setWidth(width: number): void; + } + interface VScrollbar extends ScrollBar { + setHeight(width: number): void; + } + interface LayerConfig { width: number; padding: number; firstRow: number; @@ -7848,1497 +978,3 @@ declare module "ace-code" { export var version: "1.32.9"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } -declare module "ace-code/src/commands/occur_commands" { - export namespace occurStartCommand { - let name: string; - function exec(editor: any, options: any): void; - let readOnly: boolean; - } -} -declare module "ace-code/src/commands/incremental_search_commands" { - export const iSearchStartCommands: ({ - name: string; - bindKey: { - win: string; - mac: string; - }; - exec: (editor: any, options: any) => void; - readOnly: boolean; - } | { - name: string; - exec: (editor: any, jumpToNext: any) => void; - readOnly: boolean; - bindKey?: undefined; - })[]; - export const iSearchCommands: ({ - name: string; - bindKey: { - win: string; - mac: string; - }; - exec: (iSearch: any, options: any) => void; - } | { - name: string; - exec: (iSearch: any, string: any) => void; - bindKey?: undefined; - } | { - name: string; - bindKey: string; - exec: (iSearch: any) => void; - })[]; - export function IncrementalSearchKeyboardHandler(iSearch: any): void; - export class IncrementalSearchKeyboardHandler { - constructor(iSearch: any); - } -} -declare module "ace-code/src/incremental_search" { - /** - * Implements immediate searching while the user is typing. When incremental - * search is activated, keystrokes into the editor will be used for composing - * a search term. Immediately after every keystroke the search is updated: - * - so-far-matching characters are highlighted - * - the cursor is moved to the next match - * - **/ - export class IncrementalSearch extends Search { - /** - * @param {boolean} backwards - */ - activate(editor: any, backwards: boolean): void; - /** - * @param {boolean} [reset] - */ - deactivate(reset?: boolean): void; - /** - * @param {Editor} editor - */ - selectionFix(editor: Editor): void; - /** - * @param {RegExp} regexp - */ - highlight(regexp: RegExp): void; - /** - * @param {boolean} [reset] - */ - cancelSearch(reset?: boolean): Range; - /** - * @param {boolean} moveToNext - * @param {Function} needleUpdateFunc - */ - highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; - /** - * @param {string} s - */ - addString(s: string): false | Range; - /** - * @param {any} c - */ - removeChar(c: any): false | Range; - next(options: any): false | Range; - onMouseDown(evt: any): boolean; - /** - * @param {string} text - */ - onPaste(text: string): void; - convertNeedleToRegExp(): false | Range; - convertNeedleToString(): false | Range; - statusMessage(found: any): void; - message(msg: any): void; - } - import Search_3 = require("ace-code/src/search"); - import Search = Search_3.Search; - import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); - import Editor_6 = require("ace-code/src/editor"); - import Editor = Editor_6.Editor; - import Range_15 = require("ace-code/src/range"); - import Range = Range_15.Range; -} -declare module "ace-code/src/split" { - export type ISplit = import("ace-code").Ace.EventEmitter & { - [key: string]: any; - }; - /** - * @typedef {import("ace-code").Ace.EventEmitter & {[key: string]: any}} ISplit - */ - export var Split: any; -} -declare module "ace-code/src/tokenizer_dev" { - export class Tokenizer extends BaseTokenizer { - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} - **/ - getLineTokens(line: any, startState: any): any; - } - import BaseTokenizer_1 = require("ace-code/src/tokenizer"); - import BaseTokenizer = BaseTokenizer_1.Tokenizer; -} -declare module "ace-code/src/unicode" { - export const wordChars: any; -} -declare module "ace-code/src/ext/beautify" { - export const singletonTags: string[]; - export const blockTags: string[]; - export const formatOptions: { - lineBreaksAfterCommasInCurlyBlock?: boolean; - }; - export function beautify(session: import("ace-code/src/edit_session").EditSession): void; - export const commands: { - name: string; - description: string; - exec: (editor: any) => void; - bindKey: string; - }[]; -} -declare module "ace-code/src/ext/code_lens" { - export function setLenses(session: EditSession, lenses: any): number; - export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; - export function clear(session: EditSession): void; - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { - }; -} -declare module "ace-code/src/ext/emmet" { - export const commands: HashHandler; - export function runEmmetCommand(editor: Editor): number | boolean; - export function updateCommands(editor: Editor, enabled?: boolean): void; - export function isSupportedMode(mode: any): boolean; - export function isAvailable(editor: Editor, command: string): boolean; - export function load(cb: any): boolean; - export function setCore(e: any): void; - import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_5.HashHandler; - import Editor_7 = require("ace-code/src/editor"); - import Editor = Editor_7.Editor; - /** - * Implementation of {@link IEmmetEditor} interface for Ace - */ - export class AceEmmetEditor { - /** - * @param {Editor} editor - */ - setupContext(editor: Editor): void; - ace: Editor; - indentation: string; - /** - * Returns character indexes of selected text: object with start - * and end properties. If there's no selection, should return - * object with start and end properties referring - * to current caret position - * @return {Object} - * @example - * var selection = editor.getSelectionRange(); - * alert(selection.start + ', ' + selection.end); - */ - getSelectionRange(): any; - /** - * Creates selection from start to end character - * indexes. If end is ommited, this method should place caret - * and start index - * @param {Number} start - * @param {Number} [end] - * @example - * editor.createSelection(10, 40); - * - * //move caret to 15th character - * editor.createSelection(15); - */ - createSelection(start: number, end?: number): void; - /** - * Returns current line's start and end indexes as object with start - * and end properties - * @return {Object} - * @example - * var range = editor.getCurrentLineRange(); - * alert(range.start + ', ' + range.end); - */ - getCurrentLineRange(): any; - /** - * Returns current caret position - * @return {Number|null} - */ - getCaretPos(): number | null; - /** - * Set new caret position - * @param {Number} index Caret position - */ - setCaretPos(index: number): void; - /** - * Returns content of current line - * @return {String} - */ - getCurrentLine(): string; - /** - * Replace editor's content or it's part (from start to - * end index). If value contains - * caret_placeholder, the editor will put caret into - * this position. If you skip start and end - * arguments, the whole target's content will be replaced with - * value. - * - * If you pass start argument only, - * the value will be placed at start string - * index of current content. - * - * If you pass start and end arguments, - * the corresponding substring of current target's content will be - * replaced with value. - * @param {String} value Content you want to paste - * @param {Number} [start] Start index of editor's content - * @param {Number} [end] End index of editor's content - * @param {Boolean} [noIndent] Do not auto indent value - */ - replaceContent(value: string, start?: number, end?: number, noIndent?: boolean): void; - /** - * Returns editor's content - * @return {String} - */ - getContent(): string; - /** - * Returns current editor's syntax mode - * @return {String} - */ - getSyntax(): string; - /** - * Returns current output profile name (@see emmet#setupProfile) - * @return {String} - */ - getProfileName(): string; - /** - * Ask user to enter something - * @param {String} title Dialog title - * @return {String} Entered data - * @since 0.65 - */ - prompt(title: string): string; - /** - * Returns current selection - * @return {String} - * @since 0.65 - */ - getSelection(): string; - /** - * Returns current editor's file path - * @return {String} - * @since 0.65 - */ - getFilePath(): string; - } -} -declare module "ace-code/src/ext/hardwrap" { - /** - * @param {import("ace-code/src/editor").Editor} editor - * @param {import("ace-code").Ace.HardWrapOptions} options - */ - export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; -} -declare module "ace-code/src/ext/menu_tools/settings_menu.css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/ext/menu_tools/overlay_page" { - export function overlayPage(editor: any, contentElement: HTMLElement, callback?: any): { - close: () => void; - setIgnoreFocusOut: (ignore: boolean) => void; - }; -} -declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { - export function getEditorKeybordShortcuts(editor: import("ace-code/src/editor").Editor): any[]; -} -declare module "ace-code/src/ext/keybinding_menu" { - export function init(editor: Editor): void; - import Editor_8 = require("ace-code/src/editor"); - import Editor = Editor_8.Editor; -} -declare module "ace-code/src/ext/linking" { } -declare module "ace-code/src/ext/modelist" { - /** - * Suggests a mode based on the file extension present in the given path - * @param {string} path The path to the file - * @returns {Mode} Returns an object containing information about the - * suggested mode. - */ - export function getModeForPath(path: string): Mode; - export var modes: any[]; - export var modesByName: {}; - class Mode { - /** - * @param {string} name - * @param {string} caption - * @param {string} extensions - */ - constructor(name: string, caption: string, extensions: string); - name: string; - caption: string; - mode: string; - extensions: string; - extRe: RegExp; - /** - * @param {string} filename - */ - supportsFile(filename: string): RegExpMatchArray; - } - export {}; -} -declare module "ace-code/src/ext/themelist" { - export const themesByName: {}; - export const themes: { - caption: string; - theme: string; - isDark: boolean; - name: string; - }[]; -} -declare module "ace-code/src/ext/options" { - const OptionPanel_base: undefined; - export class OptionPanel { - /** - * - * @param {Editor} editor - * @param {HTMLElement} [element] - */ - constructor(editor: Editor, element?: HTMLElement); - editor: import("ace-code/src/editor").Editor; - container: HTMLElement; - groups: any[]; - options: {}; - add(config: any): void; - render(): void; - renderOptionGroup(group: any): any[]; - /** - * @param {string} key - * @param {Object} option - */ - renderOptionControl(key: string, option: any): any; - /** - * - * @param key - * @param option - */ - renderOption(key: any, option: any): (string | any[] | { - class: string; - })[]; - /** - * @param {string | number | Object} option - * @param {string | number | boolean} value - */ - setOption(option: string | number | any, value: string | number | boolean): void; - getOption(option: any): any; - } - export type Editor = import("ace-code/src/editor").Editor; - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - export interface OptionPanel extends Ace.EventEmitter { - } -} -declare module "ace-code/src/ext/prompt" { - export type PromptOptions = { - /** - * Prompt name. - */ - name: string; - /** - * Defines which part of the predefined value should be highlited. - */ - selection: [ - start: number, - end: number - ]; - /** - * Set to true if prompt has description below input box. - */ - hasDescription: boolean; - /** - * Description below input box. - */ - prompt: string; - /** - * Placeholder for value. - */ - placeholder: string; - /** - * Set to true to keep the prompt open when focus moves to another part of the editor. - */ - ignoreFocusOut: boolean; - /** - * Function for defining list of options for value. - */ - getCompletions: Function; - /** - * Function for defining current value prefix. - */ - getPrefix: Function; - /** - * Function called when Enter is pressed. - */ - onAccept: Function; - /** - * Function called when input is added to prompt input box. - */ - onInput: Function; - /** - * Function called when Esc|Shift-Esc is pressed. - */ - onCancel: Function; - /** - * Function for defining history list. - */ - history: Function; - maxHistoryCount: number; - addToHistory: Function; - }; - export type Editor = import("ace-code/src/editor").Editor; - /** - * @typedef PromptOptions - * @property {String} name Prompt name. - * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). - * @property {[start: number, end: number]} selection Defines which part of the predefined value should be highlited. - * @property {Boolean} hasDescription Set to true if prompt has description below input box. - * @property {String} prompt Description below input box. - * @property {String} placeholder Placeholder for value. - * @property {Object} $rules Specific rules for input like password or regexp. - * @property {Boolean} ignoreFocusOut Set to true to keep the prompt open when focus moves to another part of the editor. - * @property {Function} getCompletions Function for defining list of options for value. - * @property {Function} getPrefix Function for defining current value prefix. - * @property {Function} onAccept Function called when Enter is pressed. - * @property {Function} onInput Function called when input is added to prompt input box. - * @property {Function} onCancel Function called when Esc|Shift-Esc is pressed. - * @property {Function} history Function for defining history list. - * @property {number} maxHistoryCount - * @property {Function} addToHistory - */ - /** - * Prompt plugin is used for getting input from user. - * - * @param {Editor} editor Ouside editor related to this prompt. Will be blurred when prompt is open. - * @param {String | Partial} message Predefined value of prompt input box. - * @param {Partial} options Cusomizable options for this prompt. - * @param {Function} [callback] Function called after done. - * */ - export function prompt(editor: Editor, message: string | Partial, options: Partial, callback?: Function): any; - export namespace prompt { - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ - function gotoLine(editor: import("ace-code/src/editor").Editor, callback?: Function): void; - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ - function commands(editor: import("ace-code/src/editor").Editor, callback?: Function): void; - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ - function modes(editor: import("ace-code/src/editor").Editor, callback?: Function): void; - } -} -declare module "ace-code/src/ext/rtl" { - export {}; -} -declare module "ace-code/src/ext/settings_menu" { - export function init(): void; -} -declare module "ace-code/src/ext/simple_tokenizer" { - /** - * Parses provided content according to provided highlighting rules and return tokens. - * Tokens either have the className set according to Ace themes or have no className if they are just pure text tokens. - * Result is a list of list of tokens, where each line from the provided content is a separate list of tokens. - * - * @param {string} content to tokenize - * @param {import("ace-code").Ace.HighlightRules} highlightRules defining the language grammar - * @returns {import("ace-code").Ace.TokenizeResult} tokenization result containing a list of token for each of the lines from content - */ - export function tokenize(content: string, highlightRules: import("ace-code").Ace.HighlightRules): import("ace-code").Ace.TokenizeResult; -} -declare module "ace-code/src/ext/spellcheck" { - export function contextMenuHandler(e: any): void; -} -declare module "ace-code/src/ext/split" { - const _exports: typeof import("ace-code/src/split"); - export = _exports; -} -declare module "ace-code/src/ext/static-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/ext/static_highlight" { - /** - * - * @param {HTMLElement} el - * @param opts - * @param [callback] - * @returns {boolean} - */ - function highlight(el: HTMLElement, opts: any, callback?: any): boolean; - export namespace highlight { - export { render, renderSync, highlight }; - } - /** - * Transforms a given input code snippet into HTML using the given mode - * - * @param {string} input Code snippet - * @param {string|import("ace-code").Ace.SyntaxMode} mode String specifying the mode to load such as - * `ace/mode/javascript` or, a mode loaded from `/ace/mode` - * (use 'ServerSideHiglighter.getMode'). - * @param {string} theme String specifying the theme to load such as - * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. - * @param {number} lineStart A number indicating the first line number. Defaults - * to 1. - * @param {boolean} disableGutter Specifies whether or not to disable the gutter. - * `true` disables the gutter, `false` enables the gutter. Defaults to `false`. - * @param {function} [callback] When specifying the mode or theme as a string, - * this method has no return value and you must specify a callback function. The - * callback will receive the rendered object containing the properties `html` - * and `css`. - * @returns {object} An object containing the properties `html` and `css`. - */ - function render(input: string, mode: string | import("ace-code").Ace.SyntaxMode, theme: string, lineStart: number, disableGutter: boolean, callback?: Function): object; - /** - * Transforms a given input code snippet into HTML using the given mode - * @param {string} input Code snippet - * @param {import("ace-code").Ace.SyntaxMode|string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {any} theme - * @param {any} lineStart - * @param {boolean} disableGutter - * @returns {object} An object containing: html, css - */ - function renderSync(input: string, mode: import("ace-code").Ace.SyntaxMode | string, theme: any, lineStart: any, disableGutter: boolean): object; -} -declare module "ace-code/src/ext/statusbar" { - export type Editor = import("ace-code/src/editor").Editor; - /** simple statusbar **/ - export class StatusBar { - /** - * @param {Editor} editor - * @param {HTMLElement} parentNode - */ - constructor(editor: Editor, parentNode: HTMLElement); - element: HTMLDivElement; - /** - * @param {Editor} editor - */ - updateStatus(editor: Editor): void; - } -} -declare module "ace-code/src/ext/textarea" { - const _exports: { - config: { - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): import("ace-code/src/lib/app_config").AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): boolean; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any): void; - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - warn: (message: any, ...args: any[]) => void; - reportError: (msg: any, data: any) => void; - once(name: K, callback: any): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: K_1, callback: any, capturing?: boolean): any; - addEventListener(name: K_2, callback: any, capturing?: boolean): any; - off(name: K_3, callback: any): void; - removeListener(name: K_4, callback: any): void; - removeEventListener(name: K_5, callback: any): void; - removeAllListeners(name?: string): void; - get: (key: string) => any; - set: (key: string, value: any) => void; - all: () => { - [key: string]: any; - }; - moduleUrl: (name: string, component?: string) => string; - setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: any) => void; - dynamicModules: any; - loadModule: (moduleId: string | [ - string, - string - ], onLoad: (module: any) => void) => void; - setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.32.9"; - }; - edit: (el: string | (HTMLElement & { - env?: any; - value?: any; - }), options?: any) => ace.Editor; - createEditSession: (text: string | import("ace-code/src/document").Document, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; - Range: typeof ace.Range; - Editor: typeof ace.Editor; - EditSession: typeof ace.EditSession; - UndoManager: typeof ace.UndoManager; - VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.32.9"; - transformTextarea: (element: any, options: any) => ace.Editor; - defaultOptions: { - mode: string; - theme: string; - wrap: string; - fontSize: string; - showGutter: string; - keybindings: string; - showPrintMargin: string; - useSoftTabs: string; - showInvisibles: string; - }; - }; - export = _exports; - import ace = require("ace-code"); -} -declare module "ace-code/src/ext/whitespace" { - export function $detectIndentation(lines: string[], fallback?: any): { - ch?: string; - length?: number; - }; - export function detectIndentation(session: EditSession): { - ch?: string; - length?: number; - } | {}; - export function trimTrailingSpace(session: EditSession, options: { - trimEmpty?: boolean; - keepCursorPosition?: boolean; - }): void; - export function convertIndentation(session: EditSession, ch: string, len: number): void; - export function $parseStringArg(text: string): {}; - export function $parseArg(arg: any): any; - export const commands: { - name: string; - description: string; - exec: (editor: any, args: any) => void; - }[]; - export type EditSession = import("ace-code/src/edit_session").EditSession; -} -declare module "ace-code/src/keyboard/textarea" { - import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_6.HashHandler; -} -declare function defineProp(obj: any, name: any, val: any): void; -declare function defineProp(obj: any, name: any, val: any): void; -declare module "ace-code/src/lib/fixoldbrowsers" { - export {}; -} -declare module "ace-code/src/snippets/abc.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/abc" { - export const snippetText: string; - export const scope: "abc"; -} -declare module "ace-code/src/snippets/actionscript.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/actionscript" { - export const snippetText: string; - export const scope: "actionscript"; -} -declare module "ace-code/src/snippets/c_cpp.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/c_cpp" { - export const snippetText: string; - export const scope: "c_cpp"; -} -declare module "ace-code/src/snippets/clojure.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/clojure" { - export const snippetText: string; - export const scope: "clojure"; -} -declare module "ace-code/src/snippets/coffee.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/coffee" { - export const snippetText: string; - export const scope: "coffee"; -} -declare module "ace-code/src/snippets/csound_document.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/csound_document" { - export const snippetText: string; - export const scope: "csound_document"; -} -declare module "ace-code/src/snippets/csound_orchestra.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/csound_orchestra" { - export const snippetText: string; - export const scope: "csound_orchestra"; -} -declare module "ace-code/src/snippets/css.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/css" { - export const snippetText: string; - export const scope: "css"; -} -declare module "ace-code/src/snippets/dart.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/dart" { - export const snippetText: string; - export const scope: "dart"; -} -declare module "ace-code/src/snippets/diff.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/diff" { - export const snippetText: string; - export const scope: "diff"; -} -declare module "ace-code/src/snippets/django.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/django" { - export const snippetText: string; - export const scope: "django"; -} -declare module "ace-code/src/snippets/drools.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/drools" { - export const snippetText: string; - export const scope: "drools"; -} -declare module "ace-code/src/snippets/edifact.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/edifact" { - export const snippetText: string; - export const scope: "edifact"; -} -declare module "ace-code/src/snippets/erlang.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/erlang" { - export const snippetText: string; - export const scope: "erlang"; -} -declare module "ace-code/src/snippets/fsl.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/fsl" { - export const snippetText: string; - export const scope: "fsl"; -} -declare module "ace-code/src/snippets/gobstones.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/gobstones" { - export const snippetText: string; - export const scope: "gobstones"; -} -declare module "ace-code/src/snippets/graphqlschema.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/graphqlschema" { - export const snippetText: string; - export const scope: "graphqlschema"; -} -declare module "ace-code/src/snippets/haml.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/haml" { - export const snippetText: string; - export const scope: "haml"; -} -declare module "ace-code/src/snippets/haskell.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/haskell" { - export const snippetText: string; - export const scope: "haskell"; -} -declare module "ace-code/src/snippets/html.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/html" { - export const snippetText: string; - export const scope: "html"; -} -declare module "ace-code/src/snippets/io" { - export const snippets: ({ - content: string; - name: string; - scope: string; - tabTrigger: string; - keyEquivalent?: undefined; - } | { - content: string; - keyEquivalent: string; - name: string; - scope: string; - tabTrigger: string; - } | { - content: string; - keyEquivalent: string; - name: string; - scope: string; - tabTrigger?: undefined; - })[]; - export const scope: "io"; -} -declare module "ace-code/src/snippets/java.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/java" { - export const snippetText: string; - export const scope: "java"; -} -declare module "ace-code/src/snippets/javascript.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/javascript" { - export const snippetText: string; - export const scope: "javascript"; -} -declare module "ace-code/src/snippets/jsp.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/jsp" { - export const snippetText: string; - export const scope: "jsp"; -} -declare module "ace-code/src/snippets/liquid.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/liquid" { - export const snippetText: string; - export const scope: "liquid"; -} -declare module "ace-code/src/snippets/lsl.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/lsl" { - export const snippetText: string; - export const scope: "lsl"; -} -declare module "ace-code/src/snippets/lua.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/lua" { - export const snippetText: string; - export const scope: "lua"; -} -declare module "ace-code/src/snippets/makefile.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/makefile" { - export const snippetText: string; - export const scope: "makefile"; -} -declare module "ace-code/src/snippets/markdown.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/markdown" { - export const snippetText: string; - export const scope: "markdown"; -} -declare module "ace-code/src/snippets/maze.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/maze" { - export const snippetText: string; - export const scope: "maze"; -} -declare module "ace-code/src/snippets/perl.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/perl" { - export const snippetText: string; - export const scope: "perl"; -} -declare module "ace-code/src/snippets/php.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/php" { - export const snippetText: string; - export const scope: "php"; -} -declare module "ace-code/src/snippets/python.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/python" { - export const snippetText: string; - export const scope: "python"; -} -declare module "ace-code/src/snippets/r.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/r" { - export const snippetText: string; - export const scope: "r"; -} -declare module "ace-code/src/snippets/razor.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/razor" { - export const snippetText: string; - export const scope: "razor"; -} -declare module "ace-code/src/snippets/robot.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/robot" { - export const snippetText: string; - export const scope: "robot"; -} -declare module "ace-code/src/snippets/rst.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/rst" { - export const snippetText: string; - export const scope: "rst"; -} -declare module "ace-code/src/snippets/ruby.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/ruby" { - export const snippetText: string; - export const scope: "ruby"; -} -declare module "ace-code/src/snippets/sh.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/sh" { - export const snippetText: string; - export const scope: "sh"; -} -declare module "ace-code/src/snippets/snippets.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/snippets" { - export const snippetText: string; - export const scope: "snippets"; -} -declare module "ace-code/src/snippets/sql.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/sql" { - export const snippetText: string; - export const scope: "sql"; -} -declare module "ace-code/src/snippets/sqlserver.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/sqlserver" { - export const snippetText: string; - export const scope: "sqlserver"; -} -declare module "ace-code/src/snippets/tcl.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/tcl" { - export const snippetText: string; - export const scope: "tcl"; -} -declare module "ace-code/src/snippets/tex.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/tex" { - export const snippetText: string; - export const scope: "tex"; -} -declare module "ace-code/src/snippets/textile.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/textile" { - export const snippetText: string; - export const scope: "textile"; -} -declare module "ace-code/src/snippets/vala" { - export const snippets: { - content: string; - name: string; - scope: string; - tabTrigger: string; - }[]; - export const scope: ""; -} -declare module "ace-code/src/snippets/velocity.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/velocity" { - export const snippetText: string; - export const scope: "velocity"; - export const includeScopes: string[]; -} -declare module "ace-code/src/snippets/wollok.snippets" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/snippets/wollok" { - export const snippetText: string; - export const scope: "wollok"; -} -declare module "ace-code/src/theme/ambiance-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/ambiance" { - export const isDark: true; - export const cssClass: "ace-ambiance"; - export const cssText: string; -} -declare module "ace-code/src/theme/chaos-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/chaos" { - export const isDark: true; - export const cssClass: "ace-chaos"; - export const cssText: string; -} -declare module "ace-code/src/theme/chrome-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/chrome" { - export const isDark: false; - export const cssClass: "ace-chrome"; - export const cssText: string; -} -declare module "ace-code/src/theme/cloud9_day-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cloud9_day" { - export const isDark: false; - export const cssClass: "ace-cloud9-day"; - export const cssText: string; -} -declare module "ace-code/src/theme/cloud9_night-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cloud9_night" { - export const isDark: true; - export const cssClass: "ace-cloud9-night"; - export const cssText: string; -} -declare module "ace-code/src/theme/cloud9_night_low_color-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cloud9_night_low_color" { - export const isDark: true; - export const cssClass: "ace-cloud9-night-low-color"; - export const cssText: string; -} -declare module "ace-code/src/theme/cloud_editor-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cloud_editor" { - export const isDark: false; - export const cssClass: "ace-cloud_editor"; - export const cssText: string; -} -declare module "ace-code/src/theme/cloud_editor_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cloud_editor_dark" { - export const isDark: true; - export const cssClass: "ace-cloud_editor_dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/clouds-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/clouds" { - export const isDark: false; - export const cssClass: "ace-clouds"; - export const cssText: string; -} -declare module "ace-code/src/theme/clouds_midnight-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/clouds_midnight" { - export const isDark: true; - export const cssClass: "ace-clouds-midnight"; - export const cssText: string; -} -declare module "ace-code/src/theme/cobalt-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/cobalt" { - export const isDark: true; - export const cssClass: "ace-cobalt"; - export const cssText: string; -} -declare module "ace-code/src/theme/crimson_editor-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/crimson_editor" { - export const isDark: false; - export const cssText: string; - export const cssClass: "ace-crimson-editor"; -} -declare module "ace-code/src/theme/dawn-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/dawn" { - export const isDark: false; - export const cssClass: "ace-dawn"; - export const cssText: string; -} -declare module "ace-code/src/theme/dracula-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/dracula" { - export const isDark: true; - export const cssClass: "ace-dracula"; - export const cssText: string; -} -declare module "ace-code/src/theme/dreamweaver-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/dreamweaver" { - export const isDark: false; - export const cssClass: "ace-dreamweaver"; - export const cssText: string; -} -declare module "ace-code/src/theme/eclipse-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/eclipse" { - export const isDark: false; - export const cssText: string; - export const cssClass: "ace-eclipse"; -} -declare module "ace-code/src/theme/github-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/github" { - export const isDark: false; - export const cssClass: "ace-github"; - export const cssText: string; -} -declare module "ace-code/src/theme/github_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/github_dark" { - export const isDark: true; - export const cssClass: "ace-github-dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/gob-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/gob" { - export const isDark: true; - export const cssClass: "ace-gob"; - export const cssText: string; -} -declare module "ace-code/src/theme/gruvbox-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/gruvbox" { - export const isDark: true; - export const cssClass: "ace-gruvbox"; - export const cssText: string; -} -declare module "ace-code/src/theme/gruvbox_dark_hard-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/gruvbox_dark_hard" { - export const isDark: true; - export const cssClass: "ace-gruvbox-dark-hard"; - export const cssText: string; -} -declare module "ace-code/src/theme/gruvbox_light_hard-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/gruvbox_light_hard" { - export const isDark: false; - export const cssClass: "ace-gruvbox-light-hard"; - export const cssText: string; -} -declare module "ace-code/src/theme/idle_fingers-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/idle_fingers" { - export const isDark: true; - export const cssClass: "ace-idle-fingers"; - export const cssText: string; -} -declare module "ace-code/src/theme/iplastic-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/iplastic" { - export const isDark: false; - export const cssClass: "ace-iplastic"; - export const cssText: string; -} -declare module "ace-code/src/theme/katzenmilch-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/katzenmilch" { - export const isDark: false; - export const cssClass: "ace-katzenmilch"; - export const cssText: string; -} -declare module "ace-code/src/theme/kr_theme-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/kr_theme" { - export const isDark: true; - export const cssClass: "ace-kr-theme"; - export const cssText: string; -} -declare module "ace-code/src/theme/kuroir-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/kuroir" { - export const isDark: false; - export const cssClass: "ace-kuroir"; - export const cssText: string; -} -declare module "ace-code/src/theme/merbivore-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/merbivore" { - export const isDark: true; - export const cssClass: "ace-merbivore"; - export const cssText: string; -} -declare module "ace-code/src/theme/merbivore_soft-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/merbivore_soft" { - export const isDark: true; - export const cssClass: "ace-merbivore-soft"; - export const cssText: string; -} -declare module "ace-code/src/theme/mono_industrial-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/mono_industrial" { - export const isDark: true; - export const cssClass: "ace-mono-industrial"; - export const cssText: string; -} -declare module "ace-code/src/theme/monokai-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/monokai" { - export const isDark: true; - export const cssClass: "ace-monokai"; - export const cssText: string; -} -declare module "ace-code/src/theme/nord_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/nord_dark" { - export const isDark: true; - export const cssClass: "ace-nord-dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/one_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/one_dark" { - export const isDark: true; - export const cssClass: "ace-one-dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/pastel_on_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/pastel_on_dark" { - export const isDark: true; - export const cssClass: "ace-pastel-on-dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/solarized_dark-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/solarized_dark" { - export const isDark: true; - export const cssClass: "ace-solarized-dark"; - export const cssText: string; -} -declare module "ace-code/src/theme/solarized_light-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/solarized_light" { - export const isDark: false; - export const cssClass: "ace-solarized-light"; - export const cssText: string; -} -declare module "ace-code/src/theme/sqlserver-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/sqlserver" { - export const isDark: false; - export const cssClass: "ace-sqlserver"; - export const cssText: string; -} -declare module "ace-code/src/theme/terminal-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/terminal" { - export const isDark: true; - export const cssClass: "ace-terminal-theme"; - export const cssText: string; -} -declare module "ace-code/src/theme/tomorrow-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/tomorrow" { - export const isDark: false; - export const cssClass: "ace-tomorrow"; - export const cssText: string; -} -declare module "ace-code/src/theme/tomorrow_night-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/tomorrow_night" { - export const isDark: true; - export const cssClass: "ace-tomorrow-night"; - export const cssText: string; -} -declare module "ace-code/src/theme/tomorrow_night_blue-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/tomorrow_night_blue" { - export const isDark: true; - export const cssClass: "ace-tomorrow-night-blue"; - export const cssText: string; -} -declare module "ace-code/src/theme/tomorrow_night_bright-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/tomorrow_night_bright" { - export const isDark: true; - export const cssClass: "ace-tomorrow-night-bright"; - export const cssText: string; -} -declare module "ace-code/src/theme/tomorrow_night_eighties-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/tomorrow_night_eighties" { - export const isDark: true; - export const cssClass: "ace-tomorrow-night-eighties"; - export const cssText: string; -} -declare module "ace-code/src/theme/twilight-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/twilight" { - export const isDark: true; - export const cssClass: "ace-twilight"; - export const cssText: string; -} -declare module "ace-code/src/theme/vibrant_ink-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/vibrant_ink" { - export const isDark: true; - export const cssClass: "ace-vibrant-ink"; - export const cssText: string; -} -declare module "ace-code/src/theme/xcode-css" { - const _exports: string; - export = _exports; -} -declare module "ace-code/src/theme/xcode" { - export const isDark: false; - export const cssClass: "ace-xcode"; - export const cssText: string; -} diff --git a/package.json b/package.json index 01c8a175e51..e2f074b6e4c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,10 @@ "styles", "ace.d.ts", "ace-modes.d.ts", - "ace-extensions.d.ts", + "ace-ext.d.ts", + "ace-modules.d.ts", + "ace-snippets.d.ts", + "ace-theme.d.ts", "esm-resolver.js", "translations", "!**/*_test.js", diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 1128f368c3f..87024fab72d 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -2,6 +2,8 @@ const ts = require('typescript'); const fs = require("fs"); const path = require("path"); +const SEPARATE_MODULES = ["ext", "theme", "snippets"]; // adjust this list for more granularity + /** * @param {string} directoryPath */ @@ -95,6 +97,7 @@ function fixDeclaration(content, aceNamespacePath) { var checker = program.getTypeChecker(); let interfaces = collectInterfaces(aceNamespacePath); + const finalDeclarations = []; /** * @param {ts.TransformationContext} context @@ -207,40 +210,92 @@ function fixDeclaration(content, aceNamespacePath) { }; } - const sourceCode = program.getSourceFile(temporaryName); - const result = ts.transform(sourceCode, [transformer]); - - const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { - substituteNode(hint, node) { - // remove all private members - if ((ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration(node) - || ts.isPropertySignature(node)) && ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text)) { - return ts.factory.createNotEmittedStatement(node); - } else if (ts.isVariableStatement(node) && node.getText().indexOf("export const $") > -1) { - return ts.factory.createNotEmittedStatement(node); + function pathBasedTransformer(context) { + return (sourceFile) => { + const moduleOutputs = {}; + + function visit(node) { + if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) { + let pathKey = 'modules'; + if (node.name.text === "ace-code") { + pathKey = "ace"; + if (!moduleOutputs[pathKey]) { + moduleOutputs[pathKey] = []; + } //TODO: + moduleOutputs[pathKey].push(node); + } + else { + SEPARATE_MODULES.some(module => { + if (node.name.text.includes("/" + module + "/")) { + pathKey = module; + return true; + } + }); + if (!moduleOutputs[pathKey]) { + moduleOutputs[pathKey] = []; + } + moduleOutputs[pathKey].push(node); + } + + return node; + } + return ts.visitEachChild(node, visit, context); } - return node; - } - }); - //TODO: - const outputName = aceNamespacePath.replace("ace-internal", "ace"); - result.transformed.forEach(transformedFile => { - let output = printer.printFile(transformedFile); + ts.visitNode(sourceFile, visit); - fs.writeFileSync(outputName, output); - }); + // Generate new source files for each module path + let modules = Object.keys(moduleOutputs); + modules.forEach(key => { + const newSourceFile = context.factory.updateSourceFile(sourceFile, moduleOutputs[key]); + const dirPath = path.dirname(aceNamespacePath.replace("ace-internal", "ace")); + const outputName = key === "ace" ? `${dirPath}/ace.d.ts` : `${dirPath}/ace-${key}.d.ts`; + finalDeclarations.push(outputName); + + const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { + substituteNode(hint, node) { + // remove all private members + if ((ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration( + node) || ts.isPropertySignature(node)) && ts.isIdentifier(node.name) && /^[$_]/.test( + node.name.text)) { + return ts.factory.createNotEmittedStatement(node); + } + else if (ts.isVariableStatement(node) && node.getText().indexOf("export const $") > -1) { + return ts.factory.createNotEmittedStatement(node); + } + return node; + } + }); + let output = printer.printFile(newSourceFile); + if (key === "ace") { + let referencePaths = modules.filter((el) => el != "ace").map((el) => { + return `/// `; + }); + let allReferences = referencePaths.join("\n") + "\n/// \n"; + output = allReferences + output; + } + fs.writeFileSync(outputName, output); + }); + + return sourceFile; + }; + } + + const sourceCode = program.getSourceFile(temporaryName); + const result = ts.transform(sourceCode, [transformer, pathBasedTransformer]); + result.dispose(); - checkFinalDeclaration(outputName); + checkFinalDeclaration(finalDeclarations); } + /** - * @param {string} declarationName + * @param {string[]} declarationNames */ -function checkFinalDeclaration(declarationName) { - const program = ts.createProgram([declarationName], { +function checkFinalDeclaration(declarationNames) { + const program = ts.createProgram(declarationNames, { noEmit: true, target: ts.ScriptTarget.ES2019, lib: ["lib.es2019.d.ts", "lib.dom.d.ts"] @@ -355,7 +410,6 @@ function generateDeclaration(aceNamespacePath) { let packageName = "ace-code"; let updatedContent = data.replace(/(declare module ")/g, "$1" + packageName + "/src/"); - updatedContent = "/// \n" + updatedContent; updatedContent = updatedContent.replace(/(require\(")/g, "$1" + packageName + "/src/"); updatedContent = updatedContent.replace(/(import\(")[./]*ace(?:\-internal)?("\).Ace)/g, "$1" + packageName + "$2"); @@ -387,4 +441,5 @@ if (!module.parent) { else { exports.generateDeclaration = generateDeclaration; exports.updateDeclarationModuleNames = updateDeclarationModuleNames; + exports.SEPARATE_MODULES = SEPARATE_MODULES; } diff --git a/tool/modes-declaration-generator.js b/tool/modes-declaration-generator.js index 1aad62dd8c6..65014e58459 100644 --- a/tool/modes-declaration-generator.js +++ b/tool/modes-declaration-generator.js @@ -100,7 +100,8 @@ function getExportType(exportName) { aceType = "Outdent"; } - return ts.factory.createImportTypeNode(ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(".")), + return ts.factory.createImportTypeNode( + ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral("ace-code")), undefined, ts.factory.createQualifiedName(ts.factory.createIdentifier("Ace"), ts.factory.createIdentifier(aceType)), undefined, false diff --git a/tsconfig.json b/tsconfig.json index 40f7b26ae02..cac74a53e15 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,7 @@ ], "include": [ "./src/**/*", - "./ace.d.ts" + "./ace.d.ts", + "./ace_*.d.ts" ] } From 260acaa1347bcf8ef52470f429ebb6a9ffbe4e2a Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 17 Apr 2024 15:34:12 +0400 Subject: [PATCH 10/33] separate libs from core modules --- ace-ext.d.ts | 131 --- ace-internal.d.ts | 5 + ace-lib.d.ts | 310 +++++++ ace-modules.d.ts | 1414 ----------------------------- ace.d.ts | 1 + package.json | 1 + tool/ace_declaration_generator.js | 17 +- 7 files changed, 326 insertions(+), 1553 deletions(-) create mode 100644 ace-lib.d.ts diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 65552aeff27..5b1baafddb8 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -1,6 +1,5 @@ declare module "ace-code/src/ext/command_bar" { const CommandBarTooltip_base: undefined; - /** * Displays a command tooltip above the currently active line selection, with clickable elements. * @@ -16,7 +15,6 @@ declare module "ace-code/src/ext/command_bar" { * @param {Partial} [options] */ constructor(parentNode: HTMLElement, options?: Partial); - parentNode: HTMLElement; tooltip: Tooltip; moreOptions: Tooltip; @@ -26,7 +24,6 @@ declare module "ace-code/src/ext/command_bar" { commands: {}; tooltipEl: any[] | HTMLElement | Text; moreOptionsEl: any[] | HTMLElement | Text; - /** * Registers a command on the command bar tooltip. * @@ -37,13 +34,9 @@ declare module "ace-code/src/ext/command_bar" { * @param {TooltipCommand} command */ registerCommand(id: string, command: TooltipCommand): void; - isShown(): boolean; - isMoreOptionsShown(): boolean; - getAlwaysShow(): boolean; - /** * Sets the display mode of the tooltip * @@ -53,7 +46,6 @@ declare module "ace-code/src/ext/command_bar" { * @param {boolean} alwaysShow */ setAlwaysShow(alwaysShow: boolean): void; - /** * Attaches the clickable command bar tooltip to an editor * @@ -63,29 +55,23 @@ declare module "ace-code/src/ext/command_bar" { * @param {Editor} editor */ attach(editor: Editor): void; - editor: import("ace-code/src/editor").Editor; - /** * Updates the position of the command bar tooltip. It aligns itself above the active line in the editor. */ updatePosition(): void; - /** * Updates each command element in the tooltip. * * This is automatically called on certain events, but can be called manually as well. */ update(): void; - /** * Detaches the tooltip from the editor. */ detach(): void; - destroy(): void; } - export type Editor = import("ace-code/src/editor").Editor; export type TooltipCommand = import("ace-code").Ace.TooltipCommand; import Tooltip_2 = require("ace-code/src/tooltip"); @@ -96,15 +82,12 @@ declare module "ace-code/src/ext/command_bar" { namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface CommandBarTooltip extends Ace.EventEmitter { } } declare module "ace-code/src/ext/language_tools" { export function setCompleters(val: any): void; - export function addCompleter(completer: any): void; - import textCompleter = require("ace-code/src/autocomplete/text_completer"); /**@type {import("ace-code").Ace.Completer}*/ export var keyWordCompleter: import("ace-code").Ace.Completer; @@ -123,14 +106,10 @@ declare module "ace-code/src/ext/inline_autocomplete" { * @param {Editor} editor */ constructor(editor: Editor); - editor: Editor; keyboardHandler: HashHandler; - blurListener(e: any): void; - changeListener(e: any): void; - changeTimer: { (timeout: any): void; delay(timeout: any): void; @@ -139,75 +118,54 @@ declare module "ace-code/src/ext/inline_autocomplete" { cancel(): void; isPending(): any; }; - /** * * @return {AceInline} */ getInlineRenderer(): AceInline; - inlineRenderer: AceInline; - /** * @return {CommandBarTooltip} */ getInlineTooltip(): CommandBarTooltip; - inlineTooltip: CommandBarTooltip; - /** * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; * @param {import("ace-code").Ace.CompletionOptions} options */ show(options: import("ace-code").Ace.CompletionOptions): void; - activated: boolean; - insertMatch(): boolean; - /** * @param {import("ace-code").Ace.InlineAutocompleteAction} where */ goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; - getLength(): any; - /** * @param {number} [index] * @returns {import("ace-code").Ace.Completion | undefined} */ getData(index?: number): import("ace-code").Ace.Completion | undefined; - getIndex(): number; - isOpen(): boolean; - /** * @param {number} value */ setIndex(value: number): void; - /** * @return {CompletionProvider} */ getCompletionProvider(initialPosition: any): CompletionProvider; - completionProvider: CompletionProvider; - /** * @param {import("ace-code").Ace.CompletionOptions} [options] */ updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; - base: import("ace-code/src/anchor").Anchor; completions: FilteredList; - detach(): void; - destroy(): void; - updateDocTooltip(): void; - /** * * @type {{[key: string]: import("ace-code").Ace.Command}} @@ -216,22 +174,18 @@ declare module "ace-code/src/ext/inline_autocomplete" { [key: string]: import("ace-code").Ace.Command; }; } - export namespace InlineAutocomplete { function _for(editor: any): any; export {_for as for}; export namespace startCommand { let name: string; - function exec(editor: any, options: any): void; - export namespace bindKey { let win: string; let mac: string; } } - /** * Factory method to create a command bar tooltip for inline autocomplete. * @@ -259,9 +213,7 @@ declare module "ace-code/src/ext/searchbox-css" { } declare module "ace-code/src/ext/searchbox" { export function Search(editor: Editor, isReplace?: boolean): void; - export type Editor = import("ace-code/src/editor").Editor; - export class SearchBox { /** * @param {Editor} editor @@ -269,19 +221,15 @@ declare module "ace-code/src/ext/searchbox" { * @param {undefined} [showReplaceForm] */ constructor(editor: Editor, range?: undefined, showReplaceForm?: undefined); - /**@type {any}*/ activeInput: any; /**@type {any}*/ element: any; - setSession(e: any): void; - /** * @param {Editor} editor */ setEditor(editor: Editor): void; - /**@type {Editor}*/ editor: Editor; searchRange: any; @@ -305,50 +253,34 @@ declare module "ace-code/src/ext/searchbox" { replaceInput: HTMLInputElement; /**@type {HTMLElement}*/ searchCounter: HTMLElement; - setSearchRange(range: any): void; - searchRangeMarker: number; - /** * @param {RegExp} [re] */ highlight(re?: RegExp): void; - /** * @param {boolean} skipCurrent * @param {boolean} backwards * @param {any} [preventScroll] */ find(skipCurrent: boolean, backwards: boolean, preventScroll?: any): void; - updateCounter(): void; - findNext(): void; - findPrev(): void; - findAll(): void; - replace(): void; - replaceAndFindNext(): void; - replaceAll(): void; - hide(): void; - active: boolean; - /** * @param {string} value * @param {boolean} [isReplace] */ show(value: string, isReplace?: boolean): void; - isFocused(): boolean; } - import HashHandler_3 = require("ace-code/src/keyboard/hash_handler"); import HashHandler = HashHandler_3.HashHandler; } @@ -358,17 +290,14 @@ declare module "ace-code/src/ext/elastic_tabstops_lite" { * @param {Editor} editor */ constructor(editor: Editor); - onAfterExec: () => void; onExec: () => void; onChange: (delta: any) => void; - /** * @param {number[]} rows */ processRows(rows: number[]): void; } - import Editor_3 = require("ace-code/src/editor"); import Editor = Editor_3.Editor; } @@ -381,9 +310,7 @@ declare module "ace-code/src/ext/beautify" { export const formatOptions: { lineBreaksAfterCommasInCurlyBlock?: boolean; }; - export function beautify(session: import("ace-code/src/edit_session").EditSession): void; - export const commands: { name: string; description: string; @@ -393,34 +320,23 @@ declare module "ace-code/src/ext/beautify" { } declare module "ace-code/src/ext/code_lens" { export function setLenses(session: EditSession, lenses: any): number; - export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; - export function clear(session: EditSession): void; - export type EditSession = import("ace-code/src/edit_session").EditSession; export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & {}; } declare module "ace-code/src/ext/emmet" { export const commands: HashHandler; - export function runEmmetCommand(editor: Editor): number | boolean; - export function updateCommands(editor: Editor, enabled?: boolean): void; - export function isSupportedMode(mode: any): boolean; - export function isAvailable(editor: Editor, command: string): boolean; - export function load(cb: any): boolean; - export function setCore(e: any): void; - import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); import HashHandler = HashHandler_5.HashHandler; import Editor_7 = require("ace-code/src/editor"); import Editor = Editor_7.Editor; - /** * Implementation of {@link IEmmetEditor} interface for Ace */ @@ -429,10 +345,8 @@ declare module "ace-code/src/ext/emmet" { * @param {Editor} editor */ setupContext(editor: Editor): void; - ace: Editor; indentation: string; - /** * Returns character indexes of selected text: object with start * and end properties. If there's no selection, should return @@ -444,7 +358,6 @@ declare module "ace-code/src/ext/emmet" { * alert(selection.start + ', ' + selection.end); */ getSelectionRange(): any; - /** * Creates selection from start to end character * indexes. If end is ommited, this method should place caret @@ -458,7 +371,6 @@ declare module "ace-code/src/ext/emmet" { * editor.createSelection(15); */ createSelection(start: number, end?: number): void; - /** * Returns current line's start and end indexes as object with start * and end properties @@ -468,25 +380,21 @@ declare module "ace-code/src/ext/emmet" { * alert(range.start + ', ' + range.end); */ getCurrentLineRange(): any; - /** * Returns current caret position * @return {Number|null} */ getCaretPos(): number | null; - /** * Set new caret position * @param {Number} index Caret position */ setCaretPos(index: number): void; - /** * Returns content of current line * @return {String} */ getCurrentLine(): string; - /** * Replace editor's content or it's part (from start to * end index). If value contains @@ -508,25 +416,21 @@ declare module "ace-code/src/ext/emmet" { * @param {Boolean} [noIndent] Do not auto indent value */ replaceContent(value: string, start?: number, end?: number, noIndent?: boolean): void; - /** * Returns editor's content * @return {String} */ getContent(): string; - /** * Returns current editor's syntax mode * @return {String} */ getSyntax(): string; - /** * Returns current output profile name (@see emmet#setupProfile) * @return {String} */ getProfileName(): string; - /** * Ask user to enter something * @param {String} title Dialog title @@ -534,14 +438,12 @@ declare module "ace-code/src/ext/emmet" { * @since 0.65 */ prompt(title: string): string; - /** * Returns current selection * @return {String} * @since 0.65 */ getSelection(): string; - /** * Returns current editor's file path * @return {String} @@ -572,7 +474,6 @@ declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { } declare module "ace-code/src/ext/keybinding_menu" { export function init(editor: Editor): void; - import Editor_8 = require("ace-code/src/editor"); import Editor = Editor_8.Editor; } @@ -586,10 +487,8 @@ declare module "ace-code/src/ext/modelist" { * suggested mode. */ export function getModeForPath(path: string): Mode; - export var modes: any[]; export var modesByName: {}; - class Mode { /** * @param {string} name @@ -597,19 +496,16 @@ declare module "ace-code/src/ext/modelist" { * @param {string} extensions */ constructor(name: string, caption: string, extensions: string); - name: string; caption: string; mode: string; extensions: string; extRe: RegExp; - /** * @param {string} filename */ supportsFile(filename: string): RegExpMatchArray; } - export {}; } declare module "ace-code/src/ext/themelist" { @@ -623,7 +519,6 @@ declare module "ace-code/src/ext/themelist" { } declare module "ace-code/src/ext/options" { const OptionPanel_base: undefined; - export class OptionPanel { /** * @@ -631,24 +526,18 @@ declare module "ace-code/src/ext/options" { * @param {HTMLElement} [element] */ constructor(editor: Editor, element?: HTMLElement); - editor: import("ace-code/src/editor").Editor; container: HTMLElement; groups: any[]; options: {}; - add(config: any): void; - render(): void; - renderOptionGroup(group: any): any[]; - /** * @param {string} key * @param {Object} option */ renderOptionControl(key: string, option: any): any; - /** * * @param key @@ -657,22 +546,18 @@ declare module "ace-code/src/ext/options" { renderOption(key: any, option: any): (string | any[] | { class: string; })[]; - /** * @param {string | number | Object} option * @param {string | number | boolean} value */ setOption(option: string | number | any, value: string | number | boolean): void; - getOption(option: any): any; } - export type Editor = import("ace-code/src/editor").Editor; export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface OptionPanel extends Ace.EventEmitter { } } @@ -733,7 +618,6 @@ declare module "ace-code/src/ext/prompt" { addToHistory: Function; }; export type Editor = import("ace-code/src/editor").Editor; - /** * @typedef PromptOptions * @property {String} name Prompt name. @@ -762,7 +646,6 @@ declare module "ace-code/src/ext/prompt" { * @param {Function} [callback] Function called after done. * */ export function prompt(editor: Editor, message: string | Partial, options: Partial, callback?: Function): any; - export namespace prompt { /** * @@ -770,14 +653,12 @@ declare module "ace-code/src/ext/prompt" { * @param {Function} [callback] */ function gotoLine(editor: import("ace-code/src/editor").Editor, callback?: Function): void; - /** * * @param {Editor} editor * @param {Function} [callback] */ function commands(editor: import("ace-code/src/editor").Editor, callback?: Function): void; - /** * * @param {Editor} editor @@ -824,11 +705,9 @@ declare module "ace-code/src/ext/static_highlight" { * @returns {boolean} */ function highlight(el: HTMLElement, opts: any, callback?: any): boolean; - export namespace highlight { export {render, renderSync, highlight}; } - /** * Transforms a given input code snippet into HTML using the given mode * @@ -849,7 +728,6 @@ declare module "ace-code/src/ext/static_highlight" { * @returns {object} An object containing the properties `html` and `css`. */ function render(input: string, mode: string | import("ace-code").Ace.SyntaxMode, theme: string, lineStart: number, disableGutter: boolean, callback?: Function): object; - /** * Transforms a given input code snippet into HTML using the given mode * @param {string} input Code snippet @@ -863,7 +741,6 @@ declare module "ace-code/src/ext/static_highlight" { } declare module "ace-code/src/ext/statusbar" { export type Editor = import("ace-code/src/editor").Editor; - /** simple statusbar **/ export class StatusBar { /** @@ -871,9 +748,7 @@ declare module "ace-code/src/ext/statusbar" { * @param {HTMLElement} parentNode */ constructor(editor: Editor, parentNode: HTMLElement); - element: HTMLDivElement; - /** * @param {Editor} editor */ @@ -954,23 +829,17 @@ declare module "ace-code/src/ext/whitespace" { ch?: string; length?: number; }; - export function detectIndentation(session: EditSession): { ch?: string; length?: number; } | {}; - export function trimTrailingSpace(session: EditSession, options: { trimEmpty?: boolean; keepCursorPosition?: boolean; }): void; - export function convertIndentation(session: EditSession, ch: string, len: number): void; - export function $parseStringArg(text: string): {}; - export function $parseArg(arg: any): any; - export const commands: { name: string; description: string; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 4a02c0aa79a..330f1c62bfe 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -1511,3 +1511,8 @@ declare module "./src/mouse/default_gutter_handler" { export interface GutterHandler { } } + +declare module "./src/lib/keys" { + export function keyCodeToString(keyCode: number): string; +} + diff --git a/ace-lib.d.ts b/ace-lib.d.ts new file mode 100644 index 00000000000..21611f1c4ab --- /dev/null +++ b/ace-lib.d.ts @@ -0,0 +1,310 @@ +declare module "ace-code/src/lib/useragent" { + export namespace OS { + let LINUX: string; + let MAC: string; + let WINDOWS: string; + } + + export function getOS(): string; + + export const isWin: boolean; + export const isMac: boolean; + export const isLinux: boolean; + export const isIE: number; + export const isOldIE: boolean; + export const isGecko: any; + export const isMozilla: any; + export const isOpera: boolean; + export const isWebKit: number; + export const isChrome: number; + export const isSafari: true; + export const isEdge: number; + export const isAIR: boolean; + export const isAndroid: boolean; + export const isChromeOS: boolean; + export const isIOS: boolean; + export const isMobile: boolean; +} +declare module "ace-code/src/lib/dom" { + export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; + + export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; + + export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; + + export function removeChildren(element: HTMLElement): void; + + export function createTextNode(textContent: string, element?: HTMLElement): Text; + + export function createFragment(element?: HTMLElement): DocumentFragment; + + export function hasCssClass(el: HTMLElement, name: string): boolean; + + export function addCssClass(el: HTMLElement, name: string): void; + + export function removeCssClass(el: HTMLElement, name: string): void; + + export function toggleCssClass(el: HTMLElement, name: string): boolean; + + export function setCssClass(node: HTMLElement, className: string, include: boolean): void; + + export function hasCssString(id: string, doc?: Document): boolean; + + export function removeElementById(id: string, doc?: Document): void; + + export function useStrictCSP(value: any): void; + + export function importCssStylsheet(uri: string, doc?: Document): void; + + export function scrollbarWidth(doc?: Document): number; + + export function computedStyle(element: Element, style?: any): Partial; + + export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; + + export const HAS_CSS_ANIMATION: boolean; + export const HAS_CSS_TRANSFORMS: boolean; + export const HI_DPI: boolean; + + export function translate(element: any, tx: any, ty: any): void; + + export function importCssString(cssText: any, id: any, target: any): number; +} +declare module "ace-code/src/lib/oop" { + export function inherits(ctor: any, superCtor: any): void; + + export function mixin(obj: T, mixin: any): any; + + export function implement(proto: T, mixin: any): any; +} +declare module "ace-code/src/lib/deep_copy" { + export function deepCopy(obj: any): any; +} +declare module "ace-code/src/lib/lang" { + export function last(a: any): any; + + export function stringReverse(string: any): any; + + export function stringRepeat(string: any, count: any): string; + + export function stringTrimLeft(string: any): any; + + export function stringTrimRight(string: any): any; + + export function copyObject(obj: any): {}; + + export function copyArray(array: any): any[]; + + export const deepCopy: (obj: any) => any; + + export function arrayToMap(arr: any): {}; + + export function createMap(props: any): any; + + export function arrayRemove(array: any, value: any): void; + + export function escapeRegExp(str: any): any; + + export function escapeHTML(str: any): string; + + export function getMatchOffsets(string: any, regExp: any): any[]; + + export function deferredCall(fcn: any): { + (timeout: any): any; + schedule: any; + call(): any; + cancel(): any; + isPending(): any; + }; + + export function delayedCall(fcn: any, defaultTimeout: any): { + (timeout: any): void; + delay(timeout: any): void; + schedule: any; + call(): void; + cancel(): void; + isPending(): any; + }; + + export function supportsLookbehind(): boolean; + + export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; +} +declare module "ace-code/src/lib/keys" { + export function keyCodeToString(keyCode: number): string; +} +declare module "ace-code/src/lib/event" { + export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; + + export function removeListener(elem: any, type: any, callback: any): void; + + export function stopEvent(e: any): boolean; + + export function stopPropagation(e: any): void; + + export function preventDefault(e: any): void; + + export function getButton(e: any): any; + + export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; + + export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; + + export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; + + export function getModifierString(e: KeyboardEvent | MouseEvent): any; + + export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; + + export function nextTick(callback: any, win: any): void; + + export function onIdle(cb: any, timeout: any): number; + + export function blockIdle(delay: any): void; + + export const nextFrame: any; +} +declare module "ace-code/src/lib/event_emitter" { + /**@type {any}*/ + export var EventEmitter: any; +} +declare module "ace-code/src/lib/net" { + export function get(url: any, callback: any): void; + + export function loadScript(path: any, callback: any): void; + + export function qualifyURL(url: any): string; +} +declare module "ace-code/src/lib/report_error" { + export function reportError(msg: any, data: any): void; +} +declare module "ace-code/src/lib/default_english_messages" { + export var defaultEnglishMessages: { + "autocomplete.popup.aria-roledescription": string; + "autocomplete.popup.aria-label": string; + "autocomplete.popup.item.aria-roledescription": string; + "autocomplete.loading": string; + "editor.scroller.aria-roledescription": string; + "editor.scroller.aria-label": string; + "editor.gutter.aria-roledescription": string; + "editor.gutter.aria-label": string; + "error-marker.good-state": string; + "prompt.recently-used": string; + "prompt.other-commands": string; + "prompt.no-matching-commands": string; + "search-box.find.placeholder": string; + "search-box.find-all.text": string; + "search-box.replace.placeholder": string; + "search-box.replace-next.text": string; + "search-box.replace-all.text": string; + "search-box.toggle-replace.title": string; + "search-box.toggle-regexp.title": string; + "search-box.toggle-case.title": string; + "search-box.toggle-whole-word.title": string; + "search-box.toggle-in-selection.title": string; + "search-box.search-counter": string; + "text-input.aria-roledescription": string; + "text-input.aria-label": string; + "gutter.code-folding.range.aria-label": string; + "gutter.code-folding.closed.aria-label": string; + "gutter.code-folding.open.aria-label": string; + "gutter.code-folding.closed.title": string; + "gutter.code-folding.open.title": string; + "gutter.annotation.aria-label.error": string; + "gutter.annotation.aria-label.warning": string; + "gutter.annotation.aria-label.info": string; + "inline-fold.closed.title": string; + "gutter-tooltip.aria-label.error.singular": string; + "gutter-tooltip.aria-label.error.plural": string; + "gutter-tooltip.aria-label.warning.singular": string; + "gutter-tooltip.aria-label.warning.plural": string; + "gutter-tooltip.aria-label.info.singular": string; + "gutter-tooltip.aria-label.info.plural": string; + }; +} +declare module "ace-code/src/lib/app_config" { + const AppConfig_base: undefined; + + export class AppConfig { + /** + * @param {Object} obj + * @param {string} path + * @param {{ [key: string]: any }} options + * @returns {AppConfig} + */ + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + + /** + * @param {Object} obj + */ + resetOptions(obj: any): void; + + /** + * @param {string} path + * @param {string} name + * @param {any} value + */ + setDefaultValue(path: string, name: string, value: any): boolean; + + /** + * @param {string} path + * @param {{ [key: string]: any; }} optionHash + */ + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + + /** + * @param {any} value + */ + setMessages(value: any): void; + + /** + * @param {string} key + * @param {string} defaultString + * @param {{ [x: string]: any; }} [params] + */ + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + + warn: typeof warn; + reportError: (msg: any, data: any) => void; + } + + function warn(message: any, ...args: any[]): void; + + export {}; + namespace Ace { + type EventEmitter = import("ace-code").Ace.EventEmitter; + } + + export interface AppConfig extends Ace.EventEmitter { + } +} +declare module "ace-code/src/lib/scroll" { + export function preventParentScroll(event: any): void; +} +declare module "ace-code/src/lib/bidiutil" { + export const ON_R: 3; + export const AN: 4; + export const R_H: 5; + export const B: 6; + export const RLE: 7; + export const DOT: "·"; + + export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; + + export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; + + export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; + + export var L: number; + export var R: number; + export var EN: number; +} +declare module "ace-code/src/lib/fixoldbrowsers" { + export {}; +} diff --git a/ace-modules.d.ts b/ace-modules.d.ts index b50e0ff5a0d..476b01190fd 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -1,210 +1,30 @@ -declare module "ace-code/src/lib/useragent" { - export namespace OS { - let LINUX: string; - let MAC: string; - let WINDOWS: string; - } - - export function getOS(): string; - - export const isWin: boolean; - export const isMac: boolean; - export const isLinux: boolean; - export const isIE: number; - export const isOldIE: boolean; - export const isGecko: any; - export const isMozilla: any; - export const isOpera: boolean; - export const isWebKit: number; - export const isChrome: number; - export const isSafari: true; - export const isEdge: number; - export const isAIR: boolean; - export const isAndroid: boolean; - export const isChromeOS: boolean; - export const isIOS: boolean; - export const isMobile: boolean; -} -declare module "ace-code/src/lib/dom" { - export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; - - export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; - - export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; - - export function removeChildren(element: HTMLElement): void; - - export function createTextNode(textContent: string, element?: HTMLElement): Text; - - export function createFragment(element?: HTMLElement): DocumentFragment; - - export function hasCssClass(el: HTMLElement, name: string): boolean; - - export function addCssClass(el: HTMLElement, name: string): void; - - export function removeCssClass(el: HTMLElement, name: string): void; - - export function toggleCssClass(el: HTMLElement, name: string): boolean; - - export function setCssClass(node: HTMLElement, className: string, include: boolean): void; - - export function hasCssString(id: string, doc?: Document): boolean; - - export function removeElementById(id: string, doc?: Document): void; - - export function useStrictCSP(value: any): void; - - export function importCssStylsheet(uri: string, doc?: Document): void; - - export function scrollbarWidth(doc?: Document): number; - - export function computedStyle(element: Element, style?: any): Partial; - - export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; - - export const HAS_CSS_ANIMATION: boolean; - export const HAS_CSS_TRANSFORMS: boolean; - export const HI_DPI: boolean; - - export function translate(element: any, tx: any, ty: any): void; - - export function importCssString(cssText: any, id: any, target: any): number; -} -declare module "ace-code/src/lib/oop" { - export function inherits(ctor: any, superCtor: any): void; - - export function mixin(obj: T, mixin: any): any; - - export function implement(proto: T, mixin: any): any; -} -declare module "ace-code/src/lib/deep_copy" { - export function deepCopy(obj: any): any; -} -declare module "ace-code/src/lib/lang" { - export function last(a: any): any; - - export function stringReverse(string: any): any; - - export function stringRepeat(string: any, count: any): string; - - export function stringTrimLeft(string: any): any; - - export function stringTrimRight(string: any): any; - - export function copyObject(obj: any): {}; - - export function copyArray(array: any): any[]; - - export const deepCopy: (obj: any) => any; - - export function arrayToMap(arr: any): {}; - - export function createMap(props: any): any; - - export function arrayRemove(array: any, value: any): void; - - export function escapeRegExp(str: any): any; - - export function escapeHTML(str: any): string; - - export function getMatchOffsets(string: any, regExp: any): any[]; - - export function deferredCall(fcn: any): { - (timeout: any): any; - schedule: any; - call(): any; - cancel(): any; - isPending(): any; - }; - - export function delayedCall(fcn: any, defaultTimeout: any): { - (timeout: any): void; - delay(timeout: any): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - - export function supportsLookbehind(): boolean; - - export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; -} -declare module "ace-code/src/lib/keys" { -} -declare module "ace-code/src/lib/event" { - export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; - - export function removeListener(elem: any, type: any, callback: any): void; - - export function stopEvent(e: any): boolean; - - export function stopPropagation(e: any): void; - - export function preventDefault(e: any): void; - - export function getButton(e: any): any; - - export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; - - export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; - - export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; - - export function getModifierString(e: KeyboardEvent | MouseEvent): any; - - export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; - - export function nextTick(callback: any, win: any): void; - - export function onIdle(cb: any, timeout: any): number; - - export function blockIdle(delay: any): void; - - export const nextFrame: any; -} -declare module "ace-code/src/lib/event_emitter" { - /**@type {any}*/ - export var EventEmitter: any; -} declare module "ace-code/src/layer/font_metrics" { const FontMetrics_base: undefined; - export class FontMetrics { /** * @param {HTMLElement} parentEl */ constructor(parentEl: HTMLElement); - el: HTMLDivElement; - /** * @param size */ checkForSizeChanges(size: any): void; - charSizes: any; allowBoldFonts: boolean; - /** * @param {boolean} val */ setPolling(val: boolean): void; - getCharacterWidth(ch: any): any; - destroy(): void; - els: any[] | HTMLElement | Text; - transformCoordinates(clientPos: any, elPos: any): any[]; } - export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface FontMetrics extends Ace.EventEmitter { } } @@ -213,7 +33,6 @@ declare module "ace-code/src/apply_delta" { } declare module "ace-code/src/document" { const Document_base: undefined; - /** * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. @@ -225,20 +44,17 @@ declare module "ace-code/src/document" { * @param {String | String[]} textOrLines text The starting text **/ constructor(textOrLines: string | string[]); - /** * Replaces all the lines in the current `Document` with the value of `text`. * * @param {String} text The text to use **/ setValue(text: string): void; - /** * Returns all the lines in the document as a single string, joined by the new line character. * @returns {String} **/ getValue(): string; - /** * Creates a new `Anchor` to define a floating point in the document. * @param {Number} row The row number to use @@ -246,7 +62,6 @@ declare module "ace-code/src/document" { * @returns {Anchor} **/ createAnchor(row: number, column: number): Anchor; - /** * Returns the newline character that's being used, depending on the value of `newLineMode`. * @returns {String} If `newLineMode == windows`, `\r\n` is returned. @@ -255,34 +70,29 @@ declare module "ace-code/src/document" { * **/ getNewLineCharacter(): string; - /** * [Sets the new line mode.]{: #Document.setNewLineMode.desc} * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} **/ setNewLineMode(newLineMode: NewLineMode): void; - /** * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} * @returns {NewLineMode} **/ getNewLineMode(): NewLineMode; - /** * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * @param {String} text The text to check * @returns {boolean} **/ isNewLine(text: string): boolean; - /** * Returns a verbatim copy of the given line as it is in the document * @param {Number} row The row index to retrieve * @returns {string} **/ getLine(row: number): string; - /** * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * @param {Number} firstRow The first row index to retrieve @@ -290,19 +100,16 @@ declare module "ace-code/src/document" { * @returns {string[]} **/ getLines(firstRow: number, lastRow: number): string[]; - /** * Returns all lines in the document as string array. * @returns {string[]} **/ getAllLines(): string[]; - /** * Returns the number of rows in the document. * @returns {Number} **/ getLength(): number; - /** * Returns all the text within `range` as a single string. * @param {IRange} range The range to work with. @@ -310,7 +117,6 @@ declare module "ace-code/src/document" { * @returns {String} **/ getTextRange(range: IRange): string; - /** * Returns all the text within `range` as an array of lines. * @param {IRange} range The range to work with. @@ -318,7 +124,6 @@ declare module "ace-code/src/document" { * @returns {string[]} **/ getLinesForRange(range: IRange): string[]; - /** * @param row * @param lines @@ -326,7 +131,6 @@ declare module "ace-code/src/document" { * @deprecated */ insertLines(row: any, lines: any): void; - /** * @param firstRow * @param lastRow @@ -335,7 +139,6 @@ declare module "ace-code/src/document" { * @deprecated */ removeLines(firstRow: any, lastRow: any): string[]; - /** * @param position * @returns {Point} @@ -343,7 +146,6 @@ declare module "ace-code/src/document" { * @deprecated */ insertNewLine(position: any): Point; - /** * Inserts a block of `text` at the indicated `position`. * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` @@ -352,7 +154,6 @@ declare module "ace-code/src/document" { **/ insert(position: Point, text: string): Point; - /** * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event. * @@ -365,7 +166,6 @@ declare module "ace-code/src/document" { * @returns {Point} Returns the position of the end of the inserted text **/ insertInLine(position: Point, text: string): Point; - /** * * @param {number} row @@ -373,20 +173,17 @@ declare module "ace-code/src/document" { * @return {Point} */ clippedPos(row: number, column: number): Point; - /** * @param {Point} pos * @return {Point} */ clonePos(pos: Point): Point; - /** * @param {number} row * @param {number} column * @return {Point} */ pos(row: number, column: number): Point; - /** * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. * @param {Number} row The index of the row to insert at @@ -394,7 +191,6 @@ declare module "ace-code/src/document" { **/ insertFullLines(row: number, lines: string[]): void; - /** * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. * @param {Point} position @@ -409,7 +205,6 @@ declare module "ace-code/src/document" { * ``` **/ insertMergedLines(position: Point, lines: string[]): Point; - /** * Removes the `range` from the document. * @param {IRange} range A specified Range to remove @@ -417,7 +212,6 @@ declare module "ace-code/src/document" { **/ remove(range: IRange): Point; - /** * Removes the specified columns from the `row`. This method also triggers a `"change"` event. * @param {Number} row The row to remove from @@ -427,7 +221,6 @@ declare module "ace-code/src/document" { **/ removeInLine(row: number, startColumn: number, endColumn: number): Point; - /** * Removes a range of full lines. This method also triggers the `"change"` event. * @param {Number} firstRow The first row to be removed @@ -436,14 +229,12 @@ declare module "ace-code/src/document" { **/ removeFullLines(firstRow: number, lastRow: number): string[]; - /** * Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event. * @param {Number} row The row to check * **/ removeNewLine(row: number): void; - /** * Replaces a range in the document with the new `text`. * @param {Range | IRange} range A specified Range to replace @@ -455,32 +246,27 @@ declare module "ace-code/src/document" { * **/ replace(range: Range | IRange, text: string): Point; - /** * Applies all changes in `deltas` to the document. * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) **/ applyDeltas(deltas: Delta[]): void; - /** * Reverts all changes in `deltas` from the document. * @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions) **/ revertDeltas(deltas: Delta[]): void; - /** * Applies `delta` to the document. * @param {Delta} delta A delta object (can include "insert" and "remove" actions) * @param {boolean} [doNotValidate] **/ applyDelta(delta: Delta, doNotValidate?: boolean): void; - /** * Reverts `delta` from the document. * @param {Delta} delta A delta object (can include "insert" and "remove" actions) **/ revertDelta(delta: Delta): void; - /** * Converts an index position in a document to a `{row, column}` object. * @@ -498,7 +284,6 @@ declare module "ace-code/src/document" { * @returns {Point} A `{row, column}` object of the `index` position */ indexToPosition(index: number, startRow?: number): Point; - /** * Converts the `{row, column}` position in a document to the character's index. * @@ -517,7 +302,6 @@ declare module "ace-code/src/document" { */ positionToIndex(pos: Point, startRow?: number): number; } - export type Delta = import("ace-code").Ace.Delta; export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; @@ -531,13 +315,11 @@ declare module "ace-code/src/document" { type EventEmitter = import("ace-code").Ace.EventEmitter; type DocumentEvents = import("ace-code").Ace.DocumentEvents; } - export interface Document extends Ace.EventEmitter { } } declare module "ace-code/src/anchor" { const Anchor_base: undefined; - /** * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. **/ @@ -550,26 +332,22 @@ declare module "ace-code/src/anchor" { * @param {Number} [column] The starting column position **/ constructor(doc: Document, row: number | import("ace-code").Ace.Point, column?: number); - /** * Returns an object identifying the `row` and `column` position of the current anchor. * @returns {import("ace-code").Ace.Point} **/ getPosition(): import("ace-code").Ace.Point; - /** * * Returns the current document. * @returns {Document} **/ getDocument(): Document; - /** * Internal function called when `"change"` event fired. * @param {import("ace-code").Ace.Delta} delta */ onChange(delta: import("ace-code").Ace.Delta): void; - /** * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. * @param {Number} row The row index to move the anchor to @@ -577,28 +355,23 @@ declare module "ace-code/src/anchor" { * @param {Boolean} [noClip] Identifies if you want the position to be clipped **/ setPosition(row: number, column: number, noClip?: boolean): void; - row: any; column: number; - /** * When called, the `"change"` event listener is removed. * **/ detach(): void; - /** * When called, the `"change"` event listener is appended. * @param {Document} doc The document to associate with * **/ attach(doc: Document): void; - /**@type{Document}*/ document: Document; markerId?: number; } - export type Document = import("ace-code/src/document").Document; export {}; namespace Ace { @@ -606,128 +379,11 @@ declare module "ace-code/src/anchor" { type AnchorEvents = import("ace-code").Ace.AnchorEvents; type Document = import("ace-code").Ace.Document; } - export interface Anchor extends Ace.EventEmitter { markerId?: number; document: Ace.Document; } } -declare module "ace-code/src/lib/net" { - export function get(url: any, callback: any): void; - - export function loadScript(path: any, callback: any): void; - - export function qualifyURL(url: any): string; -} -declare module "ace-code/src/lib/report_error" { - export function reportError(msg: any, data: any): void; -} -declare module "ace-code/src/lib/default_english_messages" { - export var defaultEnglishMessages: { - "autocomplete.popup.aria-roledescription": string; - "autocomplete.popup.aria-label": string; - "autocomplete.popup.item.aria-roledescription": string; - "autocomplete.loading": string; - "editor.scroller.aria-roledescription": string; - "editor.scroller.aria-label": string; - "editor.gutter.aria-roledescription": string; - "editor.gutter.aria-label": string; - "error-marker.good-state": string; - "prompt.recently-used": string; - "prompt.other-commands": string; - "prompt.no-matching-commands": string; - "search-box.find.placeholder": string; - "search-box.find-all.text": string; - "search-box.replace.placeholder": string; - "search-box.replace-next.text": string; - "search-box.replace-all.text": string; - "search-box.toggle-replace.title": string; - "search-box.toggle-regexp.title": string; - "search-box.toggle-case.title": string; - "search-box.toggle-whole-word.title": string; - "search-box.toggle-in-selection.title": string; - "search-box.search-counter": string; - "text-input.aria-roledescription": string; - "text-input.aria-label": string; - "gutter.code-folding.range.aria-label": string; - "gutter.code-folding.closed.aria-label": string; - "gutter.code-folding.open.aria-label": string; - "gutter.code-folding.closed.title": string; - "gutter.code-folding.open.title": string; - "gutter.annotation.aria-label.error": string; - "gutter.annotation.aria-label.warning": string; - "gutter.annotation.aria-label.info": string; - "inline-fold.closed.title": string; - "gutter-tooltip.aria-label.error.singular": string; - "gutter-tooltip.aria-label.error.plural": string; - "gutter-tooltip.aria-label.warning.singular": string; - "gutter-tooltip.aria-label.warning.plural": string; - "gutter-tooltip.aria-label.info.singular": string; - "gutter-tooltip.aria-label.info.plural": string; - }; -} -declare module "ace-code/src/lib/app_config" { - const AppConfig_base: undefined; - - export class AppConfig { - /** - * @param {Object} obj - * @param {string} path - * @param {{ [key: string]: any }} options - * @returns {AppConfig} - */ - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): AppConfig; - - /** - * @param {Object} obj - */ - resetOptions(obj: any): void; - - /** - * @param {string} path - * @param {string} name - * @param {any} value - */ - setDefaultValue(path: string, name: string, value: any): boolean; - - /** - * @param {string} path - * @param {{ [key: string]: any; }} optionHash - */ - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - - /** - * @param {any} value - */ - setMessages(value: any): void; - - /** - * @param {string} key - * @param {string} defaultString - * @param {{ [x: string]: any; }} [params] - */ - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - - warn: typeof warn; - reportError: (msg: any, data: any) => void; - } - - function warn(message: any, ...args: any[]): void; - - export {}; - namespace Ace { - type EventEmitter = import("ace-code").Ace.EventEmitter; - } - - export interface AppConfig extends Ace.EventEmitter { - } -} declare module "ace-code/src/config" { const _exports: { defineOptions(obj: any, path: string, options: { @@ -802,134 +458,103 @@ declare module "ace-code/src/config" { declare module "ace-code/src/layer/lines" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; - export class Lines { /** * @param {HTMLElement} element * @param {number} [canvasHeight] */ constructor(element: HTMLElement, canvasHeight?: number); - element: HTMLElement; canvasHeight: number; cells: any[]; cellCache: any[]; - /** * @param {LayerConfig} config */ moveContainer(config: LayerConfig): void; - /** * @param {LayerConfig} oldConfig * @param {LayerConfig} newConfig */ pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; - /** * @param {number} row * @param {Partial} config * @param {EditSession} session */ computeLineTop(row: number, config: Partial, session: EditSession): number; - /** * @param {number} row * @param {LayerConfig} config * @param {EditSession} session */ computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; - getLength(): number; - /** * @param {number} index */ get(index: number): any; - shift(): void; - pop(): void; - push(cell: any): void; - unshift(cell: any): void; - last(): any; - createCell(row: any, config: any, session: any, initElement: any): any; } } declare module "ace-code/src/layer/gutter" { const Gutter_base: undefined; - export class Gutter { /** * @param {HTMLElement} parentEl */ constructor(parentEl: HTMLElement); - element: HTMLDivElement; gutterWidth: number; - /** * @param {EditSession} session */ setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** * @param {number} row * @param {string} className */ addGutterDecoration(row: number, className: string): void; - /** * @param {number} row * @param {string} className */ removeGutterDecoration(row: number, className: string): void; - /** * @param {any[]} annotations */ setAnnotations(annotations: any[]): void; - /** * @param {LayerConfig} config */ update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; oldLastRow: number; - updateLineHighlight(): void; - /** * @param {LayerConfig} config */ scrollLines(config: LayerConfig): void; - /** * @param {boolean} highlightGutterLine */ setHighlightGutterLine(highlightGutterLine: boolean): void; - /** * @param {boolean} show */ setShowLineNumbers(show: boolean): void; - getShowLineNumbers(): boolean; - /** * @param {boolean} [show] */ setShowFoldWidgets(show?: boolean): void; - getShowFoldWidgets(): boolean; - /** * @param {{ x: number; }} point */ @@ -937,7 +562,6 @@ declare module "ace-code/src/layer/gutter" { x: number; }): "markers" | "foldWidgets"; } - export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; import Lines_1 = require("ace-code/src/layer/lines"); @@ -947,60 +571,47 @@ declare module "ace-code/src/layer/gutter" { type EventEmitter = import("ace-code").Ace.EventEmitter; type GutterEvents = import("ace-code").Ace.GutterEvents; } - export interface Gutter extends Ace.EventEmitter { } } declare module "ace-code/src/layer/marker" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; - export class Marker { /** * @param {HTMLElement} parentEl */ constructor(parentEl: HTMLElement); - element: HTMLDivElement; - /** * @param {number} padding */ setPadding(padding: number): void; - /** * @param {EditSession} session */ setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** * @param {{ [x: number]: import("ace-code").Ace.MarkerLike; }} markers */ setMarkers(markers: { [x: number]: import("ace-code").Ace.MarkerLike; }): void; - markers: { [x: number]: import("ace-code").Ace.MarkerLike; }; - /** * @param {string} className * @param {string} css */ elt(className: string, css: string): void; - i: number; - /** * @param {LayerConfig} config */ update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1009,7 +620,6 @@ declare module "ace-code/src/layer/marker" { * @param {string} [extraStyle] */ drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1018,7 +628,6 @@ declare module "ace-code/src/layer/marker" { * @param {string} [extraStyle] */ drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1028,7 +637,6 @@ declare module "ace-code/src/layer/marker" { * @param {string} [extraStyle] */ drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1038,7 +646,6 @@ declare module "ace-code/src/layer/marker" { * @param {string} extraStyle */ drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1047,7 +654,6 @@ declare module "ace-code/src/layer/marker" { * @param {undefined} [extraStyle] */ drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; - /** * @param {undefined} stringBuilder * @param {Range} range @@ -1057,7 +663,6 @@ declare module "ace-code/src/layer/marker" { */ drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; } - import Range_2 = require("ace-code/src/range"); import Range = Range_2.Range; } @@ -1066,87 +671,67 @@ declare module "ace-code/src/layer/text_util" { } declare module "ace-code/src/layer/text" { const Text_base: undefined; - export class Text { /** * @param {HTMLElement} parentEl */ constructor(parentEl: HTMLElement); - dom: typeof dom; element: HTMLDivElement; EOL_CHAR: any; - /** * @param {number} padding */ setPadding(padding: number): void; - /** * @returns {number} */ getLineHeight(): number; - /** * @returns {number} */ getCharacterWidth(): number; - checkForSizeChanges(): void; - /** * @param {EditSession} session */ setSession(session: EditSession): void; - /**@type {EditSession}*/ session: EditSession; - /** * @param {string} showInvisibles */ setShowInvisibles(showInvisibles: string): boolean; - showInvisibles: any; showSpaces: boolean; showTabs: boolean; showEOL: boolean; - /** * @param {boolean} display */ setDisplayIndentGuides(display: boolean): boolean; - displayIndentGuides: any; - /** * @param {boolean} highlight */ setHighlightIndentGuides(highlight: boolean): boolean; - tabSize: number; - /** * @param {LayerConfig} config * @param {number} firstRow * @param {number} lastRow */ updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; - config?: import("ace-code").Ace.LayerConfig; - /** * @param {LayerConfig} config */ scrollLines(config: LayerConfig): void; - /** * @param {LayerConfig} config */ update(config: LayerConfig): void; - renderIndentGuide(parent: any, value: any, max: any): any; - EOF_CHAR: string; EOL_CHAR_LF: string; EOL_CHAR_CRLF: string; @@ -1156,7 +741,6 @@ declare module "ace-code/src/layer/text" { destroy: {}; onChangeTabSize: () => void; } - export type LayerConfig = import("ace-code").Ace.LayerConfig; export type EditSession = import("ace-code/src/edit_session").EditSession; import dom = require("ace-code/src/lib/dom"); @@ -1168,7 +752,6 @@ declare module "ace-code/src/layer/text" { type TextEvents = import("ace-code").Ace.TextEvents; type LayerConfig = import("ace-code").Ace.LayerConfig; } - export interface Text extends Ace.EventEmitter { config?: Ace.LayerConfig; } @@ -1179,7 +762,6 @@ declare module "ace-code/src/layer/cursor" { * @param {HTMLElement} parentEl */ constructor(parentEl: HTMLElement); - element: HTMLDivElement; isVisible: boolean; isBlinking: boolean; @@ -1187,46 +769,33 @@ declare module "ace-code/src/layer/cursor" { smoothBlinking: boolean; cursors: any[]; cursor: HTMLDivElement; - /** * @param {number} padding */ setPadding(padding: number): void; - /** * @param {EditSession} session */ setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - /** * @param {boolean} blinking */ setBlinking(blinking: boolean): void; - /** * @param {number} blinkInterval */ setBlinkInterval(blinkInterval: number): void; - /** * @param {boolean} smoothBlinking */ setSmoothBlinking(smoothBlinking: boolean): void; - addCursor(): HTMLDivElement; - removeCursor(): any; - hideCursor(): void; - showCursor(): void; - restartTimer(): void; - intervalId: number; - /** * @param {import("ace-code").Ace.Point} [position] * @param {boolean} [onScreen] @@ -1235,29 +804,21 @@ declare module "ace-code/src/layer/cursor" { left: number; top: number; }; - isCursorInView(pixelPos: any, config: any): boolean; - update(config: any): void; - config: any; overwrite: any; - destroy(): void; - drawCursor: any; timeoutId?: number; } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export interface Cursor { timeoutId?: number; } } declare module "ace-code/src/scrollbar" { const VScrollBar_base: typeof Scrollbar; - /** * Represents a vertical scroll bar. **/ @@ -1268,41 +829,34 @@ declare module "ace-code/src/scrollbar" { * @param {Object} renderer An editor renderer **/ constructor(parent: Element, renderer: any); - scrollTop: number; scrollHeight: number; width: number; - /** * Emitted when the scroll bar, well, scrolls. * @event scroll **/ onScroll(): void; - /** * Returns the width of the scroll bar. * @returns {Number} **/ getWidth(): number; - /** * Sets the height of the scroll bar, in pixels. * @param {Number} height The new height **/ setHeight(height: number): void; - /** * Sets the scroll height of the scroll bar, in pixels. * @param {Number} height The new scroll height **/ setScrollHeight(height: number): void; - /** * Sets the scroll top of the scroll bar. * @param {Number} scrollTop The new scroll top **/ setScrollTop(scrollTop: number): void; - /** * Sets the inner height of the scroll bar, in pixels. * @param {Number} height The new inner height @@ -1310,9 +864,7 @@ declare module "ace-code/src/scrollbar" { **/ setInnerHeight: (height: number) => void; } - const HScrollBar_base: typeof Scrollbar; - /** * Represents a horisontal scroll bar. **/ @@ -1323,48 +875,40 @@ declare module "ace-code/src/scrollbar" { * @param {Object} renderer An editor renderer **/ constructor(parent: Element, renderer: any); - scrollLeft: number; height: any; - /** * Emitted when the scroll bar, well, scrolls. * @event scroll **/ onScroll(): void; - /** * Returns the height of the scroll bar. * @returns {Number} **/ getHeight(): number; - /** * Sets the width of the scroll bar, in pixels. * @param {Number} width The new width **/ setWidth(width: number): void; - /** * Sets the inner width of the scroll bar, in pixels. * @param {Number} width The new inner width * @deprecated Use setScrollWidth instead **/ setInnerWidth(width: number): void; - /** * Sets the scroll width of the scroll bar, in pixels. * @param {Number} width The new scroll width **/ setScrollWidth(width: number): void; - /** * Sets the scroll left of the scroll bar. * @param {Number} scrollLeft The new scroll left **/ setScrollLeft(scrollLeft: number): void; } - /** * An abstract class representing a native scrollbar control. **/ @@ -1375,13 +919,10 @@ declare module "ace-code/src/scrollbar" { * @param {string} classSuffix **/ constructor(parent: Element, classSuffix: string); - element: HTMLDivElement; inner: HTMLDivElement; skipEvent: boolean; - setVisible(isVisible: any): void; - isVisible: any; coeff: number; } @@ -1390,16 +931,13 @@ declare module "ace-code/src/scrollbar" { namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface VScrollBar extends Ace.EventEmitter { } - export interface HScrollBar extends Ace.EventEmitter { } } declare module "ace-code/src/scrollbar_custom" { const VScrollBar_base: typeof ScrollBar; - /** * Represents a vertical scroll bar. * @class VScrollBar @@ -1413,43 +951,35 @@ declare module "ace-code/src/scrollbar_custom" { **/ export class VScrollBar extends ScrollBar { constructor(parent: any, renderer: any); - scrollTop: number; scrollHeight: number; parent: any; width: number; renderer: any; - /** * Emitted when the scroll thumb dragged or scrollbar canvas clicked. **/ onMouseDown(eType: any, e: any): void; - getHeight(): number; - /** * Returns new top for scroll thumb * @param {Number}thumbTop * @returns {Number} **/ scrollTopFromThumbTop(thumbTop: number): number; - /** * Returns the width of the scroll bar. * @returns {Number} **/ getWidth(): number; - /** * Sets the height of the scroll bar, in pixels. * @param {Number} height The new height **/ setHeight(height: number): void; - height: number; slideHeight: number; viewHeight: number; - /** * Sets the inner and scroll height of the scroll bar, in pixels. * @param {Number} height The new inner height @@ -1457,22 +987,17 @@ declare module "ace-code/src/scrollbar_custom" { * @param {boolean} force Forcely update height **/ setScrollHeight(height: number, force: boolean): void; - pageHeight: any; thumbHeight: number; - /** * Sets the scroll top of the scroll bar. * @param {Number} scrollTop The new scroll top **/ setScrollTop(scrollTop: number): void; - thumbTop: number; setInnerHeight: (height: number, force: boolean) => void; } - const HScrollBar_base: typeof ScrollBar; - /** * Represents a horizontal scroll bar. **/ @@ -1483,60 +1008,49 @@ declare module "ace-code/src/scrollbar_custom" { * @param {Object} renderer An editor renderer **/ constructor(parent: Element, renderer: any); - scrollLeft: number; scrollWidth: number; height: number; renderer: any; - /** * Emitted when the scroll thumb dragged or scrollbar canvas clicked. **/ onMouseDown(eType: any, e: any): void; - /** * Returns the height of the scroll bar. * @returns {Number} **/ getHeight(): number; - /** * Returns new left for scroll thumb * @param {Number} thumbLeft * @returns {Number} **/ scrollLeftFromThumbLeft(thumbLeft: number): number; - /** * Sets the width of the scroll bar, in pixels. * @param {Number} width The new width **/ setWidth(width: number): void; - width: number; slideWidth: number; viewWidth: number; - /** * Sets the inner and scroll width of the scroll bar, in pixels. * @param {Number} width The new inner width * @param {boolean} force Forcely update width **/ setScrollWidth(width: number, force: boolean): void; - pageWidth: any; thumbWidth: number; - /** * Sets the scroll left of the scroll bar. * @param {Number} scrollLeft The new scroll left **/ setScrollLeft(scrollLeft: number): void; - thumbLeft: number; setInnerWidth: (width: number, force: boolean) => void; } - /** * An abstract class representing a native scrollbar control. **/ @@ -1547,15 +1061,12 @@ declare module "ace-code/src/scrollbar_custom" { * @param {string} classSuffix **/ constructor(parent: Element, classSuffix: string); - element: HTMLDivElement; inner: HTMLDivElement; VScrollWidth: number; HScrollHeight: number; skipEvent: boolean; - setVisible(isVisible: any): void; - isVisible: any; coeff: number; } @@ -1564,10 +1075,8 @@ declare module "ace-code/src/scrollbar_custom" { namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface VScrollBar extends Ace.EventEmitter { } - export interface HScrollBar extends Ace.EventEmitter { } } @@ -1577,14 +1086,11 @@ declare module "ace-code/src/renderloop" { **/ export class RenderLoop { constructor(onRender: any, win: any); - onRender: any; pending: boolean; changes: number; window: any; - schedule(change: any): void; - clear(change: any): number; } } @@ -1595,7 +1101,6 @@ declare module "ace-code/src/css/editor-css" { declare module "ace-code/src/layer/decorators" { export class Decorator { constructor(parent: any, renderer: any); - canvas: HTMLCanvasElement; renderer: any; pixelRatio: number; @@ -1607,14 +1112,12 @@ declare module "ace-code/src/layer/decorators" { minDecorationHeight: number; halfMinDecorationHeight: number; colors: {}; - compensateFoldRows(row: any, foldData: any): number; } } declare module "ace-code/src/virtual_renderer" { const VirtualRenderer_base: undefined; const VirtualRenderer_base_1: undefined; - /** * The class that is responsible for drawing everything you see on the screen! * @related editor.renderer @@ -1627,7 +1130,6 @@ declare module "ace-code/src/virtual_renderer" { **/ constructor(container?: HTMLElement | null, theme?: string); - container: HTMLElement; /**@type {HTMLElement}*/ scroller: HTMLElement; @@ -1673,23 +1175,17 @@ declare module "ace-code/src/virtual_renderer" { v: number; h: number; }; - updateCharacterSize(): void; - characterWidth: number; lineHeight: number; - /** * * Associates the renderer with an [[EditSession `EditSession`]]. * @param {EditSession} session The session to associate with **/ setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - onChangeNewLineMode(): void; - /** * Triggers a partial update of the text, from the range given by the two parameters. * @param {Number} firstRow The first row to update @@ -1697,26 +1193,21 @@ declare module "ace-code/src/virtual_renderer" { * @param {boolean} [force] **/ updateLines(firstRow: number, lastRow: number, force?: boolean): void; - onChangeTabSize(): void; - /** * Triggers a full update of the text, for all the rows. **/ updateText(): void; - /** * Triggers a full update of all the layers, for all the rows. * @param {Boolean} [force] If `true`, forces the changes through **/ updateFull(force?: boolean): void; - /** * Updates the font size. **/ updateFontSize(): void; - /** * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed @@ -1726,196 +1217,166 @@ declare module "ace-code/src/virtual_renderer" { **/ onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; - resizing: number; gutterWidth: any; - /** * * @param {number} width */ onGutterResize(width: number): void; - /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. **/ adjustWrapLimit(): boolean; - /** * Identifies whether you want to have an animated scroll or not. * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls **/ setAnimatedScroll(shouldAnimate: boolean): void; - /** * Returns whether an animated scroll happens or not. * @returns {Boolean} **/ getAnimatedScroll(): boolean; - /** * Identifies whether you want to show invisible characters or not. * @param {Boolean} showInvisibles Set to `true` to show invisibles **/ setShowInvisibles(showInvisibles: boolean): void; - /** * Returns whether invisible characters are being shown or not. * @returns {Boolean} **/ getShowInvisibles(): boolean; - /** * @return {boolean} */ getDisplayIndentGuides(): boolean; - /** * @param {boolean} display */ setDisplayIndentGuides(display: boolean): void; - /** * @return {boolean} */ getHighlightIndentGuides(): boolean; - /** * @param {boolean} highlight */ setHighlightIndentGuides(highlight: boolean): void; - /** * Identifies whether you want to show the print margin or not. * @param {Boolean} showPrintMargin Set to `true` to show the print margin **/ setShowPrintMargin(showPrintMargin: boolean): void; - /** * Returns whether the print margin is being shown or not. * @returns {Boolean} **/ getShowPrintMargin(): boolean; - /** * Identifies whether you want to show the print margin column or not. * @param {number} printMarginColumn Set to `true` to show the print margin column **/ setPrintMarginColumn(printMarginColumn: number): void; - /** * Returns whether the print margin column is being shown or not. * @returns {number} **/ getPrintMarginColumn(): number; - /** * Returns `true` if the gutter is being shown. * @returns {Boolean} **/ getShowGutter(): boolean; - /** * Identifies whether you want to show the gutter or not. * @param {Boolean} show Set to `true` to show the gutter **/ setShowGutter(show: boolean): void; - /** * @returns {boolean} */ getFadeFoldWidgets(): boolean; - /** * @param {boolean} show */ setFadeFoldWidgets(show: boolean): void; - /** * * @param {boolean} shouldHighlight */ setHighlightGutterLine(shouldHighlight: boolean): void; - /** * @returns {boolean} */ getHighlightGutterLine(): boolean; - /** * * Returns the root element containing this renderer. * @returns {HTMLElement} **/ getContainerElement(): HTMLElement; - /** * * Returns the element that the mouse events are attached to * @returns {HTMLElement} **/ getMouseEventTarget(): HTMLElement; - /** * * Returns the element to which the hidden text area is added. * @returns {HTMLElement} **/ getTextAreaContainer(): HTMLElement; - /** * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} * @returns {Number} **/ getFirstVisibleRow(): number; - /** * * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. * @returns {Number} **/ getFirstFullyVisibleRow(): number; - /** * * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. * @returns {Number} **/ getLastFullyVisibleRow(): number; - /** * * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} * @returns {Number} **/ getLastVisibleRow(): number; - /** * Sets the padding for all the layers. * @param {Number} padding A new padding value (in pixels) **/ setPadding(padding: number): void; - /** * * @param {number} [top] @@ -1925,7 +1386,6 @@ declare module "ace-code/src/virtual_renderer" { */ setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** * * @param {number} [top] @@ -1935,96 +1395,79 @@ declare module "ace-code/src/virtual_renderer" { */ setMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} **/ getHScrollBarAlwaysVisible(): boolean; - /** * Identifies whether you want to show the horizontal scrollbar or not. * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible **/ setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; - /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} **/ getVScrollBarAlwaysVisible(): boolean; - /** * Identifies whether you want to show the horizontal scrollbar or not. * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible **/ setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; - freeze(): void; - unfreeze(): void; - desiredHeight: any; - /** * Schedules an update to all the front markers in the document. **/ updateFrontMarkers(): void; - /** * * Schedules an update to all the back markers in the document. **/ updateBackMarkers(): void; - /** * * Deprecated; (moved to [[EditSession]]) * @deprecated **/ addGutterDecoration(row: any, className: any): void; - /** * Deprecated; (moved to [[EditSession]]) * @deprecated **/ removeGutterDecoration(row: any, className: any): void; - /** * * Redraw breakpoints. * @param {any} [rows] */ updateBreakpoints(rows?: any): void; - /** * Sets annotations for the gutter. * @param {import("ace-code").Ace.Annotation[]} annotations An array containing annotations * **/ setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; - /** * * Updates the cursor icon. **/ updateCursor(): void; - /** * * Hides the cursor icon. **/ hideCursor(): void; - /** * * Shows the cursor icon. **/ showCursor(): void; - /** * * @param {Point} anchor @@ -2032,7 +1475,6 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [offset] */ scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; - /** * * Scrolls the cursor into the first visibile area of the editor @@ -2044,33 +1486,28 @@ declare module "ace-code/src/virtual_renderer" { top?: any; bottom?: any; }): void; - /** * {:EditSession.getScrollTop} * @related EditSession.getScrollTop * @returns {Number} **/ getScrollTop(): number; - /** * {:EditSession.getScrollLeft} * @related EditSession.getScrollLeft * @returns {Number} **/ getScrollLeft(): number; - /** * Returns the first visible row, regardless of whether it's fully visible or not. * @returns {Number} **/ getScrollTopRow(): number; - /** * Returns the last visible row, regardless of whether it's fully visible or not. * @returns {Number} **/ getScrollBottomRow(): number; - /** * Gracefully scrolls from the top of the editor to the row indicated. * @param {Number} row A row id @@ -2078,7 +1515,6 @@ declare module "ace-code/src/virtual_renderer" { * @related EditSession.setScrollTop **/ scrollToRow(row: number): void; - /** * * @param {Point} cursor @@ -2086,7 +1522,6 @@ declare module "ace-code/src/virtual_renderer" { * @returns {number} */ alignCursor(cursor: Point, alignment?: number): number; - /** * Gracefully scrolls the editor to the row indicated. * @param {Number} line A line number @@ -2096,7 +1531,6 @@ declare module "ace-code/src/virtual_renderer" { **/ scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; - /** * * @param fromValue @@ -2104,33 +1538,28 @@ declare module "ace-code/src/virtual_renderer" { */ animateScrolling(fromValue: any, callback?: any): void; - /** * Scrolls the editor to the y pixel indicated. * @param {Number} scrollTop The position to scroll to **/ scrollToY(scrollTop: number): void; - /** * Scrolls the editor across the x-axis to the pixel indicated. * @param {Number} scrollLeft The position to scroll to **/ scrollToX(scrollLeft: number): void; - /** * Scrolls the editor across both x- and y-axes. * @param {Number} x The x value to scroll to * @param {Number} y The y value to scroll to **/ scrollTo(x: number, y: number): void; - /** * Scrolls the editor across both x- and y-axes. * @param {Number} deltaX The x value to scroll by * @param {Number} deltaY The y value to scroll by **/ scrollBy(deltaX: number, deltaY: number): void; - /** * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. * @param {Number} deltaX The x value to scroll by @@ -2139,7 +1568,6 @@ declare module "ace-code/src/virtual_renderer" { * @returns {Boolean} **/ isScrollableBy(deltaX: number, deltaY: number): boolean; - /** * * @param {number} x @@ -2148,7 +1576,6 @@ declare module "ace-code/src/virtual_renderer" { */ pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; - /** * * @param {number} x @@ -2157,7 +1584,6 @@ declare module "ace-code/src/virtual_renderer" { */ screenToTextCoordinates(x: number, y: number): Point; - /** * Returns an object containing the `pageX` and `pageY` coordinates of the document position. * @param {Number} row The document row position @@ -2169,25 +1595,21 @@ declare module "ace-code/src/virtual_renderer" { pageX: number; pageY: number; }; - /** * * Focuses the current container. **/ visualizeFocus(): void; - /** * * Blurs the current container. **/ visualizeBlur(): void; - /** * @param {Object} composition **/ showComposition(composition: any): void; - /** * @param {String} text A string of text to use * @@ -2195,22 +1617,18 @@ declare module "ace-code/src/virtual_renderer" { **/ setCompositionText(text: string): void; - /** * * Hides the current composition. **/ hideComposition(): void; - /** * @param {string} text * @param {Point} [position] */ setGhostText(text: string, position?: Point): void; - removeGhostText(): void; - /** * @param {string} text * @param {string} type @@ -2218,9 +1636,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [column] */ addToken(text: string, type: string, row: number, column?: number): void; - removeExtraToken(row: any, column: any): void; - /** * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} * @param {String | Theme} [theme] The path to a theme @@ -2228,45 +1644,37 @@ declare module "ace-code/src/virtual_renderer" { **/ setTheme(theme?: string | Theme, cb?: () => void): void; - /** * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} * @returns {String} **/ getTheme(): string; - /** * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} * @param {String} style A class name * @param {boolean}[include] **/ setStyle(style: string, include?: boolean): void; - /** * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} * @param {String} style A class name * **/ unsetStyle(style: string): void; - /** * @param {string} style */ setCursorStyle(style: string): void; - /** * @param {String} cursorStyle A css cursor style **/ setMouseCursor(cursorStyle: string): void; - attachToShadowRoot(): void; - /** * Destroys the text and cursor layers for this renderer. **/ destroy(): void; - CHANGE_CURSOR: number; CHANGE_MARKER: number; CHANGE_GUTTER: number; @@ -2286,7 +1694,6 @@ declare module "ace-code/src/virtual_renderer" { theme?: any; destroyed?: boolean; } - export type EditSession = import("ace-code/src/edit_session").EditSession; export type Point = import("ace-code").Ace.Point; export type Theme = import("ace-code").Ace.Theme; @@ -2314,7 +1721,6 @@ declare module "ace-code/src/virtual_renderer" { type VirtualRendererOptions = import("ace-code").Ace.VirtualRendererOptions; type EditSession = import("ace-code").Ace.EditSession; } - export interface VirtualRenderer extends Ace.EventEmitter, Ace.OptionsProvider { textarea?: HTMLTextAreaElement; enableKeyboardAccessibility?: boolean; @@ -2328,7 +1734,6 @@ declare module "ace-code/src/virtual_renderer" { declare module "ace-code/src/selection" { const Selection_base: undefined; const Selection_base_1: undefined; - /** * @typedef {import("ace-code/src/edit_session").EditSession} EditSession * @typedef {import("ace-code/src/anchor").Anchor} Anchor @@ -2341,7 +1746,6 @@ declare module "ace-code/src/selection" { * @constructor **/ constructor(session: EditSession); - /**@type {EditSession}*/ session: EditSession; /**@type {import("ace-code/src/document").Document}*/ @@ -2351,25 +1755,21 @@ declare module "ace-code/src/selection" { lead: Anchor; /**@type {Anchor}*/ anchor: Anchor; - /** * Returns `true` if the selection is empty. * @returns {Boolean} **/ isEmpty(): boolean; - /** * Returns `true` if the selection is a multi-line. * @returns {Boolean} **/ isMultiLine(): boolean; - /** * Returns an object containing the `row` and `column` current position of the cursor. * @returns {Point} **/ getCursor(): Point; - /** * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. * @param {Number} row The new row @@ -2377,7 +1777,6 @@ declare module "ace-code/src/selection" { * **/ setAnchor(row: number, column: number): void; - /** * Returns an object containing the `row` and `column` of the calling selection anchor. * @@ -2385,152 +1784,124 @@ declare module "ace-code/src/selection" { * @related Anchor.getPosition **/ getAnchor(): Point; - /** * Returns an object containing the `row` and `column` of the calling selection lead. * @returns {Object} **/ getSelectionLead(): any; - /** * Returns `true` if the selection is going backwards in the document. * @returns {Boolean} **/ isBackwards(): boolean; - /** * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} * @returns {Range} **/ getRange(): Range; - /** * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} **/ clearSelection(): void; - /** * Selects all the text in the document. **/ selectAll(): void; - /** * Sets the selection to the provided range. * @param {import("ace-code").Ace.IRange} range The range of text to select * @param {Boolean} [reverse] Indicates if the range should go backwards (`true`) or not **/ setRange(range: import("ace-code").Ace.IRange, reverse?: boolean): void; - /** * Moves the selection cursor to the indicated row and column. * @param {Number} row The row to select to * @param {Number} column The column to select to **/ selectTo(row: number, column: number): void; - /** * Moves the selection cursor to the row and column indicated by `pos`. * @param {Point} pos An object containing the row and column **/ selectToPosition(pos: Point): void; - /** * Moves the selection cursor to the indicated row and column. * @param {Number} row The row to select to * @param {Number} column The column to select to **/ moveTo(row: number, column: number): void; - /** * Moves the selection cursor to the row and column indicated by `pos`. * @param {Object} pos An object containing the row and column **/ moveToPosition(pos: any): void; - /** * Moves the selection up one row. **/ selectUp(): void; - /** * Moves the selection down one row. **/ selectDown(): void; - /** * Moves the selection right one column. **/ selectRight(): void; - /** * Moves the selection left one column. **/ selectLeft(): void; - /** * Moves the selection to the beginning of the current line. **/ selectLineStart(): void; - /** * Moves the selection to the end of the current line. **/ selectLineEnd(): void; - /** * Moves the selection to the end of the file. **/ selectFileEnd(): void; - /** * Moves the selection to the start of the file. **/ selectFileStart(): void; - /** * Moves the selection to the first word on the right. **/ selectWordRight(): void; - /** * Moves the selection to the first word on the left. **/ selectWordLeft(): void; - /** * Moves the selection to highlight the entire word. * @related EditSession.getWordRange **/ getWordRange(row: any, column: any): Range; - /** * Selects an entire word boundary. **/ selectWord(): void; - /** * Selects a word, including its right whitespace. * @related EditSession.getAWordRange **/ selectAWord(): void; - getLineRange(row: any, excludeLastChar: any): Range; - /** * Selects the entire line. **/ selectLine(): void; - /** * Moves the cursor up one row. **/ moveCursorUp(): void; - /** * Moves the cursor down one row. **/ moveCursorDown(): void; - /** * * Returns `true` if moving the character next to the cursor in the specified direction is a soft tab. @@ -2539,56 +1910,43 @@ declare module "ace-code/src/selection" { * @param {Number} direction 1 for right, -1 for left */ wouldMoveIntoSoftTab(cursor: Point, tabSize: number, direction: number): boolean; - /** * Moves the cursor left one column. **/ moveCursorLeft(): void; - /** * Moves the cursor right one column. **/ moveCursorRight(): void; - /** * Moves the cursor to the start of the line. **/ moveCursorLineStart(): void; - /** * Moves the cursor to the end of the line. **/ moveCursorLineEnd(): void; - /** * Moves the cursor to the end of the file. **/ moveCursorFileEnd(): void; - /** * Moves the cursor to the start of the file. **/ moveCursorFileStart(): void; - /** * Moves the cursor to the word on the right. **/ moveCursorLongWordRight(): void; - /** * * Moves the cursor to the word on the left. **/ moveCursorLongWordLeft(): void; - moveCursorShortWordRight(): void; - moveCursorShortWordLeft(): void; - moveCursorWordRight(): void; - moveCursorWordLeft(): void; - /** * Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document. * @param {Number} rows The number of rows to move by @@ -2597,13 +1955,11 @@ declare module "ace-code/src/selection" { * @related EditSession.documentToScreenPosition **/ moveCursorBy(rows: number, chars: number): void; - /** * Moves the selection to the position indicated by its `row` and `column`. * @param {Point} position The position to move to **/ moveCursorToPosition(position: Point): void; - /** * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} * @param {Number} row The row to move to @@ -2611,7 +1967,6 @@ declare module "ace-code/src/selection" { * @param {Boolean} [keepDesiredColumn] [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} **/ moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; - /** * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} * @param {Number} row The row to move to @@ -2619,16 +1974,13 @@ declare module "ace-code/src/selection" { * @param {Boolean} keepDesiredColumn {:preventUpdateBool} **/ moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - detach(): void; - /** * @param {Range & {desiredColumn?: number}} range */ fromOrientedRange(range: Range & { desiredColumn?: number; }): void; - /** * @param {Range & {desiredColumn?: number}} [range] */ @@ -2637,7 +1989,6 @@ declare module "ace-code/src/selection" { }): Range & { desiredColumn?: number; }; - /** * Saves the current cursor position and calls `func` that can change the cursor * postion. The result is the range of the starting and eventual cursor position. @@ -2646,26 +1997,22 @@ declare module "ace-code/src/selection" { * @returns {Range} **/ getRangeOfMovements(func: Function): Range; - /** * * @returns {Range|Range[]} */ toJSON(): Range | Range[]; - /** * * @param data */ fromJSON(data: any): void; - /** * * @param data * @return {boolean} */ isEqual(data: any): boolean; - /** * Left for backward compatibility * @deprecated @@ -2678,7 +2025,6 @@ declare module "ace-code/src/selection" { getSelectionAnchor: () => Point; setSelectionRange: (range: import("ace-code").Ace.IRange, reverse?: boolean) => void; } - export type EditSession = import("ace-code/src/edit_session").EditSession; export type Anchor = import("ace-code/src/anchor").Anchor; export type Point = import("ace-code").Ace.Point; @@ -2690,26 +2036,21 @@ declare module "ace-code/src/selection" { type SelectionEvents = import("ace-code").Ace.SelectionEvents; type MultiSelectProperties = import("ace-code").Ace.MultiSelectProperties; } - export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { } } declare module "ace-code/src/clipboard" { export let lineMode: string | false; - export function pasteCancelled(): boolean; - export function cancel(): void; } declare module "ace-code/src/keyboard/textinput" { export function $setUserAgentForTests(_isMobile: any, _isIOS: any): void; - export var TextInput: any; } declare module "ace-code/src/mouse/mouse_event" { export class MouseEvent { constructor(domEvent: any, editor: any); - /** @type {number} */ speed: number; /** @type {number} */ wheelX: number; /** @type {number} */ wheelY: number; @@ -2721,51 +2062,40 @@ declare module "ace-code/src/mouse/mouse_event" { clientY: any; propagationStopped: boolean; defaultPrevented: boolean; - stopPropagation(): void; - preventDefault(): void; - stop(): void; - /** * Get the document position below the mouse cursor * * @return {Object} 'row' and 'column' of the document position */ getDocumentPosition(): any; - /** * Get the relative position within the gutter. * * @return {Number} 'row' within the gutter. */ getGutterRow(): number; - /** * Check if the mouse cursor is inside of the text selection * * @return {Boolean} whether the mouse cursor is inside of the selection */ inSelection(): boolean; - /** * Get the clicked mouse button * * @return {Number} 0 for left button, 1 for middle button, 2 for right button */ getButton(): number; - /** * @return {Boolean} whether the shift key was pressed when the event was emitted */ getShiftKey(): boolean; - getAccelKey(): any; - time?: number; } - export interface MouseEvent { time?: number; } @@ -2773,21 +2103,17 @@ declare module "ace-code/src/mouse/mouse_event" { declare module "ace-code/src/mouse/default_handlers" { export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; - export class DefaultHandlers { /** * @param {MouseHandler} mouseHandler */ constructor(mouseHandler: MouseHandler); - /** * @param {MouseEvent} ev * @this {MouseHandler} */ onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - /** * * @param {import("ace-code").Ace.Position} [pos] @@ -2795,99 +2121,78 @@ declare module "ace-code/src/mouse/default_handlers" { * @this {MouseHandler} */ startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; - /** * @this {MouseHandler} */ select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** * @param {string | number} unitName * @this {MouseHandler} */ extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; - /** * @this {MouseHandler} */ selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** * @this {MouseHandler} */ focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** * @param {MouseEvent} ev * @this {MouseHandler} */ onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** * @param {MouseEvent} ev * @this {MouseHandler} */ onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** * @param {MouseEvent} ev * @this {MouseHandler} */ onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** * @param {MouseEvent} ev * @this {MouseHandler} */ onMouseWheel(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - selectEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; selectAllEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; selectByWordsEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; } } -declare module "ace-code/src/lib/scroll" { - export function preventParentScroll(event: any): void; -} declare module "ace-code/src/tooltip" { export class HoverTooltip extends Tooltip { constructor(parentNode?: HTMLElement); - timeout: number; lastT: number; idleTime: number; lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - onMouseOut(e: any): void; - /** * @param {MouseEvent} e * @param {Editor} editor */ onMouseMove(e: MouseEvent, editor: Editor): void; - waitForHover(): void; - /** * @param {Editor} editor */ addToEditor(editor: Editor): void; - /** * @param {Editor} editor */ removeFromEditor(editor: Editor): void; - /** * @param {MouseEvent} e */ isOutsideOfText(e: MouseEvent): boolean; - /** * @param {any} value */ setDataProvider(value: any): void; - /** * @param {Editor} editor * @param {Range} range @@ -2895,104 +2200,81 @@ declare module "ace-code/src/tooltip" { * @param {MouseEvent} startingEvent */ showForRange(editor: Editor, range: Range, domNode: any, startingEvent: MouseEvent): void; - range: Range; - /** * @param {Range} range * @param {EditSession} [session] */ addMarker(range: Range, session?: EditSession): void; - marker: number; row: number; } - export type Editor = import("ace-code/src/editor").Editor; export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; export type EditSession = import("ace-code/src/edit_session").EditSession; export var popupManager: PopupManager; - export class Tooltip { /** * @param {Element} parentNode **/ constructor(parentNode: Element); - isOpen: boolean; - /** * @returns {HTMLElement} **/ getElement(): HTMLElement; - /** * @param {String} text **/ setText(text: string): void; - /** * @param {String} html **/ setHtml(html: string): void; - /** * @param {Number} x * @param {Number} y **/ setPosition(x: number, y: number): void; - /** * @param {String} className **/ setClassName(className: string): void; - /** * @param {import("ace-code").Ace.Theme} theme */ setTheme(theme: import("ace-code").Ace.Theme): void; - /** * @param {String} [text] * @param {Number} [x] * @param {Number} [y] **/ show(text?: string, x?: number, y?: number): void; - hide(e: any): void; - /** * @returns {Number} **/ getHeight(): number; - /** * @returns {Number} **/ getWidth(): number; - destroy(): void; } - import Range_4 = require("ace-code/src/range"); import Range = Range_4.Range; - class PopupManager { /**@type{Tooltip[]} */ popups: Tooltip[]; - /** * @param {Tooltip} popup */ addPopup(popup: Tooltip): void; - /** * @param {Tooltip} popup */ removePopup(popup: Tooltip): void; - updatePopups(): void; - /** * @param {Tooltip} popupA * @param {Tooltip} popupB @@ -3000,9 +2282,7 @@ declare module "ace-code/src/tooltip" { */ doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; } - export {}; - export interface HoverTooltip { row: number; } @@ -3013,12 +2293,9 @@ declare module "ace-code/src/mouse/default_gutter_handler" { * @this {MouseHandler} */ export function GutterHandler(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, mouseHandler: MouseHandler): void; - export interface GutterHandler { } - export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - export class GutterTooltip extends Tooltip { static get annotationLabels(): { error: { @@ -3034,40 +2311,29 @@ declare module "ace-code/src/mouse/default_gutter_handler" { plural: any; }; }; - static annotationsToSummaryString(annotations: any): string; - constructor(editor: any); - editor: any; - setPosition(x: any, y: any): void; - showTooltip(row: any): void; - hideTooltip(): void; } - import Tooltip_1 = require("ace-code/src/tooltip"); import Tooltip = Tooltip_1.Tooltip; - export interface GutterHandler { } } declare module "ace-code/src/mouse/dragdrop_handler" { export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - /** * @param {MouseHandler} mouseHandler */ export function DragdropHandler(mouseHandler: MouseHandler): void; - export class DragdropHandler { /** * @param {MouseHandler} mouseHandler */ constructor(mouseHandler: MouseHandler); - /** * @param e * @this {MouseHandler} @@ -3110,14 +2376,10 @@ declare module "ace-code/src/mouse/mouse_handler" { * @param {Editor} editor */ constructor(editor: Editor); - /** @type {MouseEvent} */ mouseEvent: MouseEvent; editor: import("ace-code/src/editor").Editor; - onMouseEvent(name: any, e: any): void; - onMouseMove(name: any, e: any): void; - /** * @param {string} name * @param {{ wheelX: number; wheelY: number; }} e @@ -3126,29 +2388,21 @@ declare module "ace-code/src/mouse/mouse_handler" { wheelX: number; wheelY: number; }): void; - setState(state: any): void; - state: any; - captureMouse(ev: any, mouseMoveHandler: any): number; - x: any; y: any; isMousePressed: boolean; releaseMouse: (e: any) => void; - cancelContextMenu(): void; - destroy(): void; - cancelDrag?: boolean; mousedownEvent?: MouseEvent; startSelect?: (pos?: import("ace-code").Ace.Point, waitForClickSelection?: boolean) => void; select?: () => void; selectEnd?: () => void; } - export type Editor = import("ace-code/src/editor").Editor; import MouseEvent_1 = require("ace-code/src/mouse/mouse_event"); import MouseEvent = MouseEvent_1.MouseEvent; @@ -3157,7 +2411,6 @@ declare module "ace-code/src/mouse/mouse_handler" { type MouseEvent = import("ace-code").Ace.MouseEvent; type Point = import("ace-code").Ace.Point; } - export interface MouseHandler { cancelDrag?: boolean; mousedownEvent?: Ace.MouseEvent; @@ -3174,23 +2427,19 @@ declare module "ace-code/src/mouse/fold_handler" { declare module "ace-code/src/keyboard/keybinding" { export type Editor = import("ace-code/src/editor").Editor; export type KeyboardHandler = import("ace-code").Ace.KeyboardHandler; - export class KeyBinding { /** * @param {Editor} editor */ constructor(editor: Editor); - /** * @param {KeyboardHandler} kb */ setDefaultHandler(kb: KeyboardHandler): void; - /** * @param {KeyboardHandler} kb */ setKeyboardHandler(kb: KeyboardHandler): void; - /** * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] * @param {number} [pos] @@ -3203,7 +2452,6 @@ declare module "ace-code/src/keyboard/keybinding" { attach?: (editor: any) => void; detach?: (editor: any) => void; }, pos?: number): void; - /** * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb * @returns {boolean} @@ -3216,14 +2464,11 @@ declare module "ace-code/src/keyboard/keybinding" { attach?: (editor: any) => void; detach?: (editor: any) => void; }): boolean; - /** * @return {KeyboardHandler} */ getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - /** * @param {any} e * @param {number} hashId @@ -3231,7 +2476,6 @@ declare module "ace-code/src/keyboard/keybinding" { * @return {boolean} */ onCommandKey(e: any, hashId: number, keyCode: number): boolean; - /** * @param {string} text * @return {boolean} @@ -3241,7 +2485,6 @@ declare module "ace-code/src/keyboard/keybinding" { } declare module "ace-code/src/search" { export type EditSession = import("ace-code/src/edit_session").EditSession; - /** * A class designed to handle all sorts of text searches within a [[Document `Document`]]. **/ @@ -3253,13 +2496,11 @@ declare module "ace-code/src/search" { * @chainable **/ set(options: Partial): Search; - /** * [Returns an object containing all the search options.]{: #Search.getOptions} * @returns {Partial} **/ getOptions(): Partial; - /** * Sets the search options via the `options` parameter. * @param {SearchOptions} options object containing all the search propertie @@ -3309,21 +2550,18 @@ declare module "ace-code/src/search" { */ re?: any; }): void; - /** * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with * @returns {Range|false} **/ find(session: EditSession): Range | false; - /** * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with * @returns {Range[]} **/ findAll(session: EditSession): Range[]; - /** * Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`. * @param {String} input The text to search in @@ -3336,44 +2574,36 @@ declare module "ace-code/src/search" { **/ replace(input: string, replacement: any): string; } - import Range_5 = require("ace-code/src/range"); import Range = Range_5.Range; } declare module "ace-code/src/keyboard/hash_handler" { export type Command = import("ace-code").Ace.Command; export type CommandLike = import("ace-code").Ace.CommandLike; - export class HashHandler extends MultiHashHandler { } - export namespace HashHandler { function call(thisArg: any, config: any, platform: any): void; } - export class MultiHashHandler { /** * @param {Record | Command[]} [config] * @param {string} [platform] */ constructor(config?: Record | Command[], platform?: string); - platform: string; /**@type {Record}*/ commands: Record; commandKeyBinding: {}; - /** * @param {Command} command */ addCommand(command: Command): void; - /** * @param {Command | string} command * @param {boolean} [keepCommand] */ removeCommand(command: Command | string, keepCommand?: boolean): void; - /** * @param {string | { win?: string; mac?: string; position?:number}} key * @param {CommandLike | string} command @@ -3384,22 +2614,18 @@ declare module "ace-code/src/keyboard/hash_handler" { mac?: string; position?: number; }, command: CommandLike | string, position?: number): void; - /** * @param {Record | Command[]} [commands] */ addCommands(commands?: Record | Command[]): void; - /** * @param {Record} commands */ removeCommands(commands: Record): void; - /** * @param {Record} keyList */ bindKeys(keyList: Record): void; - /** * Accepts keys in the form ctrl+Enter or ctrl-Enter * keys without modifiers or shift only @@ -3410,14 +2636,12 @@ declare module "ace-code/src/keyboard/hash_handler" { key: string; hashId: number; } | false; - /** * @param {number} hashId * @param {string} keyString * @returns {Command} */ findKeyCommand(hashId: number, keyString: string): Command; - /** * @param {{ $keyChain: string | any[]; }} data * @param {number} hashId @@ -3428,7 +2652,6 @@ declare module "ace-code/src/keyboard/hash_handler" { handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: number): { command: string; } | void; - /** * @param {any} [editor] * @param {any} [data] @@ -3436,14 +2659,12 @@ declare module "ace-code/src/keyboard/hash_handler" { */ getStatusText(editor?: any, data?: any): string; } - export namespace MultiHashHandler { function call(thisArg: any, config: any, platform: any): void; } } declare module "ace-code/src/commands/command_manager" { const CommandManager_base: typeof MultiHashHandler; - export class CommandManager extends MultiHashHandler { /** * new CommandManager(platform, commands) @@ -3451,9 +2672,7 @@ declare module "ace-code/src/commands/command_manager" { * @param {any[]} commands A list of commands **/ constructor(platform: string, commands: any[]); - byName: Record; - /** * * @param {string | string[] | import("ace-code").Ace.Command} command @@ -3462,25 +2681,20 @@ declare module "ace-code/src/commands/command_manager" { * @returns {boolean} */ exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; - /** * @param {Editor} editor * @returns {boolean} */ toggleRecording(editor: Editor): boolean; - macro: any; recording: boolean; oldMacro: any; - /** * @param {Editor} editor */ replay(editor: Editor): boolean; - trimMacro(m: any): any; } - export type Editor = import("ace-code/src/editor").Editor; import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; @@ -3488,7 +2702,6 @@ declare module "ace-code/src/commands/command_manager" { namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface CommandManager extends Ace .EventEmitter { } @@ -3498,7 +2711,6 @@ declare module "ace-code/src/commands/default_commands" { } declare module "ace-code/src/token_iterator" { export type EditSession = import("ace-code/src/edit_session").EditSession; - /** * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens. **/ @@ -3510,53 +2722,45 @@ declare module "ace-code/src/token_iterator" { * @param {Number} initialColumn The column to start the tokenizing at **/ constructor(session: EditSession, initialRow: number, initialColumn: number); - /** * Moves iterator position to the start of previous token. * @returns {import("ace-code").Ace.Token|null} **/ stepBackward(): import("ace-code").Ace.Token | null; - /** * Moves iterator position to the start of next token. * @returns {import("ace-code").Ace.Token|null} **/ stepForward(): import("ace-code").Ace.Token | null; - /** * * Returns current token. * @returns {import("ace-code").Ace.Token} **/ getCurrentToken(): import("ace-code").Ace.Token; - /** * * Returns the current row. * @returns {Number} **/ getCurrentTokenRow(): number; - /** * * Returns the current column. * @returns {Number} **/ getCurrentTokenColumn(): number; - /** * Return the current token position. * @returns {import("ace-code").Ace.Point} */ getCurrentTokenPosition(): import("ace-code").Ace.Point; - /** * Return the current token range. * @returns {Range} */ getCurrentTokenRange(): Range; } - import Range_6 = require("ace-code/src/range"); import Range = Range_6.Range; } @@ -3566,80 +2770,65 @@ declare module "ace-code/src/line_widgets" { * @param {EditSession} session */ constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; - /** * * @param {import("ace-code").Ace.Delta} delta */ updateOnChange(delta: import("ace-code").Ace.Delta): void; - /** * @param {any} e * @param {VirtualRenderer} renderer */ renderWidgets(e: any, renderer: VirtualRenderer): void; - /** * @param {any} e * @param {VirtualRenderer} renderer */ measureWidgets(e: any, renderer: VirtualRenderer): void; - /** * @param {number} row * @return {number} */ getRowLength(row: number): number; - /** * * @param {Editor} editor */ attach(editor: Editor): void; - /**@type {Editor} */ editor: Editor; - detach(e: any): void; - /** * * @param e * @param {EditSession} session */ updateOnFold(e: any, session: EditSession): void; - /** * * @param {LineWidget} w * @return {LineWidget} */ addLineWidget(w: LineWidget): LineWidget; - /** * @param {LineWidget} w */ removeLineWidget(w: LineWidget): void; - /** * * @param {number} row * @return {LineWidget[]} */ getWidgetsAtRow(row: number): LineWidget[]; - /** * @param {LineWidget} w */ onWidgetChanged(w: LineWidget): void; - firstRow: number; lastRow: number; lineWidgets: import("ace-code").Ace.LineWidget[]; } - export type EditSession = import("ace-code/src/edit_session").EditSession; export type Editor = import("ace-code/src/editor").Editor; export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; @@ -3648,7 +2837,6 @@ declare module "ace-code/src/line_widgets" { type LineWidget = import("ace-code").Ace.LineWidget; type Editor = import("ace-code").Ace.Editor; } - export interface LineWidgets { lineWidgets: Ace.LineWidget[]; editor: Ace.Editor; @@ -3657,7 +2845,6 @@ declare module "ace-code/src/line_widgets" { declare module "ace-code/src/keyboard/gutter_handler" { export class GutterKeyboardHandler { constructor(editor: any); - editor: any; gutterLayer: any; element: any; @@ -3665,41 +2852,32 @@ declare module "ace-code/src/keyboard/gutter_handler" { activeRowIndex: any; activeLane: string; annotationTooltip: GutterTooltip; - addListener(): void; - removeListener(): void; - lane: any; } - export class GutterKeyboardEvent { constructor(domEvent: any, gutterKeyboardHandler: any); - gutterKeyboardHandler: any; domEvent: any; - /** * Returns the key that was presssed. * * @return {string} the key that was pressed. */ getKey(): string; - /** * Returns the row in the gutter that was focused after the keyboard event was handled. * * @return {number} the key that was pressed. */ getRow(): number; - /** * Returns whether focus is on the annotation lane after the keyboard event was handled. * * @return {boolean} true if focus was on the annotation lane after the keyboard event. */ isInAnnotationLane(): boolean; - /** * Returns whether focus is on the fold lane after the keyboard event was handled. * @@ -3707,7 +2885,6 @@ declare module "ace-code/src/keyboard/gutter_handler" { */ isInFoldLane(): boolean; } - import GutterTooltip_1 = require("ace-code/src/mouse/default_gutter_handler"); import GutterTooltip = GutterTooltip_1.GutterTooltip; } @@ -3720,7 +2897,6 @@ declare module "ace-code/src/editor" { const Editor_base_5: undefined; const Editor_base_6: undefined; const Editor_base_7: undefined; - /** * The main entry point into the Ace functionality. * @@ -3737,7 +2913,6 @@ declare module "ace-code/src/editor" { * @param {Partial} [options] The default options **/ constructor(renderer: VirtualRenderer, session?: EditSession, options?: Partial); - /**@type{EditSession}*/ session: EditSession; /**@type {HTMLElement & {env?:any, value?:any}}*/ container: HTMLElement & { @@ -3752,9 +2927,7 @@ declare module "ace-code/src/editor" { textInput: any; /**@type {KeyBinding}*/ keyBinding: KeyBinding; - startOperation(commandEvent: any): void; - prevOp: {}; previousCommand: any; /** @@ -3763,42 +2936,34 @@ declare module "ace-code/src/editor" { curOp: { [key: string]: any; }; - /** * @arg e */ endOperation(e: any): any; - mergeNextCommand: boolean; sequenceStartTime: number; - /** * Sets a new key handler, such as "vim" or "windows". * @param {String | import("ace-code").Ace.KeyboardHandler | null} keyboardHandler The new key handler * @param {() => void} [cb] **/ setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; - /** * Returns the keyboard handler, such as "vim" or "windows". * @returns {Object} **/ getKeyboardHandler(): any; - /** * Sets a new editsession to use. This method also emits the `'changeSession'` event. * @param {EditSession} [session] The new session to use **/ setSession(session?: EditSession): void; - selection: import("ace-code/src/selection").Selection; - /** * Returns the current session being used. * @returns {EditSession} **/ getSession(): EditSession; - /** * Sets the current document to `val`. * @param {String} val The new value to set for the document @@ -3808,7 +2973,6 @@ declare module "ace-code/src/editor" { * @related Document.setValue **/ setValue(val: string, cursorPos?: number): string; - /** * Returns the current session's content. * @@ -3816,28 +2980,24 @@ declare module "ace-code/src/editor" { * @related EditSession.getValue **/ getValue(): string; - /** * * Returns the currently highlighted selection. * @returns {Selection} The selection object **/ getSelection(): Selection; - /** * {:VirtualRenderer.onResize} * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed * @related VirtualRenderer.onResize **/ resize(force?: boolean): void; - /** * {:VirtualRenderer.setTheme} * @param {string | import("ace-code").Ace.Theme} theme The path to a theme * @param {() => void} [cb] optional callback called when theme is loaded **/ setTheme(theme: string | import("ace-code").Ace.Theme, cb?: () => void): void; - /** * {:VirtualRenderer.getTheme} * @@ -3845,128 +3005,100 @@ declare module "ace-code/src/editor" { * @related VirtualRenderer.getTheme **/ getTheme(): string; - /** * {:VirtualRenderer.setStyle} * @param {String} style A class name * @related VirtualRenderer.setStyle **/ setStyle(style: string): void; - /** * {:VirtualRenderer.unsetStyle} * @related VirtualRenderer.unsetStyle * @param {string} style */ unsetStyle(style: string): void; - /** * Gets the current font size of the editor text. * @return {string} */ getFontSize(): string; - /** * Set a new font size (in pixels) for the editor text. * @param {String} size A font size ( _e.g._ "12px") **/ setFontSize(size: string): void; - /** * * Brings the current `textInput` into focus. **/ focus(): void; - /** * Returns `true` if the current `textInput` is in focus. * @return {Boolean} **/ isFocused(): boolean; - /** * * Blurs the current `textInput`. **/ blur(): void; - /** * Emitted once the editor comes into focus. **/ onFocus(e: any): void; - /** * Emitted once the editor has been blurred. **/ onBlur(e: any): void; - /** * Emitted whenever the document is changed. * @param {import("ace-code").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes **/ onDocumentChange(delta: import("ace-code").Ace.Delta): void; - onTokenizerUpdate(e: any): void; - onScrollTopChange(): void; - onScrollLeftChange(): void; - /** * Emitted when the selection changes. **/ onCursorChange(): void; - /** * * @param e */ onSelectionChange(e: any): void; - onChangeFrontMarker(): void; - onChangeBackMarker(): void; - onChangeBreakpoint(): void; - onChangeAnnotation(): void; - /** * @param e */ onChangeMode(e: any): void; - onChangeWrapLimit(): void; - onChangeWrapMode(): void; - /** */ onChangeFold(): void; - /** * Returns the string of text currently highlighted. * @returns {String} **/ getCopyText(): string; - /** * Called whenever a text "copy" happens. **/ onCopy(): void; - /** * Called whenever a text "cut" happens. **/ onCut(): void; - /** * Called whenever a text "paste" happens. * @param {String} text The pasted text * @param {any} event **/ onPaste(text: string, event: any): void; - /** * * @param {string | string[]} command @@ -3974,16 +3106,13 @@ declare module "ace-code/src/editor" { * @return {boolean} */ execCommand(command: string | string[], args?: any): boolean; - /** * Inserts `text` into wherever the cursor is pointing. * @param {String} text The new text to add * @param {boolean} [pasted] **/ insert(text: string, pasted?: boolean): void; - autoIndent(): void; - /** * * @param text @@ -3991,263 +3120,217 @@ declare module "ace-code/src/editor" { * @returns {*} */ onTextInput(text: any, composition: any): any; - /** * @param {string} [text] * @param {any} [composition] */ applyComposition(text?: string, composition?: any): void; - onCommandKey(e: any, hashId: any, keyCode: any): boolean; - /** * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. * @param {Boolean} overwrite Defines whether or not to set overwrites * @related EditSession.setOverwrite **/ setOverwrite(overwrite: boolean): void; - /** * Returns `true` if overwrites are enabled; `false` otherwise. * @returns {Boolean} * @related EditSession.getOverwrite **/ getOverwrite(): boolean; - /** * Sets the value of overwrite to the opposite of whatever it currently is. * @related EditSession.toggleOverwrite **/ toggleOverwrite(): void; - /** * Sets how fast the mouse scrolling should do. * @param {Number} speed A value indicating the new speed (in milliseconds) **/ setScrollSpeed(speed: number): void; - /** * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). * @returns {Number} **/ getScrollSpeed(): number; - /** * Sets the delay (in milliseconds) of the mouse drag. * @param {Number} dragDelay A value indicating the new delay **/ setDragDelay(dragDelay: number): void; - /** * Returns the current mouse drag delay. * @returns {Number} **/ getDragDelay(): number; - /** * Draw selection markers spanning whole line, or only over selected text. Default value is "line" * @param {"fullLine" | "screenLine" | "text" | "line"} val The new selection style "line"|"text" **/ setSelectionStyle(val: "fullLine" | "screenLine" | "text" | "line"): void; - /** * Returns the current selection style. * @returns {import("ace-code").Ace.EditorOptions["selectionStyle"]} **/ getSelectionStyle(): import("ace-code").Ace.EditorOptions["selectionStyle"]; - /** * Determines whether or not the current line should be highlighted. * @param {Boolean} shouldHighlight Set to `true` to highlight the current line **/ setHighlightActiveLine(shouldHighlight: boolean): void; - /** * Returns `true` if current lines are always highlighted. * @return {Boolean} **/ getHighlightActiveLine(): boolean; - /** * @param {boolean} shouldHighlight */ setHighlightGutterLine(shouldHighlight: boolean): void; - /** * @returns {Boolean} */ getHighlightGutterLine(): boolean; - /** * Determines if the currently selected word should be highlighted. * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word **/ setHighlightSelectedWord(shouldHighlight: boolean): void; - /** * Returns `true` if currently highlighted words are to be highlighted. * @returns {Boolean} **/ getHighlightSelectedWord(): boolean; - /** * @param {boolean} shouldAnimate */ setAnimatedScroll(shouldAnimate: boolean): void; - /** * @return {boolean} */ getAnimatedScroll(): boolean; - /** * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters **/ setShowInvisibles(showInvisibles: boolean): void; - /** * Returns `true` if invisible characters are being shown. * @returns {Boolean} **/ getShowInvisibles(): boolean; - /** * @param {boolean} display */ setDisplayIndentGuides(display: boolean): void; - /** * @return {boolean} */ getDisplayIndentGuides(): boolean; - /** * @param {boolean} highlight */ setHighlightIndentGuides(highlight: boolean): void; - /** * @return {boolean} */ getHighlightIndentGuides(): boolean; - /** * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin * **/ setShowPrintMargin(showPrintMargin: boolean): void; - /** * Returns `true` if the print margin is being shown. * @returns {Boolean} **/ getShowPrintMargin(): boolean; - /** * Sets the column defining where the print margin should be. * @param {Number} showPrintMargin Specifies the new print margin * **/ setPrintMarginColumn(showPrintMargin: number): void; - /** * Returns the column number of where the print margin is. * @returns {Number} **/ getPrintMarginColumn(): number; - /** * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. * @param {Boolean} readOnly Specifies whether the editor can be modified or not **/ setReadOnly(readOnly: boolean): void; - /** * Returns `true` if the editor is set to read-only mode. * @returns {Boolean} **/ getReadOnly(): boolean; - /** * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} * @param {Boolean} enabled Enables or disables behaviors **/ setBehavioursEnabled(enabled: boolean): void; - /** * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} * @returns {Boolean} **/ getBehavioursEnabled(): boolean; - /** * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets * when such a character is typed in. * @param {Boolean} enabled Enables or disables wrapping behaviors **/ setWrapBehavioursEnabled(enabled: boolean): void; - /** * Returns `true` if the wrapping behaviors are currently enabled. * @returns {boolean} **/ getWrapBehavioursEnabled(): boolean; - /** * Indicates whether the fold widgets should be shown or not. * @param {Boolean} show Specifies whether the fold widgets are shown **/ setShowFoldWidgets(show: boolean): void; - /** * Returns `true` if the fold widgets are shown. * @return {Boolean} **/ getShowFoldWidgets(): boolean; - /** * @param {boolean} fade */ setFadeFoldWidgets(fade: boolean): void; - /** * @returns {boolean} */ getFadeFoldWidgets(): boolean; - /** * Removes the current selection or one character. * @param {'left' | 'right'} [dir] The direction of the deletion to occur, either "left" or "right" **/ remove(dir?: 'left' | 'right'): void; - /** * Removes the word directly to the right of the current selection. **/ removeWordRight(): void; - /** * Removes the word directly to the left of the current selection. **/ removeWordLeft(): void; - /** * Removes all the words to the left of the current selection, until the start of the line. **/ removeToLineStart(): void; - /** * Removes all the words to the right of the current selection, until the end of the line. **/ removeToLineEnd(): void; - /** * Splits the line at the current selection (by inserting an `'\n'`). **/ splitLine(): void; - /** * Set the "ghost" text in provided position. "Ghost" text is a kind of * preview text inside the editor which can be used to preview some code @@ -4257,104 +3340,84 @@ declare module "ace-code/src/editor" { * @param {Point} [position] Position to insert text to */ setGhostText(text: string, position?: Point): void; - /** * Removes "ghost" text currently displayed in the editor. */ removeGhostText(): void; - /** * Transposes current line. **/ transposeLetters(): void; - /** * Converts the current selection entirely into lowercase. **/ toLowerCase(): void; - /** * Converts the current selection entirely into uppercase. **/ toUpperCase(): void; - /** * Inserts an indentation into the current cursor position or indents the selected lines. * * @related EditSession.indentRows **/ indent(): void; - /** * Indents the current line. * @related EditSession.indentRows **/ blockIndent(): void; - /** * Outdents the current line. * @related EditSession.outdentRows **/ blockOutdent(): void; - sortLines(): void; - /** * Given the currently selected range, this function either comments all the lines, or uncomments all of them. **/ toggleCommentLines(): void; - toggleBlockComment(): void; - /** * Works like [[EditSession.getTokenAt]], except it returns a number. * @returns {any} **/ getNumberAt(row: any, column: any): any; - /** * If the character before the cursor is a number, this functions changes its value by `amount`. * @param {Number} amount The value to change the numeral by (can be negative to decrease value) **/ modifyNumber(amount: number): void; - /** */ toggleWord(): void; - /** * Finds link at defined {row} and {column} * @returns {String} **/ findLinkAt(row: any, column: any): string; - /** * Open valid url under cursor in another tab * @returns {Boolean} **/ openLink(): boolean; - /** * Removes all the lines in the current selection * @related EditSession.remove **/ removeLines(): void; - duplicateSelection(): void; - /** * Shifts all the selected lines down one row. * * @related EditSession.moveLinesUp **/ moveLinesDown(): void; - /** * Shifts all the selected lines up one row. * @related EditSession.moveLinesDown **/ moveLinesUp(): void; - /** * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * ```json @@ -4368,28 +3431,21 @@ declare module "ace-code/src/editor" { * @related EditSession.moveText **/ moveText(range: Range, toPosition: Point, copy?: boolean): Range; - /** * Copies all the selected lines up one row. * **/ copyLinesUp(): void; - /** * Copies all the selected lines down one row. * @related EditSession.duplicateLines * **/ copyLinesDown(): void; - inVirtualSelectionMode: boolean; - onCompositionStart(compositionState: any): void; - onCompositionUpdate(text: any): void; - onCompositionEnd(): void; - /** * {:VirtualRenderer.getFirstVisibleRow} * @@ -4397,7 +3453,6 @@ declare module "ace-code/src/editor" { * @related VirtualRenderer.getFirstVisibleRow **/ getFirstVisibleRow(): number; - /** * {:VirtualRenderer.getLastVisibleRow} * @@ -4405,7 +3460,6 @@ declare module "ace-code/src/editor" { * @related VirtualRenderer.getLastVisibleRow **/ getLastVisibleRow(): number; - /** * Indicates if the row is currently visible on the screen. * @param {Number} row The row to check @@ -4413,7 +3467,6 @@ declare module "ace-code/src/editor" { * @returns {Boolean} **/ isRowVisible(row: number): boolean; - /** * Indicates if the entire row is currently visible on the screen. * @param {Number} row The row to check @@ -4422,44 +3475,36 @@ declare module "ace-code/src/editor" { * @returns {Boolean} **/ isRowFullyVisible(row: number): boolean; - /** * Selects the text from the current position of the document until where a "page down" finishes. **/ selectPageDown(): void; - /** * Selects the text from the current position of the document until where a "page up" finishes. **/ selectPageUp(): void; - /** * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ gotoPageDown(): void; - /** * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ gotoPageUp(): void; - /** * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ scrollPageDown(): void; - /** * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ scrollPageUp(): void; - /** * Moves the editor to the specified row. * @related VirtualRenderer.scrollToRow * @param {number} row */ scrollToRow(row: number): void; - /** * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). * @param {Number} line The line to scroll to @@ -4470,12 +3515,10 @@ declare module "ace-code/src/editor" { * @related VirtualRenderer.scrollToLine **/ scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; - /** * Attempts to center the current selection on the screen. **/ centerSelection(): void; - /** * Gets the current position of the cursor. * @returns {Point} An object that looks something like this: @@ -4487,33 +3530,28 @@ declare module "ace-code/src/editor" { * @related Selection.getCursor **/ getCursorPosition(): Point; - /** * Returns the screen position of the cursor. * @returns {Point} * @related EditSession.documentToScreenPosition **/ getCursorPositionScreen(): Point; - /** * {:Selection.getRange} * @returns {Range} * @related Selection.getRange **/ getSelectionRange(): Range; - /** * Selects all the text in editor. * @related Selection.selectAll **/ selectAll(): void; - /** * {:Selection.clearSelection} * @related Selection.clearSelection **/ clearSelection(): void; - /** * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. * @param {Number} row The new row number @@ -4521,21 +3559,18 @@ declare module "ace-code/src/editor" { * @related Selection.moveCursorTo **/ moveCursorTo(row: number, column: number): void; - /** * Moves the cursor to the position indicated by `pos.row` and `pos.column`. * @param {Point} pos An object with two properties, row and column * @related Selection.moveCursorToPosition **/ moveCursorToPosition(pos: Point): void; - /** * Moves the cursor's row and column to the next matching bracket or HTML tag. * @param {boolean} [select] * @param {boolean} [expand] */ jumpToMatching(select?: boolean, expand?: boolean): void; - /** * Moves the cursor to the specified line number, and also into the indicated column. * @param {Number} lineNumber The line number to go to @@ -4543,7 +3578,6 @@ declare module "ace-code/src/editor" { * @param {Boolean} [animate] If `true` animates scolling **/ gotoLine(lineNumber: number, column?: number, animate?: boolean): void; - /** * Moves the cursor to the specified row and column. Note that this does de-select the current selection. * @param {Number} row The new row number @@ -4552,71 +3586,60 @@ declare module "ace-code/src/editor" { * @related Editor.moveCursorTo **/ navigateTo(row: number, column: number): void; - /** * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection. * @param {Number} [times] The number of times to change navigation * **/ navigateUp(times?: number): void; - /** * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection. * @param {Number} [times] The number of times to change navigation * **/ navigateDown(times?: number): void; - /** * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection. * @param {Number} [times] The number of times to change navigation * **/ navigateLeft(times?: number): void; - /** * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection. * @param {Number} [times] The number of times to change navigation * **/ navigateRight(times?: number): void; - /** * * Moves the cursor to the start of the current line. Note that this does de-select the current selection. **/ navigateLineStart(): void; - /** * * Moves the cursor to the end of the current line. Note that this does de-select the current selection. **/ navigateLineEnd(): void; - /** * * Moves the cursor to the end of the current file. Note that this does de-select the current selection. **/ navigateFileEnd(): void; - /** * * Moves the cursor to the start of the current file. Note that this does de-select the current selection. **/ navigateFileStart(): void; - /** * * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection. **/ navigateWordRight(): void; - /** * * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection. **/ navigateWordLeft(): void; - /** * Replaces the first occurrence of `options.needle` with the value in `replacement`. * @param {String} [replacement] The text to replace with @@ -4624,7 +3647,6 @@ declare module "ace-code/src/editor" { * @return {number} **/ replace(replacement?: string, options?: Partial): number; - /** * Replaces all occurrences of `options.needle` with the value in `replacement`. * @param {String} [replacement] The text to replace with @@ -4632,14 +3654,12 @@ declare module "ace-code/src/editor" { * @return {number} **/ replaceAll(replacement?: string, options?: Partial): number; - /** * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. * @related Search.getOptions * @returns {Partial} **/ getLastSearchOptions(): Partial; - /** * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. * @param {String|RegExp|Object} needle The text to search for (optional) @@ -4648,7 +3668,6 @@ declare module "ace-code/src/editor" { * @related Search.find **/ find(needle: string | RegExp | any, options?: Partial, animate?: boolean): false | Range; - /** * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. * @param {Partial} [options] search options @@ -4657,7 +3676,6 @@ declare module "ace-code/src/editor" { * @related Editor.find **/ findNext(options?: Partial, animate?: boolean): void; - /** * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. * @param {Partial} [options] search options @@ -4666,43 +3684,36 @@ declare module "ace-code/src/editor" { * @related Editor.find **/ findPrevious(options?: Partial, animate?: boolean): void; - /** * * @param {Range} range * @param {boolean} [animate] */ revealRange(range: Range, animate?: boolean): void; - /** * {:UndoManager.undo} * @related UndoManager.undo **/ undo(): void; - /** * {:UndoManager.redo} * @related UndoManager.redo **/ redo(): void; - /** * * Cleans up the entire editor. **/ destroy(): void; - /** * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element * @param {Boolean} enable default true **/ setAutoScrollEditorIntoView(enable: boolean): void; - /** * opens a prompt displaying message **/ prompt(message: any, options: any, callback: any): void; - env?: any; widgetManager?: LineWidgets; completer?: import("ace-code/src/autocomplete").Autocomplete | import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; @@ -4711,7 +3722,6 @@ declare module "ace-code/src/editor" { showSettingsMenu?: () => void; searchBox?: import("ace-code/src/ext/searchbox").SearchBox; } - export namespace Editor { export {$uid}; } @@ -4753,7 +3763,6 @@ declare module "ace-code/src/editor" { type Completer = import("ace-code").Ace.Completer; type SearchBox = import("ace-code").Ace.SearchBox; } - export interface Editor extends Ace.EditorMultiSelectProperties, Ace.OptionsProvider, Ace.EventEmitter, Ace.CodeLenseEditorExtension, Ace.ElasticTabstopsEditorExtension, Ace.TextareaEditorExtension, Ace.PromptEditorExtension, Ace.OptionsEditorExtension { session: Ace.EditSession; env?: any; @@ -4770,7 +3779,6 @@ declare module "ace-code/src/undomanager" { export type Delta = import("ace-code").Ace.Delta; export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; - /** * @typedef {import("ace-code/src/edit_session").EditSession} EditSession * @typedef {import("ace-code").Ace.Delta} Delta @@ -4786,7 +3794,6 @@ declare module "ace-code/src/undomanager" { * @param {EditSession} session */ addSession(session: EditSession): void; - /** * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: * @@ -4798,25 +3805,20 @@ declare module "ace-code/src/undomanager" { * @param {EditSession} [session] **/ add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; - lastDeltas: any[]; - /** * * @param {any} selection * @param {number} [rev] */ addSelection(selection: any, rev?: number): void; - startNewGroup(): any; - /** * * @param {number} from * @param {number} [to] */ markIgnored(from: number, to?: number): void; - /** * * @param {number} rev @@ -4827,12 +3829,10 @@ declare module "ace-code/src/undomanager" { value: string; rev: number; }; - /** * @return {number} */ getRevision(): number; - /** * * @param {number} from @@ -4840,28 +3840,24 @@ declare module "ace-code/src/undomanager" { * @return {import("ace-code").Ace.Delta[]} */ getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; - /** * * @param {number} from * @param {number} [to] */ getChangedRanges(from: number, to?: number): void; - /** * * @param {number} from * @param {number} [to] */ getChangedLines(from: number, to?: number): void; - /** * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} * @param {EditSession} session * @param {Boolean} [dontSelect] {:dontSelect} **/ undo(session: EditSession, dontSelect?: boolean): void; - /** * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} * @param {EditSession} session @@ -4869,45 +3865,37 @@ declare module "ace-code/src/undomanager" { * **/ redo(session: EditSession, dontSelect?: boolean): void; - /** * Destroys the stack of undo and redo redo operations. **/ reset(): void; - mark: number; selections: any[]; - /** * Returns `true` if there are undo operations left to perform. * @returns {Boolean} **/ canUndo(): boolean; - /** * Returns `true` if there are redo operations left to perform. * @returns {Boolean} **/ canRedo(): boolean; - /** * Marks the current status clean * @param {number} [rev] */ bookmark(rev?: number): void; - /** * Returns if the current status is clean * @returns {Boolean} **/ isAtBookmark(): boolean; - /** * Returns an object which can be safely stringified into JSON * @returns {object} */ toJSON(): object; - /** * Takes in an object which was returned from the toJSON method above, * and resets the current undoManager instance to use the previously exported @@ -4915,7 +3903,6 @@ declare module "ace-code/src/undomanager" { * @param {object} json */ fromJSON(json: object): void; - hasUndo: () => boolean; hasRedo: () => boolean; isClean: () => boolean; @@ -4932,25 +3919,21 @@ declare module "ace-code/src/tokenizer" { * @param {Object} rules The highlighting rules **/ constructor(rules: any); - /**@type {RegExp}*/ splitRegex: RegExp; states: any; regExps: {}; matchMappings: {}; - /** * @param {string} src * @returns {string} */ removeCapturingGroups(src: string): string; - /** * @param {string} src * @param {string} flag */ createSplitterRegexp(src: string, flag: string): RegExp; - /** * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. * @param {string} line @@ -4961,13 +3944,11 @@ declare module "ace-code/src/tokenizer" { tokens: import("ace-code").Ace.Token[]; state: string | string[]; }; - reportError: (msg: any, data: any) => void; } } declare module "ace-code/src/autocomplete/popup" { const AcePopup_base: undefined; - /** * This object is used in some places where needed to show popups - like prompt; autocomplete etc. */ @@ -4977,7 +3958,6 @@ declare module "ace-code/src/autocomplete/popup" { * @param {Element} [parentNode] */ constructor(parentNode?: Element); - setSelectOnHover: (val: boolean) => void; setRow: (line: number) => void; getRow: () => number; @@ -5000,16 +3980,13 @@ declare module "ace-code/src/autocomplete/popup" { isMouseOver?: boolean; selectedNode?: HTMLElement; } - /** * * @param {HTMLElement} [el] * @return {Editor} */ export function $singleLineEditor(el?: HTMLElement): Editor; - export function getAriaId(index: any): string; - import Editor_1 = require("ace-code/src/editor"); import Editor = Editor_1.Editor; export {}; @@ -5019,7 +3996,6 @@ declare module "ace-code/src/autocomplete/popup" { type Point = import("ace-code").Ace.Point; type AcePopupNavigation = import("ace-code").Ace.AcePopupNavigation; } - export interface AcePopup extends Ace.AcePopupWithEditor { setSelectOnHover: (val: boolean) => void; setRow: (line: number) => void; @@ -5047,10 +4023,8 @@ declare module "ace-code/src/autocomplete/popup" { declare module "ace-code/src/range_list" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type Point = import("ace-code").Ace.Point; - export class RangeList { ranges: any[]; - /** * @param {Point} pos * @param {boolean} [excludeEdges] @@ -5058,61 +4032,47 @@ declare module "ace-code/src/range_list" { * @return {number} */ pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; - /** * @param {Range} range */ add(range: Range): any[]; - /** * @param {Range[]} list */ addList(list: Range[]): any[]; - /** * @param {Point} pos */ substractPoint(pos: Point): any[]; - merge(): any[]; - /** * @param {number} row * @param {number} column */ contains(row: number, column: number): boolean; - /** * @param {Point} pos */ containsPoint(pos: Point): boolean; - /** * @param {Point} pos */ rangeAtPoint(pos: Point): any; - /** * @param {number} startRow * @param {number} endRow */ clipRows(startRow: number, endRow: number): any[]; - removeAll(): any[]; - /** * @param {EditSession} session */ attach(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; onChange: any; - detach(): void; - comparePoints: (p1: import("ace-code").Ace.Point, p2: import("ace-code").Ace.Point) => number; } - import Range_8 = require("ace-code/src/range"); import Range = Range_8.Range; } @@ -5135,7 +4095,6 @@ declare module "ace-code/src/snippets" { guard?: string; endGuard?: string; }; - class SnippetManager { snippetMap: {}; snippetNameMap: {}; @@ -5170,36 +4129,22 @@ declare module "ace-code/src/snippets" { CURRENT_MINUTE: any; CURRENT_SECOND: any; }; - /** * @return {Tokenizer} */ getTokenizer(): Tokenizer; - createTokenizer(): any; - tokenizeTmSnippet(str: any, startState: any): (string | import("ace-code").Ace.Token)[]; - getVariableValue(editor: any, name: any, indentation: any): any; - tmStrFormat(str: any, ch: any, editor: any): any; - tmFormatFunction(str: any, ch: any, editor: any): any; - resolveVariables(snippet: any, editor: any): any[]; - getDisplayTextForSnippet(editor: any, snippetText: any): any; - insertSnippetForSelection(editor: any, snippetText: any, options?: {}): void; - insertSnippet(editor: any, snippetText: any, options?: {}): void; - getActiveScopes(editor: any): any[]; - expandWithTab(editor: any, options: any): any; - expandSnippetForSelection(editor: any, options: any): boolean; - /** * @param {Snippet[]} snippetList * @param {string} before @@ -5207,27 +4152,21 @@ declare module "ace-code/src/snippets" { * @return {Snippet} */ findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; - /** * @param {any[]} snippets * @param {string} scope */ register(snippets: any[], scope: string): void; - unregister(snippets: any, scope: any): void; - parseSnippetFile(str: any): Snippet[]; - getSnippetByName(name: any, editor: any): undefined; } - import Tokenizer_1 = require("ace-code/src/tokenizer"); import Tokenizer = Tokenizer_1.Tokenizer; export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - interface SnippetManager extends Ace.EventEmitter { } } @@ -5241,20 +4180,15 @@ declare module "ace-code/src/autocomplete/inline_screenreader" { * @param {import("ace-code/src/editor").Editor} editor */ constructor(editor: import("ace-code/src/editor").Editor); - editor: import("ace-code/src/editor").Editor; screenReaderDiv: HTMLDivElement; - /** * Set the ghost text content to the screen reader div * @param {string} content */ setScreenReaderContent(content: string): void; - popup: import("ace-code/src/autocomplete/popup").AcePopup; - destroy(): void; - /** * Take this._lines, render it as blocks and add those to the screen reader div. */ @@ -5263,13 +4197,11 @@ declare module "ace-code/src/autocomplete/inline_screenreader" { } declare module "ace-code/src/autocomplete/inline" { export type Editor = import("ace-code/src/editor").Editor; - /** * This object is used to manage inline code completions rendered into an editor with ghost text. */ export class AceInline { editor: any; - /** * Renders the completion as ghost text to the current cursor position * @param {Editor} editor @@ -5278,30 +4210,20 @@ declare module "ace-code/src/autocomplete/inline" { * @returns {boolean} True if the completion could be rendered to the editor, false otherwise */ show(editor: Editor, completion: import("ace-code").Ace.Completion, prefix: string): boolean; - inlineScreenReader: AceInlineScreenReader; - isOpen(): boolean; - hide(): boolean; - destroy(): void; } - import AceInlineScreenReader_1 = require("ace-code/src/autocomplete/inline_screenreader"); import AceInlineScreenReader = AceInlineScreenReader_1.AceInlineScreenReader; } declare module "ace-code/src/autocomplete/util" { export function parForEach(array: any, fn: any, callback: any): void; - export function retrievePrecedingIdentifier(text: any, pos: any, regex: any): string; - export function retrieveFollowingIdentifier(text: any, pos: any, regex: any): any[]; - export function getCompletionPrefix(editor: any): string; - export function triggerAutocomplete(editor: Editor, previousChar?: string): boolean; - export type Editor = import("ace-code/src/editor").Editor; } declare module "ace-code/src/autocomplete" { @@ -5314,13 +4236,11 @@ declare module "ace-code/src/autocomplete" { caption: any; value: string; }[]; - /** * @param {Editor} editor * @return {Autocomplete} */ static for(editor: Editor): Autocomplete; - autoInsert: boolean; autoSelect: boolean; autoShown: boolean; @@ -5343,17 +4263,11 @@ declare module "ace-code/src/autocomplete" { * on the currently selected item when new items are added to the popup. Set to a negative value to disable this feature and never set selection to sticky. */ stickySelectionDelay: number; - blurListener(e: any): void; - changeListener(e: any): void; - mousedownListener(e: any): void; - mousewheelListener(e: any): void; - onLayoutChange(): void; - changeTimer: { (timeout: any): void; delay(timeout: any): void; @@ -5409,84 +4323,61 @@ declare module "ace-code/src/autocomplete" { /**@type {AcePopup}**/ popup: AcePopup; inlineRenderer: AceInline; - /** * @return {AcePopup} */ getPopup(): AcePopup; - stickySelection: boolean; - observeLayoutChanges(): void; - unObserveLayoutChanges(): void; - /** * @param {Editor} editor * @param {string} prefix * @param {boolean} [keepPopupPosition] */ openPopup(editor: Editor, prefix: string, keepPopupPosition?: boolean): void; - /** * Detaches all elements from the editor, and cleans up the data for the session */ detach(): void; - activated: boolean; completionProvider: CompletionProvider; completions: FilteredList; base: import("ace-code/src/anchor").Anchor; - mouseOutListener(e: any): void; - goTo(where: any): void; - /** * @param {Completion} data * @param {undefined} [options] * @return {boolean | void} */ insertMatch(data: Completion, options?: undefined): boolean | void; - /** * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions * @param {Editor} editor * @param {CompletionOptions} [options] */ showPopup(editor: Editor, options?: CompletionOptions): void; - editor: import("ace-code/src/editor").Editor; - getCompletionProvider(initialPosition: any): CompletionProvider; - /** * This method is deprecated, it is only kept for backwards compatibility. * Use the same method include CompletionProvider instead for the same functionality. * @deprecated */ gatherCompletions(editor: any, callback: any): boolean; - /** * @param {boolean} keepPopupPosition * @param {CompletionOptions} [options] */ updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; - cancelContextMenu(): void; - updateDocTooltip(): void; - showDocTooltip(item: any): void; - tooltipNode: HTMLDivElement; - hideDocTooltip(): void; - onTooltipClick(e: any): void; - destroy(): void; - commands: { Up: (editor: any) => void; Down: (editor: any) => void; @@ -5502,7 +4393,6 @@ declare module "ace-code/src/autocomplete" { }; emptyMessage?: Function; } - /** * This class is responsible for providing completions and inserting them to the editor */ @@ -5514,13 +4404,11 @@ declare module "ace-code/src/autocomplete" { pos: import("ace-code").Ace.Position; prefix: string; }); - initialPosition: { pos: import("ace-code").Ace.Position; prefix: string; }; active: boolean; - /** * @param {Editor} editor * @param {number} index @@ -5528,7 +4416,6 @@ declare module "ace-code/src/autocomplete" { * @returns {boolean} */ insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; - /** * @param {Editor} editor * @param {Completion} data @@ -5536,15 +4423,12 @@ declare module "ace-code/src/autocomplete" { * @returns {boolean} */ insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; - /** * @param {Editor} editor * @param {import("ace-code").Ace.CompletionCallbackFunction} callback */ gatherCompletions(editor: Editor, callback: import("ace-code").Ace.CompletionCallbackFunction): boolean; - completers: import("ace-code").Ace.Completer[]; - /** * This is the entry point to the class, it gathers, then provides the completions asynchronously via callback. * The callback function may be called multiple times, the last invokation is marked with a `finished` flag @@ -5553,12 +4437,9 @@ declare module "ace-code/src/autocomplete" { * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback */ provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [], finished: boolean) => void): void; - detach(): void; - completions: FilteredList; } - export type Editor = import("ace-code/src/editor").Editor; export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; export type CompletionOptions = import("ace-code").Ace.CompletionOptions; @@ -5627,26 +4508,19 @@ declare module "ace-code/src/autocomplete" { import AcePopup = AcePopup_1.AcePopup; import AceInline_1 = require("ace-code/src/autocomplete/inline"); import AceInline = AceInline_1.AceInline; - export class FilteredList { constructor(array: any, filterText: any); - all: any; filtered: any; filterText: any; exactMatch: boolean; ignoreCaption: boolean; - setFilter(str: any): void; - filterCompletions(items: any, needle: any): any[]; } - export namespace startCommand { let name: string; - function exec(editor: any, options: any): void; - let bindKey: string; } export {}; @@ -5654,12 +4528,10 @@ declare module "ace-code/src/autocomplete" { type AcePopup = import("ace-code").Ace.AcePopup; type FilteredList = import("ace-code").Ace.FilteredList; } - export interface Autocomplete { popup: Ace.AcePopup; emptyMessage?: Function; } - export interface CompletionProvider { completions: Ace.FilteredList; } @@ -5670,22 +4542,17 @@ declare module "ace-code/src/autocomplete/text_completer" { declare module "ace-code/src/search_highlight" { export type Marker = import("ace-code/src/layer/marker").Marker; export type EditSession = import("ace-code/src/edit_session").EditSession; - export class SearchHighlight { /** * @param {any} regExp * @param {string} clazz */ constructor(regExp: any, clazz: string, type?: string); - clazz: string; type: string; - setRegexp(regExp: any): void; - regExp: any; cache: any[]; - /** * @param {any} html * @param {Marker} markerLayer @@ -5693,7 +4560,6 @@ declare module "ace-code/src/search_highlight" { * @param {Partial} config */ update(html: any, markerLayer: Marker, session: EditSession, config: Partial): void; - MAX_RANGES: number; } } @@ -5701,7 +4567,6 @@ declare module "ace-code/src/occur" { export type Editor = import("ace-code/src/editor").Editor; export type Point = import("ace-code").Ace.Point; export type SearchOptions = import("ace-code").Ace.SearchOptions; - /** * Finds all lines matching a search term in the current [[Document * `Document`]] and displays them instead of the original `Document`. Keeps @@ -5720,7 +4585,6 @@ declare module "ace-code/src/occur" { * **/ enter(editor: Editor, options: any): boolean; - /** * Disables occur mode. Resets the [[Sessions `EditSession`]] [[Document * `Document`]] back to the original doc. If options.translatePosition is @@ -5731,24 +4595,20 @@ declare module "ace-code/src/occur" { * **/ exit(editor: Editor, options: any): boolean; - /** * @param {EditSession} sess * @param {RegExp} regexp */ highlight(sess: EditSession, regexp: RegExp): void; - /** * @param {Editor} editor * @param {Partial} options */ displayOccurContent(editor: Editor, options: Partial): void; - /** * @param {Editor} editor */ displayOriginalContent(editor: Editor): void; - /** * Translates the position from the original document to the occur lines in * the document or the beginning if the doc {row: 0, column: 0} if not @@ -5758,7 +4618,6 @@ declare module "ace-code/src/occur" { * @return {Point} position in occur doc **/ originalToOccurPosition(session: EditSession, pos: Point): Point; - /** * Translates the position from the occur document to the original document * or `pos` if not found. @@ -5767,14 +4626,12 @@ declare module "ace-code/src/occur" { * @return {Point} position **/ occurToOriginalPosition(session: EditSession, pos: Point): Point; - /** * @param {EditSession} session * @param {Partial} options */ matchingLines(session: EditSession, options: Partial): any[]; } - import Search_2 = require("ace-code/src/search"); import Search = Search_2.Search; import EditSession_2 = require("ace-code/src/edit_session"); @@ -5787,7 +4644,6 @@ declare module "ace-code/src/marker_group" { className: string; }; export type Marker = import("ace-code/src/layer/marker").Marker; - /** * @typedef {import("ace-code/src/edit_session").EditSession} EditSession * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem @@ -5800,18 +4656,15 @@ declare module "ace-code/src/marker_group" { * @param {EditSession} session */ constructor(session: EditSession); - markers: any[]; /**@type {EditSession}*/ session: EditSession; - /** * Finds the first marker containing pos * @param {import("ace-code").Ace.Point} pos * @returns import("ace-code").Ace.MarkerGroupItem */ getMarkerAtPosition(pos: import("ace-code").Ace.Point): any; - /** * Comparator for Array.sort function, which sorts marker definitions by their positions * @@ -5820,13 +4673,11 @@ declare module "ace-code/src/marker_group" { * @returns {number} negative number if a should be before b, positive number if b should be before a, 0 otherwise. */ markersComparator(a: MarkerGroupItem, b: MarkerGroupItem): number; - /** * Sets marker definitions to be rendered. Limits the number of markers at MAX_MARKERS. * @param {MarkerGroupItem[]} markers an array of marker definitions. */ setMarkers(markers: MarkerGroupItem[]): void; - /** * @param {any} html * @param {Marker} markerLayer @@ -5837,7 +4688,6 @@ declare module "ace-code/src/marker_group" { firstRow: any; lastRow: any; }): void; - MAX_MARKERS: number; } } @@ -5848,7 +4698,6 @@ declare module "ace-code/src/edit_session/fold" { * @param {any} placeholder */ constructor(range: Range, placeholder: any); - foldLine: import("ace-code/src/edit_session/fold_line").FoldLine; placeholder: any; range: import("ace-code/src/range").Range; @@ -5857,41 +4706,33 @@ declare module "ace-code/src/edit_session/fold" { sameRow: boolean; /**@type {Fold[]}*/ subFolds: Fold[]; - /** * @param {FoldLine} foldLine */ setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - /** * @param {Fold} fold */ addSubFold(fold: Fold): any; - /** * @param {IRange} range */ restoreRange(range: IRange): void; - collapseChildren?: number; } - export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; export type Range = import("ace-code/src/range").Range; export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; import RangeList_1 = require("ace-code/src/range_list"); import RangeList = RangeList_1.RangeList; - export interface Fold { collapseChildren?: number; } } declare module "ace-code/src/edit_session/fold_line" { export type Fold = import("ace-code/src/edit_session/fold").Fold; - export class FoldLine { /** * If an array is passed in, the folds are expected to be sorted already. @@ -5899,37 +4740,31 @@ declare module "ace-code/src/edit_session/fold_line" { * @param {Fold[]|Fold} folds */ constructor(foldData: FoldLine[], folds: Fold[] | Fold); - foldData: FoldLine[]; /**@type {Fold[]} */ folds: Fold[]; range: Range; start: import("ace-code").Ace.Point; end: import("ace-code").Ace.Point; - /** * Note: This doesn't update wrapData! * @param {number} shift */ shiftRow(shift: number): void; - /** * @param {Fold} fold */ addFold(fold: Fold): void; - /** * @param {number} row */ containsRow(row: number): boolean; - /** * @param {Function} callback * @param {number} endRow * @param {number} endColumn */ walk(callback: Function, endRow: number, endColumn: number): void; - /** * @param {number} row * @param {number} column @@ -5939,59 +4774,34 @@ declare module "ace-code/src/edit_session/fold_line" { fold: Fold; kind: string; } | null; - /** * @param {number} row * @param {number} column * @param {number} len */ addRemoveChars(row: number, column: number, len: number): void; - /** * @param {number} row * @param {number} column * @return {FoldLine | null} */ split(row: number, column: number): FoldLine | null; - /** * @param {FoldLine} foldLineNext */ merge(foldLineNext: FoldLine): void; - toString(): string; - /** * @param {number} idx * @return {import("ace-code").Ace.Point} */ idxToPosition(idx: number): import("ace-code").Ace.Point; } - import Range_9 = require("ace-code/src/range"); import Range = Range_9.Range; } -declare module "ace-code/src/lib/bidiutil" { - export const ON_R: 3; - export const AN: 4; - export const R_H: 5; - export const B: 6; - export const RLE: 7; - export const DOT: "·"; - - export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; - - export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; - - export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; - - export var L: number; - export var R: number; - export var EN: number; -} declare module "ace-code/src/bidihandler" { export type EditSession = import("ace-code/src/edit_session").EditSession; - /** * This object is used to ensure Bi-Directional support (for languages with text flowing from right to left, like Arabic or Hebrew) * including correct caret positioning, text selection mouse and keyboard arrows functioning @@ -6002,7 +4812,6 @@ declare module "ace-code/src/bidihandler" { * @param {EditSession} session The session to use **/ constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; bidiMap: {}; currentRow: any; @@ -6021,7 +4830,6 @@ declare module "ace-code/src/bidihandler" { wrapOffset: number; isMoveLeftOperation: boolean; seenBidi: boolean; - /** * Returns 'true' if row contains Bidi characters, in such case * creates Bidi map to be used in operations related to selection @@ -6031,41 +4839,27 @@ declare module "ace-code/src/bidihandler" { * @param {Number} [splitIndex] the wrapped screen line index [ optional] **/ isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; - onChange(delta: any): void; - getDocumentRow(): number; - getSplitIndex(): number; - updateRowLine(docRow: any, splitIndex: any): void; - updateBidiMap(): void; - /** * Resets stored info related to current screen row **/ markAsDirty(): void; - /** * Updates array of character widths * @param {Object} fontMetrics metrics * **/ updateCharacterWidths(fontMetrics: any): void; - characterWidth: any; - setShowInvisibles(showInvisibles: any): void; - setEolChar(eolChar: any): void; - setContentWidth(width: any): void; - isRtlLine(row: any): boolean; - setRtlDirection(editor: any, isRtlDir: any): void; - /** * Returns offset of character at position defined by column. * @param {Number} col the screen column position @@ -6073,7 +4867,6 @@ declare module "ace-code/src/bidihandler" { * @return {Number} horizontal pixel offset of given screen column **/ getPosLeft(col: number): number; - /** * Returns 'selections' - array of objects defining set of selection rectangles * @param {Number} startCol the start column position @@ -6082,7 +4875,6 @@ declare module "ace-code/src/bidihandler" { * @return {Object[]} Each object contains 'left' and 'width' values defining selection rectangle. **/ getSelections(startCol: number, endCol: number): any[]; - /** * Converts character coordinates on the screen to respective document column number * @param {Number} posX character horizontal offset @@ -6091,12 +4883,10 @@ declare module "ace-code/src/bidihandler" { **/ offsetToCol(posX: number): number; } - import bidiUtil = require("ace-code/src/lib/bidiutil"); } declare module "ace-code/src/background_tokenizer" { const BackgroundTokenizer_base: undefined; - /** * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. * @@ -6109,68 +4899,56 @@ declare module "ace-code/src/background_tokenizer" { * @param {EditSession} [session] The editor session to associate with **/ constructor(tokenizer: Tokenizer, session?: EditSession); - /**@type {false|number}*/ running: false | number; lines: any[]; states: any[]; currentLine: number; tokenizer: import("ace-code/src/tokenizer").Tokenizer; - /** * Sets a new tokenizer for this object. * @param {Tokenizer} tokenizer The new tokenizer to use **/ setTokenizer(tokenizer: Tokenizer): void; - /** * Sets a new document to associate with this object. * @param {Document} doc The new document to associate with **/ setDocument(doc: Document): void; - doc: import("ace-code/src/document").Document; - /** * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. * @param {Number} firstRow The starting row region * @param {Number} lastRow The final row region **/ fireUpdateEvent(firstRow: number, lastRow: number): void; - /** * Starts tokenizing at the row indicated. * @param {Number} startRow The row to start at **/ start(startRow: number): void; - /** * Sets pretty long delay to prevent the tokenizer from interfering with the user */ scheduleStart(): void; - /** * Stops tokenizing. **/ stop(): void; - /** * Gives list of [[Token]]'s of the row. (tokens are cached) * @param {Number} row The row to get tokens at * @returns {import("ace-code").Ace.Token[]} **/ getTokens(row: number): import("ace-code").Ace.Token[]; - /** * Returns the state of tokenization at the end of a row. * @param {Number} row The row to get state at * @returns {string} **/ getState(row: number): string; - cleanup(): void; } - export type Document = import("ace-code/src/document").Document; export type EditSession = import("ace-code/src/edit_session").EditSession; export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; @@ -6179,14 +4957,12 @@ declare module "ace-code/src/background_tokenizer" { type EventEmitter = import("ace-code").Ace.EventEmitter; type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; } - export interface BackgroundTokenizer extends Ace.EventEmitter { } } declare module "ace-code/src/edit_session/folding" { export type IFolding = import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding; export type Delta = import("ace-code").Ace.Delta; - /** * @typedef {import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding} IFolding * @typedef {import("ace-code").Ace.Delta } Delta @@ -6196,7 +4972,6 @@ declare module "ace-code/src/edit_session/folding" { * @type {IFolding} */ export function Folding(this: IFolding): void; - export class Folding { /** * Looks up a fold at a given row/column. Possible values for side: @@ -6412,7 +5187,6 @@ declare module "ace-code/src/edit_session/folding" { */ tokenizerUpdateFoldWidgets: (e: any) => void; } - import Fold_1 = require("ace-code/src/edit_session/fold"); import Fold = Fold_1.Fold; import Range_10 = require("ace-code/src/range"); @@ -6423,9 +5197,7 @@ declare module "ace-code/src/edit_session/folding" { declare module "ace-code/src/edit_session/bracket_match" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type Point = import("ace-code/src/edit_session").Point; - export function BracketMatch(): void; - export class BracketMatch { /** * @@ -6465,7 +5237,6 @@ declare module "ace-code/src/edit_session/bracket_match" { openTagName: Range; } | undefined; } - import Range_11 = require("ace-code/src/range"); import Range = Range_11.Range; } @@ -6474,7 +5245,6 @@ declare module "ace-code/src/edit_session" { const EditSession_base_1: undefined; const EditSession_base_2: undefined; const EditSession_base_3: undefined; - /** * @typedef TextMode * @type {SyntaxMode} @@ -6492,20 +5262,17 @@ declare module "ace-code/src/edit_session" { * @returns {EditSession} */ static fromJSON(session: string | object): EditSession; - /** * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. * @param {Document | String} [text] [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} * @param {SyntaxMode} [mode] [The initial language mode to use for the document]{: #modeParam} **/ constructor(text?: Document | string, mode?: SyntaxMode); - /**@type {Document}*/ doc: Document; id: string; bgTokenizer: BackgroundTokenizer; selection: Selection; destroyed: boolean; - /** * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. * @@ -6513,44 +5280,35 @@ declare module "ace-code/src/edit_session" { * **/ setDocument(doc: Document): void; - /** * Returns the `Document` associated with this session. * @return {Document} **/ getDocument(): Document; - resetCaches(): void; - onChangeFold(e: any): void; - /** * * @param {Delta} delta */ onChange(delta: Delta): void; - mergeUndoDeltas: boolean; - /** * Sets the session text. * @param {String} text The new text to place **/ setValue(text: string): void; - /** * Returns the current edit session. * @method toJSON * @returns {Object} */ toJSON(): any; - /** * Returns selection object. * @returns {Selection} **/ getSelection(): Selection; - /** * {:BackgroundTokenizer.getState} * @param {Number} row The row to start at @@ -6558,14 +5316,12 @@ declare module "ace-code/src/edit_session" { * @related BackgroundTokenizer.getState **/ getState(row: number): string; - /** * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. * @param {Number} row The row to start at * @returns {import("ace-code").Ace.Token[]} **/ getTokens(row: number): import("ace-code").Ace.Token[]; - /** * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. * @param {Number} row The row number to retrieve from @@ -6574,72 +5330,60 @@ declare module "ace-code/src/edit_session" { * **/ getTokenAt(row: number, column: number): import("ace-code").Ace.Token; - /** * Sets the undo manager. * @param {UndoManager} undoManager The new undo manager **/ setUndoManager(undoManager: UndoManager): void; - /** * starts a new group in undo history **/ markUndoGroup(): void; - /** * Returns the current undo manager. * @returns {UndoManager} **/ getUndoManager(): UndoManager; - /** * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. * @returns {String} **/ getTabString(): string; - /** * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * @param {Boolean} val Value indicating whether or not to use soft tabs **/ setUseSoftTabs(val: boolean): void; - /** * Returns `true` if soft tabs are being used, `false` otherwise. * @returns {Boolean} **/ getUseSoftTabs(): boolean; - /** * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. * @param {Number} tabSize The new tab size **/ setTabSize(tabSize: number): void; - /** * Returns the current tab size. * @return {number} **/ getTabSize(): number; - /** * Returns `true` if the character at the position is a soft tab. * @param {Point} position The position to check **/ isTabStop(position: Point): boolean; - /** * Set whether keyboard navigation of soft tabs moves the cursor within the soft tab, rather than over * @param {Boolean} navigateWithinSoftTabs Value indicating whether or not to navigate within soft tabs **/ setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; - /** * Returns `true` if keyboard navigation moves the cursor within soft tabs, `false` if it moves the cursor over soft tabs. * @returns {Boolean} **/ getNavigateWithinSoftTabs(): boolean; - /** * Pass in `true` to enable overwrites in your session, or `false` to disable. * @@ -6649,61 +5393,51 @@ declare module "ace-code/src/edit_session" { * **/ setOverwrite(overwrite: boolean): void; - /** * Returns `true` if overwrites are enabled; `false` otherwise. **/ getOverwrite(): boolean; - /** * Sets the value of overwrite to the opposite of whatever it currently is. **/ toggleOverwrite(): void; - /** * Adds `className` to the `row`, to be used for CSS stylings and whatnot. * @param {Number} row The row number * @param {String} className The class to add **/ addGutterDecoration(row: number, className: string): void; - /** * Removes `className` from the `row`. * @param {Number} row The row number * @param {String} className The class to add **/ removeGutterDecoration(row: number, className: string): void; - /** * Returns an array of strings, indicating the breakpoint class (if any) applied to each row. * @returns {String[]} **/ getBreakpoints(): string[]; - /** * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * @param {number[]} rows An array of row indices **/ setBreakpoints(rows: number[]): void; - /** * Removes all breakpoints on the rows. This function also emits the `'changeBreakpoint'` event. **/ clearBreakpoints(): void; - /** * Sets a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. * @param {Number} row A row index * @param {String} className Class of the breakpoint **/ setBreakpoint(row: number, className: string): void; - /** * Removes a breakpoint on the row number given by `row`. This function also emits the `'changeBreakpoint'` event. * @param {Number} row A row index **/ clearBreakpoint(row: number): void; - /** * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. * @param {Range} range Define the range of the marker @@ -6714,7 +5448,6 @@ declare module "ace-code/src/edit_session" { * @return {Number} The new marker id **/ addMarker(range: Range, clazz: string, type?: import("ace-code").Ace.MarkerRenderer | "fullLine" | "screenLine" | "text" | "line", inFront?: boolean): number; - /** * Adds a dynamic marker to the session. * @param {import("ace-code").Ace.MarkerLike} marker object with update method @@ -6723,13 +5456,11 @@ declare module "ace-code/src/edit_session" { * @return {import("ace-code").Ace.MarkerLike} The added marker **/ addDynamicMarker(marker: import("ace-code").Ace.MarkerLike, inFront?: boolean): import("ace-code").Ace.MarkerLike; - /** * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. * @param {Number} markerId A number representing a marker **/ removeMarker(markerId: number): void; - /** * Returns an object containing all of the markers, either front or back. * @param {Boolean} [inFront] If `true`, indicates you only want front markers; `false` indicates only back markers @@ -6739,12 +5470,10 @@ declare module "ace-code/src/edit_session" { getMarkers(inFront?: boolean): { [id: number]: import("ace-code").Ace.MarkerLike; }; - /** * @param {RegExp} re */ highlight(re: RegExp): void; - /** * experimental * @param {number} startRow @@ -6754,24 +5483,20 @@ declare module "ace-code/src/edit_session" { * @return {Range} */ highlightLines(startRow: number, endRow: number, clazz: string, inFront?: boolean): Range; - /** * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. * @param {import("ace-code").Ace.Annotation[]} annotations A list of annotations **/ setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; - /** * Returns the annotations for the `EditSession`. * @returns {import("ace-code").Ace.Annotation[]} **/ getAnnotations(): import("ace-code").Ace.Annotation[]; - /** * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. **/ clearAnnotations(): void; - /** * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * @param {Number} row The row to start at @@ -6780,7 +5505,6 @@ declare module "ace-code/src/edit_session" { * @returns {Range} **/ getWordRange(row: number, column: number): Range; - /** * Gets the range of a word, including its right whitespace. * @param {Number} row The row number to start from @@ -6789,7 +5513,6 @@ declare module "ace-code/src/edit_session" { * @return {Range} **/ getAWordRange(row: number, column: number): Range; - /** * {:Document.setNewLineMode.desc} * @param {import("ace-code").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} @@ -6798,7 +5521,6 @@ declare module "ace-code/src/edit_session" { * @related Document.setNewLineMode **/ setNewLineMode(newLineMode: import("ace-code").Ace.NewLineMode): void; - /** * * Returns the current new line mode. @@ -6806,86 +5528,71 @@ declare module "ace-code/src/edit_session" { * @related Document.getNewLineMode **/ getNewLineMode(): import("ace-code").Ace.NewLineMode; - /** * Identifies if you want to use a worker for the `EditSession`. * @param {Boolean} useWorker Set to `true` to use a worker **/ setUseWorker(useWorker: boolean): void; - /** * Returns `true` if workers are being used. **/ getUseWorker(): boolean; - /** * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. **/ onReloadTokenizer(e: any): void; - /** * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. * @param {SyntaxMode | string} mode Set a new text mode * @param {() => void} [cb] optional callback **/ setMode(mode: SyntaxMode | string, cb?: () => void): void; - /**@type {RegExp}*/ tokenRe: RegExp; /**@type {RegExp}*/ nonTokenRe: RegExp; - /** * Returns the current text mode. * @returns {TextMode} The current text mode **/ getMode(): TextMode; - /** * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. * @param {Number} scrollTop The new scroll top value **/ setScrollTop(scrollTop: number): void; - /** * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} * @returns {Number} **/ getScrollTop(): number; - /** * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} * @param {number} scrollLeft */ setScrollLeft(scrollLeft: number): void; - /** * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} * @returns {Number} **/ getScrollLeft(): number; - /** * Returns the width of the screen. * @returns {Number} **/ getScreenWidth(): number; - /** * @return {number} */ getLineWidgetMaxWidth(): number; - lineWidgetWidth: number; screenWidth: any; - /** * Returns a verbatim copy of the given line as it is in the document * @param {Number} row The row to retrieve from * @returns {String} **/ getLine(row: number): string; - /** * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * @param {Number} firstRow The first row index to retrieve @@ -6895,13 +5602,11 @@ declare module "ace-code/src/edit_session" { * **/ getLines(firstRow: number, lastRow: number): string[]; - /** * Returns the number of rows in the document. * @returns {Number} **/ getLength(): number; - /** * {:Document.getTextRange.desc} * @param {IRange} [range] The range to work with @@ -6909,7 +5614,6 @@ declare module "ace-code/src/edit_session" { * @returns {String} **/ getTextRange(range?: IRange): string; - /** * Inserts a block of `text` and the indicated `position`. * @param {Point} position The position {row, column} to start inserting at @@ -6917,14 +5621,12 @@ declare module "ace-code/src/edit_session" { * @returns {Point} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. **/ insert(position: Point, text: string): Point; - /** * Removes the `range` from the document. * @param {IRange} range A specified Range to remove * @returns {Point} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. **/ remove(range: IRange): Point; - /** * Removes a range of full lines. This method also triggers the `'change'` event. * @param {Number} firstRow The first row to be removed @@ -6935,28 +5637,24 @@ declare module "ace-code/src/edit_session" { * **/ removeFullLines(firstRow: number, lastRow: number): string[]; - /** * Reverts previous changes to your document. * @param {Delta[]} deltas An array of previous changes * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} **/ undoChanges(deltas: Delta[], dontSelect?: boolean): void; - /** * Re-implements a previously undone change to your document. * @param {Delta[]} deltas An array of previous changes * @param {Boolean} [dontSelect] {:dontSelect} **/ redoChanges(deltas: Delta[], dontSelect?: boolean): void; - /** * Enables or disables highlighting of the range where an undo occurred. * @param {Boolean} enable If `true`, selects the range of the reinserted change * **/ setUndoSelect(enable: boolean): void; - /** * Replaces a range in the document with the new `text`. * @@ -6972,7 +5670,6 @@ declare module "ace-code/src/edit_session" { * @related Document.replace **/ replace(range: IRange, text: string): Point; - /** * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * ```json @@ -6984,7 +5681,6 @@ declare module "ace-code/src/edit_session" { * @returns {Range} The new range where the text was moved to. **/ moveText(fromRange: Range, toPosition: Point, copy?: boolean): Range; - /** * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * @@ -6994,13 +5690,11 @@ declare module "ace-code/src/edit_session" { * @param {String} indentString The indent token **/ indentRows(startRow: number, endRow: number, indentString: string): void; - /** * Outdents all the rows defined by the `start` and `end` properties of `range`. * @param {Range} range A range of rows **/ outdentRows(range: Range): void; - /** * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. * @param {Number} firstRow The starting row to move up @@ -7008,7 +5702,6 @@ declare module "ace-code/src/edit_session" { * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. **/ moveLinesUp(firstRow: number, lastRow: number): number; - /** * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. * @param {Number} firstRow The starting row to move down @@ -7016,7 +5709,6 @@ declare module "ace-code/src/edit_session" { * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. **/ moveLinesDown(firstRow: number, lastRow: number): number; - /** * Duplicates all the text between `firstRow` and `lastRow`. * @param {Number} firstRow The starting row to duplicate @@ -7024,26 +5716,22 @@ declare module "ace-code/src/edit_session" { * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. **/ duplicateLines(firstRow: number, lastRow: number): number; - /** * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. * @param {Boolean} useWrapMode Enable (or disable) wrap mode **/ setUseWrapMode(useWrapMode: boolean): void; - /** * Returns `true` if wrap mode is being used; `false` otherwise. * @returns {Boolean} **/ getUseWrapMode(): boolean; - /** * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. * @param {Number} min The minimum wrap value (the left side wrap) * @param {Number} max The maximum wrap value (the right side wrap) **/ setWrapLimitRange(min: number, max: number): void; - /** * This should generally only be called by the renderer when a resize is detected. * @param {Number} desiredLimit The new wrap limit @@ -7051,13 +5739,11 @@ declare module "ace-code/src/edit_session" { * @returns {Boolean} **/ adjustWrapLimit(desiredLimit: number, $printMargin?: any): boolean; - /** * Returns the value of wrap limit. * @returns {Number} The wrap limit. **/ getWrapLimit(): number; - /** * Sets the line length for soft wrap in the editor. Lines will break * at a minimum of the given length minus 20 chars and at a maximum @@ -7065,7 +5751,6 @@ declare module "ace-code/src/edit_session" { * @param {number} limit The maximum line length in chars, for soft wrapping lines. */ setWrapLimit(limit: number): void; - /** * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * @@ -7077,26 +5762,22 @@ declare module "ace-code/src/edit_session" { min: number; max: number; }; - /** * Returns number of screenrows in a wrapped line. * @param {Number} row The row number to check * @returns {Number} **/ getRowLength(row: number): number; - /** * @param {Number} row * @returns {Number} **/ getRowLineCount(row: number): number; - /** * @param {Number} screenRow * @returns {Number} **/ getRowWrapIndent(screenRow: number): number; - /** * Returns the position (on screen) for the last character in the provided screen row. * @param {Number} screenRow The screen row to check @@ -7105,7 +5786,6 @@ declare module "ace-code/src/edit_session" { * @related EditSession.documentToScreenColumn **/ getScreenLastRowColumn(screenRow: number): number; - /** * For the given document row and column, this returns the column position of the last screen row. * @param {Number} docRow @@ -7113,7 +5793,6 @@ declare module "ace-code/src/edit_session" { * @returns {number} **/ getDocumentLastRowColumn(docRow: number, docColumn: number): number; - /** * For the given document row and column, this returns the document position of the last row. * @param {Number} docRow @@ -7121,14 +5800,12 @@ declare module "ace-code/src/edit_session" { * @returns {Point} **/ getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; - /** * For the given row, this returns the split data. * @param {number} row * @returns {String | undefined} */ getRowSplitData(row: number): string | undefined; - /** * The distance to the next tab stop at the specified screen column. * @param {Number} screenColumn The screen column to check @@ -7136,21 +5813,18 @@ declare module "ace-code/src/edit_session" { * @returns {Number} **/ getScreenTabSize(screenColumn: number): number; - /** * @param {number} screenRow * @param {number} screenColumn * @returns {number} */ screenToDocumentRow(screenRow: number, screenColumn: number): number; - /** * @param {number} screenRow * @param {number} screenColumn * @returns {number} */ screenToDocumentColumn(screenRow: number, screenColumn: number): number; - /** * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} * @param {Number} screenRow The screen row to check @@ -7162,7 +5836,6 @@ declare module "ace-code/src/edit_session" { * @related EditSession.documentToScreenPosition **/ screenToDocumentPosition(screenRow: number, screenColumn: number, offsetX?: number): Point; - /** * Converts document coordinates to screen coordinates. {:conversionConsiderations} * @param {Number|Point} docRow The document row to check @@ -7172,7 +5845,6 @@ declare module "ace-code/src/edit_session" { * @related EditSession.screenToDocumentPosition **/ documentToScreenPosition(docRow: number | Point, docColumn?: number | undefined): Point; - /** * For the given document row and column, returns the screen column. * @param {Number|Point} row @@ -7180,7 +5852,6 @@ declare module "ace-code/src/edit_session" { * @returns {Number} **/ documentToScreenColumn(row: number | Point, docColumn?: number): number; - /** * For the given document row and column, returns the screen row. * @param {Number|Point} docRow @@ -7188,20 +5859,16 @@ declare module "ace-code/src/edit_session" { * @returns {number} **/ documentToScreenRow(docRow: number | Point, docColumn?: number): number; - /** * Returns the length of the screen. * @returns {Number} **/ getScreenLength(): number; - /** * @returns {string} the last character preceding the cursor in the editor */ getPrecedingCharacter(): string; - destroy(): void; - /** * Returns the current [[Document `Document`]] as a string. * @method getValue @@ -7223,14 +5890,11 @@ declare module "ace-code/src/edit_session" { scrollTop: number; }; lineWidgetsWidth?: number; - getSelectionMarkers(): any[]; - gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; } - export namespace EditSession { export {$uid}; } @@ -7253,9 +5917,7 @@ declare module "ace-code/src/edit_session" { import UndoManager = UndoManager_1.UndoManager; import Range_12 = require("ace-code/src/range"); import Range = Range_12.Range; - function isFullWidth(c: any): boolean; - var $uid: number; export {}; namespace Ace { @@ -7269,7 +5931,6 @@ declare module "ace-code/src/edit_session" { type Point = import("ace-code").Ace.Point; type Occur = import("ace-code").Ace.Occur; } - export interface EditSession extends Ace.EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace.BracketMatch { doc: Ace.Document; widgetManager?: any; @@ -7280,9 +5941,7 @@ declare module "ace-code/src/edit_session" { [key: string]: any; }; lineWidgetsWidth?: number; - getSelectionMarkers(): any[]; - gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; @@ -7307,19 +5966,16 @@ declare module "ace-code/src/range" { * @constructor **/ constructor(startRow?: number, startColumn?: number, endRow?: number, endColumn?: number); - /**@type {Point}*/ start: Point; /**@type {Point}*/ end: Point; - /** * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. * @param {IRange} range A range to check against * @return {Boolean} **/ isEqual(range: IRange): boolean; - /** * Returns a string containing the range's row and column information, given like this: * ``` @@ -7328,7 +5984,6 @@ declare module "ace-code/src/range" { * @return {String} **/ toString(): string; - /** * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if: * ```javascript @@ -7341,7 +5996,6 @@ declare module "ace-code/src/range" { * @related [[Range.compare]] **/ contains(row: number, column: number): boolean; - /** * Compares `this` range (A) with another range (B). * @param {IRange} range A range to compare with @@ -7355,7 +6009,6 @@ declare module "ace-code/src/range" { * * `42`: FTW state: (B) ends in (A) but starts outside of (A) **/ compareRange(range: IRange): number; - /** * Compares the row and column of `p` with the starting and ending [[Point]]'s of the calling range (by calling [[Range.compare]]). * @param {Point} p A point to compare with @@ -7363,7 +6016,6 @@ declare module "ace-code/src/range" { * @returns {Number} **/ comparePoint(p: Point): number; - /** * Checks the start and end [[Point]]'s of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range. * @param {IRange} range A range to compare with @@ -7371,14 +6023,12 @@ declare module "ace-code/src/range" { * @related [[Range.comparePoint]] **/ containsRange(range: IRange): boolean; - /** * Returns `true` if passed in `range` intersects with the one calling this method. * @param {IRange} range A range to compare with * @returns {Boolean} **/ intersects(range: IRange): boolean; - /** * Returns `true` if the caller's ending row is the same as `row`, and if the caller's ending column is the same as `column`. * @param {Number} row A row to compare with @@ -7386,7 +6036,6 @@ declare module "ace-code/src/range" { * @returns {Boolean} **/ isEnd(row: number, column: number): boolean; - /** * Returns `true` if the caller's starting row is the same as `row`, and if the caller's starting column is the same as `column`. * @param {Number} row A row to compare with @@ -7394,7 +6043,6 @@ declare module "ace-code/src/range" { * @returns {Boolean} **/ isStart(row: number, column: number): boolean; - /** * Sets the starting row and column for the range. * @param {Number|Point} row A row to set @@ -7402,7 +6050,6 @@ declare module "ace-code/src/range" { * **/ setStart(row: number | Point, column?: number): void; - /** * Sets the starting row and column for the range. * @param {Number|Point} row A row to set @@ -7410,7 +6057,6 @@ declare module "ace-code/src/range" { * **/ setEnd(row: number | Point, column?: number): void; - /** * Returns `true` if the `row` and `column` are within the given range. * @param {Number} row A row to compare with @@ -7419,7 +6065,6 @@ declare module "ace-code/src/range" { * @related [[Range.compare]] **/ inside(row: number, column: number): boolean; - /** * Returns `true` if the `row` and `column` are within the given range's starting [[Point]]. * @param {Number} row A row to compare with @@ -7428,7 +6073,6 @@ declare module "ace-code/src/range" { * @related [[Range.compare]] **/ insideStart(row: number, column: number): boolean; - /** * Returns `true` if the `row` and `column` are within the given range's ending [[Point]]. * @param {Number} row A row to compare with @@ -7438,7 +6082,6 @@ declare module "ace-code/src/range" { * **/ insideEnd(row: number, column: number): boolean; - /** * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. * @param {Number} row A row to compare with @@ -7457,7 +6100,6 @@ declare module "ace-code/src/range" { * * Otherwise, it returns 1 **/ compare(row: number, column: number): number; - /** * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. * @param {Number} row A row to compare with @@ -7467,7 +6109,6 @@ declare module "ace-code/src/range" { * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. **/ compareStart(row: number, column: number): number; - /** * Compares the `row` and `column` with the starting and ending [[Point]]'s of the calling range. * @param {Number} row A row to compare with @@ -7477,7 +6118,6 @@ declare module "ace-code/src/range" { * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. */ compareEnd(row: number, column: number): number; - /** * Compares the `row` and `column` with the start and end [[Point]]'s of the calling range. * @param {Number} row A row to compare with @@ -7488,7 +6128,6 @@ declare module "ace-code/src/range" { * * Otherwise, it returns the value after calling [[Range.compare `compare()`]]. **/ compareInside(row: number, column: number): number; - /** * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object. * @param {Number} firstRow The starting row @@ -7496,7 +6135,6 @@ declare module "ace-code/src/range" { * @returns {Range} **/ clipRows(firstRow: number, lastRow: number): Range; - /** * Changes the `row` and `column` for the calling range for both the starting and ending [[Point]]'s. * @param {Number} row A new row to extend to @@ -7504,38 +6142,32 @@ declare module "ace-code/src/range" { * @returns {Range} The original range with the new row **/ extend(row: number, column: number): Range; - /** * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). * @returns {Boolean} **/ isEmpty(): boolean; - /** * Returns `true` if the range spans across multiple lines. * @returns {Boolean} **/ isMultiLine(): boolean; - /** * Returns a duplicate of the calling range. * @returns {Range} **/ clone(): Range; - /** * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. * @returns {Range} **/ collapseRows(): Range; - /** * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. * @param {EditSession} session The `EditSession` to retrieve coordinates from * @returns {Range} **/ toScreenRange(session: EditSession): Range; - /** * Shift the calling range by `row` and `column` values. * @param {Number} row @@ -7543,19 +6175,16 @@ declare module "ace-code/src/range" { * @experimental */ moveBy(row: number, column: number): void; - id?: number; cursor?: import("ace-code").Ace.Point; isBackwards?: boolean; } - export namespace Range { export {fromPoints, comparePoints}; } export type EditSession = import("ace-code/src/edit_session").EditSession; export type IRange = import("ace-code").Ace.IRange; export type Point = import("ace-code").Ace.Point; - /** * Creates and returns a new `Range` based on the `start` [[Point]] and `end` [[Point]] of the given parameters. * @param {Point} start A starting point to use @@ -7563,7 +6192,6 @@ declare module "ace-code/src/range" { * @returns {Range} **/ function fromPoints(start: Point, end: Point): Range; - /** * Compares `p1` and `p2` [[Point]]'s, useful for sorting * @param {Point} p1 @@ -7571,12 +6199,10 @@ declare module "ace-code/src/range" { * @returns {Number} */ function comparePoints(p1: Point, p2: Point): number; - export {}; namespace Ace { type Point = import("ace-code").Ace.Point; } - export interface Range { id?: number; cursor?: Ace.Point; @@ -7588,7 +6214,6 @@ declare module "ace-code/src/worker/worker_client" { } declare module "ace-code/src/placeholder" { const PlaceHolder_base: undefined; - export class PlaceHolder { /** * @param {EditSession} session @@ -7599,13 +6224,11 @@ declare module "ace-code/src/placeholder" { * @param {String} othersClass **/ constructor(session: EditSession, length: number, pos: import("ace-code").Ace.Point, others: any[], mainClass: string, othersClass: string); - length: number; session: import("ace-code/src/edit_session").EditSession; doc: import("ace-code/src/document").Document; mainClass: string; othersClass: string; - /** * PlaceHolder.setup() * @@ -7613,11 +6236,9 @@ declare module "ace-code/src/placeholder" { * **/ setup(): void; - selectionBefore: Range | Range[]; pos: import("ace-code/src/anchor").Anchor; others: any[]; - /** * PlaceHolder.showOtherMarkers() * @@ -7625,9 +6246,7 @@ declare module "ace-code/src/placeholder" { * **/ showOtherMarkers(): void; - othersActive: boolean; - /** * PlaceHolder.hideOtherMarkers() * @@ -7635,7 +6254,6 @@ declare module "ace-code/src/placeholder" { * **/ hideOtherMarkers(): void; - /** * PlaceHolder@onUpdate(e) * @@ -7643,14 +6261,11 @@ declare module "ace-code/src/placeholder" { * @param {import("ace-code").Ace.Delta} delta */ onUpdate(delta: import("ace-code").Ace.Delta): void; - /** * @param {import("ace-code").Ace.Delta} delta */ updateAnchors(delta: import("ace-code").Ace.Delta): void; - updateMarkers(): void; - /** * PlaceHolder@onCursorChange(e) * @@ -7658,7 +6273,6 @@ declare module "ace-code/src/placeholder" { * @param {any} [event] */ onCursorChange(event?: any): void; - /** * PlaceHolder.detach() * @@ -7666,7 +6280,6 @@ declare module "ace-code/src/placeholder" { * **/ detach(): void; - /** * PlaceHolder.cancel() * @@ -7675,7 +6288,6 @@ declare module "ace-code/src/placeholder" { **/ cancel(): void; } - export type EditSession = import("ace-code/src/edit_session").EditSession; import Range_13 = require("ace-code/src/range"); import Range = Range_13.Range; @@ -7684,7 +6296,6 @@ declare module "ace-code/src/placeholder" { type EventEmitter = import("ace-code").Ace.EventEmitter; type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; } - export interface PlaceHolder extends Ace.EventEmitter { } } @@ -7704,21 +6315,17 @@ declare module "ace-code/src/multi_select" { export type Anchor = import("ace-code/src/anchor").Anchor; export type Point = import("ace-code").Ace.Point; export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; - /** * @param {Editor} editor */ export function MultiSelect(editor: Editor): void; - import Editor_4 = require("ace-code/src/editor"); import Editor = Editor_4.Editor; } declare module "ace-code/src/commands/occur_commands" { export namespace occurStartCommand { let name: string; - function exec(editor: any, options: any): void; - let readOnly: boolean; } } @@ -7753,9 +6360,7 @@ declare module "ace-code/src/commands/incremental_search_commands" { bindKey: string; exec: (iSearch: any) => void; })[]; - export function IncrementalSearchKeyboardHandler(iSearch: any): void; - export class IncrementalSearchKeyboardHandler { constructor(iSearch: any); } @@ -7774,61 +6379,46 @@ declare module "ace-code/src/incremental_search" { * @param {boolean} backwards */ activate(editor: any, backwards: boolean): void; - /** * @param {boolean} [reset] */ deactivate(reset?: boolean): void; - /** * @param {Editor} editor */ selectionFix(editor: Editor): void; - /** * @param {RegExp} regexp */ highlight(regexp: RegExp): void; - /** * @param {boolean} [reset] */ cancelSearch(reset?: boolean): Range; - /** * @param {boolean} moveToNext * @param {Function} needleUpdateFunc */ highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; - /** * @param {string} s */ addString(s: string): false | Range; - /** * @param {any} c */ removeChar(c: any): false | Range; - next(options: any): false | Range; - onMouseDown(evt: any): boolean; - /** * @param {string} text */ onPaste(text: string): void; - convertNeedleToRegExp(): false | Range; - convertNeedleToString(): false | Range; - statusMessage(found: any): void; - message(msg: any): void; } - import Search_3 = require("ace-code/src/search"); import Search = Search_3.Search; import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); @@ -7854,7 +6444,6 @@ declare module "ace-code/src/tokenizer_dev" { **/ getLineTokens(line: any, startState: any): any; } - import BaseTokenizer_1 = require("ace-code/src/tokenizer"); import BaseTokenizer = BaseTokenizer_1.Tokenizer; } @@ -7865,6 +6454,3 @@ declare module "ace-code/src/keyboard/textarea" { import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); import HashHandler = HashHandler_6.HashHandler; } -declare module "ace-code/src/lib/fixoldbrowsers" { - export {}; -} diff --git a/ace.d.ts b/ace.d.ts index b406c305356..d4877588734 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,3 +1,4 @@ +/// /// /// /// diff --git a/package.json b/package.json index e2f074b6e4c..e1b13149b33 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "ace-modules.d.ts", "ace-snippets.d.ts", "ace-theme.d.ts", + "ace-lib.d.ts", "esm-resolver.js", "translations", "!**/*_test.js", diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 87024fab72d..bf16b3d9def 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -2,7 +2,7 @@ const ts = require('typescript'); const fs = require("fs"); const path = require("path"); -const SEPARATE_MODULES = ["ext", "theme", "snippets"]; // adjust this list for more granularity +const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity /** * @param {string} directoryPath @@ -96,7 +96,7 @@ function fixDeclaration(content, aceNamespacePath) { }, customCompilerHost); var checker = program.getTypeChecker(); - let interfaces = collectInterfaces(aceNamespacePath); + let internalStatements = collectStatements(aceNamespacePath); const finalDeclarations = []; /** @@ -111,17 +111,17 @@ function fixDeclaration(content, aceNamespacePath) { // replace wrong generated modules if (node.name.text.endsWith("lib/keys") || node.name.text.endsWith("linking")) { let statements = []; - if (interfaces[node.name.text]) { - statements = interfaces[node.name.text]; + if (internalStatements[node.name.text]) { + statements = internalStatements[node.name.text]; } const newBody = ts.factory.createModuleBlock(statements); updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); } - else if (interfaces[node.name.text]) { - // add corresponding interfaces to support mixins (EventEmitter, OptionsProvider, etc.) + else if (internalStatements[node.name.text]) { + // add corresponding internalStatements to support mixins (EventEmitter, OptionsProvider, etc.) if (node.body && ts.isModuleBlock(node.body)) { const newBody = ts.factory.createModuleBlock( - node.body.statements.concat(interfaces[node.name.text]).filter(statement => { + node.body.statements.concat(internalStatements[node.name.text]).filter(statement => { if (node.name.text.endsWith("autocomplete")) { return !(ts.isModuleDeclaration(statement) && statement.name.text === 'Autocomplete'); @@ -318,9 +318,10 @@ function checkFinalDeclaration(declarationNames) { } /** + * Collect statements (interfaces and function declarations) from the ace-internal. * @param {string} aceNamespacePath */ -function collectInterfaces(aceNamespacePath) { +function collectStatements(aceNamespacePath) { const program = ts.createProgram([aceNamespacePath], { noEmit: true }); From a6df107703e55d3bae4d39dc0ac4781a095192df Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 18 Apr 2024 14:19:46 +0400 Subject: [PATCH 11/33] filter all nodes with `private` modifier --- ace-lib.d.ts | 71 ------------------------------- ace-modules.d.ts | 29 ++----------- src/autocomplete.js | 1 + tool/ace_declaration_generator.js | 13 ++++-- 4 files changed, 14 insertions(+), 100 deletions(-) diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 21611f1c4ab..98c05aabdc4 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -4,9 +4,7 @@ declare module "ace-code/src/lib/useragent" { let MAC: string; let WINDOWS: string; } - export function getOS(): string; - export const isWin: boolean; export const isMac: boolean; export const isLinux: boolean; @@ -27,54 +25,32 @@ declare module "ace-code/src/lib/useragent" { } declare module "ace-code/src/lib/dom" { export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; - export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; - export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; - export function removeChildren(element: HTMLElement): void; - export function createTextNode(textContent: string, element?: HTMLElement): Text; - export function createFragment(element?: HTMLElement): DocumentFragment; - export function hasCssClass(el: HTMLElement, name: string): boolean; - export function addCssClass(el: HTMLElement, name: string): void; - export function removeCssClass(el: HTMLElement, name: string): void; - export function toggleCssClass(el: HTMLElement, name: string): boolean; - export function setCssClass(node: HTMLElement, className: string, include: boolean): void; - export function hasCssString(id: string, doc?: Document): boolean; - export function removeElementById(id: string, doc?: Document): void; - export function useStrictCSP(value: any): void; - export function importCssStylsheet(uri: string, doc?: Document): void; - export function scrollbarWidth(doc?: Document): number; - export function computedStyle(element: Element, style?: any): Partial; - export function setStyle(styles: CSSStyleDeclaration, property: string, value: string): void; - export const HAS_CSS_ANIMATION: boolean; export const HAS_CSS_TRANSFORMS: boolean; export const HI_DPI: boolean; - export function translate(element: any, tx: any, ty: any): void; - export function importCssString(cssText: any, id: any, target: any): number; } declare module "ace-code/src/lib/oop" { export function inherits(ctor: any, superCtor: any): void; - export function mixin(obj: T, mixin: any): any; - export function implement(proto: T, mixin: any): any; } declare module "ace-code/src/lib/deep_copy" { @@ -82,33 +58,19 @@ 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 stringRepeat(string: any, count: any): string; - export function stringTrimLeft(string: any): any; - export function stringTrimRight(string: any): any; - export function copyObject(obj: any): {}; - export function copyArray(array: any): any[]; - export const deepCopy: (obj: any) => any; - export function arrayToMap(arr: any): {}; - export function createMap(props: any): any; - export function arrayRemove(array: any, value: any): void; - export function escapeRegExp(str: any): any; - export function escapeHTML(str: any): string; - export function getMatchOffsets(string: any, regExp: any): any[]; - export function deferredCall(fcn: any): { (timeout: any): any; schedule: any; @@ -116,7 +78,6 @@ declare module "ace-code/src/lib/lang" { cancel(): any; isPending(): any; }; - export function delayedCall(fcn: any, defaultTimeout: any): { (timeout: any): void; delay(timeout: any): void; @@ -125,9 +86,7 @@ declare module "ace-code/src/lib/lang" { cancel(): void; isPending(): any; }; - export function supportsLookbehind(): boolean; - export function skipEmptyMatch(line: any, last: any, supportsUnicodeFlag: any): 1 | 2; } declare module "ace-code/src/lib/keys" { @@ -135,33 +94,19 @@ declare module "ace-code/src/lib/keys" { } declare module "ace-code/src/lib/event" { export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; - export function removeListener(elem: any, type: any, callback: any): void; - export function stopEvent(e: any): boolean; - export function stopPropagation(e: any): void; - export function preventDefault(e: any): void; - export function getButton(e: any): any; - export function capture(el: any, eventHandler: any, releaseCaptureHandler: any): (e: any) => void; - export function addMouseWheelListener(el: any, callback: any, destroyer?: any): void; - export function addMultiMouseDownListener(elements: any, timeouts: any, eventHandler: any, callbackName: any, destroyer?: any): void; - export function getModifierString(e: KeyboardEvent | MouseEvent): any; - export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; - export function nextTick(callback: any, win: any): void; - export function onIdle(cb: any, timeout: any): number; - export function blockIdle(delay: any): void; - export const nextFrame: any; } declare module "ace-code/src/lib/event_emitter" { @@ -170,9 +115,7 @@ declare module "ace-code/src/lib/event_emitter" { } declare module "ace-code/src/lib/net" { export function get(url: any, callback: any): void; - export function loadScript(path: any, callback: any): void; - export function qualifyURL(url: any): string; } declare module "ace-code/src/lib/report_error" { @@ -224,7 +167,6 @@ declare module "ace-code/src/lib/default_english_messages" { } declare module "ace-code/src/lib/app_config" { const AppConfig_base: undefined; - export class AppConfig { /** * @param {Object} obj @@ -235,19 +177,16 @@ declare module "ace-code/src/lib/app_config" { defineOptions(obj: any, path: string, options: { [key: string]: any; }): AppConfig; - /** * @param {Object} obj */ resetOptions(obj: any): void; - /** * @param {string} path * @param {string} name * @param {any} value */ setDefaultValue(path: string, name: string, value: any): boolean; - /** * @param {string} path * @param {{ [key: string]: any; }} optionHash @@ -255,12 +194,10 @@ declare module "ace-code/src/lib/app_config" { setDefaultValues(path: string, optionHash: { [key: string]: any; }): void; - /** * @param {any} value */ setMessages(value: any): void; - /** * @param {string} key * @param {string} defaultString @@ -269,18 +206,14 @@ declare module "ace-code/src/lib/app_config" { nls(key: string, defaultString: string, params?: { [x: string]: any; }): any; - warn: typeof warn; reportError: (msg: any, data: any) => void; } - function warn(message: any, ...args: any[]): void; - export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } - export interface AppConfig extends Ace.EventEmitter { } } @@ -294,13 +227,9 @@ declare module "ace-code/src/lib/bidiutil" { export const B: 6; export const RLE: 7; export const DOT: "·"; - export function doBidiReorder(text: string, textCharTypes: any[], isRtl: boolean): any; - export function hasBidiCharacters(text: string, textCharTypes: any[]): boolean; - export function getVisualFromLogicalIdx(logIdx: number, rowMap: any): number; - export var L: number; export var R: number; export var EN: number; diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 476b01190fd..af6fbe4eda3 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -4249,7 +4249,6 @@ declare module "ace-code/src/autocomplete" { keyboardHandler: HashHandler; parentNode: any; setSelectOnHover: boolean; - hasSeen: Set; /** * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled * it shows a loading indicator on the popup while autocomplete is loading. @@ -4272,12 +4271,7 @@ declare module "ace-code/src/autocomplete" { (timeout: any): void; delay(timeout: any): void; schedule: any; - call(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ + call(): void; cancel(): void; isPending(): any; }; @@ -4285,12 +4279,7 @@ declare module "ace-code/src/autocomplete" { (timeout: any): void; delay(timeout: any): void; schedule: any; - call(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ + call(): void; cancel(): void; isPending(): any; }; @@ -4298,12 +4287,7 @@ declare module "ace-code/src/autocomplete" { (timeout: any): void; delay(timeout: any): void; schedule: any; - call(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ + call(): void; cancel(): void; isPending(): any; }; @@ -4311,12 +4295,7 @@ declare module "ace-code/src/autocomplete" { (timeout: any): void; delay(timeout: any): void; schedule: any; - call(): void; /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled - * it shows a loading indicator on the popup while autocomplete is loading. - * - * Experimental: This visualisation is not yet considered stable and might change in the future. - */ + call(): void; cancel(): void; isPending(): any; }; diff --git a/src/autocomplete.js b/src/autocomplete.js index 2c5cfba8ba3..2f965bee0fd 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -76,6 +76,7 @@ class Autocomplete { this.keyboardHandler.bindKeys(this.commands); this.parentNode = null; this.setSelectOnHover = false; + /**@private*/ this.hasSeen = new Set(); /** diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index bf16b3d9def..a3b733115a5 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -256,10 +256,15 @@ function fixDeclaration(content, aceNamespacePath) { const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { substituteNode(hint, node) { // remove all private members - if ((ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration( - node) || ts.isPropertySignature(node)) && ts.isIdentifier(node.name) && /^[$_]/.test( - node.name.text)) { - return ts.factory.createNotEmittedStatement(node); + if (ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration(node) + || ts.isPropertySignature(node)) { + const isPrivate = node.modifiers?.some( + modifier => modifier.kind === ts.SyntaxKind.PrivateKeyword); + const startsWithDollar = ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text); + + if (isPrivate || startsWithDollar) { + return ts.factory.createNotEmittedStatement(node); + } } else if (ts.isVariableStatement(node) && node.getText().indexOf("export const $") > -1) { return ts.factory.createNotEmittedStatement(node); From b3db1c38da3eebced8c1116f55fcaf32bf9dcd5f Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 18 Apr 2024 17:07:48 +0400 Subject: [PATCH 12/33] update ci script --- .github/workflows/nodejs.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 2eb07029b0b..d4be00593c9 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -52,10 +52,14 @@ jobs: fi fi # check types - - run: npm run update-types - - run: node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts - - run: npm run typecheck - - run: git diff --exit-code ./ace-modes.d.ts ./ace.d.ts + - run: | + set -x; + npx tsc -v; + npm run update-types; + git diff --color --exit-code ./ace*d.ts; + npm run typecheck; + node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts; + # upload to codecov - uses: codecov/codecov-action@v3 with: token: d8edca4b-8e97-41e5-b54e-34c7cf3b2d47 From ed40c519ea741a9db7fbbb02f17a4f8d25b4d858 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 18 Apr 2024 18:40:53 +0400 Subject: [PATCH 13/33] set default d.ts format code settings --- ace-ext.d.ts | 1 + ace-lib.d.ts | 1 + ace-modules.d.ts | 3 ++ ace.d.ts | 10 ++-- tool/ace_declaration_generator.js | 79 +++++++++++++++++++++++++++++-- 5 files changed, 84 insertions(+), 10 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 5b1baafddb8..d72f66ee9ec 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -506,6 +506,7 @@ declare module "ace-code/src/ext/modelist" { */ supportsFile(filename: string): RegExpMatchArray; } + export {}; } declare module "ace-code/src/ext/themelist" { diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 98c05aabdc4..9b07e4da1ee 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -210,6 +210,7 @@ declare module "ace-code/src/lib/app_config" { reportError: (msg: any, data: any) => void; } function warn(message: any, ...args: any[]): void; + export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; diff --git a/ace-modules.d.ts b/ace-modules.d.ts index af6fbe4eda3..a8084b9cf32 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -21,6 +21,7 @@ declare module "ace-code/src/layer/font_metrics" { els: any[] | HTMLElement | Text; transformCoordinates(clientPos: any, elPos: any): any[]; } + export {}; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; @@ -2282,6 +2283,7 @@ declare module "ace-code/src/tooltip" { */ doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; } + export {}; export interface HoverTooltip { row: number; @@ -6178,6 +6180,7 @@ declare module "ace-code/src/range" { * @returns {Number} */ function comparePoints(p1: Point, p2: Point): number; + export {}; namespace Ace { type Point = import("ace-code").Ace.Point; diff --git a/ace.d.ts b/ace.d.ts index d4877588734..ad31b3baf7c 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -599,9 +599,9 @@ declare module "ace-code" { clazz: string; inFront?: boolean; id?: number; - update?: (html: string[], - // TODO maybe define Marker class - marker: any, session: EditSession, config: any) => void; + update?: (html: string[], + // TODO maybe define Marker class + marker: any, session: EditSession, config: any) => void; [key: string]: any; } type MarkerRenderer = (html: string[], range: Range, left: number, top: number, config: any) => void; @@ -672,7 +672,7 @@ declare module "ace-code" { } interface SyntaxMode { HighlightRules: { - new (config: any): HighlightRules; + new(config: any): HighlightRules; }; //TODO: fix this foldingRules?: FoldMode; /** @@ -734,7 +734,7 @@ declare module "ace-code" { isBackwards: boolean; } var Selection: { - new (session: EditSession): Selection; + new(session: EditSession): Selection; }; interface TextInput { resetSelection(): void; diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index a3b733115a5..a6f3d1dbeb0 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -4,6 +4,31 @@ const path = require("path"); const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity +const defaultFormatCodeSettings = { + baseIndentSize: 0, + indentSize: 4, + tabSize: 4, + indentStyle: ts.IndentStyle.Smart, + newLineCharacter: "\n", + convertTabsToSpaces: true, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterConstructor: false, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceAfterTypeAssertion: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + insertSpaceBeforeTypeAnnotation: false +}; + /** * @param {string} directoryPath */ @@ -47,7 +72,7 @@ function generateInitialDeclaration(excludeDir) { return defaultCompilerHost.getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile); } }; - + const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options, customCompilerHost); program.emit(); return fileContent; @@ -280,6 +305,7 @@ function fixDeclaration(content, aceNamespacePath) { let allReferences = referencePaths.join("\n") + "\n/// \n"; output = allReferences + output; } + output = formatDts(outputName, output); fs.writeFileSync(outputName, output); }); @@ -289,12 +315,53 @@ function fixDeclaration(content, aceNamespacePath) { const sourceCode = program.getSourceFile(temporaryName); const result = ts.transform(sourceCode, [transformer, pathBasedTransformer]); - + result.dispose(); checkFinalDeclaration(finalDeclarations); } +function createMinimalLanguageServiceHost() { + return { + files: {}, + addFile(fileName, text) { + this.files[fileName] = ts.ScriptSnapshot.fromString(text); + }, + "getCompilationSettings": function () { + return ts.getDefaultCompilerOptions(); + }, + "getScriptFileNames": function () { + return Object.keys(this.files); + }, + "getScriptVersion": function (_fileName) { + return "0"; + }, + "getScriptSnapshot": function (fileName) { + return this.files[fileName]; + }, + "getCurrentDirectory": function () { + return ""; + } + }; + +} + +function formatDts(filename, text) { + var host = createMinimalLanguageServiceHost(); + host.addFile(filename, text); + const languageService = ts.createLanguageService(host); + let formatEdits = languageService.getFormattingEditsForDocument(filename, defaultFormatCodeSettings); + formatEdits + .sort((a, b) => a.span.start - b.span.start) + .reverse() + .forEach(edit => { + const head = text.slice(0, edit.span.start); + const tail = text.slice(edit.span.start + edit.span.length); + text = `${head}${edit.newText}${tail}`; + }); + return text; +} + /** * @param {string[]} declarationNames @@ -408,7 +475,7 @@ function cloneAceNamespace(aceNamespacePath) { */ function generateDeclaration(aceNamespacePath) { if (!aceNamespacePath) { - aceNamespacePath = __dirname + "/../ace-internal.d.ts" + aceNamespacePath = __dirname + "/../ace-internal.d.ts"; } const excludeDir = "src/mode"; //TODO: remove, when modes are ES6 @@ -433,7 +500,9 @@ function generateDeclaration(aceNamespacePath) { */ function updateDeclarationModuleNames(content) { let output = content.replace( - /ace\-code(?:\/src)?\/(mode(?!\/(?:matching_brace_outdent|matching_parens_outdent|behaviour|folding))|theme|ext|keybinding|snippets)\//g, "ace-builds/src-noconflict/$1-"); + /ace\-code(?:\/src)?\/(mode(?!\/(?:matching_brace_outdent|matching_parens_outdent|behaviour|folding))|theme|ext|keybinding|snippets)\//g, + "ace-builds/src-noconflict/$1-" + ); output = output.replace(/"ace\-code"/g, "\"ace-builds\""); output = output.replace(/ace\-code(?:\/src)?/g, "ace-builds-internal"); return output; @@ -442,7 +511,7 @@ function updateDeclarationModuleNames(content) { if (!module.parent) { require("./modes-declaration-generator"); - generateDeclaration(); + generateDeclaration(); } else { exports.generateDeclaration = generateDeclaration; From 7e8d9bfa2fbea0713eafd60412ee87e45fbf6da8 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 18 Apr 2024 18:46:41 +0400 Subject: [PATCH 14/33] re-generate after new changes --- ace-ext.d.ts | 26 +++--- ace-lib.d.ts | 5 +- ace-modes.d.ts | 8 ++ ace-modules.d.ts | 227 +++++++++++++++++++++++------------------------ ace.d.ts | 8 +- 5 files changed, 138 insertions(+), 136 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index d72f66ee9ec..c5406acdb76 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -78,7 +78,7 @@ declare module "ace-code/src/ext/command_bar" { import Tooltip = Tooltip_2.Tooltip; export var TOOLTIP_CLASS_NAME: string; export var BUTTON_CLASS_NAME: string; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -93,7 +93,7 @@ declare module "ace-code/src/ext/language_tools" { export var keyWordCompleter: import("ace-code").Ace.Completer; /**@type {import("ace-code").Ace.Completer} */ export var snippetCompleter: import("ace-code").Ace.Completer; - export {textCompleter}; + export { textCompleter }; } declare module "ace-code/src/ext/inline_autocomplete" { /** @@ -176,8 +176,7 @@ declare module "ace-code/src/ext/inline_autocomplete" { } export namespace InlineAutocomplete { function _for(editor: any): any; - - export {_for as for}; + export { _for as for }; export namespace startCommand { let name: string; function exec(editor: any, options: any): void; @@ -323,7 +322,8 @@ declare module "ace-code/src/ext/code_lens" { export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; export function clear(session: EditSession): void; export type EditSession = import("ace-code/src/edit_session").EditSession; - export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & {}; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { + }; } declare module "ace-code/src/ext/emmet" { export const commands: HashHandler; @@ -477,8 +477,7 @@ declare module "ace-code/src/ext/keybinding_menu" { import Editor_8 = require("ace-code/src/editor"); import Editor = Editor_8.Editor; } -declare module "ace-code/src/ext/linking" { -} +declare module "ace-code/src/ext/linking" { } declare module "ace-code/src/ext/modelist" { /** * Suggests a mode based on the file extension present in the given path @@ -506,8 +505,7 @@ declare module "ace-code/src/ext/modelist" { */ supportsFile(filename: string): RegExpMatchArray; } - - export {}; + export { }; } declare module "ace-code/src/ext/themelist" { export const themesByName: {}; @@ -555,7 +553,7 @@ declare module "ace-code/src/ext/options" { getOption(option: any): any; } export type Editor = import("ace-code/src/editor").Editor; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -669,7 +667,7 @@ declare module "ace-code/src/ext/prompt" { } } declare module "ace-code/src/ext/rtl" { - export {}; + export { }; } declare module "ace-code/src/ext/settings_menu" { export function init(): void; @@ -707,7 +705,7 @@ declare module "ace-code/src/ext/static_highlight" { */ function highlight(el: HTMLElement, opts: any, callback?: any): boolean; export namespace highlight { - export {render, renderSync, highlight}; + export { render, renderSync, highlight }; } /** * Transforms a given input code snippet into HTML using the given mode @@ -796,7 +794,7 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.32.9"; + version: "1.33.0"; }; edit: (el: string | (HTMLElement & { env?: any; @@ -808,7 +806,7 @@ declare module "ace-code/src/ext/textarea" { EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.32.9"; + version: "1.33.0"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 9b07e4da1ee..0700d9de6c0 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -210,8 +210,7 @@ declare module "ace-code/src/lib/app_config" { reportError: (msg: any, data: any) => void; } function warn(message: any, ...args: any[]): void; - - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -236,5 +235,5 @@ declare module "ace-code/src/lib/bidiutil" { export var EN: number; } declare module "ace-code/src/lib/fixoldbrowsers" { - export {}; + export { }; } diff --git a/ace-modes.d.ts b/ace-modes.d.ts index eeec864a093..ddf86858c99 100644 --- a/ace-modes.d.ts +++ b/ace-modes.d.ts @@ -142,6 +142,10 @@ declare module "ace-code/src/mode/behaviour/html" { export const HtmlBehaviour: new () => import("ace-code").Ace.Behaviour; } +declare module "ace-code/src/mode/behaviour/javascript" { + export const JavaScriptBehaviour: new () => import("ace-code").Ace.Behaviour; +} + declare module "ace-code/src/mode/behaviour/liquid" { export const LiquidBehaviour: new () => import("ace-code").Ace.Behaviour; } @@ -464,6 +468,10 @@ declare module "ace-code/src/mode/folding/java" { export const FoldMode: new () => import("ace-code").Ace.Folding; } +declare module "ace-code/src/mode/folding/javascript" { + export const FoldMode: new () => import("ace-code").Ace.Folding; +} + declare module "ace-code/src/mode/folding/latex" { export const FoldMode: new () => import("ace-code").Ace.Folding; } diff --git a/ace-modules.d.ts b/ace-modules.d.ts index a8084b9cf32..aa594dbea60 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -21,8 +21,7 @@ declare module "ace-code/src/layer/font_metrics" { els: any[] | HTMLElement | Text; transformCoordinates(clientPos: any, elPos: any): any[]; } - - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -74,7 +73,7 @@ declare module "ace-code/src/document" { /** * [Sets the new line mode.]{: #Document.setNewLineMode.desc} * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} - + **/ setNewLineMode(newLineMode: NewLineMode): void; /** @@ -128,7 +127,7 @@ declare module "ace-code/src/document" { /** * @param row * @param lines - + * @deprecated */ insertLines(row: any, lines: any): void; @@ -136,14 +135,14 @@ declare module "ace-code/src/document" { * @param firstRow * @param lastRow * @returns {String[]} - + * @deprecated */ removeLines(firstRow: any, lastRow: any): string[]; /** * @param position * @returns {Point} - + * @deprecated */ insertNewLine(position: any): Point; @@ -152,7 +151,7 @@ declare module "ace-code/src/document" { * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` * @param {String} text A chunk of text to insert * @returns {Point} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - + **/ insert(position: Point, text: string): Point; /** @@ -189,7 +188,7 @@ declare module "ace-code/src/document" { * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. * @param {Number} row The index of the row to insert at * @param {string[]} lines An array of strings - + **/ insertFullLines(row: number, lines: string[]): void; /** @@ -210,7 +209,7 @@ declare module "ace-code/src/document" { * Removes the `range` from the document. * @param {IRange} range A specified Range to remove * @returns {Point} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - + **/ remove(range: IRange): Point; /** @@ -219,7 +218,7 @@ declare module "ace-code/src/document" { * @param {Number} startColumn The column to start removing at * @param {Number} endColumn The column to stop removing at * @returns {Point} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. - + **/ removeInLine(row: number, startColumn: number, endColumn: number): Point; /** @@ -227,7 +226,7 @@ declare module "ace-code/src/document" { * @param {Number} firstRow The first row to be removed * @param {Number} lastRow The last row to be removed * @returns {String[]} Returns all the removed lines. - + **/ removeFullLines(firstRow: number, lastRow: number): string[]; /** @@ -311,7 +310,7 @@ declare module "ace-code/src/document" { import Anchor = Anchor_1.Anchor; import Range_1 = require("ace-code/src/range"); import Range = Range_1.Range; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type DocumentEvents = import("ace-code").Ace.DocumentEvents; @@ -374,7 +373,7 @@ declare module "ace-code/src/anchor" { markerId?: number; } export type Document = import("ace-code/src/document").Document; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type AnchorEvents = import("ace-code").Ace.AnchorEvents; @@ -450,7 +449,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.32.9"; + version: "1.33.0"; }; export = _exports; import AppConfig_1 = require("ace-code/src/lib/app_config"); @@ -567,7 +566,7 @@ declare module "ace-code/src/layer/gutter" { export type LayerConfig = import("ace-code").Ace.LayerConfig; import Lines_1 = require("ace-code/src/layer/lines"); import Lines = Lines_1.Lines; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type GutterEvents = import("ace-code").Ace.GutterEvents; @@ -747,7 +746,7 @@ declare module "ace-code/src/layer/text" { import dom = require("ace-code/src/lib/dom"); import Lines_2 = require("ace-code/src/layer/lines"); import Lines = Lines_2.Lines; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type TextEvents = import("ace-code").Ace.TextEvents; @@ -927,8 +926,7 @@ declare module "ace-code/src/scrollbar" { isVisible: any; coeff: number; } - - export {VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH}; + export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -1071,8 +1069,7 @@ declare module "ace-code/src/scrollbar_custom" { isVisible: any; coeff: number; } - - export {VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH}; + export { VScrollBar as ScrollBar, VScrollBar as ScrollBarV, HScrollBar as ScrollBarH }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -1128,7 +1125,7 @@ declare module "ace-code/src/virtual_renderer" { * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. * @param {HTMLElement | null} [container] The root element of the editor * @param {String} [theme] The starting theme - + **/ constructor(container?: HTMLElement | null, theme?: string); container: HTMLElement; @@ -1202,7 +1199,7 @@ declare module "ace-code/src/virtual_renderer" { /** * Triggers a full update of all the layers, for all the rows. * @param {Boolean} [force] If `true`, forces the changes through - + **/ updateFull(force?: boolean): void; /** @@ -1215,7 +1212,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {Number} [gutterWidth] The width of the gutter in pixels * @param {Number} [width] The width of the editor in pixels * @param {Number} [height] The hiehgt of the editor, in pixels - + **/ onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; resizing: number; @@ -1223,111 +1220,111 @@ declare module "ace-code/src/virtual_renderer" { /** * * @param {number} width - + */ onGutterResize(width: number): void; /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. - + **/ adjustWrapLimit(): boolean; /** * Identifies whether you want to have an animated scroll or not. * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls - + **/ setAnimatedScroll(shouldAnimate: boolean): void; /** * Returns whether an animated scroll happens or not. * @returns {Boolean} - + **/ getAnimatedScroll(): boolean; /** * Identifies whether you want to show invisible characters or not. * @param {Boolean} showInvisibles Set to `true` to show invisibles - + **/ setShowInvisibles(showInvisibles: boolean): void; /** * Returns whether invisible characters are being shown or not. * @returns {Boolean} - + **/ getShowInvisibles(): boolean; /** * @return {boolean} - + */ getDisplayIndentGuides(): boolean; /** * @param {boolean} display - + */ setDisplayIndentGuides(display: boolean): void; /** - + * @return {boolean} */ getHighlightIndentGuides(): boolean; /** - + * @param {boolean} highlight */ setHighlightIndentGuides(highlight: boolean): void; /** * Identifies whether you want to show the print margin or not. * @param {Boolean} showPrintMargin Set to `true` to show the print margin - + **/ setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns whether the print margin is being shown or not. * @returns {Boolean} - + **/ getShowPrintMargin(): boolean; /** * Identifies whether you want to show the print margin column or not. * @param {number} printMarginColumn Set to `true` to show the print margin column - + **/ setPrintMarginColumn(printMarginColumn: number): void; /** * Returns whether the print margin column is being shown or not. * @returns {number} - + **/ getPrintMarginColumn(): number; /** * Returns `true` if the gutter is being shown. * @returns {Boolean} - + **/ getShowGutter(): boolean; /** * Identifies whether you want to show the gutter or not. * @param {Boolean} show Set to `true` to show the gutter - + **/ setShowGutter(show: boolean): void; /** - + * @returns {boolean} */ getFadeFoldWidgets(): boolean; /** - + * @param {boolean} show */ setFadeFoldWidgets(show: boolean): void; /** - * + * * @param {boolean} shouldHighlight */ setHighlightGutterLine(shouldHighlight: boolean): void; /** - + * @returns {boolean} */ getHighlightGutterLine(): boolean; @@ -1375,7 +1372,7 @@ declare module "ace-code/src/virtual_renderer" { /** * Sets the padding for all the layers. * @param {Number} padding A new padding value (in pixels) - + **/ setPadding(padding: number): void; /** @@ -1384,7 +1381,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [bottom] * @param {number} [left] * @param {number} [right] - + */ setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; /** @@ -1393,25 +1390,25 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [bottom] * @param {number} [left] * @param {number} [right] - + */ setMargin(top?: number, bottom?: number, left?: number, right?: number): void; /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} - + **/ getHScrollBarAlwaysVisible(): boolean; /** * Identifies whether you want to show the horizontal scrollbar or not. * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - + **/ setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} - + **/ getVScrollBarAlwaysVisible(): boolean; /** @@ -1529,14 +1526,14 @@ declare module "ace-code/src/virtual_renderer" { * @param {Boolean} center If `true`, centers the editor the to indicated line * @param {Boolean} animate If `true` animates scrolling * @param {() => void} [callback] Function to be called after the animation has finished - + **/ scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; /** * * @param fromValue * @param [callback] - + */ animateScrolling(fromValue: any, callback?: any): void; /** @@ -1574,7 +1571,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} x * @param {number} y * @returns {import("ace-code").Ace.ScreenCoordinates} - + */ pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; /** @@ -1582,7 +1579,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} x * @param {number} y * @returns {Point} - + */ screenToTextCoordinates(x: number, y: number): Point; /** @@ -1608,20 +1605,20 @@ declare module "ace-code/src/virtual_renderer" { visualizeBlur(): void; /** * @param {Object} composition - + **/ showComposition(composition: any): void; /** * @param {String} text A string of text to use * * Sets the inner text of the current composition to `text`. - + **/ setCompositionText(text: string): void; /** * * Hides the current composition. - + **/ hideComposition(): void; /** @@ -1642,7 +1639,7 @@ declare module "ace-code/src/virtual_renderer" { * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} * @param {String | Theme} [theme] The path to a theme * @param {() => void} [cb] optional callback - + **/ setTheme(theme?: string | Theme, cb?: () => void): void; /** @@ -1673,7 +1670,7 @@ declare module "ace-code/src/virtual_renderer" { attachToShadowRoot(): void; /** * Destroys the text and cursor layers for this renderer. - + **/ destroy(): void; CHANGE_CURSOR: number; @@ -1714,7 +1711,7 @@ declare module "ace-code/src/virtual_renderer" { import RenderLoop = RenderLoop_1.RenderLoop; import Decorator_1 = require("ace-code/src/layer/decorators"); import Decorator = Decorator_1.Decorator; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; @@ -1940,9 +1937,9 @@ declare module "ace-code/src/selection" { **/ moveCursorLongWordRight(): void; /** - * - * Moves the cursor to the word on the left. - **/ + * + * Moves the cursor to the word on the left. + **/ moveCursorLongWordLeft(): void; moveCursorShortWordRight(): void; moveCursorShortWordLeft(): void; @@ -2031,7 +2028,7 @@ declare module "ace-code/src/selection" { export type Point = import("ace-code").Ace.Point; import Range_3 = require("ace-code/src/range"); import Range = Range_3.Range; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type SelectionEvents = import("ace-code").Ace.SelectionEvents; @@ -2283,8 +2280,7 @@ declare module "ace-code/src/tooltip" { */ doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; } - - export {}; + export { }; export interface HoverTooltip { row: number; } @@ -2496,18 +2492,18 @@ declare module "ace-code/src/search" { * @param {Partial} options An object containing all the new search properties * @returns {Search} * @chainable - **/ + **/ set(options: Partial): Search; /** * [Returns an object containing all the search options.]{: #Search.getOptions} * @returns {Partial} - **/ + **/ getOptions(): Partial; /** * Sets the search options via the `options` parameter. * @param {SearchOptions} options object containing all the search propertie * @related Search.set - **/ + **/ setOptions(options: { /** * - The string or regular expression you're looking for @@ -2562,7 +2558,7 @@ declare module "ace-code/src/search" { * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with * @returns {Range[]} - **/ + **/ findAll(session: EditSession): Range[]; /** * Searches for `options.needle` in `input`, and, if found, replaces it with `replacement`. @@ -2573,7 +2569,7 @@ declare module "ace-code/src/search" { * * * @returns {String} - **/ + **/ replace(input: string, replacement: any): string; } import Range_5 = require("ace-code/src/range"); @@ -2651,7 +2647,8 @@ declare module "ace-code/src/keyboard/hash_handler" { * @param {number} keyCode * @returns {{command: string} | void} */ - handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: number): { + handleKeyboard(data: { + }, hashId: number, keyString: string, keyCode: number): { command: string; } | void; /** @@ -2700,7 +2697,7 @@ declare module "ace-code/src/commands/command_manager" { export type Editor = import("ace-code/src/editor").Editor; import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -3725,7 +3722,7 @@ declare module "ace-code/src/editor" { searchBox?: import("ace-code/src/ext/searchbox").SearchBox; } export namespace Editor { - export {$uid}; + export { $uid }; } export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; export type Selection = import("ace-code/src/selection").Selection; @@ -3746,7 +3743,7 @@ declare module "ace-code/src/editor" { import LineWidgets_1 = require("ace-code/src/line_widgets"); import LineWidgets = LineWidgets_1.LineWidgets; var $uid: number; - export {}; + export { }; namespace Ace { type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; type OptionsProvider = import("ace-code").Ace.OptionsProvider; @@ -3991,7 +3988,7 @@ declare module "ace-code/src/autocomplete/popup" { export function getAriaId(index: any): string; import Editor_1 = require("ace-code/src/editor"); import Editor = Editor_1.Editor; - export {}; + export { }; namespace Ace { type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; type Completion = import("ace-code").Ace.Completion; @@ -4165,7 +4162,7 @@ declare module "ace-code/src/snippets" { } import Tokenizer_1 = require("ace-code/src/tokenizer"); import Tokenizer = Tokenizer_1.Tokenizer; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -4417,7 +4414,8 @@ declare module "ace-code/src/autocomplete" { * @param {CompletionProviderOptions} options * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback */ - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [], finished: boolean) => void): void; + provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ + ], finished: boolean) => void): void; detach(): void; completions: FilteredList; } @@ -4504,7 +4502,7 @@ declare module "ace-code/src/autocomplete" { function exec(editor: any, options: any): void; let bindKey: string; } - export {}; + export { }; namespace Ace { type AcePopup = import("ace-code").Ace.AcePopup; type FilteredList = import("ace-code").Ace.FilteredList; @@ -4591,21 +4589,21 @@ declare module "ace-code/src/occur" { */ displayOriginalContent(editor: Editor): void; /** - * Translates the position from the original document to the occur lines in - * the document or the beginning if the doc {row: 0, column: 0} if not - * found. - * @param {EditSession} session The occur session - * @param {Point} pos The position in the original document - * @return {Point} position in occur doc - **/ + * Translates the position from the original document to the occur lines in + * the document or the beginning if the doc {row: 0, column: 0} if not + * found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the original document + * @return {Point} position in occur doc + **/ originalToOccurPosition(session: EditSession, pos: Point): Point; /** - * Translates the position from the occur document to the original document - * or `pos` if not found. - * @param {EditSession} session The occur session - * @param {Point} pos The position in the occur session document - * @return {Point} position - **/ + * Translates the position from the occur document to the original document + * or `pos` if not found. + * @param {EditSession} session The occur session + * @param {Point} pos The position in the occur session document + * @return {Point} position + **/ occurToOriginalPosition(session: EditSession, pos: Point): Point; /** * @param {EditSession} session @@ -4818,7 +4816,7 @@ declare module "ace-code/src/bidihandler" { * @param {Number} screenRow the screen row to be checked * @param {Number} [docRow] the document row to be checked [optional] * @param {Number} [splitIndex] the wrapped screen line index [ optional] - **/ + **/ isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; onChange(delta: any): void; getDocumentRow(): number; @@ -4827,13 +4825,13 @@ declare module "ace-code/src/bidihandler" { updateBidiMap(): void; /** * Resets stored info related to current screen row - **/ + **/ markAsDirty(): void; /** * Updates array of character widths * @param {Object} fontMetrics metrics * - **/ + **/ updateCharacterWidths(fontMetrics: any): void; characterWidth: any; setShowInvisibles(showInvisibles: any): void; @@ -4854,14 +4852,14 @@ declare module "ace-code/src/bidihandler" { * @param {Number} endCol the end column position * * @return {Object[]} Each object contains 'left' and 'width' values defining selection rectangle. - **/ + **/ getSelections(startCol: number, endCol: number): any[]; /** * Converts character coordinates on the screen to respective document column number * @param {Number} posX character horizontal offset * * @return {Number} screen column number corresponding to given pixel offset - **/ + **/ offsetToCol(posX: number): number; } import bidiUtil = require("ace-code/src/lib/bidiutil"); @@ -4933,7 +4931,7 @@ declare module "ace-code/src/background_tokenizer" { export type Document = import("ace-code/src/document").Document; export type EditSession = import("ace-code/src/edit_session").EditSession; export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; @@ -5237,11 +5235,11 @@ declare module "ace-code/src/edit_session" { **/ export class EditSession { /** - * Returns a new instance of EditSession with state from JSON. - * @method fromJSON - * @param {string|object} session The EditSession state. - * @returns {EditSession} - */ + * Returns a new instance of EditSession with state from JSON. + * @method fromJSON + * @param {string|object} session The EditSession state. + * @returns {EditSession} + */ static fromJSON(session: string | object): EditSession; /** * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. @@ -5877,7 +5875,7 @@ declare module "ace-code/src/edit_session" { multiSelect?: any; } export namespace EditSession { - export {$uid}; + export { $uid }; } export type FontMetrics = import("ace-code/src/layer/font_metrics").FontMetrics; export type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; @@ -5900,7 +5898,7 @@ declare module "ace-code/src/edit_session" { import Range = Range_12.Range; function isFullWidth(c: any): boolean; var $uid: number; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type EditSessionEvents = import("ace-code").Ace.EditSessionEvents; @@ -6114,14 +6112,14 @@ declare module "ace-code/src/range" { * @param {Number} firstRow The starting row * @param {Number} lastRow The ending row * @returns {Range} - **/ + **/ clipRows(firstRow: number, lastRow: number): Range; /** * Changes the `row` and `column` for the calling range for both the starting and ending [[Point]]'s. * @param {Number} row A new row to extend to * @param {Number} column A new column to extend to * @returns {Range} The original range with the new row - **/ + **/ extend(row: number, column: number): Range; /** * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). @@ -6131,23 +6129,23 @@ declare module "ace-code/src/range" { /** * Returns `true` if the range spans across multiple lines. * @returns {Boolean} - **/ + **/ isMultiLine(): boolean; /** * Returns a duplicate of the calling range. * @returns {Range} - **/ + **/ clone(): Range; /** * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. * @returns {Range} - **/ + **/ collapseRows(): Range; /** * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. * @param {EditSession} session The `EditSession` to retrieve coordinates from * @returns {Range} - **/ + **/ toScreenRange(session: EditSession): Range; /** * Shift the calling range by `row` and `column` values. @@ -6161,7 +6159,7 @@ declare module "ace-code/src/range" { isBackwards?: boolean; } export namespace Range { - export {fromPoints, comparePoints}; + export { fromPoints, comparePoints }; } export type EditSession = import("ace-code/src/edit_session").EditSession; export type IRange = import("ace-code").Ace.IRange; @@ -6171,7 +6169,7 @@ declare module "ace-code/src/range" { * @param {Point} start A starting point to use * @param {Point} end An ending point to use * @returns {Range} - **/ + **/ function fromPoints(start: Point, end: Point): Range; /** * Compares `p1` and `p2` [[Point]]'s, useful for sorting @@ -6180,8 +6178,7 @@ declare module "ace-code/src/range" { * @returns {Number} */ function comparePoints(p1: Point, p2: Point): number; - - export {}; + export { }; namespace Ace { type Point = import("ace-code").Ace.Point; } @@ -6273,7 +6270,7 @@ declare module "ace-code/src/placeholder" { export type EditSession = import("ace-code/src/edit_session").EditSession; import Range_13 = require("ace-code/src/range"); import Range = Range_13.Range; - export {}; + export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; diff --git a/ace.d.ts b/ace.d.ts index ad31b3baf7c..71dc384bfb1 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -600,8 +600,8 @@ declare module "ace-code" { inFront?: boolean; id?: number; update?: (html: string[], - // TODO maybe define Marker class - marker: any, session: EditSession, config: any) => void; + // TODO maybe define Marker class + marker: any, session: EditSession, config: any) => void; [key: string]: any; } type MarkerRenderer = (html: string[], range: Range, left: number, top: number, config: any) => void; @@ -959,7 +959,7 @@ declare module "ace-code" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.32.9"; + version: "1.33.0"; }; export function edit(el: string | (HTMLElement & { env?: any; @@ -976,6 +976,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.32.9"; + export var version: "1.33.0"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } From da46e1f426c33a0cd0305a8ae6422489033d935b Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 18 Apr 2024 18:58:26 +0400 Subject: [PATCH 15/33] add missing type --- ace-modules.d.ts | 12 ++---------- src/multi_select.js | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ace-modules.d.ts b/ace-modules.d.ts index aa594dbea60..e64ded6401a 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -2442,11 +2442,7 @@ declare module "ace-code/src/keyboard/keybinding" { * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] * @param {number} [pos] */ - addKeyboardHandler(kb?: Partial & { - attach?: (editor: import("ace-code/src/editor").Editor) => void; - detach?: (editor: import("ace-code/src/editor").Editor) => void; - getStatusText?: (editor?: any, data?: any) => string; - } & { + addKeyboardHandler(kb?: KeyboardHandler & { attach?: (editor: any) => void; detach?: (editor: any) => void; }, pos?: number): void; @@ -2454,11 +2450,7 @@ declare module "ace-code/src/keyboard/keybinding" { * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb * @returns {boolean} */ - removeKeyboardHandler(kb: Partial & { - attach?: (editor: import("ace-code/src/editor").Editor) => void; - detach?: (editor: import("ace-code/src/editor").Editor) => void; - getStatusText?: (editor?: any, data?: any) => string; - } & { + removeKeyboardHandler(kb: KeyboardHandler & { attach?: (editor: any) => void; detach?: (editor: any) => void; }): boolean; diff --git a/src/multi_select.js b/src/multi_select.js index 4b03c6decf4..9f6e75476e0 100644 --- a/src/multi_select.js +++ b/src/multi_select.js @@ -900,7 +900,7 @@ function isSamePoint(p1, p2) { * patch * adds multicursor support to a session * @this {Editor} - * @type {(e) => void} + * @type {(e: any) => void} */ exports.onSessionChange = function(e) { var session = e.session; From bb9b63bde832b4c662aca983bae3dcae73dc826d Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 18 Apr 2024 22:17:53 +0400 Subject: [PATCH 16/33] revert change to ace-modes --- ace-modes.d.ts | 132 ------------------------------------------------- 1 file changed, 132 deletions(-) diff --git a/ace-modes.d.ts b/ace-modes.d.ts index ddf86858c99..3b3b85ec165 100644 --- a/ace-modes.d.ts +++ b/ace-modes.d.ts @@ -130,34 +130,6 @@ declare module "ace-code/src/mode/behaviour" { export const Behaviour: new () => import("ace-code").Ace.Behaviour; } -declare module "ace-code/src/mode/behaviour/css" { - export const CssBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/cstyle" { - export const CstyleBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/html" { - export const HtmlBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/javascript" { - export const JavaScriptBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/liquid" { - export const LiquidBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/xml" { - export const XmlBehaviour: new () => import("ace-code").Ace.Behaviour; -} - -declare module "ace-code/src/mode/behaviour/xquery" { - export const XQueryBehaviour: new () => import("ace-code").Ace.Behaviour; -} - declare module "ace-code/src/mode/bibtex_highlight_rules" { export const BibTeXHighlightRules: new () => import("ace-code").Ace.HighlightRules; } @@ -420,110 +392,6 @@ declare module "ace-code/src/mode/flix" { export const Mode: new () => import("ace-code").Ace.SyntaxMode; } -declare module "ace-code/src/mode/folding/asciidoc" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/c9search" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/coffee" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/csharp" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/cstyle" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/diff" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/drools" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/fold_mode" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/haskell_cabal" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/html" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/ini" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/java" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/javascript" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/latex" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/lua" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/markdown" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/mixed" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/php" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/pythonic" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/ruby" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/sql" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/sqlserver" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/vbscript" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/velocity" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/xml" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - -declare module "ace-code/src/mode/folding/yaml" { - export const FoldMode: new () => import("ace-code").Ace.Folding; -} - declare module "ace-code/src/mode/forth_highlight_rules" { export const ForthHighlightRules: new () => import("ace-code").Ace.HighlightRules; } From 389e14ee30507464fecbceb6d3aa3ab22395dd95 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 29 May 2024 16:51:10 +0400 Subject: [PATCH 17/33] add config options --- ace-ext.d.ts | 8 ++--- ace-internal.d.ts | 40 ++++++++++++++++++--- ace-lib.d.ts | 2 +- ace-modules.d.ts | 76 +++++++++------------------------------- ace.d.ts | 39 ++++++++++++++++----- src/autocomplete_test.js | 8 +++++ src/config.js | 18 +++++++--- src/lib/lang.js | 7 +++- src/search.js | 32 ++++------------- 9 files changed, 121 insertions(+), 109 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index c5406acdb76..b55a070346f 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -780,11 +780,9 @@ declare module "ace-code/src/ext/textarea" { removeListener(name: K_4, callback: any): void; removeEventListener(name: K_5, callback: any): void; removeAllListeners(name?: string): void; - get: (key: string) => any; - set: (key: string, value: any) => void; - all: () => { - [key: string]: any; - }; + get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; + set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; + all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; setLoader: (cb: any) => void; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 330f1c62bfe..3790b95c047 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -31,10 +31,26 @@ export namespace Ace { type AfterLoadCallback = (err: Error | null, module: unknown) => void; type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface ConfigOptions { + packaged: boolean, + workerPath: string | null, + modePath: string | null, + themePath: string | null, + basePath: string, + suffix: string, + $moduleUrls: {[url: string]: string}, + loadWorkerFromBlob: boolean, + sharedPopups: boolean, + useStrictCSP: boolean | null + } + //setOption(name: K, value: T[K]): void; + // + // getOption(name: K): T[K]; + export interface Config { - get(key: string): any; + get(key: K): ConfigOptions[K]; - set(key: string, value: any): void; + set(key: K, value: ConfigOptions[K]): void; all(): { [key: string]: any }; @@ -633,18 +649,34 @@ export namespace Ace { } interface SearchOptions { + /**The string or regular expression you're looking for*/ needle: string | RegExp; preventScroll: boolean; + /**Whether to search backwards from where cursor currently is*/ backwards: boolean; + /**The starting [[Range]] or cursor position to begin the search*/ start: Range; + /**Whether or not to include the current line in the search*/ skipCurrent: boolean; - range: Range; + /**The [[Range]] to search within. Set this to `null` for the whole document*/ + range: Range | null; preserveCase: boolean; + /**Whether the search is a regular expression or not*/ regExp: boolean; + /**Whether the search matches only on whole words*/ wholeWord: boolean; + /**Whether the search ought to be case-sensitive*/ caseSensitive: boolean; + /**Whether to wrap the search back to the beginning when it hits the end*/ wrap: boolean; - re: RegExp; + re: any; + /**true, if needle has \n or \r\n*/ + $isMultiLine: boolean; + /** + * internal property, determine if browser supports unicode flag + * @private + * */ + $supportsUnicodeFlag: boolean; } interface Point { diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 0700d9de6c0..56068a19339 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -62,7 +62,7 @@ declare module "ace-code/src/lib/lang" { export function stringRepeat(string: any, count: any): string; export function stringTrimLeft(string: any): any; export function stringTrimRight(string: any): any; - export function copyObject(obj: any): {}; + export function copyObject(obj: T): T; export function copyArray(array: any): any[]; export const deepCopy: (obj: any) => any; export function arrayToMap(arr: any): {}; diff --git a/ace-modules.d.ts b/ace-modules.d.ts index e64ded6401a..f480678281d 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -410,21 +410,21 @@ declare module "ace-code/src/config" { removeEventListener(name: K_5, callback: any): void; removeAllListeners(name?: string): void; /** - * @param {string} key - * @return {*} + * @template {keyof ConfigOptions} K + * @param {K} key - The key of the config option to retrieve. + * @returns {ConfigOptions[K]} - The value of the config option. */ - get: (key: string) => any; + get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; /** - * @param {string} key - * @param value + * @template {keyof ConfigOptions} K + * @param {K} key + * @param {ConfigOptions[K]} value */ - set: (key: string, value: any) => void; + set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; /** - * @return {{[key: string]: any}} + * @return {import("ace-code").Ace.ConfigOptions} */ - all: () => { - [key: string]: any; - }; + all: () => import("ace-code").Ace.ConfigOptions; /** * module loading * @param {string} name @@ -2475,71 +2475,29 @@ declare module "ace-code/src/keyboard/keybinding" { } declare module "ace-code/src/search" { export type EditSession = import("ace-code/src/edit_session").EditSession; + export type SearchOptions = import("ace-code").Ace.SearchOptions; /** * A class designed to handle all sorts of text searches within a [[Document `Document`]]. **/ export class Search { /** * Sets the search options via the `options` parameter. - * @param {Partial} options An object containing all the new search properties + * @param {Partial} options An object containing all the new search properties * @returns {Search} * @chainable **/ - set(options: Partial): Search; + set(options: Partial): Search; /** * [Returns an object containing all the search options.]{: #Search.getOptions} - * @returns {Partial} + * @returns {Partial} **/ - getOptions(): Partial; + getOptions(): Partial; /** * Sets the search options via the `options` parameter. - * @param {SearchOptions} options object containing all the search propertie + * @param {Partial} options object containing all the search propertie * @related Search.set **/ - setOptions(options: { - /** - * - The string or regular expression you're looking for - */ - needle?: string | RegExp; - /** - * - Whether to search backwards from where cursor currently is - */ - backwards?: boolean; - /** - * - Whether to wrap the search back to the beginning when it hits the end - */ - wrap?: boolean; - /** - * - Whether the search ought to be case-sensitive - */ - caseSensitive?: boolean; - /** - * - Whether the search matches only on whole words - */ - wholeWord?: boolean; - /** - * - The [[Range]] to search within. Set this to `null` for the whole document - */ - range?: Range | null; - /** - * - Whether the search is a regular expression or not - */ - regExp?: boolean; - /** - * - The starting [[Range]] or cursor position to begin the search - */ - start?: Range | import("ace-code").Ace.Position; - /** - * - Whether or not to include the current line in the search - */ - skipCurrent?: boolean; - preserveCase?: boolean; - preventScroll?: boolean; - /** - * ** - */ - re?: any; - }): void; + setOptions(options: Partial): void; /** * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with diff --git a/ace.d.ts b/ace.d.ts index 71dc384bfb1..4df5a0220f4 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -35,9 +35,23 @@ declare module "ace-code" { type AppConfig = import("ace-code/src/lib/app_config").AppConfig; type AfterLoadCallback = (err: Error | null, module: unknown) => void; type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface ConfigOptions { + packaged: boolean; + workerPath: string | null; + modePath: string | null; + themePath: string | null; + basePath: string; + suffix: string; + loadWorkerFromBlob: boolean; + sharedPopups: boolean; + useStrictCSP: boolean | null; + } + //setOption(name: K, value: T[K]): void; + // + // getOption(name: K): T[K]; export interface Config { - get(key: string): any; - set(key: string, value: any): void; + get(key: K): ConfigOptions[K]; + set(key: K, value: ConfigOptions[K]): void; all(): { [key: string]: any; }; @@ -532,18 +546,27 @@ declare module "ace-code" { removeAllListeners(name?: string): void; } interface SearchOptions { + /**The string or regular expression you're looking for*/ needle: string | RegExp; preventScroll: boolean; + /**Whether to search backwards from where cursor currently is*/ backwards: boolean; + /**The starting [[Range]] or cursor position to begin the search*/ start: Range; + /**Whether or not to include the current line in the search*/ skipCurrent: boolean; - range: Range; + /**The [[Range]] to search within. Set this to `null` for the whole document*/ + range: Range | null; preserveCase: boolean; + /**Whether the search is a regular expression or not*/ regExp: boolean; + /**Whether the search matches only on whole words*/ wholeWord: boolean; + /**Whether the search ought to be case-sensitive*/ caseSensitive: boolean; + /**Whether to wrap the search back to the beginning when it hits the end*/ wrap: boolean; - re: RegExp; + re: any; } interface Point { row: number; @@ -945,11 +968,9 @@ declare module "ace-code" { removeListener(name: K_4, callback: any): void; removeEventListener(name: K_5, callback: any): void; removeAllListeners(name?: string): void; - get: (key: string) => any; - set: (key: string, value: any) => void; - all: () => { - [key: string]: any; - }; + get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; + set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; + all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; setLoader: (cb: any) => void; diff --git a/src/autocomplete_test.js b/src/autocomplete_test.js index b48ec080b21..c9a5f5e0f83 100644 --- a/src/autocomplete_test.js +++ b/src/autocomplete_test.js @@ -12,6 +12,7 @@ var user = require("./test/user"); var Range = require("./range").Range; require("./ext/language_tools"); var Autocomplete = require("./autocomplete").Autocomplete; +var config = require("./config"); var MouseEvent = function(type, opts){ var e = document.createEvent("MouseEvents"); @@ -1542,6 +1543,13 @@ module.exports = { // Popup should be closed now assert.equal(completer.popup.isOpen, false); + }, + "test: should set create shared Autocomplete with sharedPopups on": function() { + assert.equal(Autocomplete.$sharedInstance == undefined, true); + config.set("sharedPopups", true); + var editor = initEditor(""); + var completer = Autocomplete.for(editor); + assert.equal(Autocomplete.$sharedInstance == undefined, false); } }; diff --git a/src/config.js b/src/config.js index b97b1fc4d2d..4d578e52186 100644 --- a/src/config.js +++ b/src/config.js @@ -1,4 +1,9 @@ "no use strict"; + +/** + * @typedef {import("../ace-internal").Ace.ConfigOptions} ConfigOptions + */ + var lang = require("./lib/lang"); var net = require("./lib/net"); var dom = require("./lib/dom"); @@ -6,6 +11,7 @@ var AppConfig = require("./lib/app_config").AppConfig; module.exports = exports = new AppConfig(); +/** @type {ConfigOptions} */ var options = { packaged: false, workerPath: null, @@ -20,8 +26,9 @@ var options = { }; /** - * @param {string} key - * @return {*} + * @template {keyof ConfigOptions} K + * @param {K} key - The key of the config option to retrieve. + * @returns {ConfigOptions[K]} - The value of the config option. */ exports.get = function(key) { if (!options.hasOwnProperty(key)) @@ -30,8 +37,9 @@ exports.get = function(key) { }; /** - * @param {string} key - * @param value + * @template {keyof ConfigOptions} K + * @param {K} key + * @param {ConfigOptions[K]} value */ exports.set = function(key, value) { if (options.hasOwnProperty(key)) @@ -42,7 +50,7 @@ exports.set = function(key, value) { dom.useStrictCSP(value); }; /** - * @return {{[key: string]: any}} + * @return {import("../ace-internal").Ace.ConfigOptions} */ exports.all = function() { return lang.copyObject(options); diff --git a/src/lib/lang.js b/src/lib/lang.js index 950fb271a54..dfb7c6d0d43 100644 --- a/src/lib/lang.js +++ b/src/lib/lang.js @@ -30,8 +30,13 @@ exports.stringTrimLeft = function (string) { exports.stringTrimRight = function (string) { return string.replace(trimEndRegexp, ''); }; - +/** + * @template T + * @param {T} obj + * @return {T} + */ exports.copyObject = function(obj) { + /** @type Object*/ var copy = {}; for (var key in obj) { copy[key] = obj[key]; diff --git a/src/search.js b/src/search.js index b19bd87ef50..1354c782f10 100644 --- a/src/search.js +++ b/src/search.js @@ -1,6 +1,7 @@ "use strict"; /** * @typedef {import("./edit_session").EditSession} EditSession + * @typedef {import("../ace-internal").Ace.SearchOptions} SearchOptions */ var lang = require("./lib/lang"); var oop = require("./lib/oop"); @@ -10,34 +11,15 @@ var Range = require("./range").Range; * A class designed to handle all sorts of text searches within a [[Document `Document`]]. **/ class Search { - /** - * Creates a new `Search` object. The following search options are available: - * @typedef SearchOptions - * - * @property {string|RegExp} [needle] - The string or regular expression you're looking for - * @property {boolean} [backwards] - Whether to search backwards from where cursor currently is - * @property {boolean} [wrap] - Whether to wrap the search back to the beginning when it hits the end - * @property {boolean} [caseSensitive] - Whether the search ought to be case-sensitive - * @property {boolean} [wholeWord] - Whether the search matches only on whole words - * @property {Range|null} [range] - The [[Range]] to search within. Set this to `null` for the whole document - * @property {boolean} [regExp] - Whether the search is a regular expression or not - * @property {Range|import("../ace-internal").Ace.Position} [start] - The starting [[Range]] or cursor position to begin the search - * @property {boolean} [skipCurrent] - Whether or not to include the current line in the search - * @property {boolean} [$isMultiLine] - true, if needle has \n or \r\n - * @property {boolean} [preserveCase] - * @property {boolean} [preventScroll] - * @property {boolean} [$supportsUnicodeFlag] - internal property, determine if browser supports unicode flag - * @property {any} [re] - **/ constructor() { - /**@type {SearchOptions}*/ + /**@type {Partial}*/ this.$options = {}; } /** * Sets the search options via the `options` parameter. - * @param {Partial} options An object containing all the new search properties + * @param {Partial} options An object containing all the new search properties * @returns {Search} * @chainable **/ @@ -48,7 +30,7 @@ class Search { /** * [Returns an object containing all the search options.]{: #Search.getOptions} - * @returns {Partial} + * @returns {Partial} **/ getOptions() { return lang.copyObject(this.$options); @@ -56,7 +38,7 @@ class Search { /** * Sets the search options via the `options` parameter. - * @param {SearchOptions} options object containing all the search propertie + * @param {Partial} options object containing all the search propertie * @related Search.set **/ setOptions(options) { @@ -209,7 +191,7 @@ class Search { /** * - * @param {SearchOptions} options + * @param {Partial} options * @param {boolean} [$disableFakeMultiline] * @return {RegExp|boolean|*[]|*} */ @@ -389,7 +371,7 @@ class Search { /** * * @param {string} needle - * @param {SearchOptions} options + * @param {Partial} options * @return {string} */ function addWordBoundary(needle, options) { From 23b49483e1714b252367ef0cd8f299921e22e85e Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 29 May 2024 16:57:42 +0400 Subject: [PATCH 18/33] resolve merge conflicts --- ace-ext.d.ts | 4 ++-- ace-internal.d.ts | 20 ++++++++++---------- ace-lib.d.ts | 2 +- ace-modules.d.ts | 33 +++++++++++++++++---------------- ace.d.ts | 18 +++++++++--------- src/editor.js | 4 +--- src/lib/lang.js | 2 ++ 7 files changed, 42 insertions(+), 41 deletions(-) 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..6f2af769704 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 { @@ -1321,12 +1322,6 @@ declare module "./src/edit_session" { widgetManager?: any, $bracketHighlight?: any, $selectionMarker?: number, - curOp?: { - command: {}, - args: string, - scrollTop: number, - [key: string]: any; - }, lineWidgetsWidth?: number, $getWidgetScreenLength?: () => number, _changedWidgets?: any, @@ -1335,9 +1330,6 @@ declare module "./src/edit_session" { $enableVarChar?: any, $wrap?: any, $navigateWithinSoftTabs?: boolean, - - getSelectionMarkers(): any[], - $selectionMarkers?: any[], gutterRenderer?: any, $firstLineNumber?: number, @@ -1349,6 +1341,14 @@ declare module "./src/edit_session" { $occurMatchingLines?: any, $useEmacsStyleLineStart?: boolean, $selectLongWords?: boolean, + curOp?: { + command: {}, + args: string, + scrollTop: number, + [key: string]: any; + }, + + getSelectionMarkers(): any[], } } @@ -1417,7 +1417,6 @@ declare module "./src/virtual_renderer" { $maxLines?: number, $scrollPastEnd?: number, enableKeyboardAccessibility?: boolean, - keyboardFocusClassName?: string, $highlightGutterLine?: boolean, $minLines?: number, $maxPixelHeight?: number, @@ -1430,6 +1429,7 @@ declare module "./src/virtual_renderer" { $theme?: any, destroyed?: boolean, session: Ace.EditSession, + keyboardFocusClassName?: string, } } 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..2c34bd7f825 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"); @@ -1687,10 +1687,10 @@ declare module "ace-code/src/virtual_renderer" { STEPS: number; textarea?: HTMLTextAreaElement; enableKeyboardAccessibility?: boolean; - keyboardFocusClassName?: string; showInvisibles?: boolean; theme?: any; destroyed?: boolean; + keyboardFocusClassName?: string; } export type EditSession = import("ace-code/src/edit_session").EditSession; export type Point = import("ace-code").Ace.Point; @@ -1722,11 +1722,11 @@ declare module "ace-code/src/virtual_renderer" { export interface VirtualRenderer extends Ace.EventEmitter, Ace.OptionsProvider { textarea?: HTMLTextAreaElement; enableKeyboardAccessibility?: boolean; - keyboardFocusClassName?: string; showInvisibles?: boolean; theme?: any; destroyed?: boolean; session: Ace.EditSession; + keyboardFocusClassName?: string; } } declare module "ace-code/src/selection" { @@ -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 @@ -5812,17 +5813,17 @@ declare module "ace-code/src/edit_session" { lineWidgets: null | import("ace-code").Ace.LineWidget[]; isFullWidth: typeof isFullWidth; widgetManager?: any; + lineWidgetsWidth?: number; + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; curOp?: { [key: string]: any; command: {}; args: string; scrollTop: number; }; - lineWidgetsWidth?: number; getSelectionMarkers(): any[]; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; } export namespace EditSession { export { $uid }; @@ -5863,17 +5864,17 @@ declare module "ace-code/src/edit_session" { export interface EditSession extends Ace.EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace.BracketMatch { doc: Ace.Document; widgetManager?: any; + lineWidgetsWidth?: number; + gutterRenderer?: any; + selectionMarkerCount?: number; + multiSelect?: any; curOp?: { command: {}; args: string; scrollTop: number; [key: string]: any; }; - lineWidgetsWidth?: number; getSelectionMarkers(): any[]; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; } } declare module "ace-code/src/range" { 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(""); }; From 47707040c3b61e75af939aab3222b2558c08c4fb Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 18 Jun 2024 14:21:31 +0400 Subject: [PATCH 19/33] filter nodes tagged with @internal flag --- ace-ext.d.ts | 8 +- ace-internal.d.ts | 10 +- ace-lib.d.ts | 5 +- ace-modules.d.ts | 184 +++--------------------------- ace.d.ts | 12 +- src/anchor.js | 1 + src/autocomplete.js | 10 +- src/bidihandler.js | 4 + src/edit_session.js | 6 + src/editor.js | 57 ++++++++- src/incremental_search.js | 4 + src/keyboard/keybinding.js | 2 + src/line_widgets.js | 1 + src/placeholder.js | 2 + src/scrollbar.js | 2 + src/scrollbar_custom.js | 2 + src/snippets.js | 13 ++- src/tooltip.js | 4 + src/virtual_renderer.js | 12 +- tool/ace_declaration_generator.js | 11 +- 20 files changed, 148 insertions(+), 202 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 3d69867334f..6c00007088b 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -765,7 +765,9 @@ declare module "ace-code/src/ext/textarea" { setDefaultValues(path: string, optionHash: { [key: string]: any; }): void; - setMessages(value: any): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; nls(key: string, defaultString: string, params?: { [x: string]: any; }): any; @@ -792,7 +794,7 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.34.2"; + version: "1.35.0"; }; edit: (el: string | (HTMLElement & { env?: any; @@ -804,7 +806,7 @@ declare module "ace-code/src/ext/textarea" { EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.34.2"; + version: "1.35.0"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 2d2ce5b41a8..b2d590022a2 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -43,9 +43,6 @@ export namespace Ace { sharedPopups: boolean, useStrictCSP: boolean | null } - //setOption(name: K, value: T[K]): void; - // - // getOption(name: K): T[K]; export interface Config { get(key: K): ConfigOptions[K]; @@ -1342,12 +1339,7 @@ declare module "./src/edit_session" { $occurMatchingLines?: any, $useEmacsStyleLineStart?: boolean, $selectLongWords?: boolean, - curOp?: { - command: {}, - args: string, - scrollTop: number, - [key: string]: any; - }, + curOp?: any, getSelectionMarkers(): any[], } diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 18189a11237..7bc3734edf9 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -196,8 +196,11 @@ declare module "ace-code/src/lib/app_config" { }): void; /** * @param {any} value + * @param {{placeholders?: "dollarSigns" | "curlyBrackets"}} [options] */ - setMessages(value: any): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; /** * @param {string} key * @param {string} defaultString diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 2c34bd7f825..6bd6394efa7 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -343,11 +343,6 @@ declare module "ace-code/src/anchor" { * @returns {Document} **/ getDocument(): Document; - /** - * Internal function called when `"change"` event fired. - * @param {import("ace-code").Ace.Delta} delta - */ - onChange(delta: import("ace-code").Ace.Delta): void; /** * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. * @param {Number} row The row index to move the anchor to @@ -394,7 +389,9 @@ declare module "ace-code/src/config" { setDefaultValues(path: string, optionHash: { [key: string]: any; }): void; - setMessages(value: any): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; nls(key: string, defaultString: string, params?: { [x: string]: any; }): any; @@ -449,7 +446,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.34.2"; + version: "1.35.0"; }; export = _exports; import AppConfig_1 = require("ace-code/src/lib/app_config"); @@ -832,11 +829,6 @@ declare module "ace-code/src/scrollbar" { scrollTop: number; scrollHeight: number; width: number; - /** - * Emitted when the scroll bar, well, scrolls. - * @event scroll - **/ - onScroll(): void; /** * Returns the width of the scroll bar. * @returns {Number} @@ -877,11 +869,6 @@ declare module "ace-code/src/scrollbar" { constructor(parent: Element, renderer: any); scrollLeft: number; height: any; - /** - * Emitted when the scroll bar, well, scrolls. - * @event scroll - **/ - onScroll(): void; /** * Returns the height of the scroll bar. * @returns {Number} @@ -955,10 +942,6 @@ declare module "ace-code/src/scrollbar_custom" { parent: any; width: number; renderer: any; - /** - * Emitted when the scroll thumb dragged or scrollbar canvas clicked. - **/ - onMouseDown(eType: any, e: any): void; getHeight(): number; /** * Returns new top for scroll thumb @@ -1011,10 +994,6 @@ declare module "ace-code/src/scrollbar_custom" { scrollWidth: number; height: number; renderer: any; - /** - * Emitted when the scroll thumb dragged or scrollbar canvas clicked. - **/ - onMouseDown(eType: any, e: any): void; /** * Returns the height of the scroll bar. * @returns {Number} @@ -1183,7 +1162,6 @@ declare module "ace-code/src/virtual_renderer" { **/ setSession(session: EditSession): void; session: import("ace-code/src/edit_session").EditSession; - onChangeNewLineMode(): void; /** * Triggers a partial update of the text, from the range given by the two parameters. * @param {Number} firstRow The first row to update @@ -1191,7 +1169,6 @@ declare module "ace-code/src/virtual_renderer" { * @param {boolean} [force] **/ updateLines(firstRow: number, lastRow: number, force?: boolean): void; - onChangeTabSize(): void; /** * Triggers a full update of the text, for all the rows. **/ @@ -1206,23 +1183,8 @@ declare module "ace-code/src/virtual_renderer" { * Updates the font size. **/ updateFontSize(): void; - /** - * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} - * @param {Boolean} [force] If `true`, recomputes the size, even if the height and width haven't changed - * @param {Number} [gutterWidth] The width of the gutter in pixels - * @param {Number} [width] The width of the editor in pixels - * @param {Number} [height] The hiehgt of the editor, in pixels - - **/ - onResize(force?: boolean, gutterWidth?: number, width?: number, height?: number): number; resizing: number; gutterWidth: any; - /** - * - * @param {number} width - - */ - onGutterResize(width: number): void; /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. @@ -2168,12 +2130,6 @@ declare module "ace-code/src/tooltip" { lastT: number; idleTime: number; lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - onMouseOut(e: any): void; - /** - * @param {MouseEvent} e - * @param {Editor} editor - */ - onMouseMove(e: MouseEvent, editor: Editor): void; waitForHover(): void; /** * @param {Editor} editor @@ -2459,18 +2415,6 @@ declare module "ace-code/src/keyboard/keybinding" { */ getKeyboardHandler(): KeyboardHandler; getStatusText(): string; - /** - * @param {any} e - * @param {number} hashId - * @param {number} keyCode - * @return {boolean} - */ - onCommandKey(e: any, hashId: number, keyCode: number): boolean; - /** - * @param {string} text - * @return {boolean} - */ - onTextInput(text: string): boolean; } } declare module "ace-code/src/search" { @@ -2630,6 +2574,13 @@ declare module "ace-code/src/commands/command_manager" { * @returns {boolean} */ exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; + /** + * + * @param {string | import("ace-code").Ace.Command} command + * @param {Editor} editor + * @returns {boolean} + */ + canExecute(command: string | import("ace-code").Ace.Command, editor: Editor): boolean; /** * @param {Editor} editor * @returns {boolean} @@ -2770,10 +2721,6 @@ declare module "ace-code/src/line_widgets" { * @return {LineWidget[]} */ getWidgetsAtRow(row: number): LineWidget[]; - /** - * @param {LineWidget} w - */ - onWidgetChanged(w: LineWidget): void; firstRow: number; lastRow: number; lineWidgets: import("ace-code").Ace.LineWidget[]; @@ -2991,63 +2938,11 @@ declare module "ace-code/src/editor" { * Blurs the current `textInput`. **/ blur(): void; - /** - * Emitted once the editor comes into focus. - **/ - onFocus(e: any): void; - /** - * Emitted once the editor has been blurred. - **/ - onBlur(e: any): void; - /** - * Emitted whenever the document is changed. - * @param {import("ace-code").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes - **/ - onDocumentChange(delta: import("ace-code").Ace.Delta): void; - onTokenizerUpdate(e: any): void; - onScrollTopChange(): void; - onScrollLeftChange(): void; - /** - * Emitted when the selection changes. - **/ - onCursorChange(): void; - /** - * - * @param e - */ - onSelectionChange(e: any): void; - onChangeFrontMarker(): void; - onChangeBackMarker(): void; - onChangeBreakpoint(): void; - onChangeAnnotation(): void; - /** - * @param e - */ - onChangeMode(e: any): void; - onChangeWrapLimit(): void; - onChangeWrapMode(): void; - /** - */ - onChangeFold(): void; /** * Returns the string of text currently highlighted. * @returns {String} **/ getCopyText(): string; - /** - * Called whenever a text "copy" happens. - **/ - onCopy(): void; - /** - * Called whenever a text "cut" happens. - **/ - onCut(): void; - /** - * Called whenever a text "paste" happens. - * @param {String} text The pasted text - * @param {any} event - **/ - onPaste(text: string, event: any): void; /** * * @param {string | string[]} command @@ -3062,19 +2957,11 @@ declare module "ace-code/src/editor" { **/ insert(text: string, pasted?: boolean): void; autoIndent(): void; - /** - * - * @param text - * @param composition - * @returns {*} - */ - onTextInput(text: any, composition: any): any; /** * @param {string} [text] * @param {any} [composition] */ applyComposition(text?: string, composition?: any): void; - onCommandKey(e: any, hashId: any, keyCode: any): boolean; /** * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. * @param {Boolean} overwrite Defines whether or not to set overwrites @@ -3392,9 +3279,6 @@ declare module "ace-code/src/editor" { **/ copyLinesDown(): void; inVirtualSelectionMode: boolean; - onCompositionStart(compositionState: any): void; - onCompositionUpdate(text: any): void; - onCompositionEnd(): void; /** * {:VirtualRenderer.getFirstVisibleRow} * @@ -4215,7 +4099,6 @@ declare module "ace-code/src/autocomplete" { changeListener(e: any): void; mousedownListener(e: any): void; mousewheelListener(e: any): void; - onLayoutChange(): void; changeTimer: { (timeout: any): void; delay(timeout: any): void; @@ -4304,7 +4187,6 @@ declare module "ace-code/src/autocomplete" { showDocTooltip(item: any): void; tooltipNode: HTMLDivElement; hideDocTooltip(): void; - onTooltipClick(e: any): void; destroy(): void; commands: { Up: (editor: any) => void; @@ -4768,7 +4650,6 @@ declare module "ace-code/src/bidihandler" { * @param {Number} [splitIndex] the wrapped screen line index [ optional] **/ isBidiRow(screenRow: number, docRow?: number, splitIndex?: number): any; - onChange(delta: any): void; getDocumentRow(): number; getSplitIndex(): number; updateRowLine(docRow: any, splitIndex: any): void; @@ -5216,12 +5097,6 @@ declare module "ace-code/src/edit_session" { **/ getDocument(): Document; resetCaches(): void; - onChangeFold(e: any): void; - /** - * - * @param {Delta} delta - */ - onChange(delta: Delta): void; mergeUndoDeltas: boolean; /** * Sets the session text. @@ -5467,10 +5342,6 @@ declare module "ace-code/src/edit_session" { * Returns `true` if workers are being used. **/ getUseWorker(): boolean; - /** - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ - onReloadTokenizer(e: any): void; /** * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. * @param {SyntaxMode | string} mode Set a new text mode @@ -5817,12 +5688,7 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: { - [key: string]: any; - command: {}; - args: string; - scrollTop: number; - }; + curOp?: any; getSelectionMarkers(): any[]; } export namespace EditSession { @@ -5868,12 +5734,7 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: { - command: {}; - args: string; - scrollTop: number; - [key: string]: any; - }; + curOp?: any; getSelectionMarkers(): any[]; } } @@ -6184,25 +6045,11 @@ declare module "ace-code/src/placeholder" { * **/ hideOtherMarkers(): void; - /** - * PlaceHolder@onUpdate(e) - * - * Emitted when the place holder updates. - * @param {import("ace-code").Ace.Delta} delta - */ - onUpdate(delta: import("ace-code").Ace.Delta): void; /** * @param {import("ace-code").Ace.Delta} delta */ updateAnchors(delta: import("ace-code").Ace.Delta): void; updateMarkers(): void; - /** - * PlaceHolder@onCursorChange(e) - * - * Emitted when the cursor changes. - * @param {any} [event] - */ - onCursorChange(event?: any): void; /** * PlaceHolder.detach() * @@ -6339,11 +6186,6 @@ declare module "ace-code/src/incremental_search" { */ removeChar(c: any): false | Range; next(options: any): false | Range; - onMouseDown(evt: any): boolean; - /** - * @param {string} text - */ - onPaste(text: string): void; convertNeedleToRegExp(): false | Range; convertNeedleToString(): false | Range; statusMessage(found: any): void; diff --git a/ace.d.ts b/ace.d.ts index 85f7d26a0ed..8d02039e35b 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -46,9 +46,6 @@ declare module "ace-code" { sharedPopups: boolean; useStrictCSP: boolean | null; } - //setOption(name: K, value: T[K]): void; - // - // getOption(name: K): T[K]; export interface Config { get(key: K): ConfigOptions[K]; set(key: K, value: ConfigOptions[K]): void; @@ -329,6 +326,7 @@ declare module "ace-code" { enableKeyboardAccessibility: boolean; enableCodeLens: boolean; textInputAriaLabel: string; + enableMobileMenu: boolean; } interface EventsBase { [key: string]: any; @@ -954,7 +952,9 @@ declare module "ace-code" { setDefaultValues(path: string, optionHash: { [key: string]: any; }): void; - setMessages(value: any): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; nls(key: string, defaultString: string, params?: { [x: string]: any; }): any; @@ -981,7 +981,7 @@ declare module "ace-code" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.34.2"; + version: "1.35.0"; }; 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.34.2"; + export var version: "1.35.0"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/src/anchor.js b/src/anchor.js index b5d112c9a6d..c6e994242bd 100644 --- a/src/anchor.js +++ b/src/anchor.js @@ -46,6 +46,7 @@ class Anchor { /** * Internal function called when `"change"` event fired. * @param {import("../ace-internal").Ace.Delta} delta + * @internal */ onChange(delta) { if (delta.start.row == delta.end.row && delta.start.row != this.row) diff --git a/src/autocomplete.js b/src/autocomplete.js index 4d6ff2af084..de0fc9267e6 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -256,6 +256,10 @@ class Autocomplete { }); this.$elements = null; } + + /** + * @internal + */ onLayoutChange() { if (!this.popup.isOpen) return this.unObserveLayoutChanges(); this.$updatePopupPosition(); @@ -706,7 +710,11 @@ class Autocomplete { if (el.parentNode) el.parentNode.removeChild(el); } - + + /** + * @param e + * @internal + */ onTooltipClick(e) { var a = e.target; while (a && a != this.tooltipNode) { diff --git a/src/bidihandler.js b/src/bidihandler.js index 003822fcafd..6dbfbb83b17 100644 --- a/src/bidihandler.js +++ b/src/bidihandler.js @@ -59,6 +59,10 @@ class BidiHandler { return this.bidiMap.bidiLevels; } + /** + * @param {import("../ace-internal").Ace.Delta} delta + * @internal + */ onChange(delta) { if (!this.seenBidi) { if (delta.action == "insert" && bidiRE.test(delta.lines.join("\n"))) { diff --git a/src/edit_session.js b/src/edit_session.js index 9cb28439f8b..718105762f6 100644 --- a/src/edit_session.js +++ b/src/edit_session.js @@ -152,6 +152,10 @@ class EditSession { this.bgTokenizer.start(0); } + /** + * @param e + * @internal + */ onChangeFold(e) { var fold = e.data; this.$resetRowCache(fold.start.row); @@ -160,6 +164,7 @@ class EditSession { /** * * @param {Delta} delta + * @internal */ onChange(delta) { this.$modified = true; @@ -774,6 +779,7 @@ class EditSession { /** * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + * @internal **/ onReloadTokenizer(e) { var rows = e.data; diff --git a/src/editor.js b/src/editor.js index c587dbd3c8b..c9d2bf7a6d4 100644 --- a/src/editor.js +++ b/src/editor.js @@ -585,6 +585,7 @@ class Editor { /** * Emitted once the editor comes into focus. + * @internal **/ onFocus(e) { if (this.$isFocused) @@ -597,6 +598,7 @@ class Editor { /** * Emitted once the editor has been blurred. + * @internal **/ onBlur(e) { if (!this.$isFocused) @@ -618,6 +620,7 @@ class Editor { /** * Emitted whenever the document is changed. * @param {import("../ace-internal").Ace.Delta} delta Contains a single property, `data`, which has the delta of changes + * @internal **/ onDocumentChange(delta) { // Rerender and emit "change" event. @@ -631,22 +634,31 @@ class Editor { this.$cursorChange(); } + /** + * @internal + */ onTokenizerUpdate(e) { var rows = e.data; this.renderer.updateLines(rows.first, rows.last); } - + /** + * @internal + */ onScrollTopChange() { this.renderer.scrollToY(this.session.getScrollTop()); } + /** + * @internal + */ onScrollLeftChange() { this.renderer.scrollToX(this.session.getScrollLeft()); } /** * Emitted when the selection changes. + * @internal **/ onCursorChange() { this.$cursorChange(); @@ -684,8 +696,8 @@ class Editor { } /** - * * @param e + * @internal */ onSelectionChange(e) { var session = this.session; @@ -739,43 +751,60 @@ class Editor { return re; } - + /** + * @internal + */ onChangeFrontMarker() { this.renderer.updateFrontMarkers(); } + /** + * @internal + */ onChangeBackMarker() { this.renderer.updateBackMarkers(); } - - + + /** + * @internal + */ onChangeBreakpoint() { this.renderer.updateBreakpoints(); } + /** + * @internal + */ onChangeAnnotation() { this.renderer.setAnnotations(this.session.getAnnotations()); } /** * @param e + * @internal */ onChangeMode (e) { this.renderer.updateText(); this._emit("changeMode", e); } - + /** + * @internal + */ onChangeWrapLimit() { this.renderer.updateFull(); } + /** + * @internal + */ onChangeWrapMode() { this.renderer.onResize(true); } /** + * @internal */ onChangeFold() { // Update the active line marker as due to folding changes the current @@ -821,6 +850,7 @@ class Editor { /** * Called whenever a text "copy" happens. + * @internal **/ onCopy() { this.commands.exec("copy", this); @@ -828,6 +858,7 @@ class Editor { /** * Called whenever a text "cut" happens. + * @internal **/ onCut() { this.commands.exec("cut", this); @@ -838,6 +869,7 @@ class Editor { * Called whenever a text "paste" happens. * @param {String} text The pasted text * @param {any} event + * @internal **/ onPaste(text, event) { var e = {text: text, event: event}; @@ -1020,6 +1052,7 @@ class Editor { * @param text * @param composition * @returns {*} + * @internal */ onTextInput(text, composition) { if (!composition) @@ -1061,6 +1094,9 @@ class Editor { } } + /** + * @internal + */ onCommandKey(e, hashId, keyCode) { return this.keyBinding.onCommandKey(e, hashId, keyCode); } @@ -1952,14 +1988,23 @@ class Editor { }; } + /** + * @internal + */ onCompositionStart(compositionState) { this.renderer.showComposition(compositionState); } + /** + * @internal + */ onCompositionUpdate(text) { this.renderer.setCompositionText(text); } + /** + * @internal + */ onCompositionEnd() { this.renderer.hideComposition(); } diff --git a/src/incremental_search.js b/src/incremental_search.js index 58ba6725414..89c2194fa74 100644 --- a/src/incremental_search.js +++ b/src/incremental_search.js @@ -207,6 +207,9 @@ class IncrementalSearch extends Search { }); } + /** + * @internal + */ onMouseDown(evt) { // when mouse interaction happens then we quit incremental search this.deactivate(); @@ -215,6 +218,7 @@ class IncrementalSearch extends Search { /** * @param {string} text + * @internal */ onPaste(text) { this.addString(text); diff --git a/src/keyboard/keybinding.js b/src/keyboard/keybinding.js index 5de3ab8251c..ab1f663f1e9 100644 --- a/src/keyboard/keybinding.js +++ b/src/keyboard/keybinding.js @@ -140,6 +140,7 @@ class KeyBinding { * @param {number} hashId * @param {number} keyCode * @return {boolean} + * @internal */ onCommandKey(e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); @@ -149,6 +150,7 @@ class KeyBinding { /** * @param {string} text * @return {boolean} + * @internal */ onTextInput(text) { return this.$callKeyboardHandlers(-1, text); diff --git a/src/line_widgets.js b/src/line_widgets.js index 8d781db79a8..4ff0825d1fe 100644 --- a/src/line_widgets.js +++ b/src/line_widgets.js @@ -315,6 +315,7 @@ class LineWidgets { /** * @param {LineWidget} w + * @internal */ onWidgetChanged(w) { this.session._changedWidgets.push(w); diff --git a/src/placeholder.js b/src/placeholder.js index a3e84f76e78..99c6f4b6f19 100644 --- a/src/placeholder.js +++ b/src/placeholder.js @@ -106,6 +106,7 @@ class PlaceHolder { * * Emitted when the place holder updates. * @param {import("../ace-internal").Ace.Delta} delta + * @internal */ onUpdate(delta) { if (this.$updating) @@ -174,6 +175,7 @@ class PlaceHolder { * * Emitted when the cursor changes. * @param {any} [event] + * @internal */ onCursorChange(event) { if (this.$updating || !this.session) return; diff --git a/src/scrollbar.js b/src/scrollbar.js index 70cc2cc02af..a2037bfb733 100644 --- a/src/scrollbar.js +++ b/src/scrollbar.js @@ -76,6 +76,7 @@ class VScrollBar extends Scrollbar { /** * Emitted when the scroll bar, well, scrolls. * @event scroll + * @internal **/ onScroll() { @@ -171,6 +172,7 @@ class HScrollBar extends Scrollbar { /** * Emitted when the scroll bar, well, scrolls. * @event scroll + * @internal **/ onScroll() { if (!this.skipEvent) { diff --git a/src/scrollbar_custom.js b/src/scrollbar_custom.js index 095d2038ba8..f270ebf1bbe 100644 --- a/src/scrollbar_custom.js +++ b/src/scrollbar_custom.js @@ -105,6 +105,7 @@ class VScrollBar extends ScrollBar { /** * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + * @internal **/ onMouseDown(eType, e) { if (eType !== "mousedown") return; @@ -241,6 +242,7 @@ class HScrollBar extends ScrollBar { /** * Emitted when the scroll thumb dragged or scrollbar canvas clicked. + * @internal **/ onMouseDown(eType, e) { if (eType !== "mousedown") return; diff --git a/src/snippets.js b/src/snippets.js index 263434e0f67..39be8335cd6 100644 --- a/src/snippets.js +++ b/src/snippets.js @@ -818,7 +818,9 @@ class TabstopManager { this.session = null; this.editor = null; } - + /** + * @internal + */ onChange(delta) { var isRemove = delta.action[0] == "r"; var selectedTabstop = this.selectedTabstop || {}; @@ -862,10 +864,16 @@ class TabstopManager { } this.$inChange = false; } + /** + * @internal + */ onAfterExec(e) { if (e.command && !e.command.readOnly) this.updateLinkedFields(); } + /** + * @internal + */ onChangeSelection() { if (!this.editor) return; @@ -882,6 +890,9 @@ class TabstopManager { } this.detach(); } + /** + * @internal + */ onChangeSession() { this.detach(); } diff --git a/src/tooltip.js b/src/tooltip.js index fc62ae7a52a..4590728a1be 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -241,6 +241,7 @@ class HoverTooltip extends Tooltip { /** * @param {MouseEvent} e * @param {Editor} editor + * @internal */ onMouseMove(e, editor) { this.lastEvent = e; @@ -397,6 +398,9 @@ class HoverTooltip extends Tooltip { window.removeEventListener("mousedown", this.hide, true); } + /** + * @internal + */ onMouseOut(e) { if (this.timeout) { clearTimeout(this.timeout); diff --git a/src/virtual_renderer.js b/src/virtual_renderer.js index 40d5a927cd6..c26b31e5727 100644 --- a/src/virtual_renderer.js +++ b/src/virtual_renderer.js @@ -264,12 +264,18 @@ class VirtualRenderer { this.$loop.schedule(this.CHANGE_LINES); } + /** + * @internal + */ onChangeNewLineMode() { this.$loop.schedule(this.CHANGE_TEXT); this.$textLayer.$updateEolChar(); this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR); } - + + /** + * @internal + */ onChangeTabSize() { this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); this.$textLayer.onChangeTabSize(); @@ -313,7 +319,7 @@ class VirtualRenderer { * @param {Number} [gutterWidth] The width of the gutter in pixels * @param {Number} [width] The width of the editor in pixels * @param {Number} [height] The hiehgt of the editor, in pixels - + * @internal **/ onResize(force, gutterWidth, width, height) { if (this.resizing > 2) @@ -431,7 +437,7 @@ class VirtualRenderer { /** * * @param {number} width - + * @internal */ onGutterResize(width) { var gutterWidth = this.$showGutter ? width : 0; diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index a6f3d1dbeb0..ae27873abb9 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -285,9 +285,10 @@ function fixDeclaration(content, aceNamespacePath) { || ts.isPropertySignature(node)) { const isPrivate = node.modifiers?.some( modifier => modifier.kind === ts.SyntaxKind.PrivateKeyword); + const startsWithDollar = ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text); - if (isPrivate || startsWithDollar) { + if (isPrivate || startsWithDollar || hasInternalTag(node)) { return ts.factory.createNotEmittedStatement(node); } } @@ -321,6 +322,14 @@ function fixDeclaration(content, aceNamespacePath) { checkFinalDeclaration(finalDeclarations); } +function hasInternalTag(node) { + const sourceFile = node.getSourceFile(); + if (!sourceFile) return false; + + const jsDocs = ts.getJSDocTags(node).filter(tag => tag.tagName.text === 'internal'); + return jsDocs.length > 0; +} + function createMinimalLanguageServiceHost() { return { files: {}, From 5797ae1b961e7b3095307c9fd87c3c572ad0bb93 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 12 Jul 2024 19:31:45 +0400 Subject: [PATCH 20/33] update types for typescript 5.5.3 --- ace-ext.d.ts | 40 ++++++------ ace-internal.d.ts | 7 ++- ace-lib.d.ts | 10 +-- ace-modules.d.ts | 138 +++++++++++++++++++++--------------------- ace-theme.d.ts | 9 +++ ace.d.ts | 24 ++++---- src/config.js | 14 ++--- src/lib/app_config.js | 2 +- 8 files changed, 129 insertions(+), 115 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 6c00007088b..72fbd666472 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -324,6 +324,8 @@ declare module "ace-code/src/ext/code_lens" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { }; + import Editor_7 = require("ace-code/src/editor"); + import Editor = Editor_7.Editor; } declare module "ace-code/src/ext/emmet" { export const commands: HashHandler; @@ -335,8 +337,8 @@ declare module "ace-code/src/ext/emmet" { export function setCore(e: any): void; import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); import HashHandler = HashHandler_5.HashHandler; - import Editor_7 = require("ace-code/src/editor"); - import Editor = Editor_7.Editor; + import Editor_8 = require("ace-code/src/editor"); + import Editor = Editor_8.Editor; /** * Implementation of {@link IEmmetEditor} interface for Ace */ @@ -458,6 +460,8 @@ declare module "ace-code/src/ext/hardwrap" { * @param {import("ace-code").Ace.HardWrapOptions} options */ export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; + import Editor_9 = require("ace-code/src/editor"); + import Editor = Editor_9.Editor; } declare module "ace-code/src/ext/menu_tools/settings_menu.css" { const _exports: string; @@ -474,8 +478,8 @@ declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { } declare module "ace-code/src/ext/keybinding_menu" { export function init(editor: Editor): void; - import Editor_8 = require("ace-code/src/editor"); - import Editor = Editor_8.Editor; + import Editor_10 = require("ace-code/src/editor"); + import Editor = Editor_10.Editor; } declare module "ace-code/src/ext/linking" { } declare module "ace-code/src/ext/modelist" { @@ -651,19 +655,19 @@ declare module "ace-code/src/ext/prompt" { * @param {Editor} editor * @param {Function} [callback] */ - function gotoLine(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + function gotoLine(editor: Editor, callback?: Function): void; /** * * @param {Editor} editor * @param {Function} [callback] */ - function commands(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + function commands(editor: Editor, callback?: Function): void; /** * * @param {Editor} editor * @param {Function} [callback] */ - function modes(editor: import("ace-code/src/editor").Editor, callback?: Function): void; + function modes(editor: Editor, callback?: Function): void; } } declare module "ace-code/src/ext/rtl" { @@ -759,7 +763,7 @@ declare module "ace-code/src/ext/textarea" { config: { defineOptions(obj: any, path: string, options: { [key: string]: any; - }): import("ace-code/src/lib/app_config").AppConfig; + }): import("ace-code").Ace.AppConfig; resetOptions(obj: any): void; setDefaultValue(path: string, name: string, value: any): boolean; setDefaultValues(path: string, optionHash: { @@ -776,14 +780,14 @@ declare module "ace-code/src/ext/textarea" { once(name: K, callback: any): void; setDefaultHandler(name: string, callback: Function): void; removeDefaultHandler(name: string, callback: Function): void; - on(name: K_1, callback: any, capturing?: boolean): any; - addEventListener(name: K_2, callback: any, capturing?: boolean): any; - off(name: K_3, callback: any): void; - removeListener(name: K_4, callback: any): void; - removeEventListener(name: K_5, callback: any): void; + on(name: K, callback: any, capturing?: boolean): any; + addEventListener(name: K, callback: any, capturing?: boolean): any; + off(name: K, callback: any): void; + removeListener(name: K, callback: any): void; + removeEventListener(name: K, callback: any): void; removeAllListeners(name?: string): void; - get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; - set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; + get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; + set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; @@ -794,19 +798,19 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.35.0"; + version: "1.35.2"; }; edit: (el: string | (HTMLElement & { env?: any; value?: any; }), options?: any) => ace.Editor; - createEditSession: (text: string | import("ace-code/src/document").Document, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; + createEditSession: (text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; Range: typeof ace.Range; Editor: typeof ace.Editor; EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.35.0"; + version: "1.35.2"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index b2d590022a2..aec218c71e9 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -1339,7 +1339,12 @@ declare module "./src/edit_session" { $occurMatchingLines?: any, $useEmacsStyleLineStart?: boolean, $selectLongWords?: boolean, - curOp?: any, + curOp?: { + command: {}, + args: string, + scrollTop: number, + [key: string]: any; + }, getSelectionMarkers(): any[], } diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 7bc3734edf9..3206eea5098 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -26,7 +26,7 @@ declare module "ace-code/src/lib/useragent" { declare module "ace-code/src/lib/dom" { export function buildDom(arr: any, parent?: HTMLElement, refs?: any): HTMLElement | Text | any[]; export function getDocumentHead(doc?: Document): HTMLHeadElement | HTMLElement; - export function createElement(tag: string | T, ns?: string): HTMLElementTagNameMap[T]; + export function createElement(tag: T | string, ns?: string): HTMLElementTagNameMap[T]; export function removeChildren(element: HTMLElement): void; export function createTextNode(textContent: string, element?: HTMLElement): Text; export function createFragment(element?: HTMLElement): DocumentFragment; @@ -50,8 +50,8 @@ declare module "ace-code/src/lib/dom" { } declare module "ace-code/src/lib/oop" { export function inherits(ctor: any, superCtor: any): void; - export function mixin(obj: T, mixin: any): any; - export function implement(proto: T, mixin: any): any; + export function mixin(obj: T, mixin: any): T & any; + export function implement(proto: T, mixin: any): T & any; } declare module "ace-code/src/lib/deep_copy" { export function deepCopy(obj: any): any; @@ -172,11 +172,11 @@ declare module "ace-code/src/lib/app_config" { * @param {Object} obj * @param {string} path * @param {{ [key: string]: any }} options - * @returns {AppConfig} + * @returns {import("ace-code").Ace.AppConfig} */ defineOptions(obj: any, path: string, options: { [key: string]: any; - }): AppConfig; + }): import("ace-code").Ace.AppConfig; /** * @param {Object} obj */ diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 6bd6394efa7..158385e0642 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -383,7 +383,7 @@ declare module "ace-code/src/config" { const _exports: { defineOptions(obj: any, path: string, options: { [key: string]: any; - }): AppConfig; + }): import("ace-code").Ace.AppConfig; resetOptions(obj: any): void; setDefaultValue(path: string, name: string, value: any): boolean; setDefaultValues(path: string, optionHash: { @@ -400,24 +400,24 @@ declare module "ace-code/src/config" { once(name: K, callback: any): void; setDefaultHandler(name: string, callback: Function): void; removeDefaultHandler(name: string, callback: Function): void; - on(name: K_1, callback: any, capturing?: boolean): any; - addEventListener(name: K_2, callback: any, capturing?: boolean): any; - off(name: K_3, callback: any): void; - removeListener(name: K_4, callback: any): void; - removeEventListener(name: K_5, callback: any): void; + on(name: K, callback: any, capturing?: boolean): any; + addEventListener(name: K, callback: any, capturing?: boolean): any; + off(name: K, callback: any): void; + removeListener(name: K, callback: any): void; + removeEventListener(name: K, callback: any): void; removeAllListeners(name?: string): void; /** - * @template {keyof ConfigOptions} K + * @template {keyof import("ace-code").Ace.ConfigOptions} K * @param {K} key - The key of the config option to retrieve. - * @returns {ConfigOptions[K]} - The value of the config option. + * @returns {import("ace-code").Ace.ConfigOptions[K]} - The value of the config option. */ - get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; + get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; /** - * @template {keyof ConfigOptions} K + * @template {keyof import("ace-code").Ace.ConfigOptions} K * @param {K} key - * @param {ConfigOptions[K]} value + * @param {import("ace-code").Ace.ConfigOptions[K]} value */ - set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; + set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; /** * @return {import("ace-code").Ace.ConfigOptions} */ @@ -446,11 +446,9 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.35.0"; + version: "1.35.2"; }; export = _exports; - import AppConfig_1 = require("ace-code/src/lib/app_config"); - import AppConfig = AppConfig_1.AppConfig; } declare module "ace-code/src/layer/lines" { export type EditSession = import("ace-code/src/edit_session").EditSession; @@ -1161,7 +1159,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {EditSession} session The session to associate with **/ setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; + session: import("ace-code").Ace.EditSession; /** * Triggers a partial update of the text, from the range given by the two parameters. * @param {Number} firstRow The first row to update @@ -2352,7 +2350,7 @@ declare module "ace-code/src/mouse/mouse_handler" { cancelContextMenu(): void; destroy(): void; cancelDrag?: boolean; - mousedownEvent?: MouseEvent; + mousedownEvent?: import("ace-code").Ace.MouseEvent; startSelect?: (pos?: import("ace-code").Ace.Point, waitForClickSelection?: boolean) => void; select?: () => void; selectEnd?: () => void; @@ -3146,7 +3144,7 @@ declare module "ace-code/src/editor" { * Removes the current selection or one character. * @param {'left' | 'right'} [dir] The direction of the deletion to occur, either "left" or "right" **/ - remove(dir?: 'left' | 'right'): void; + remove(dir?: "left" | "right"): void; /** * Removes the word directly to the right of the current selection. **/ @@ -3548,12 +3546,12 @@ declare module "ace-code/src/editor" { **/ prompt(message: any, options: any, callback: any): void; env?: any; - widgetManager?: LineWidgets; - completer?: import("ace-code/src/autocomplete").Autocomplete | import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + widgetManager?: import("ace-code").Ace.LineWidgets; + completer?: import("ace-code").Ace.Autocomplete | import("ace-code").Ace.InlineAutocomplete; completers: import("ace-code").Ace.Completer[]; showKeyboardShortcuts?: () => void; showSettingsMenu?: () => void; - searchBox?: import("ace-code/src/ext/searchbox").SearchBox; + searchBox?: import("ace-code").Ace.SearchBox; } export namespace Editor { export { $uid }; @@ -3574,8 +3572,6 @@ declare module "ace-code/src/editor" { import Search = Search_1.Search; import Range_7 = require("ace-code/src/range"); import Range = Range_7.Range; - import LineWidgets_1 = require("ace-code/src/line_widgets"); - import LineWidgets = LineWidgets_1.LineWidgets; var $uid: number; export { }; namespace Ace { @@ -3799,13 +3795,13 @@ declare module "ace-code/src/autocomplete/popup" { isOpen: boolean; isTopdown: boolean; autoSelect: boolean; - data: import("ace-code/src/autocomplete").Completion[]; - setData: (data: import("ace-code/src/autocomplete").Completion[], filterText: string) => void; - getData: (row: number) => import("ace-code/src/autocomplete").Completion; + data: import("ace-code").Ace.Completion[]; + setData: (data: import("ace-code").Ace.Completion[], filterText: string) => void; + getData: (row: number) => import("ace-code").Ace.Completion; hide: () => void; - anchor: "bottom" | "top"; + anchor: "top" | "bottom"; anchorPosition: import("ace-code").Ace.Point; - tryShow: (pos: any, lineHeight: number, anchor: "bottom" | "top", forceShow?: boolean) => boolean; + tryShow: (pos: any, lineHeight: number, anchor: "top" | "bottom", forceShow?: boolean) => boolean; show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void; goTo: (where: import("ace-code").Ace.AcePopupNavigation) => void; getTextLeftOffset: () => number; @@ -3904,7 +3900,7 @@ declare module "ace-code/src/range_list" { session: import("ace-code/src/edit_session").EditSession; onChange: any; detach(): void; - comparePoints: (p1: import("ace-code").Ace.Point, p2: import("ace-code").Ace.Point) => number; + comparePoints: (p1: import("ace-code/src/range").Point, p2: import("ace-code/src/range").Point) => number; } import Range_8 = require("ace-code/src/range"); import Range = Range_8.Range; @@ -4249,7 +4245,7 @@ declare module "ace-code/src/autocomplete" { provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ ], finished: boolean) => void): void; detach(): void; - completions: FilteredList; + completions: import("ace-code").Ace.FilteredList; } export type Editor = import("ace-code/src/editor").Editor; export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; @@ -4793,24 +4789,24 @@ declare module "ace-code/src/edit_session/folding" { * @param {number} [side] * @return {Fold} **/ - getFoldAt: (row: number, column: number, side?: number) => Fold; + getFoldAt: (row: number, column: number, side?: number) => import("ace-code").Ace.Fold; /** * Returns all folds in the given range. Note, that this will return folds * @param {Range| Delta} range * @returns {Fold[]} **/ - getFoldsInRange: (range: import("ace-code").Ace.Delta | Range) => Fold[]; + getFoldsInRange: (range: import("ace-code").Ace.Range | import("ace-code").Ace.Delta) => import("ace-code").Ace.Fold[]; /** * * @param {Range[]|Range}ranges * @returns {Fold[]} */ - getFoldsInRangeList: (ranges: Range | Range[]) => Fold[]; + getFoldsInRangeList: (ranges: import("ace-code").Ace.Range[] | import("ace-code").Ace.Range) => import("ace-code").Ace.Fold[]; /** * Returns all folds in the document * @returns {Fold[]} */ - getAllFolds: () => Fold[]; + getAllFolds: () => import("ace-code").Ace.Fold[]; /** * Returns the string between folds at the given position. * E.g. @@ -4833,21 +4829,21 @@ declare module "ace-code/src/edit_session/folding" { * @param {FoldLine} [foldLine] * @returns {string | null} */ - getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: FoldLine) => string; + getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: import("ace-code").Ace.FoldLine) => string | null; /** * * @param {number} docRow * @param {FoldLine} [startFoldLine] * @returns {null|FoldLine} */ - getFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + getFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; /** * Returns the fold which starts after or contains docRow * @param {number} docRow * @param {FoldLine} [startFoldLine] * @returns {null|FoldLine} */ - getNextFoldLine: (docRow: number, startFoldLine?: FoldLine) => FoldLine; + getNextFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; /** * * @param {number} first @@ -4865,36 +4861,36 @@ declare module "ace-code/src/edit_session/folding" { * passed in range fits an existing fold exactly. * @this {IFolding} */ - addFold: (placeholder: string | Fold, range?: Range) => Fold; + addFold: (placeholder: import("ace-code").Ace.Fold | string, range?: import("ace-code").Ace.Range) => import("ace-code").Ace.Fold; /** * @param {Fold[]} folds */ - addFolds: (folds: Fold[]) => void; + addFolds: (folds: import("ace-code").Ace.Fold[]) => void; /** * * @param {Fold} fold */ - removeFold: (fold: Fold) => void; + removeFold: (fold: import("ace-code").Ace.Fold) => void; /** * * @param {Fold[]} folds */ - removeFolds: (folds: Fold[]) => void; + removeFolds: (folds: import("ace-code").Ace.Fold[]) => void; /** * @param {Fold} fold */ - expandFold: (fold: Fold) => void; + expandFold: (fold: import("ace-code").Ace.Fold) => void; /** * @param {Fold[]}folds */ - expandFolds: (folds: Fold[]) => void; + expandFolds: (folds: import("ace-code").Ace.Fold[]) => void; /** * * @param {number|null|import("ace-code").Ace.Point|Range|Range[]} [location] * @param {boolean} [expandInner] * @return {Fold[]| undefined} */ - unfold: (location?: number | import("ace-code").Ace.Point | Range | Range[], expandInner?: boolean) => Fold[]; + unfold: (location?: number | null | import("ace-code").Ace.Point | import("ace-code").Ace.Range | import("ace-code").Ace.Range[], expandInner?: boolean) => import("ace-code").Ace.Fold[] | undefined; /** * Checks if a given documentRow is folded. This is true if there are some * folded parts such that some parts of the line is still visible. @@ -4902,21 +4898,21 @@ declare module "ace-code/src/edit_session/folding" { * @param {FoldLine} [startFoldRow] * @returns {boolean} **/ - isRowFolded: (docRow: number, startFoldRow?: FoldLine) => boolean; + isRowFolded: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => boolean; /** * * @param {number} docRow * @param {FoldLine} [startFoldRow] * @return {number} */ - getRowFoldEnd: (docRow: number, startFoldRow?: FoldLine) => number; + getRowFoldEnd: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; /** * * @param {number} docRow * @param {FoldLine} [startFoldRow] * @returns {number} */ - getRowFoldStart: (docRow: number, startFoldRow?: FoldLine) => number; + getRowFoldStart: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; /** * * @param {FoldLine} foldLine @@ -4926,7 +4922,7 @@ declare module "ace-code/src/edit_session/folding" { * @param {number | null} [startColumn] * @return {string} */ - getFoldDisplayLine: (foldLine: FoldLine, endRow?: number, endColumn?: number, startRow?: number, startColumn?: number) => string; + getFoldDisplayLine: (foldLine: import("ace-code").Ace.FoldLine, endRow?: number | null, endColumn?: number | null, startRow?: number | null, startColumn?: number | null) => string; /** * * @param {number} row @@ -4935,7 +4931,7 @@ declare module "ace-code/src/edit_session/folding" { * @param {number | null} startColumn * @return {string} */ - getDisplayLine: (row: number, endColumn: number, startRow: number, startColumn: number) => string; + getDisplayLine: (row: number, endColumn: number | null, startRow: number | null, startColumn: number | null) => string; /** * @param {boolean} [tryToUnfold] */ @@ -4947,7 +4943,7 @@ declare module "ace-code/src/edit_session/folding" { * @param {number} [dir] * @return {Range | undefined} */ - getCommentFoldRange: (row: number, column: number, dir?: number) => Range; + getCommentFoldRange: (row: number, column: number, dir?: number) => import("ace-code").Ace.Range | undefined; /** * * @param {number | null} [startRow] @@ -4955,7 +4951,7 @@ declare module "ace-code/src/edit_session/folding" { * @param {number | null} [depth] * @param {Function} [test] */ - foldAll: (startRow?: number, endRow?: number, depth?: number, test?: Function) => void; + foldAll: (startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function) => void; /** * * @param {number} level @@ -4975,8 +4971,8 @@ declare module "ace-code/src/edit_session/folding" { * @return {{range?: Range, firstRange?: Range}} */ getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { - range?: Range; - firstRange?: Range; + range?: import("ace-code").Ace.Range; + firstRange?: import("ace-code").Ace.Range; }; /** * @@ -4998,12 +4994,6 @@ declare module "ace-code/src/edit_session/folding" { */ tokenizerUpdateFoldWidgets: (e: any) => void; } - import Fold_1 = require("ace-code/src/edit_session/fold"); - import Fold = Fold_1.Fold; - import Range_10 = require("ace-code/src/range"); - import Range = Range_10.Range; - import FoldLine_1 = require("ace-code/src/edit_session/fold_line"); - import FoldLine = FoldLine_1.FoldLine; } declare module "ace-code/src/edit_session/bracket_match" { export type EditSession = import("ace-code/src/edit_session").EditSession; @@ -5048,8 +5038,8 @@ declare module "ace-code/src/edit_session/bracket_match" { openTagName: Range; } | undefined; } - import Range_11 = require("ace-code/src/range"); - import Range = Range_11.Range; + import Range_10 = require("ace-code/src/range"); + import Range = Range_10.Range; } declare module "ace-code/src/edit_session" { const EditSession_base: undefined; @@ -5688,7 +5678,12 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: any; + curOp?: { + command: {}; + args: string; + scrollTop: number; + [key: string]: any; + }; getSelectionMarkers(): any[]; } export namespace EditSession { @@ -5711,8 +5706,8 @@ declare module "ace-code/src/edit_session" { import BidiHandler = BidiHandler_1.BidiHandler; import UndoManager_1 = require("ace-code/src/undomanager"); import UndoManager = UndoManager_1.UndoManager; - import Range_12 = require("ace-code/src/range"); - import Range = Range_12.Range; + import Range_11 = require("ace-code/src/range"); + import Range = Range_11.Range; function isFullWidth(c: any): boolean; var $uid: number; export { }; @@ -5734,7 +5729,12 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: any; + curOp?: { + command: {}; + args: string; + scrollTop: number; + [key: string]: any; + }; getSelectionMarkers(): any[]; } } @@ -6066,8 +6066,8 @@ declare module "ace-code/src/placeholder" { cancel(): void; } export type EditSession = import("ace-code/src/edit_session").EditSession; - import Range_13 = require("ace-code/src/range"); - import Range = Range_13.Range; + import Range_12 = require("ace-code/src/range"); + import Range = Range_12.Range; export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; @@ -6196,8 +6196,8 @@ declare module "ace-code/src/incremental_search" { import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); import Editor_6 = require("ace-code/src/editor"); import Editor = Editor_6.Editor; - import Range_15 = require("ace-code/src/range"); - import Range = Range_15.Range; + import Range_14 = require("ace-code/src/range"); + import Range = Range_14.Range; } declare module "ace-code/src/split" { export type ISplit = import("ace-code").Ace.EventEmitter & { diff --git a/ace-theme.d.ts b/ace-theme.d.ts index 53901f77936..037b5569c62 100644 --- a/ace-theme.d.ts +++ b/ace-theme.d.ts @@ -169,6 +169,15 @@ declare module "ace-code/src/theme/github_dark" { export const cssClass: "ace-github-dark"; export const cssText: string; } +declare module "ace-code/src/theme/github_light_default-css" { + const _exports: string; + export = _exports; +} +declare module "ace-code/src/theme/github_light_default" { + export const isDark: false; + export const cssClass: "ace-github-light-default"; + export const cssText: string; +} declare module "ace-code/src/theme/gob-css" { const _exports: string; export = _exports; diff --git a/ace.d.ts b/ace.d.ts index 8d02039e35b..d1b2eac0442 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -946,7 +946,7 @@ declare module "ace-code" { export const config: { defineOptions(obj: any, path: string, options: { [key: string]: any; - }): import("ace-code/src/lib/app_config").AppConfig; + }): import("ace-code").Ace.AppConfig; resetOptions(obj: any): void; setDefaultValue(path: string, name: string, value: any): boolean; setDefaultValues(path: string, optionHash: { @@ -963,14 +963,14 @@ declare module "ace-code" { once(name: K, callback: any): void; setDefaultHandler(name: string, callback: Function): void; removeDefaultHandler(name: string, callback: Function): void; - on(name: K_1, callback: any, capturing?: boolean): any; - addEventListener(name: K_2, callback: any, capturing?: boolean): any; - off(name: K_3, callback: any): void; - removeListener(name: K_4, callback: any): void; - removeEventListener(name: K_5, callback: any): void; + on(name: K, callback: any, capturing?: boolean): any; + addEventListener(name: K, callback: any, capturing?: boolean): any; + off(name: K, callback: any): void; + removeListener(name: K, callback: any): void; + removeEventListener(name: K, callback: any): void; removeAllListeners(name?: string): void; - get: (key: K_6) => import("ace-code").Ace.ConfigOptions[K_6]; - set: (key: K_7, value: import("ace-code").Ace.ConfigOptions[K_7]) => void; + get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; + set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; @@ -981,7 +981,7 @@ declare module "ace-code" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.35.0"; + version: "1.35.2"; }; export function edit(el: string | (HTMLElement & { env?: any; @@ -992,12 +992,12 @@ declare module "ace-code" { import Editor = Editor_5.Editor; import EditSession_3 = require("ace-code/src/edit_session"); import EditSession = EditSession_3.EditSession; - import Range_14 = require("ace-code/src/range"); - import Range = Range_14.Range; + import Range_13 = require("ace-code/src/range"); + import Range = Range_13.Range; import UndoManager_2 = require("ace-code/src/undomanager"); import UndoManager = UndoManager_2.UndoManager; import Renderer_1 = require("ace-code/src/virtual_renderer"); import Renderer = Renderer_1.VirtualRenderer; - export var version: "1.35.0"; + export var version: "1.35.2"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/src/config.js b/src/config.js index b5380028391..ade4d28059c 100644 --- a/src/config.js +++ b/src/config.js @@ -1,9 +1,5 @@ "no use strict"; -/** - * @typedef {import("../ace-internal").Ace.ConfigOptions} ConfigOptions - */ - var lang = require("./lib/lang"); var net = require("./lib/net"); var dom = require("./lib/dom"); @@ -11,7 +7,7 @@ var AppConfig = require("./lib/app_config").AppConfig; module.exports = exports = new AppConfig(); -/** @type {ConfigOptions} */ +/** @type {import("../ace-internal").Ace.ConfigOptions} */ var options = { packaged: false, workerPath: null, @@ -26,9 +22,9 @@ var options = { }; /** - * @template {keyof ConfigOptions} K + * @template {keyof import("../ace-internal").Ace.ConfigOptions} K * @param {K} key - The key of the config option to retrieve. - * @returns {ConfigOptions[K]} - The value of the config option. + * @returns {import("../ace-internal").Ace.ConfigOptions[K]} - The value of the config option. */ exports.get = function(key) { if (!options.hasOwnProperty(key)) @@ -37,9 +33,9 @@ exports.get = function(key) { }; /** - * @template {keyof ConfigOptions} K + * @template {keyof import("../ace-internal").Ace.ConfigOptions} K * @param {K} key - * @param {ConfigOptions[K]} value + * @param {import("../ace-internal").Ace.ConfigOptions[K]} value */ exports.set = function(key, value) { if (options.hasOwnProperty(key)) diff --git a/src/lib/app_config.js b/src/lib/app_config.js index 905998d9f57..ed80d29e5e0 100644 --- a/src/lib/app_config.js +++ b/src/lib/app_config.js @@ -72,7 +72,7 @@ class AppConfig { * @param {Object} obj * @param {string} path * @param {{ [key: string]: any }} options - * @returns {AppConfig} + * @returns {import("../../ace-internal").Ace.AppConfig} */ defineOptions(obj, path, options) { if (!obj.$options) From 05577d6e58bfbbe442a86b8e0bb5fb9c5649181d Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 9 Sep 2024 16:10:17 +0400 Subject: [PATCH 21/33] regenerate after code changes --- ace-ext.d.ts | 4 +- ace-lib.d.ts | 6 + ace-modules.d.ts | 39 +- ace.d.ts | 2167 +++++++++++++++++++++------------------------- package.json | 2 +- 5 files changed, 1038 insertions(+), 1180 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 72fbd666472..21cd1cbaf8a 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -798,7 +798,7 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.35.2"; + version: "1.36.2"; }; edit: (el: string | (HTMLElement & { env?: any; @@ -810,7 +810,7 @@ declare module "ace-code/src/ext/textarea" { EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.35.2"; + version: "1.36.2"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 3206eea5098..936f1bed89c 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -163,6 +163,12 @@ declare module "ace-code/src/lib/default_english_messages" { "gutter-tooltip.aria-label.warning.plural": string; "gutter-tooltip.aria-label.info.singular": string; "gutter-tooltip.aria-label.info.plural": string; + "gutter.annotation.aria-label.security": string; + "gutter.annotation.aria-label.hint": string; + "gutter-tooltip.aria-label.security.singular": string; + "gutter-tooltip.aria-label.security.plural": string; + "gutter-tooltip.aria-label.hint.singular": string; + "gutter-tooltip.aria-label.hint.plural": string; }; } declare module "ace-code/src/lib/app_config" { diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 158385e0642..d10749aed64 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -446,7 +446,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.35.2"; + version: "1.36.2"; }; export = _exports; } @@ -1594,6 +1594,10 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [column] */ addToken(text: string, type: string, row: number, column?: number): void; + hideTokensAfterPosition(row: any, column: any): { + type: string; + value: string; + }[]; removeExtraToken(row: any, column: any): void; /** * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} @@ -2254,6 +2258,10 @@ declare module "ace-code/src/mouse/default_gutter_handler" { singular: any; plural: any; }; + security: { + singular: any; + plural: any; + }; warning: { singular: any; plural: any; @@ -2262,6 +2270,10 @@ declare module "ace-code/src/mouse/default_gutter_handler" { singular: any; plural: any; }; + hint: { + singular: any; + plural: any; + }; }; static annotationsToSummaryString(annotations: any): string; constructor(editor: any); @@ -4450,10 +4462,12 @@ declare module "ace-code/src/marker_group" { range: import("ace-code/src/range").Range; className: string; }; + export type LayerConfig = import("ace-code").Ace.LayerConfig; export type Marker = import("ace-code/src/layer/marker").Marker; /** * @typedef {import("ace-code/src/edit_session").EditSession} EditSession * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem + * @typedef {import("ace-code").Ace.LayerConfig} LayerConfig */ /** * @typedef {import("ace-code/src/layer/marker").Marker} Marker @@ -4461,17 +4475,25 @@ declare module "ace-code/src/marker_group" { export class MarkerGroup { /** * @param {EditSession} session - */ - constructor(session: EditSession); + * @param {{markerType: "fullLine" | "line" | undefined}} [options] Options controlling the behvaiour of the marker. + * User `markerType` to control how the markers which are part of this group will be rendered: + * - `undefined`: uses `text` type markers where only text characters within the range will be highlighted. + * - `fullLine`: will fully highlight all the rows within the range, including the characters before and after the range on the respective rows. + * - `line`: will fully highlight the lines within the range but will only cover the characters between the start and end of the range. + */ + constructor(session: EditSession, options?: { + markerType: "fullLine" | "line" | undefined; + }); + markerType: "line" | "fullLine"; markers: any[]; /**@type {EditSession}*/ session: EditSession; /** * Finds the first marker containing pos * @param {import("ace-code").Ace.Point} pos - * @returns import("ace-code").Ace.MarkerGroupItem + * @returns {import("ace-code").Ace.MarkerGroupItem | undefined} */ - getMarkerAtPosition(pos: import("ace-code").Ace.Point): any; + getMarkerAtPosition(pos: import("ace-code").Ace.Point): import("ace-code").Ace.MarkerGroupItem | undefined; /** * Comparator for Array.sort function, which sorts marker definitions by their positions * @@ -4489,12 +4511,9 @@ declare module "ace-code/src/marker_group" { * @param {any} html * @param {Marker} markerLayer * @param {EditSession} session - * @param {{ firstRow: any; lastRow: any; }} config + * @param {LayerConfig} config */ - update(html: any, markerLayer: Marker, session: EditSession, config: { - firstRow: any; - lastRow: any; - }): void; + update(html: any, markerLayer: Marker, session: EditSession, config: LayerConfig): void; MAX_MARKERS: number; } } diff --git a/ace.d.ts b/ace.d.ts index 6fbcbbd1366..98f985cf298 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,1170 +1,1003 @@ +/// +/// +/// +/// +/// /// -/// - -export namespace Ace { - export type NewLineMode = 'auto' | 'unix' | 'windows'; - - export interface Anchor extends EventEmitter { - getPosition(): Position; - getDocument(): Document; - setPosition(row: number, column: number, noClip?: boolean): void; - detach(): void; - attach(doc: Document): void; - } - - export interface Document extends EventEmitter { - setValue(text: string): void; - getValue(): string; - createAnchor(row: number, column: number): Anchor; - getNewLineCharacter(): string; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - isNewLine(text: string): boolean; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getAllLines(): string[]; - getLength(): number; - getTextRange(range: Range): string; - getLinesForRange(range: Range): string[]; - insert(position: Position, text: string): Position; - insert(position: {row: number, column: number}, text: string): Position; - insertInLine(position: Position, text: string): Position; - insertNewLine(position: Point): Point; - clippedPos(row: number, column: number): Point; - clonePos(pos: Point): Point; - pos(row: number, column: number): Point; - insertFullLines(row: number, lines: string[]): void; - insertMergedLines(position: Position, lines: string[]): Point; - remove(range: Range): Position; - removeInLine(row: number, startColumn: number, endColumn: number): Position; - removeFullLines(firstRow: number, lastRow: number): string[]; - removeNewLine(row: number): void; - replace(range: Range, text: string): Position; - applyDeltas(deltas: Delta[]): void; - revertDeltas(deltas: Delta[]): void; - applyDelta(delta: Delta, doNotValidate?: boolean): void; - revertDelta(delta: Delta): void; - indexToPosition(index: number, startRow: number): Position; - positionToIndex(pos: Position, startRow?: number): number; - } - - export interface FoldLine { - folds: Fold[]; - range: Range; - start: Point; - end: Point; - - shiftRow(shift: number): void; - addFold(fold: Fold): void; - containsRow(row: number): boolean; - walk(callback: Function, endRow?: number, endColumn?: number): void; - getNextFoldTo(row: number, column: number): null | { fold: Fold, kind: string }; - addRemoveChars(row: number, column: number, len: number): void; - split(row: number, column: number): FoldLine; - merge(foldLineNext: FoldLine): void; - idxToPosition(idx: number): Point; - } - - export interface Fold { - range: Range; - start: Point; - end: Point; - foldLine?: FoldLine; - sameRow: boolean; - subFolds: Fold[]; - - setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - addSubFold(fold: Fold): Fold; - restoreRange(range: Range): void; - } - - interface Folding { - getFoldAt(row: number, column: number, side: number): Fold; - getFoldsInRange(range: Range): Fold[]; - getFoldsInRangeList(ranges: Range[]): Fold[]; - getAllFolds(): Fold[]; - getFoldStringAt(row: number, - column: number, - trim?: number, - foldLine?: FoldLine): string | null; - getFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getNextFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getFoldedRowCount(first: number, last: number): number; - addFold(placeholder: string | Fold, range?: Range): Fold; - addFolds(folds: Fold[]): void; - removeFold(fold: Fold): void; - removeFolds(folds: Fold[]): void; - expandFold(fold: Fold): void; - expandFolds(folds: Fold[]): void; - unfold(location: null | number | Point | Range, - expandInner?: boolean): Fold[] | undefined; - isRowFolded(docRow: number, startFoldRow?: FoldLine): boolean; - getFoldRowEnd(docRow: number, startFoldRow?: FoldLine): number; - getFoldRowStart(docRow: number, startFoldRow?: FoldLine): number; - getFoldDisplayLine(foldLine: FoldLine, - endRow: number | null, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - getDisplayLine(row: number, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - toggleFold(tryToUnfold?: boolean): void; - getCommentFoldRange(row: number, - column: number, - dir: number): Range | undefined; - foldAll(startRow?: number, endRow?: number, depth?: number): void; - setFoldStyle(style: string): void; - getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { - range?: Range, - firstRange: Range +declare module "ace-code" { + export namespace Ace { + type Anchor = import("ace-code/src/anchor").Anchor; + type Editor = import("ace-code/src/editor").Editor; + type EditSession = import("ace-code/src/edit_session").EditSession; + type Document = import("ace-code/src/document").Document; + type Fold = import("ace-code/src/edit_session/fold").Fold; + type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + type Range = import("ace-code/src/range").Range; + type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + type UndoManager = import("ace-code/src/undomanager").UndoManager; + type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + type TokenIterator = import("ace-code/src/token_iterator").TokenIterator; + type Selection = import("ace-code/src/selection").Selection; + type Autocomplete = import("ace-code/src/autocomplete").Autocomplete; + type InlineAutocomplete = import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + type CompletionProvider = import("ace-code/src/autocomplete").CompletionProvider; + type AcePopup = import("ace-code/src/autocomplete/popup").AcePopup; + type AceInline = import("ace-code/src/autocomplete/inline").AceInline; + type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + type RangeList = import("ace-code/src/range_list").RangeList; + type FilteredList = import("ace-code/src/autocomplete").FilteredList; + type LineWidgets = import("ace-code/src/line_widgets").LineWidgets; + type SearchBox = import("ace-code/src/ext/searchbox").SearchBox; + type Occur = import("ace-code/src/occur").Occur; + type DefaultHandlers = import("ace-code/src/mouse/default_handlers").DefaultHandlers; + type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; + type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; + type AppConfig = import("ace-code/src/lib/app_config").AppConfig; + type AfterLoadCallback = (err: Error | null, module: unknown) => void; + type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface ConfigOptions { + packaged: boolean; + workerPath: string | null; + modePath: string | null; + themePath: string | null; + basePath: string; + suffix: string; + loadWorkerFromBlob: boolean; + sharedPopups: boolean; + useStrictCSP: boolean | null; + } + export interface Config { + get(key: K): ConfigOptions[K]; + set(key: K, value: ConfigOptions[K]): void; + all(): { + [key: string]: any; + }; + moduleUrl(name: string, component?: string): string; + setModuleUrl(name: string, subst: string): string; + setLoader(cb: LoaderFunction): void; + setModuleLoader(name: string, onLoad: Function): void; + loadModule(moduleName: string | [ + string, + string + ], onLoad?: (module: any) => void): void; + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): void; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any): void; + nls(string: string, params?: { + [x: string]: any; + }): string; + } + interface Theme { + cssClass?: string; + cssText?: string; + padding?: number | string; + isDark?: boolean; + } + interface ScrollBar { + setVisible(visible: boolean): void; + [key: string]: any; + } + interface HScrollbar extends ScrollBar { + setWidth(width: number): void; + } + interface VScrollbar extends ScrollBar { + setHeight(width: number): void; + } + interface LayerConfig { + width: number; + padding: number; + firstRow: number; + firstRowScreen: number; + lastRow: number; + lineHeight: number; + characterWidth: number; + minHeight: number; + maxHeight: number; + offset: number; + height: number; + gutterOffset: number; + } + interface HardWrapOptions { + startRow: number; + endRow: number; + allowMerge?: boolean; + column?: number; + } + interface CommandBarOptions { + maxElementsOnTooltip: number; + alwaysShow: boolean; + showDelay: number; + hideDelay: number; + } + interface ScreenCoordinates { + row: number; + column: number; + side?: 1 | -1; + offsetX?: number; + } + interface Folding { + /** + * Looks up a fold at a given row/column. Possible values for side: + * -1: ignore a fold if fold.start = row/column + * +1: ignore a fold if fold.end = row/column + **/ + getFoldAt(row: number, column: number, side?: number): Ace.Fold; + /** + * Returns all folds in the given range. Note, that this will return folds + **/ + getFoldsInRange(range: Ace.Range | Ace.Delta): Ace.Fold[]; + getFoldsInRangeList(ranges: Ace.Range[] | Ace.Range): Ace.Fold[]; + /** + * Returns all folds in the document + */ + getAllFolds(): Ace.Fold[]; + /** + * Returns the string between folds at the given position. + * E.g. + * foob|arwolrd -> "bar" + * foobarwol|rd -> "world" + * foobarwolrd -> + * + * where | means the position of row/column + * + * The trim option determs if the return string should be trimed according + * to the "side" passed with the trim value: + * + * E.g. + * foob|arwolrd -trim=-1> "b" + * foobarwol|rd -trim=+1> "rld" + * fo|obarwolrd -trim=00> "foo" + */ + getFoldStringAt(row: number, column: number, trim?: number, foldLine?: Ace.FoldLine): string | null; + getFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + /** + * Returns the fold which starts after or contains docRow + */ + getNextFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + getFoldedRowCount(first: number, last: number): number; + /** + * Adds a new fold. + * @returns {Ace.Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + */ + addFold(placeholder: Ace.Fold | string, range?: Ace.Range): Ace.Fold; + addFolds(folds: Ace.Fold[]): void; + removeFold(fold: Ace.Fold): void; + removeFolds(folds: Ace.Fold[]): void; + expandFold(fold: Ace.Fold): void; + expandFolds(folds: Ace.Fold[]): void; + unfold(location?: number | null | Ace.Point | Ace.Range | Ace.Range[], expandInner?: boolean): Ace.Fold[] | undefined; + /** + * Checks if a given documentRow is folded. This is true if there are some + * folded parts such that some parts of the line is still visible. + **/ + isRowFolded(docRow: number, startFoldRow?: Ace.FoldLine): boolean; + getRowFoldEnd(docRow: number, startFoldRow?: Ace.FoldLine): number; + getRowFoldStart(docRow: number, startFoldRow?: Ace.FoldLine): number; + getFoldDisplayLine(foldLine: Ace.FoldLine, endRow?: number | null, endColumn?: number | null, startRow?: number | null, startColumn?: number | null): string; + getDisplayLine(row: number, endColumn: number | null, startRow: number | null, startColumn: number | null): string; + toggleFold(tryToUnfold?: boolean): void; + getCommentFoldRange(row: number, column: number, dir?: number): Ace.Range | undefined; + foldAll(startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function): void; + foldToLevel(level: number): void; + foldAllComments(): void; + setFoldStyle(style: string): void; + foldWidgets: any[]; + getFoldWidget: any; + getFoldWidgetRange: any; + getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { + range?: Ace.Range; + firstRange?: Ace.Range; + }; + onFoldWidgetClick(row: number, e: any): void; + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget(toggleParent?: boolean): void; + updateFoldWidgets(delta: Ace.Delta): void; + tokenizerUpdateFoldWidgets(e: any): void; + } + interface BracketMatch { + findMatchingBracket: (position: Point, chr?: string) => Point; + getBracketRange: (pos: Point) => null | Range; + /** + * Returns: + * * null if there is no any bracket at `pos`; + * * two Ranges if there is opening and closing brackets; + * * one Range if there is only one bracket + */ + getMatchingBracketRanges: (pos: Point, isBackwards?: boolean) => null | Range[]; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + */ + getMatchingTags: (pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + }; + } + interface IRange { + start: Point; + end: Point; + } + interface LineWidget { + el: HTMLElement; + rowCount: number; + hidden: boolean; + column?: number; + row?: number; + session: EditSession; + html?: string; + text?: string; + className?: string; + coverGutter?: boolean; + pixelHeight?: number; + editor: Editor; + coverLine?: boolean; + fixedWidth?: boolean; + fullWidth?: boolean; + screenWidth?: number; + rowsAbove?: number; + lenses?: any[]; + } + type NewLineMode = "auto" | "unix" | "windows"; + interface EditSessionOptions { + wrap: "off" | "free" | "printmargin" | boolean | number; + wrapMethod: "code" | "text" | "auto"; + indentedSoftWrap: boolean; + firstLineNumber: number; + useWorker: boolean; + useSoftTabs: boolean; + tabSize: number; + navigateWithinSoftTabs: boolean; + foldStyle: "markbegin" | "markbeginend" | "manual"; + overwrite: boolean; + newLineMode: NewLineMode; + mode: string; + } + interface VirtualRendererOptions { + animatedScroll: boolean; + showInvisibles: boolean; + showPrintMargin: boolean; + printMarginColumn: number; + printMargin: boolean | number; + showGutter: boolean; + fadeFoldWidgets: boolean; + showFoldWidgets: boolean; + showLineNumbers: boolean; + displayIndentGuides: boolean; + highlightIndentGuides: boolean; + highlightGutterLine: boolean; + hScrollBarAlwaysVisible: boolean; + vScrollBarAlwaysVisible: boolean; + fontSize: string | number; + fontFamily: string; + maxLines: number; + minLines: number; + scrollPastEnd: number; + fixedWidthGutter: boolean; + customScrollbar: boolean; + theme: string; + hasCssTransforms: boolean; + maxPixelHeight: number; + useSvgGutterIcons: boolean; + showFoldedAnnotations: boolean; + useResizeObserver: boolean; + } + interface MouseHandlerOptions { + scrollSpeed: number; + dragDelay: number; + dragEnabled: boolean; + focusTimeout: number; + tooltipFollowsMouse: boolean; + } + interface EditorOptions extends EditSessionOptions, MouseHandlerOptions, VirtualRendererOptions { + selectionStyle: "fullLine" | "screenLine" | "text" | "line"; + highlightActiveLine: boolean; + highlightSelectedWord: boolean; + readOnly: boolean; + copyWithEmptySelection: boolean; + cursorStyle: "ace" | "slim" | "smooth" | "wide"; + mergeUndoDeltas: true | false | "always"; + behavioursEnabled: boolean; + wrapBehavioursEnabled: boolean; + enableAutoIndent: boolean; + enableBasicAutocompletion: boolean | Completer[]; + enableLiveAutocompletion: boolean | Completer[]; + liveAutocompletionDelay: number; + liveAutocompletionThreshold: number; + enableSnippets: boolean; + autoScrollEditorIntoView: boolean; + keyboardHandler: string | null; + placeholder: string; + value: string; + session: EditSession; + relativeLineNumbers: boolean; + enableMultiselect: boolean; + enableKeyboardAccessibility: boolean; + enableCodeLens: boolean; + textInputAriaLabel: string; + enableMobileMenu: boolean; + } + interface EventsBase { + [key: string]: any; + } + interface EditSessionEvents { + /** + * Emitted when the document changes. + * @param delta + */ + "change": (delta: Delta) => void; + /** + * Emitted when the tab size changes, via [[EditSession.setTabSize]]. + * @param tabSize + */ + "changeTabSize": (tabSize: number) => void; + /** + * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. + * @param overwrite + */ + "changeOverwrite": (overwrite: boolean) => void; + /** + * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. + * @param e + */ + "changeBreakpoint": (e: { + row: number; + breakpoint: boolean; + }) => void; + /** + * Emitted when a front marker changes. + * @param e + */ + "changeFrontMarker": (e: { + row: number; + marker: boolean; + }) => void; + /** + * Emitted when a back marker changes. + * @param e + */ + "changeBackMarker": (e: { + row: number; + marker: boolean; + }) => void; + /** + * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. + * @param e + */ + "changeAnnotation": (e: { + row: number; + lines: string[]; + }) => void; + /** + * Emitted when a background tokenizer asynchronously processes new rows. + */ + "tokenizerUpdate": (e: { + data: { + first: string; + last: string; + }; + }) => void; + /** + * Emitted when the current mode changes. + * @param e + */ + "changeMode": (e: any) => void; + /** + * Emitted when the wrap mode changes. + * @param e + */ + "changeWrapMode": (e: any) => void; + /** + * Emitted when the wrapping limit changes. + * @param e + */ + "changeWrapLimit": (e: any) => void; + /** + * Emitted when a code fold is added or removed. + * @param e + */ + "changeFold": (e: any, session: EditSession) => void; + /** + * Emitted when the scroll top changes. + * @param scrollTop The new scroll top value + **/ + "changeScrollTop": (scrollTop: number) => void; + /** + * Emitted when the scroll left changes. + * @param scrollLeft The new scroll left value + **/ + "changeScrollLeft": (scrollLeft: number) => void; + "changeEditor": (e: { + editor: Editor; + }) => void; + } + interface EditorEvents { + "change": (delta: Delta) => void; + "changeSelection": () => void; + "input": () => void; + /** + * Emitted whenever the [[EditSession]] changes. + * @param e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. + **/ + "changeSession": (e: { + oldSession: EditSession; + session: EditSession; + }) => void; + "blur": (e: any) => void; + "mousedown": (e: MouseEvent) => void; + "mousemove": (e: MouseEvent & { + scrollTop?: any; + }, editor?: Editor) => void; + "changeStatus": () => void; + "keyboardActivity": () => void; + "mousewheel": (e: MouseEvent) => void; + "mouseup": (e: MouseEvent) => void; + "beforeEndOperation": (e: any) => void; + "nativecontextmenu": (e: any) => void; + "destroy": () => void; + "focus": () => void; + /** + * Emitted when text is copied. + * @param text The copied text + **/ + "copy": (text: string) => void; + /** + * Emitted when text is pasted. + **/ + "paste": (text: string, event: any) => void; + /** + * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. + * @param data Contains one property, `data`, which indicates the new selection style + **/ + "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; + } + interface AcePopupEvents { + "click": (e: MouseEvent) => void; + "dblclick": (e: MouseEvent) => void; + "tripleclick": (e: MouseEvent) => void; + "quadclick": (e: MouseEvent) => void; + "show": () => void; + "hide": () => void; + "select": (hide: boolean) => void; + "changeHoverMarker": (e: any) => void; + } + interface DocumentEvents { + /** + * Fires whenever the document changes. + * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available: + * * `"insert"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being added + * * `"remove"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being removed + * + **/ + "change": (e: Delta) => void; + "changeNewLineMode": () => void; + } + interface AnchorEvents { + /** + * Fires whenever the anchor position changes. + * Both of these objects have a `row` and `column` property corresponding to the position. + * Events that can trigger this function include [[Anchor.setPosition `setPosition()`]]. + * @param {Object} e An object containing information about the anchor position. It has two properties: + * - `old`: An object describing the old Anchor position + * - `value`: An object describing the new Anchor position + **/ + "change": (e: { + old: Point; + value: Point; + }) => void; + } + interface BackgroundTokenizerEvents { + /** + * Fires whenever the background tokeniziers between a range of rows are going to be updated. + * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + **/ + "update": (e: { + first: number; + last: number; + }) => void; + } + interface SelectionEvents { + /** + * Emitted when the cursor position changes. + **/ + "changeCursor": () => void; + /** + * Emitted when the cursor selection changes. + **/ + "changeSelection": () => void; + } + interface PlaceHolderEvents { + } + interface GutterEvents { + "changeGutterWidth": (width: number) => void; + } + interface TextEvents { + "changeCharacterSize": (e: any) => void; + } + interface VirtualRendererEvents { + "afterRender": (e: any, renderer: VirtualRenderer) => void; + "beforeRender": (e: any, renderer: VirtualRenderer) => void; + } + class EventEmitter { + once(name: K, callback: T[K]): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K, callback: T[K], capturing?: boolean): T[K]; + addEventListener(name: K, callback: T[K], capturing?: boolean): T[K]; + off(name: K, callback: T[K]): void; + removeListener(name: K, callback: T[K]): void; + removeEventListener(name: K, callback: T[K]): void; + removeAllListeners(name?: string): void; + } + interface SearchOptions { + /**The string or regular expression you're looking for*/ + needle: string | RegExp; + preventScroll: boolean; + /**Whether to search backwards from where cursor currently is*/ + backwards: boolean; + /**The starting [[Range]] or cursor position to begin the search*/ + start: Range; + /**Whether or not to include the current line in the search*/ + skipCurrent: boolean; + /**The [[Range]] to search within. Set this to `null` for the whole document*/ + range: Range | null; + preserveCase: boolean; + /**Whether the search is a regular expression or not*/ + regExp: boolean; + /**Whether the search matches only on whole words*/ + wholeWord: boolean; + /**Whether the search ought to be case-sensitive*/ + caseSensitive: boolean; + /**Whether to wrap the search back to the beginning when it hits the end*/ + wrap: boolean; + re: any; + } + interface Point { + row: number; + column: number; + } + type Position = Point; + interface Delta { + action: "insert" | "remove"; + start: Point; + end: Point; + lines: string[]; + id?: number; + folds?: Fold[]; + } + interface Annotation { + row: number; + column: number; + text: string; + type: string; + } + export interface MarkerGroupItem { + range: Range; + className: string; + } + type MarkerGroup = import("ace-code/src/marker_group").MarkerGroup; + export interface Command { + name?: string; + bindKey?: string | { + mac?: string; + win?: string; + }; + readOnly?: boolean; + exec?: (editor?: Editor | any, args?: any) => void; + isAvailable?: (editor: Editor) => boolean; + description?: string; + multiSelectAction?: "forEach" | "forEachLine" | Function; + scrollIntoView?: true | "cursor" | "center" | "selectionPart" | "animate" | "selection" | "none"; + aceCommandGroup?: string; + passEvent?: boolean; + level?: number; + action?: string; + } + type CommandLike = Command | ((editor: Editor) => void) | ((sb: SearchBox) => void); + type KeyboardHandler = Partial & { + attach?: (editor: Editor) => void; + detach?: (editor: Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + }; + export interface MarkerLike { + range?: Range; + type: string; + renderer?: MarkerRenderer; + clazz: string; + inFront?: boolean; + id?: number; + update?: (html: string[], + // TODO maybe define Marker class + marker: any, session: EditSession, config: any) => void; + [key: string]: any; + } + type MarkerRenderer = (html: string[], range: Range, left: number, top: number, config: any) => void; + interface Token { + type: string; + value: string; + index?: number; + start?: number; + } + type BaseCompletion = import("ace-code/src/autocomplete").BaseCompletion; + type SnippetCompletion = import("ace-code/src/autocomplete").SnippetCompletion; + type ValueCompletion = import("ace-code/src/autocomplete").ValueCompletion; + type Completion = import("ace-code/src/autocomplete").Completion; + type HighlightRule = ({ + defaultToken: string; + } | { + include: string; + } | { + todo: string; + } | { + token: string | string[] | ((value: string) => string); + regex: string | RegExp; + next?: string | (() => void); + push?: string; + comment?: string; + caseInsensitive?: boolean; + nextState?: string; + }) & { + [key: string]: any; + }; + type HighlightRulesMap = Record; + type KeywordMapper = (keyword: string) => string; + interface HighlightRules { + addRules(rules: HighlightRulesMap, prefix?: string): void; + getRules(): HighlightRulesMap; + embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; + getEmbeds(): string[]; + normalizeRules(): void; + createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; + } + type FoldWidget = "start" | "end" | ""; + interface FoldMode { + foldingStartMarker: RegExp; + foldingStopMarker?: RegExp; + getFoldWidget(session: EditSession, foldStyle: string, row: number): FoldWidget; + getFoldWidgetRange(session: EditSession, foldStyle: string, row: number): Range | undefined; + indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; + 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 | string[], action: string, editor: Editor, session: EditSession, text: string | Range) => ({ + text: string; + selection: number[]; + } | Range) & { + [key: string]: any; + } | undefined; + type BehaviorMap = Record>; + interface Behaviour { + add(name: string, action: string, callback: BehaviorAction): void; + addBehaviours(behaviours: BehaviorMap): void; + remove(name: string): void; + inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; + getBehaviours(filter?: string[]): BehaviorMap; + } + interface Outdent { + checkOutdent(line: string, input: string): boolean; + autoOutdent(doc: Document, row: number): number | undefined; + } + interface SyntaxMode { + HighlightRules: { + new(config: any): HighlightRules; + }; //TODO: fix this + foldingRules?: FoldMode; + /** + * characters that indicate the start of a line comment + */ + lineCommentStart?: string; + /** + * characters that indicate the start and end of a block comment + */ + blockComment?: { + start: string; + end: string; + }; + tokenRe?: RegExp; + nonTokenRe?: RegExp; + completionKeywords: string[]; + transformAction: BehaviorAction; + path?: string; + getTokenizer(): Tokenizer; + 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 | string[], session: EditSession, pos: Point, prefix: string): Completion[]; + } + interface OptionsBase { + [key: string]: any; + } + class OptionsProvider { + setOptions(optList: Partial): void; + getOptions(optionNames?: Array | Partial): Partial; + setOption(name: K, value: T[K]): void; + getOption(name: K): T[K]; + } + type KeyBinding = import("ace-code/src/keyboard/keybinding").KeyBinding; + interface CommandMap { + [name: string]: Command; + } + type execEventHandler = (obj: { + editor: Editor; + command: Command; + args: any[]; + }) => void; + interface CommandManagerEvents { + on(name: "exec", callback: execEventHandler): Function; + on(name: "afterExec", callback: execEventHandler): Function; + } + type CommandManager = import("ace-code/src/commands/command_manager").CommandManager; + interface SavedSelection { + start: Point; + end: Point; + isBackwards: boolean; + } + var Selection: { + new(session: EditSession): Selection; + }; + interface TextInput { + resetSelection(): void; + setAriaOption(options?: { + activeDescendant: string; + role: string; + setLabel: any; + }): void; + } + type CompleterCallback = (error: any, completions: Completion[]) => void; + interface Completer { + identifierRegexps?: Array; + getCompletions(editor: Editor, session: EditSession, position: Point, prefix: string, callback: CompleterCallback): void; + getDocTooltip?(item: Completion): void | string | Completion; + onSeen?: (editor: Ace.Editor, completion: Completion) => void; + onInsert?: (editor: Ace.Editor, completion: Completion) => void; + cancel?(): void; + id?: string; + triggerCharacters?: string[]; + hideInlinePreview?: boolean; + } + interface CompletionOptions { + matches?: Completion[]; + } + type CompletionProviderOptions = { + exactMatch?: boolean; + ignoreCaption?: boolean; + }; + type GatherCompletionRecord = { + prefix: string; + matches: Completion[]; + finished: boolean; + }; + type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; + type CompletionProviderCallback = (this: import("ace-code/src/autocomplete").Autocomplete, err: Error | undefined, completions: import("ace-code/src/autocomplete").FilteredList, finished: boolean) => void; + type AcePopupNavigation = "up" | "down" | "start" | "end"; + interface EditorMultiSelectProperties { + inMultiSelectMode?: boolean; + /** + * Updates the cursor and marker layers. + **/ + updateSelectionMarkers: () => void; + /** + * Adds the selection and cursor. + * @param orientedRange A range containing a cursor + **/ + addSelectionMarker: (orientedRange: Ace.Range & { + marker?: any; + }) => Ace.Range & { + marker?: any; + }; + /** + * Removes the selection marker. + * @param range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. + **/ + removeSelectionMarker: (range: Ace.Range & { + marker?: any; + }) => void; + removeSelectionMarkers: (ranges: (Ace.Range & { + marker?: any; + })[]) => void; + /** + * Executes a command for each selection range. + * @param cmd The command to execute + * @param [args] Any arguments for the command + **/ + forEachSelection: (cmd: Object, args?: string, options?: Object) => void; + /** + * Removes all the selections except the last added one. + **/ + exitMultiSelectMode: () => void; + getSelectedText: () => string; + /** + * Finds and selects all the occurrences of `needle`. + * @param needle The text to find + * @param options The search options + * @param additive keeps + * @returns {Number} The cumulative count of all found matches + **/ + findAll: (needle?: string, options?: Partial, additive?: boolean) => number; + /** + * Adds a cursor above or below the active cursor. + * @param dir The direction of lines to select: -1 for up, 1 for down + * @param [skip] If `true`, removes the active selection range + */ + selectMoreLines: (dir: number, skip?: boolean) => void; + /** + * Transposes the selected ranges. + * @param {Number} dir The direction to rotate selections + **/ + transposeSelections: (dir: number) => void; + /** + * Finds the next occurrence of text in an active selection and adds it to the selections. + * @param {Number} dir The direction of lines to select: -1 for up, 1 for down + * @param {Boolean} [skip] If `true`, removes the active selection range + * @param {Boolean} [stopAtFirst] + **/ + selectMore: (dir: number, skip?: boolean, stopAtFirst?: boolean) => void; + /** + * Aligns the cursors or selected text. + **/ + alignCursors: () => void; + multiSelect?: any; + } + interface CodeLenseEditorExtension { + codeLensProviders?: any[]; + } + interface ElasticTabstopsEditorExtension { + elasticTabstops?: import("ace-code/src/ext/elastic_tabstops_lite").ElasticTabstopsLite; + } + interface TextareaEditorExtension { + setDisplaySettings?: (settings: any) => void; + } + interface PromptEditorExtension { + cmdLine?: Editor; + } + interface OptionsEditorExtension { + } + interface MultiSelectProperties { + ranges: Ace.Range[] | null; + rangeList: Ace.RangeList | null; + /** + * Adds a range to a selection by entering multiselect mode, if necessary. + * @param {Ace.Range} range The new range to add + * @param {Boolean} [$blockChangeEvents] Whether or not to block changing events + **/ + addRange(range: Ace.Range, $blockChangeEvents?: boolean): any; + inMultiSelectMode: boolean; + /** + * @param {Ace.Range} [range] + **/ + toSingleRange(range?: Ace.Range): void; + /** + * Removes a Range containing pos (if it exists). + * @param {Ace.Point} pos The position to remove, as a `{row, column}` object + **/ + substractPoint(pos: Ace.Point): any; + /** + * Merges overlapping ranges ensuring consistency after changes + **/ + mergeOverlappingRanges(): void; + rangeCount: number; + /** + * Returns a concatenation of all the ranges. + * @returns {Ace.Range[]} + **/ + getAllRanges(): Ace.Range[]; + /** + * Splits all the ranges into lines. + **/ + splitIntoLines(): void; + /** + */ + joinSelections(): void; + /** + **/ + toggleBlockSelection(): void; + /** + * + * Gets list of ranges composing rectangular block on the screen + * + * @param {Ace.ScreenCoordinates} screenCursor The cursor to use + * @param {Ace.ScreenCoordinates} screenAnchor The anchor to use + * @param {Boolean} [includeEmptyLines] If true, this includes ranges inside the block which are empty due to clipping + * @returns {Ace.Range[]} + **/ + rectangularRangeBlock(screenCursor: Ace.ScreenCoordinates, screenAnchor: Ace.ScreenCoordinates, includeEmptyLines?: boolean): Ace.Range[]; + index?: number; + } + type AcePopupEventsCombined = Ace.EditorEvents & Ace.AcePopupEvents; + type AcePopupWithEditor = Ace.EventEmitter & Ace.Editor; + type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; + type TooltipCommandFunction = (editor: Ace.Editor) => T; + export interface TooltipCommand extends Ace.Command { + enabled: TooltipCommandFunction | boolean; + getValue?: TooltipCommandFunction; + type: "button" | "text" | "checkbox"; + iconCssClass?: string; + cssClass?: string; + } + export type CommandBarTooltip = import("ace-code/src/ext/command_bar").CommandBarTooltip; + export type TokenizeResult = Array>; + } + export const config: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): import("ace-code").Ace.AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K, callback: any, capturing?: boolean): any; + addEventListener(name: K, callback: any, capturing?: boolean): any; + off(name: K, callback: any): void; + removeListener(name: K, callback: any): void; + removeEventListener(name: K, callback: any): void; + removeAllListeners(name?: string): void; + get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; + set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; + all: () => import("ace-code").Ace.ConfigOptions; + moduleUrl: (name: string, component?: string) => string; + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.36.2"; }; - toggleFoldWidget(toggleParent?: boolean): void; - updateFoldWidgets(delta: Delta): void; - } - - export interface Range { - start: Point; - end: Point; - - isEqual(range: Range): boolean; - toString(): string; - contains(row: number, column: number): boolean; - compareRange(range: Range): number; - comparePoint(p: Point): number; - containsRange(range: Range): boolean; - intersects(range: Range): boolean; - isEnd(row: number, column: number): boolean; - isStart(row: number, column: number): boolean; - setStart(row: number, column: number): void; - setEnd(row: number, column: number): void; - inside(row: number, column: number): boolean; - insideStart(row: number, column: number): boolean; - insideEnd(row: number, column: number): boolean; - compare(row: number, column: number): number; - compareStart(row: number, column: number): number; - compareEnd(row: number, column: number): number; - compareInside(row: number, column: number): number; - clipRows(firstRow: number, lastRow: number): Range; - extend(row: number, column: number): Range; - isEmpty(): boolean; - isMultiLine(): boolean; - clone(): Range; - collapseRows(): Range; - toScreenRange(session: EditSession): Range; - moveBy(row: number, column: number): void; - } - - export interface EditSessionOptions { - wrap: "off" | "free" | "printmargin" | boolean | number; - wrapMethod: 'code' | 'text' | 'auto'; - indentedSoftWrap: boolean; - firstLineNumber: number; - useWorker: boolean; - useSoftTabs: boolean; - tabSize: number; - navigateWithinSoftTabs: boolean; - foldStyle: 'markbegin' | 'markbeginend' | 'manual'; - overwrite: boolean; - newLineMode: NewLineMode; - mode: string; - } - - export interface VirtualRendererOptions { - animatedScroll: boolean; - showInvisibles: boolean; - showPrintMargin: boolean; - printMarginColumn: number; - printMargin: boolean | number; - showGutter: boolean; - fadeFoldWidgets: boolean; - showFoldWidgets: boolean; - showLineNumbers: boolean; - displayIndentGuides: boolean; - highlightIndentGuides: boolean; - highlightGutterLine: boolean; - hScrollBarAlwaysVisible: boolean; - vScrollBarAlwaysVisible: boolean; - fontSize: number; - fontFamily: string; - maxLines: number; - minLines: number; - scrollPastEnd: number; - fixedWidthGutter: boolean; - customScrollbar: boolean; - theme: string; - hasCssTransforms: boolean; - maxPixelHeight: number; - useSvgGutterIcons: boolean; - showFoldedAnnotations: boolean; - } - - export interface MouseHandlerOptions { - scrollSpeed: number; - dragDelay: number; - dragEnabled: boolean; - focusTimeout: number; - tooltipFollowsMouse: boolean; - } - - export interface EditorOptions extends EditSessionOptions, - MouseHandlerOptions, - VirtualRendererOptions { - selectionStyle: string; - highlightActiveLine: boolean; - highlightSelectedWord: boolean; - readOnly: boolean; - copyWithEmptySelection: boolean; - cursorStyle: 'ace' | 'slim' | 'smooth' | 'wide'; - mergeUndoDeltas: true | false | 'always'; - behavioursEnabled: boolean; - wrapBehavioursEnabled: boolean; - enableAutoIndent: boolean; - enableBasicAutocompletion: boolean | Completer[]; - enableLiveAutocompletion: boolean | Completer[]; - liveAutocompletionDelay: number; - liveAutocompletionThreshold: number; - enableSnippets: boolean; - autoScrollEditorIntoView: boolean; - keyboardHandler: string | null; - placeholder: string; - value: string; - session: EditSession; - relativeLineNumbers: boolean; - enableMultiselect: boolean; - enableKeyboardAccessibility: boolean; - textInputAriaLabel: string; - enableMobileMenu: boolean; - } - - export interface SearchOptions { - needle: string | RegExp; - preventScroll: boolean; - backwards: boolean; - start: Range; - skipCurrent: boolean; - range: Range; - preserveCase: boolean; - regExp: boolean; - wholeWord: boolean; - caseSensitive: boolean; - wrap: boolean; - } - - export interface EventEmitter { - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - removeAllListeners(name?: string): void; - } - - export interface Point { - row: number; - column: number; - } - - export interface Delta { - action: 'insert' | 'remove'; - start: Point; - end: Point; - lines: string[]; - } - - export interface Annotation { - row?: number; - column?: number; - text: string; - type: string; - } - - export interface MarkerGroupItem { - range: Range; - className: string; - } - - export class MarkerGroup { - constructor(session: EditSession, options?: {markerType?: "fullLine" | "line"}); - setMarkers(markers: MarkerGroupItem[]): void; - getMarkerAtPosition(pos: Position): MarkerGroupItem | undefined; - } - - - export interface Command { - name?: string; - bindKey?: string | { mac?: string, win?: string }; - readOnly?: boolean; - exec: (editor: Editor, args?: any) => void; - } - - export type CommandLike = Command | ((editor: Editor) => void); - - export interface KeyboardHandler { - handleKeyboard: Function; - } - - export interface MarkerLike { - range?: Range; - type: string; - renderer?: MarkerRenderer; - clazz: string; - inFront: boolean; - id: number; - update?: (html: string[], - // TODO maybe define Marker class - marker: any, - session: EditSession, - config: any) => void; - } - - export type MarkerRenderer = (html: string[], - range: Range, - left: number, - top: number, - config: any) => void; - - export interface Token { - type: string; - value: string; - index?: number; - start?: number; - } - - interface BaseCompletion { - score?: number; - meta?: string; - caption?: string; - docHTML?: string; - docText?: string; - completerId?: string; - } - - export interface SnippetCompletion extends BaseCompletion { - snippet: string; - } - - export interface ValueCompletion extends BaseCompletion { - value: string; - } - - export type Completion = SnippetCompletion | ValueCompletion - - export interface Tokenizer { - removeCapturingGroups(src: string): string; - createSplitterRegexp(src: string, flag?: string): RegExp; - getLineTokens(line: string, startState: string | string[]): Token[]; - } - - interface TokenIterator { - getCurrentToken(): Token; - getCurrentTokenColumn(): number; - getCurrentTokenRow(): number; - getCurrentTokenPosition(): Point; - getCurrentTokenRange(): Range; - stepBackward(): Token; - stepForward(): Token; - } - - export type HighlightRule = {defaultToken: string} | {include: string} | {todo: string} | { - token: string | string[] | ((value: string) => string); - regex: string | RegExp; - next?: string; - push?: string; - comment?: string; - caseInsensitive?: boolean; - } - - export type HighlightRulesMap = Record; - - export type KeywordMapper = (keyword: string) => string; - - export interface HighlightRules { - addRules(rules: HighlightRulesMap, prefix?: string): void; - getRules(): HighlightRulesMap; - embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; - getEmbeds(): string[]; - normalizeRules(): void; - createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; - } - - export interface FoldMode { - foldingStartMarker: RegExp; - foldingStopMarker?: RegExp; - getFoldWidget(session: EditSession, foldStyle: string, row: number): string; - getFoldWidgetRange(session: EditSession, foldStyle: string, row: number, forceMultiline?: boolean): Range | undefined; - indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; - 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) => {text: string, selection: number[]} | Range | undefined; - type BehaviorMap = Record>; - - export interface Behaviour { - add(name: string, action: string, callback: BehaviorAction): void; - addBehaviours(behaviours: BehaviorMap): void; - remove(name: string): void; - inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; - getBehaviours(filter: string[]): BehaviorMap; - } - - export interface Outdent { - checkOutdent(line: string, input: string): boolean; - autoOutdent(doc: Document, row: number): number | undefined; - } - - export interface SyntaxMode { - HighlightRules: new () => HighlightRules; - foldingRules?: FoldMode; - $behaviour?: Behaviour; - $defaultBehaviour?: Behaviour; - lineCommentStart?: 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: Document, row: number): void; - // TODO implement WorkerClient types - createWorker(session: EditSession): any; - createModeDelegates(mapping: { [key: string]: string }): void; - transformAction: BehaviorAction; - getKeywords(append?: boolean): Array; - getCompletions(state: string, - session: EditSession, - pos: Point, - prefix: string): Completion[]; - } - - type AfterLoadCallback = (err: Error | null, module: unknown) => void; - type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; - - export interface Config { - get(key: string): any; - set(key: string, value: any): void; - all(): { [key: string]: any }; - moduleUrl(name: string, component?: string): string; - setModuleUrl(name: string, subst: string): string; - setLoader(cb: LoaderFunction): void; - setModuleLoader(name: string, onLoad: Function): void; - loadModule(moduleName: string | [string, string], - onLoad?: (module: any) => void): void; - init(packaged: any): any; - defineOptions(obj: any, path: string, options: { [key: string]: any }): Config; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): void; - setDefaultValues(path: string, optionHash: { [key: string]: any }): void; - } - - export interface OptionsProvider { - setOptions(optList: { [key: string]: any }): void; - getOptions(optionNames?: string[] | { [key: string]: any }): { [key: string]: any }; - setOption(name: string, value: any): void; - getOption(name: string): any; - } - - export interface UndoManager { - addSession(session: EditSession): void; - add(delta: Delta, allowMerge: boolean, session: EditSession): void; - addSelection(selection: string, rev?: number): void; - startNewGroup(): void; - markIgnored(from: number, to?: number): void; - getSelection(rev: number, after?: boolean): { value: string, rev: number }; - getRevision(): number; - getDeltas(from: number, to?: number): Delta[]; - undo(session: EditSession, dontSelect?: boolean): void; - redo(session: EditSession, dontSelect?: boolean): void; - reset(): void; - canUndo(): boolean; - canRedo(): boolean; - bookmark(rev?: number): void; - isAtBookmark(): boolean; - hasUndo(): boolean; - hasRedo(): boolean; - isClean(): boolean; - markClean(rev?: number): void; - toJSON(): object; - fromJSON(json: object): void; - } - - export interface Position { - row: number, - column: number - } - - export interface EditSession extends EventEmitter, OptionsProvider, Folding { - selection: Selection; - - // TODO: define BackgroundTokenizer - - on(name: 'changeFold', - callback: (obj: { data: Fold, action: string }) => void): Function; - on(name: 'changeScrollLeft', callback: (scrollLeft: number) => void): Function; - on(name: 'changeScrollTop', callback: (scrollTop: number) => void): Function; - on(name: 'tokenizerUpdate', - callback: (obj: { data: { first: number, last: number } }) => void): Function; - on(name: 'change', callback: () => void): Function; - on(name: 'changeTabSize', callback: () => void): Function; - - - setOption(name: T, value: EditSessionOptions[T]): void; - getOption(name: T): EditSessionOptions[T]; - - readonly doc: Document; - - setDocument(doc: Document): void; - getDocument(): Document; - resetCaches(): void; - setValue(text: string): void; - getValue(): string; - getSelection(): Selection; - getState(row: number): string; - getTokens(row: number): Token[]; - getTokenAt(row: number, column: number): Token | null; - setUndoManager(undoManager: UndoManager): void; - markUndoGroup(): void; - getUndoManager(): UndoManager; - getTabString(): string; - setUseSoftTabs(val: boolean): void; - getUseSoftTabs(): boolean; - setTabSize(tabSize: number): void; - getTabSize(): number; - isTabStop(position: Position): boolean; - setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; - getNavigateWithinSoftTabs(): boolean; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - addGutterDecoration(row: number, className: string): void; - removeGutterDecoration(row: number, className: string): void; - getBreakpoints(): string[]; - setBreakpoints(rows: number[]): void; - clearBreakpoints(): void; - setBreakpoint(row: number, className: string): void; - clearBreakpoint(row: number): void; - addMarker(range: Range, - className: string, - type: "fullLine" | "screenLine" | "text" | MarkerRenderer, - inFront?: boolean): number; - addDynamicMarker(marker: MarkerLike, inFront: boolean): MarkerLike; - removeMarker(markerId: number): void; - getMarkers(inFront?: boolean): {[id: number]: MarkerLike}; - highlight(re: RegExp): void; - highlightLines(startRow: number, - endRow: number, - className: string, - inFront?: boolean): Range; - setAnnotations(annotations: Annotation[]): void; - getAnnotations(): Annotation[]; - clearAnnotations(): void; - getWordRange(row: number, column: number): Range; - getAWordRange(row: number, column: number): Range; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - setUseWorker(useWorker: boolean): void; - getUseWorker(): boolean; - setMode(mode: string | SyntaxMode, callback?: () => void): void; - getMode(): SyntaxMode; - setScrollTop(scrollTop: number): void; - getScrollTop(): number; - setScrollLeft(scrollLeft: number): void; - getScrollLeft(): number; - getScreenWidth(): number; - getLineWidgetMaxWidth(): number; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getLength(): number; - getTextRange(range: Range): string; - insert(position: Position, text: string): void; - remove(range: Range): void; - removeFullLines(firstRow: number, lastRow: number): void; - undoChanges(deltas: Delta[], dontSelect?: boolean): void; - redoChanges(deltas: Delta[], dontSelect?: boolean): void; - setUndoSelect(enable: boolean): void; - replace(range: Range, text: string): void; - moveText(fromRange: Range, toPosition: Position, copy?: boolean): void; - indentRows(startRow: number, endRow: number, indentString: string): void; - outdentRows(range: Range): void; - moveLinesUp(firstRow: number, lastRow: number): void; - moveLinesDown(firstRow: number, lastRow: number): void; - duplicateLines(firstRow: number, lastRow: number): void; - setUseWrapMode(useWrapMode: boolean): void; - getUseWrapMode(): boolean; - setWrapLimitRange(min: number, max: number): void; - adjustWrapLimit(desiredLimit: number): boolean; - getWrapLimit(): number; - setWrapLimit(limit: number): void; - getWrapLimitRange(): { min: number, max: number }; - getRowLineCount(row: number): number; - getRowWrapIndent(screenRow: number): number; - getScreenLastRowColumn(screenRow: number): number; - getDocumentLastRowColumn(docRow: number, docColumn: number): number; - getdocumentLastRowColumnPosition(docRow: number, docColumn: number): Position; - getRowSplitData(row: number): string | undefined; - getScreenTabSize(screenColumn: number): number; - screenToDocumentRow(screenRow: number, screenColumn: number): number; - screenToDocumentColumn(screenRow: number, screenColumn: number): number; - screenToDocumentPosition(screenRow: number, - screenColumn: number, - offsetX?: number): Position; - documentToScreenPosition(docRow: number, docColumn: number): Position; - documentToScreenPosition(position: Position): Position; - documentToScreenColumn(row: number, docColumn: number): number; - documentToScreenRow(docRow: number, docColumn: number): number; - getScreenLength(): number; - getPrecedingCharacter(): string; - toJSON(): Object; - destroy(): void; - } - - export interface KeyBinding { - setDefaultHandler(handler: KeyboardHandler): void; - setKeyboardHandler(handler: KeyboardHandler): void; - addKeyboardHandler(handler: KeyboardHandler, pos?: number): void; - removeKeyboardHandler(handler: KeyboardHandler): boolean; - getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - onCommandKey(e: any, hashId: number, keyCode: number): boolean; - onTextInput(text: string): boolean; - } - - interface CommandMap { - [name: string]: Command; - } - - type execEventHandler = (obj: { - editor: Editor, - command: Command, - args: any[] - }) => void; - - export interface CommandManager extends EventEmitter { - byName: CommandMap, - commands: CommandMap, - on(name: 'exec', callback: execEventHandler): Function; - on(name: 'afterExec', callback: execEventHandler): Function; - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - - exec(command: string | string[] | Command, editor: Editor, args: any): boolean; - canExecute(command: string | Command, editor: Editor): boolean; - toggleRecording(editor: Editor): void; - replay(editor: Editor): void; - addCommand(command: Command): void; - addCommands(command: Command[]): void; - removeCommand(command: Command | string, keepCommand?: boolean): void; - removeCommands(command: Command[]): void; - bindKey(key: string | { mac?: string, win?: string}, - command: CommandLike, - position?: number): void; - bindKeys(keys: {[s: string]: Function}): void; - parseKeys(keyPart: string): {key: string, hashId: number}; - findKeyCommand(hashId: number, keyString: string): string | undefined; - handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: string | number): void | {command: string}; - getStatusText(editor: Editor, data: {}): string; - } - - export interface VirtualRenderer extends OptionsProvider, EventEmitter { - readonly container: HTMLElement; - readonly scroller: HTMLElement; - readonly content: HTMLElement; - readonly characterWidth: number; - readonly lineHeight: number; - readonly scrollLeft: number; - readonly scrollTop: number; - readonly $padding: number; - - setOption(name: T, value: VirtualRendererOptions[T]): void; - getOption(name: T): VirtualRendererOptions[T]; - - setSession(session: EditSession): void; - updateLines(firstRow: number, lastRow: number, force?: boolean): void; - updateText(): void; - updateFull(force?: boolean): void; - updateFontSize(): void; - adjustWrapLimit(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: boolean): void; - getPrintMarginColumn(): boolean; - setShowGutter(show: boolean): void; - getShowGutter(): boolean; - setFadeFoldWidgets(show: boolean): void; - getFadeFoldWidgets(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - getContainerElement(): HTMLElement; - getMouseEventTarget(): HTMLElement; - getTextAreaContainer(): HTMLElement; - getFirstVisibleRow(): number; - getFirstFullyVisibleRow(): number; - getLastFullyVisibleRow(): number; - getLastVisibleRow(): number; - setPadding(padding: number): void; - setScrollMargin(top: number, - bottom: number, - left: number, - right: number): void; - setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getHScrollBarAlwaysVisible(): boolean; - setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getVScrollBarAlwaysVisible(): boolean; - freeze(): void; - unfreeze(): void; - updateFrontMarkers(): void; - updateBackMarkers(): void; - updateBreakpoints(): void; - setAnnotations(annotations: Annotation[]): void; - updateCursor(): void; - hideCursor(): void; - showCursor(): void; - scrollSelectionIntoView(anchor: Position, - lead: Position, - offset?: number): void; - scrollCursorIntoView(cursor: Position, offset?: number): void; - getScrollTop(): number; - getScrollLeft(): number; - getScrollTopRow(): number; - getScrollBottomRow(): number; - scrollToRow(row: number): void; - alignCursor(cursor: Position | number, alignment: number): number; - scrollToLine(line: number, - center: boolean, - animate: boolean, - callback: () => void): void; - animateScrolling(fromValue: number, callback: () => void): void; - scrollToY(scrollTop: number): void; - scrollToX(scrollLeft: number): void; - scrollTo(x: number, y: number): void; - scrollBy(deltaX: number, deltaY: number): void; - isScrollableBy(deltaX: number, deltaY: number): boolean; - textToScreenCoordinates(row: number, column: number): { pageX: number, pageY: number}; - pixelToScreenCoordinates(x: number, y: number): {row: number, column: number, side: 1|-1, offsetX: number}; - visualizeFocus(): void; - visualizeBlur(): void; - showComposition(position: number): void; - setCompositionText(text: string): void; - hideComposition(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string, include?: boolean): void; - unsetStyle(style: string): void; - setCursorStyle(style: string): void; - setMouseCursor(cursorStyle: string): void; - attachToShadowRoot(): void; - destroy(): void; - } - - - export interface Selection extends EventEmitter { - moveCursorWordLeft(): void; - moveCursorWordRight(): void; - fromOrientedRange(range: Range): void; - setSelectionRange(match: any): void; - getAllRanges(): Range[]; - addRange(range: Range): void; - isEmpty(): boolean; - isMultiLine(): boolean; - setCursor(row: number, column: number): void; - setAnchor(row: number, column: number): void; - getAnchor(): Position; - getCursor(): Position; - isBackwards(): boolean; - getRange(): Range; - clearSelection(): void; - selectAll(): void; - setRange(range: Range, reverse?: boolean): void; - selectTo(row: number, column: number): void; - selectToPosition(pos: any): void; - selectUp(): void; - selectDown(): void; - selectRight(): void; - selectLeft(): void; - selectLineStart(): void; - selectLineEnd(): void; - selectFileEnd(): void; - selectFileStart(): void; - selectWordRight(): void; - selectWordLeft(): void; - getWordRange(): void; - selectWord(): void; - selectAWord(): void; - selectLine(): void; - moveCursorUp(): void; - moveCursorDown(): void; - moveCursorLeft(): void; - moveCursorRight(): void; - moveCursorLineStart(): void; - moveCursorLineEnd(): void; - moveCursorFileEnd(): void; - moveCursorFileStart(): void; - moveCursorLongWordRight(): void; - moveCursorLongWordLeft(): void; - moveCursorBy(rows: number, chars: number): void; - moveCursorToPosition(position: any): void; - moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - - toJSON(): SavedSelection | SavedSelection[]; - fromJSON(selection: SavedSelection | SavedSelection[]): void; - } - interface SavedSelection { - start: Point; - end: Point; - isBackwards: boolean; - } - - var Selection: { - new(session: EditSession): Selection; - } - - export interface TextInput { - resetSelection(): void; - setAriaOption(activeDescendant: string, role: string): void; - } - - export interface Editor extends OptionsProvider, EventEmitter { - container: HTMLElement; - renderer: VirtualRenderer; - id: string; - commands: CommandManager; - keyBinding: KeyBinding; - session: EditSession; - selection: Selection; - textInput: TextInput; - - on(name: 'blur', callback: (e: Event) => void): void; - on(name: 'input', callback: () => void): void; - on(name: 'change', callback: (delta: Delta) => void): void; - on(name: 'changeSelectionStyle', callback: (obj: { data: string }) => void): void; - on(name: 'changeSession', - callback: (obj: { session: EditSession, oldSession: EditSession }) => void): void; - on(name: 'copy', callback: (obj: { text: string }) => void): void; - on(name: 'focus', callback: (e: Event) => void): void; - on(name: 'paste', callback: (obj: { text: string }) => void): void; - on(name: 'mousemove', callback: (e: any) => void): void; - on(name: 'mouseup', callback: (e: any) => void): void; - on(name: 'mousewheel', callback: (e: any) => void): void; - on(name: 'click', callback: (e: any) => void): void; - on(name: 'guttermousedown', callback: (e: any) => void): void; - on(name: 'gutterkeydown', callback: (e: any) => void): void; - - onPaste(text: string, event: any): void; - - setOption(name: T, value: EditorOptions[T]): void; - getOption(name: T): EditorOptions[T]; - - setKeyboardHandler(keyboardHandler: string, callback?: () => void): void; - setKeyboardHandler(keyboardHandler: KeyboardHandler|null): void; - getKeyboardHandler(): string; - setSession(session: EditSession | undefined): void; - getSession(): EditSession; - setValue(val: string, cursorPos?: number): string; - getValue(): string; - getSelection(): Selection; - resize(force?: boolean): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string): void; - unsetStyle(style: string): void; - getFontSize(): string; - setFontSize(size: number|string): void; - focus(): void; - isFocused(): boolean; - blur(): void; - getSelectedText(): string; - getCopyText(): string; - execCommand(command: string | string[], args?: any): boolean; - insert(text: string, pasted?: boolean): void; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - setScrollSpeed(speed: number): void; - getScrollSpeed(): number; - setDragDelay(dragDelay: number): void; - getDragDelay(): number; - setSelectionStyle(val: string): void; - getSelectionStyle(): string; - setHighlightActiveLine(shouldHighlight: boolean): void; - getHighlightActiveLine(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - setHighlightSelectedWord(shouldHighlight: boolean): void; - getHighlightSelectedWord(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: number): void; - getPrintMarginColumn(): number; - setReadOnly(readOnly: boolean): void; - getReadOnly(): boolean; - setBehavioursEnabled(enabled: boolean): void; - getBehavioursEnabled(): boolean; - setWrapBehavioursEnabled(enabled: boolean): void; - getWrapBehavioursEnabled(): boolean; - setShowFoldWidgets(show: boolean): void; - getShowFoldWidgets(): boolean; - setFadeFoldWidgets(fade: boolean): void; - getFadeFoldWidgets(): boolean; - remove(dir?: 'left' | 'right'): void; - removeWordRight(): void; - removeWordLeft(): void; - removeLineToEnd(): void; - splitLine(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - transposeLetters(): void; - toLowerCase(): void; - toUpperCase(): void; - indent(): void; - blockIndent(): void; - blockOutdent(): void; - sortLines(): void; - toggleCommentLines(): void; - toggleBlockComment(): void; - modifyNumber(amount: number): void; - removeLines(): void; - duplicateSelection(): void; - moveLinesDown(): void; - moveLinesUp(): void; - moveText(range: Range, toPosition: Point, copy?: boolean): Range; - copyLinesUp(): void; - copyLinesDown(): void; - getFirstVisibleRow(): number; - getLastVisibleRow(): number; - isRowVisible(row: number): boolean; - isRowFullyVisible(row: number): boolean; - selectPageDown(): void; - selectPageUp(): void; - gotoPageDown(): void; - gotoPageUp(): void; - scrollPageDown(): void; - scrollPageUp(): void; - scrollToRow(row: number): void; - scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void; - centerSelection(): void; - getCursorPosition(): Point; - getCursorPositionScreen(): Point; - getSelectionRange(): Range; - selectAll(): void; - clearSelection(): void; - moveCursorTo(row: number, column: number): void; - moveCursorToPosition(pos: Point): void; - jumpToMatching(select: boolean, expand: boolean): void; - gotoLine(lineNumber: number, column: number, animate: boolean): void; - navigateTo(row: number, column: number): void; - navigateUp(times?: number): void; - navigateDown(times?: number): void; - navigateLeft(times?: number): void; - navigateRight(times?: number): void; - navigateLineStart(): void; - navigateLineEnd(): void; - navigateFileEnd(): void; - navigateFileStart(): void; - navigateWordRight(): void; - navigateWordLeft(): void; - replace(replacement: string, options?: Partial): number; - replaceAll(replacement: string, options?: Partial): number; - getLastSearchOptions(): Partial; - find(needle: string | RegExp, options?: Partial, animate?: boolean): Ace.Range | undefined; - findNext(options?: Partial, animate?: boolean): void; - findPrevious(options?: Partial, animate?: boolean): void; - findAll(needle: string | RegExp, options?: Partial, additive?: boolean): number; - undo(): void; - redo(): void; - destroy(): void; - setAutoScrollEditorIntoView(enable: boolean): void; - completers: Completer[]; - } - - type CompleterCallback = (error: any, completions: Completion[]) => void; - - interface Completer { - identifierRegexps?: Array, - getCompletions(editor: Editor, - session: EditSession, - position: Point, - prefix: string, - callback: CompleterCallback): void; - getDocTooltip?(item: Completion): undefined | string | Completion; - onSeen?: (editor: Ace.Editor, completion: Completion) => void; - onInsert?: (editor: Ace.Editor, completion: Completion) => void; - cancel?(): void; - id?: string; - triggerCharacters?: string[]; - hideInlinePreview?: boolean; - } - - export class AceInline { - show(editor: Editor, completion: Completion, prefix: string): void; - isOpen(): void; - hide(): void; - destroy(): void; - } - - interface CompletionOptions { - matches?: Completion[]; - } - - type CompletionProviderOptions = { - exactMatch?: boolean; - ignoreCaption?: boolean; - } - - type CompletionRecord = { - all: Completion[]; - filtered: Completion[]; - filterText: string; - } | CompletionProviderOptions - - type GatherCompletionRecord = { - prefix: string; - matches: Completion[]; - finished: boolean; - } - - type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; - type CompletionProviderCallback = (err: Error | undefined, completions: CompletionRecord, finished: boolean) => void; - - export class CompletionProvider { - insertByIndex(editor: Editor, index: number, options: CompletionProviderOptions): boolean; - insertMatch(editor: Editor, data: Completion, options: CompletionProviderOptions): boolean; - completions: CompletionRecord; - gatherCompletions(editor: Editor, callback: CompletionCallbackFunction): boolean; - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: CompletionProviderCallback): void; - detach(): void; - } - - export class Autocomplete { - constructor(); - autoInsert?: boolean; - autoSelect?: boolean; - autoShown?: boolean; - exactMatch?: boolean; - inlineEnabled?: boolean; - parentNode?: HTMLElement; - setSelectOnHover?: Boolean; - stickySelectionDelay?: Number; - ignoreCaption?: Boolean; - showLoadingState?: Boolean; - emptyMessage?(prefix: String): String; - getPopup(): AcePopup; - showPopup(editor: Editor, options: CompletionOptions): void; - detach(): void; - destroy(): void; - } - - type AcePopupNavigation = "up" | "down" | "start" | "end"; - - export class AcePopup { - constructor(parentNode: HTMLElement); - setData(list: Completion[], filterText: string): void; - getData(row: number): Completion; - getRow(): number; - getRow(line: number): void; - hide(): void; - show(pos: Point, lineHeight: number, topdownOnly: boolean): void; - tryShow(pos: Point, lineHeight: number, anchor: "top" | "bottom" | undefined, forceShow?: boolean): boolean; - goTo(where: AcePopupNavigation): void; - } -} - - -export const version: string; -export const config: Ace.Config; -export function require(name: string): any; -export function edit(el: Element | string, options?: Partial): Ace.Editor; -export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession; -export const VirtualRenderer: { - new(container: HTMLElement, theme?: string): Ace.VirtualRenderer; -}; -export const EditSession: { - new(text: string | Ace.Document, mode?: Ace.SyntaxMode): Ace.EditSession; -}; -export const UndoManager: { - new(): Ace.UndoManager; -}; -export const Editor: { - new(): Ace.Editor; -}; -export const Range: { - new(startRow: number, startColumn: number, endRow: number, endColumn: number): Ace.Range; - fromPoints(start: Ace.Point, end: Ace.Point): Ace.Range; - comparePoints(p1: Ace.Point, p2: Ace.Point): number; -}; - - -type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; - -type TooltipCommandFunction = (editor: Ace.Editor) => T; - -interface TooltipCommand extends Ace.Command { - enabled: TooltipCommandFunction | boolean, - getValue?: TooltipCommandFunction, - type: "button" | "text" | "checkbox" - iconCssClass: string, - cssClass: string -} - -export class InlineAutocomplete { - constructor(); - getInlineRenderer(): Ace.AceInline; - getInlineTooltip(): CommandBarTooltip; - getCompletionProvider(): Ace.CompletionProvider; - show(editor: Ace.Editor): void; - isOpen(): boolean; - detach(): void; - destroy(): void; - goTo(action: InlineAutocompleteAction): void; - tooltipEnabled: boolean; - commands: Record - getIndex(): number; - setIndex(value: number): void; - getLength(): number; - getData(index?: number): Ace.Completion | undefined; - updateCompletions(options: Ace.CompletionOptions): void; -} - -export class CommandBarTooltip { - constructor(parentElement: HTMLElement); - registerCommand(id: string, command: TooltipCommand): void; - attach(editor: Ace.Editor): void; - updatePosition(): void; - update(): void; - isShown(): boolean; - getAlwaysShow(): boolean; - setAlwaysShow(alwaysShow: boolean): void; - detach(): void; - destroy(): void; + export function edit(el: string | (HTMLElement & { + env?: any; + value?: any; + }), options?: any): Editor; + export function createEditSession(text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode): EditSession; + import Editor_5 = require("ace-code/src/editor"); + import Editor = Editor_5.Editor; + import EditSession_3 = require("ace-code/src/edit_session"); + import EditSession = EditSession_3.EditSession; + import Range_13 = require("ace-code/src/range"); + import Range = Range_13.Range; + import UndoManager_2 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_2.UndoManager; + import Renderer_1 = require("ace-code/src/virtual_renderer"); + import Renderer = Renderer_1.VirtualRenderer; + export var version: "1.36.2"; + export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/package.json b/package.json index b151a3cb00d..b4178295213 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "^8.20.0", "istanbul": "^0.4.5", "standard-version": "^9.3.2", - "typescript": "^5.2.2" + "typescript": "^5.5.4" }, "mappings": { "ace": "." From 0ede0d810ae3fd123864a88b853ea1d980a54518 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 30 Sep 2024 19:21:28 +0400 Subject: [PATCH 22/33] add new events; improve EventEmitter method declarations; fix Config type --- ace-internal.d.ts | 110 +++++++++++++++------------------ ace-modules.d.ts | 8 +-- ace.d.ts | 122 ++++++++++++++++++------------------- src/mouse/mouse_handler.js | 8 +-- 4 files changed, 119 insertions(+), 129 deletions(-) diff --git a/ace-internal.d.ts b/ace-internal.d.ts index aec218c71e9..b57d0062294 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -26,7 +26,7 @@ export namespace Ace { type GutterHandler = import("./src/mouse/default_gutter_handler").GutterHandler; type DragdropHandler = import("./src/mouse/dragdrop_handler").DragdropHandler; type AppConfig = import("./src/lib/app_config").AppConfig; - + type Config = typeof import("./src/config"); type AfterLoadCallback = (err: Error | null, module: unknown) => void; type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; @@ -43,37 +43,6 @@ export namespace Ace { sharedPopups: boolean, useStrictCSP: boolean | null } - - export interface Config { - get(key: K): ConfigOptions[K]; - - set(key: K, value: ConfigOptions[K]): void; - - all(): { [key: string]: any }; - - moduleUrl(name: string, component?: string): string; - - setModuleUrl(name: string, subst: string): string; - - setLoader(cb: LoaderFunction): void; - - setModuleLoader(name: string, onLoad: Function): void; - - loadModule(moduleName: string | [string, string], - onLoad?: (module: any) => void): void; - - defineOptions(obj: any, path: string, options: { [key: string]: any }): AppConfig; - - resetOptions(obj: any): void; - - setDefaultValue(path: string, name: string, value: any): void; - - setDefaultValues(path: string, optionHash: { [key: string]: any }): void; - - setMessages(value: any): void; - - nls(string: string, params?:{ [x: string]: any; }): string; - } interface Theme { cssClass?: string; @@ -445,9 +414,8 @@ export namespace Ace { "change": (delta: Delta) => void; /** * Emitted when the tab size changes, via [[EditSession.setTabSize]]. - * @param tabSize */ - "changeTabSize": (tabSize: number) => void; + "changeTabSize": () => void; /** * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. * @param overwrite @@ -457,26 +425,23 @@ export namespace Ace { * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. * @param e */ - "changeBreakpoint": (e: { row: number, breakpoint: boolean }) => void; + "changeBreakpoint": (e?: { row?: number, breakpoint?: boolean }) => void; /** * Emitted when a front marker changes. - * @param e */ - "changeFrontMarker": (e: { row: number, marker: boolean }) => void; + "changeFrontMarker": () => void; /** * Emitted when a back marker changes. - * @param e */ - "changeBackMarker": (e: { row: number, marker: boolean }) => void; + "changeBackMarker": () => void; /** * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. - * @param e */ - "changeAnnotation": (e: { row: number, lines: string[] }) => void; + "changeAnnotation": (e: {}) => void; /** * Emitted when a background tokenizer asynchronously processes new rows. */ - "tokenizerUpdate": (e: { data: { first: string, last: string } }) => void; + "tokenizerUpdate": (e: { data: { first: number, last: number } }) => void; /** * Emitted when the current mode changes. * @param e @@ -496,7 +461,7 @@ export namespace Ace { * Emitted when a code fold is added or removed. * @param e */ - "changeFold": (e: any, session: EditSession) => void; + "changeFold": (e: any, session?: EditSession) => void; /** * Emitted when the scroll top changes. * @param scrollTop The new scroll top value @@ -507,7 +472,7 @@ export namespace Ace { * @param scrollLeft The new scroll left value **/ "changeScrollLeft": (scrollLeft: number) => void; - "changeEditor": (e: { editor: Editor }) => void; + "changeEditor": (e: { editor?: Editor, oldEditor?: Editor }) => void; } interface EditorEvents { @@ -522,19 +487,19 @@ export namespace Ace { "blur": (e: any) => void; "mousedown": (e: MouseEvent) => void; "mousemove": (e: MouseEvent & { scrollTop?: any }, editor?: Editor) => void; - "changeStatus": () => void; - "keyboardActivity": () => void; + "changeStatus": (e: any) => void; + "keyboardActivity": (e: any) => void; "mousewheel": (e: MouseEvent) => void; "mouseup": (e: MouseEvent) => void; "beforeEndOperation": (e: any) => void; "nativecontextmenu": (e: any) => void; - "destroy": () => void; - "focus": () => void; + "destroy": (e: any) => void; + "focus": (e?: any) => void; /** * Emitted when text is copied. * @param text The copied text **/ - "copy": (text: string) => void; + "copy": (e: {text: string}) => void; /** * Emitted when text is pasted. **/ @@ -544,6 +509,15 @@ export namespace Ace { * @param data Contains one property, `data`, which indicates the new selection style **/ "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; + "changeMode": (e: {mode?: Ace.SyntaxMode, oldMode?: Ace.SyntaxMode}) => void; + + //from searchbox extension + "findSearchBox": (e: { match: boolean }) => void; + + //from code_lens extension + "codeLensClick": (e: any) => void; + + "select" : () => void; } interface AcePopupEvents { @@ -588,9 +562,11 @@ export namespace Ace { interface BackgroundTokenizerEvents { /** * Fires whenever the background tokeniziers between a range of rows are going to be updated. - * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + * @param e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. **/ - "update": (e: { first: number, last: number }) => void; + "update": (e: { + data: { first: number, last: number } + }) => void; } interface SelectionEvents { @@ -604,12 +580,21 @@ export namespace Ace { "changeSelection": () => void; } - interface PlaceHolderEvents { + interface MultiSelectionEvents extends SelectionEvents { + "multiSelect": () => void; + "addRange": (e: {range: Range}) => void; + "removeRange": (e: {ranges: Range[]}) => void; + "singleSelect": () => void; + } + interface PlaceHolderEvents { + "cursorEnter": (e: any) => void; + "cursorLeave": (e: any) => void; } interface GutterEvents { "changeGutterWidth": (width: number) => void; + "afterRender": () => void; } interface TextEvents { @@ -617,8 +602,14 @@ export namespace Ace { } interface VirtualRendererEvents { - "afterRender": (e: any, renderer: VirtualRenderer) => void; - "beforeRender": (e: any, renderer: VirtualRenderer) => void; + "afterRender": (e?: any, renderer?: VirtualRenderer) => void; + "beforeRender": (e: any, renderer?: VirtualRenderer) => void; + "themeLoaded": (e: { theme: string | Theme }) => void; + "themeChange": (e: { theme: string | Theme }) => void; + "scrollbarVisibilityChanged": () => void; + "changeCharacterSize": (e: any) => void; + "resize": (e?: any) => void; + "autosize": () => void; } class EventEmitter { @@ -640,11 +631,11 @@ export namespace Ace { removeAllListeners(name?: string): void; - _signal(eventName: string, e: any): void; + _signal(eventName: K, ...args: Parameters): void; - _emit(eventName: string, e: any): void; + _emit(eventName: K, ...args: Parameters): void; - _dispatchEvent(eventName: string, e: any): void; + _dispatchEvent(eventName: K, ...args: Parameters): void; } interface SearchOptions { @@ -824,7 +815,7 @@ export namespace Ace { interface Behaviour { $behaviours: {[behaviour: string]: any} - + add(name: string, action: string, callback: BehaviorAction): void; addBehaviours(behaviours: BehaviorMap): void; @@ -1387,9 +1378,8 @@ declare module "./src/line_widgets" { } declare module "./src/selection" { - export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { + export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { } - } declare module "./src/range" { diff --git a/ace-modules.d.ts b/ace-modules.d.ts index d10749aed64..46770481fea 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -1995,10 +1995,10 @@ declare module "ace-code/src/selection" { export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; - type SelectionEvents = import("ace-code").Ace.SelectionEvents; + type MultiSelectionEvents = import("ace-code").Ace.MultiSelectionEvents; type MultiSelectProperties = import("ace-code").Ace.MultiSelectProperties; } - export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { + export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { } } declare module "ace-code/src/clipboard" { @@ -2345,10 +2345,10 @@ declare module "ace-code/src/mouse/mouse_handler" { onMouseEvent(name: any, e: any): void; onMouseMove(name: any, e: any): void; /** - * @param {string} name + * @param {any} name * @param {{ wheelX: number; wheelY: number; }} e */ - onMouseWheel(name: string, e: { + onMouseWheel(name: any, e: { wheelX: number; wheelY: number; }): void; diff --git a/ace.d.ts b/ace.d.ts index 98f985cf298..1591732668c 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -33,6 +33,7 @@ declare module "ace-code" { type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; type AppConfig = import("ace-code/src/lib/app_config").AppConfig; + type Config = typeof import("ace-code/src/config"); type AfterLoadCallback = (err: Error | null, module: unknown) => void; type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; export interface ConfigOptions { @@ -46,33 +47,6 @@ declare module "ace-code" { sharedPopups: boolean; useStrictCSP: boolean | null; } - export interface Config { - get(key: K): ConfigOptions[K]; - set(key: K, value: ConfigOptions[K]): void; - all(): { - [key: string]: any; - }; - moduleUrl(name: string, component?: string): string; - setModuleUrl(name: string, subst: string): string; - setLoader(cb: LoaderFunction): void; - setModuleLoader(name: string, onLoad: Function): void; - loadModule(moduleName: string | [ - string, - string - ], onLoad?: (module: any) => void): void; - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): void; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any): void; - nls(string: string, params?: { - [x: string]: any; - }): string; - } interface Theme { cssClass?: string; cssText?: string; @@ -339,9 +313,8 @@ declare module "ace-code" { "change": (delta: Delta) => void; /** * Emitted when the tab size changes, via [[EditSession.setTabSize]]. - * @param tabSize */ - "changeTabSize": (tabSize: number) => void; + "changeTabSize": () => void; /** * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. * @param overwrite @@ -351,41 +324,29 @@ declare module "ace-code" { * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. * @param e */ - "changeBreakpoint": (e: { - row: number; - breakpoint: boolean; + "changeBreakpoint": (e?: { + row?: number; + breakpoint?: boolean; }) => void; /** * Emitted when a front marker changes. - * @param e */ - "changeFrontMarker": (e: { - row: number; - marker: boolean; - }) => void; + "changeFrontMarker": () => void; /** * Emitted when a back marker changes. - * @param e */ - "changeBackMarker": (e: { - row: number; - marker: boolean; - }) => void; + "changeBackMarker": () => void; /** * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. - * @param e */ - "changeAnnotation": (e: { - row: number; - lines: string[]; - }) => void; + "changeAnnotation": (e: {}) => void; /** * Emitted when a background tokenizer asynchronously processes new rows. */ "tokenizerUpdate": (e: { data: { - first: string; - last: string; + first: number; + last: number; }; }) => void; /** @@ -407,7 +368,7 @@ declare module "ace-code" { * Emitted when a code fold is added or removed. * @param e */ - "changeFold": (e: any, session: EditSession) => void; + "changeFold": (e: any, session?: EditSession) => void; /** * Emitted when the scroll top changes. * @param scrollTop The new scroll top value @@ -419,7 +380,8 @@ declare module "ace-code" { **/ "changeScrollLeft": (scrollLeft: number) => void; "changeEditor": (e: { - editor: Editor; + editor?: Editor; + oldEditor?: Editor; }) => void; } interface EditorEvents { @@ -439,19 +401,21 @@ declare module "ace-code" { "mousemove": (e: MouseEvent & { scrollTop?: any; }, editor?: Editor) => void; - "changeStatus": () => void; - "keyboardActivity": () => void; + "changeStatus": (e: any) => void; + "keyboardActivity": (e: any) => void; "mousewheel": (e: MouseEvent) => void; "mouseup": (e: MouseEvent) => void; "beforeEndOperation": (e: any) => void; "nativecontextmenu": (e: any) => void; - "destroy": () => void; - "focus": () => void; + "destroy": (e: any) => void; + "focus": (e?: any) => void; /** * Emitted when text is copied. * @param text The copied text **/ - "copy": (text: string) => void; + "copy": (e: { + text: string; + }) => void; /** * Emitted when text is pasted. **/ @@ -461,6 +425,17 @@ declare module "ace-code" { * @param data Contains one property, `data`, which indicates the new selection style **/ "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; + "changeMode": (e: { + mode?: Ace.SyntaxMode; + oldMode?: Ace.SyntaxMode; + }) => void; + //from searchbox extension + "findSearchBox": (e: { + match: boolean; + }) => void; + //from code_lens extension + "codeLensClick": (e: any) => void; + "select": () => void; } interface AcePopupEvents { "click": (e: MouseEvent) => void; @@ -504,11 +479,13 @@ declare module "ace-code" { interface BackgroundTokenizerEvents { /** * Fires whenever the background tokeniziers between a range of rows are going to be updated. - * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + * @param e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. **/ "update": (e: { - first: number; - last: number; + data: { + first: number; + last: number; + }; }) => void; } interface SelectionEvents { @@ -521,17 +498,40 @@ declare module "ace-code" { **/ "changeSelection": () => void; } + interface MultiSelectionEvents extends SelectionEvents { + "multiSelect": () => void; + "addRange": (e: { + range: Range; + }) => void; + "removeRange": (e: { + ranges: Range[]; + }) => void; + "singleSelect": () => void; + } interface PlaceHolderEvents { + "cursorEnter": (e: any) => void; + "cursorLeave": (e: any) => void; } interface GutterEvents { "changeGutterWidth": (width: number) => void; + "afterRender": () => void; } interface TextEvents { "changeCharacterSize": (e: any) => void; } interface VirtualRendererEvents { - "afterRender": (e: any, renderer: VirtualRenderer) => void; - "beforeRender": (e: any, renderer: VirtualRenderer) => void; + "afterRender": (e?: any, renderer?: VirtualRenderer) => void; + "beforeRender": (e: any, renderer?: VirtualRenderer) => void; + "themeLoaded": (e: { + theme: string | Theme; + }) => void; + "themeChange": (e: { + theme: string | Theme; + }) => void; + "scrollbarVisibilityChanged": () => void; + "changeCharacterSize": (e: any) => void; + "resize": (e?: any) => void; + "autosize": () => void; } class EventEmitter { once(name: K, callback: T[K]): void; diff --git a/src/mouse/mouse_handler.js b/src/mouse/mouse_handler.js index 7ec0623020e..3d582b70c48 100644 --- a/src/mouse/mouse_handler.js +++ b/src/mouse/mouse_handler.js @@ -80,7 +80,7 @@ class MouseHandler { } else { renderer.setCursorStyle(""); } - + }, //@ts-expect-error TODO: seems mistyping - should be boolean editor); } @@ -100,7 +100,7 @@ class MouseHandler { } /** - * @param {string} name + * @param {any} name * @param {{ wheelX: number; wheelY: number; }} e */ onMouseWheel(name, e) { @@ -112,7 +112,7 @@ class MouseHandler { this.editor._emit(name, mouseEvent); } - + setState(state) { this.state = state; } @@ -168,7 +168,7 @@ class MouseHandler { var onOperationEnd = function(e) { if (!self.releaseMouse) return; - // some touchpads fire mouseup event after a slight delay, + // some touchpads fire mouseup event after a slight delay, // which can cause problems if user presses a keyboard shortcut quickly if (editor.curOp.command.name && editor.curOp.selectionChanged) { self[self.state + "End"] && self[self.state + "End"](); From d8626048ab0cd9f48a991c55c6d6a2fc9ae5facf Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 30 Sep 2024 19:32:53 +0400 Subject: [PATCH 23/33] add a test --- .github/workflows/nodejs.yml | 3 +++ demo/test_package/index.ts | 14 ++++++++++++++ demo/test_package/package.json | 16 ++++++++++++++++ demo/test_package/tsconfig.json | 26 ++++++++++++++++++++++++++ tool/test-npm-package.sh | 31 +++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 demo/test_package/index.ts create mode 100644 demo/test_package/package.json create mode 100644 demo/test_package/tsconfig.json create mode 100755 tool/test-npm-package.sh diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d4be00593c9..50d9f943b0a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -59,6 +59,9 @@ jobs: git diff --color --exit-code ./ace*d.ts; npm run typecheck; node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts; + - run: | + set -x; + ./tool/test-npm-package.sh # upload to codecov - uses: codecov/codecov-action@v3 with: diff --git a/demo/test_package/index.ts b/demo/test_package/index.ts new file mode 100644 index 00000000000..a47753a1249 --- /dev/null +++ b/demo/test_package/index.ts @@ -0,0 +1,14 @@ +import * as ace from "ace-code"; + +(globalThis as {document: Object}).document = {} +const editor = ace.edit(null); // should not be an error +editor.setTheme("ace/theme/monokai"); +editor.session.setMode("ace/mode/javascript"); + +function configure(config: ace.Ace.Config) { + config.setDefaultValues("editor", { + fontSize: 14, + showPrintMargin: false, + }) +} +configure(ace.config) // should not be a error diff --git a/demo/test_package/package.json b/demo/test_package/package.json new file mode 100644 index 00000000000..69e4815ddd7 --- /dev/null +++ b/demo/test_package/package.json @@ -0,0 +1,16 @@ +{ + "name": "ace-test-package", + "version": "1.0.0", + "description": "Test package for Ace", + "main": "index.js", + "scripts": { + "build": "tsc -p tsconfig.json", + "test": "node index.js" + }, + "dependencies": { + "ace-code": "file:../../ace-code-latest.tgz" + }, + "devDependencies": { + "typescript": "^4.5.5" + } +} diff --git a/demo/test_package/tsconfig.json b/demo/test_package/tsconfig.json new file mode 100644 index 00000000000..1f23bf07327 --- /dev/null +++ b/demo/test_package/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "target": "es2020", + "moduleResolution": "node" + }, + "include": ["*.ts"], + "exclude": ["node_modules"] +} diff --git a/tool/test-npm-package.sh b/tool/test-npm-package.sh new file mode 100755 index 00000000000..8268248555a --- /dev/null +++ b/tool/test-npm-package.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -euxo pipefail + +# Navigate to the ace repository root +cd "$(dirname "$0")/.." + +# npm pack the ace repository +npm pack + +rm -f ace-code-latest.tgz + +# Get the name of the packed file +PACKAGE_FILE=$(ls ace-*.tgz | sort -V | tail -n 1) + +mv "$PACKAGE_FILE" ace-code-latest.tgz + + +# Install the ace package from the npm pack result +# npm install "../../$PACKAGE_FILE" + +cd demo/test_package +# Install TypeScript +npm install + +# Run TypeScript type checking +npm run build +npm run test + +# Clean up +cd ../.. +rm ace-code-latest.tgz From 6aca79a39dcf71dc8e9afa0c0cc3a5d239a621ba Mon Sep 17 00:00:00 2001 From: mkslanc Date: Fri, 11 Oct 2024 18:18:48 +0400 Subject: [PATCH 24/33] improve types --- ace-ext.d.ts | 34 +++++++------ ace-internal.d.ts | 43 +++++++++++----- ace-modules.d.ts | 34 ++++++++----- ace.d.ts | 23 +++++++-- demo/test_package/index.ts | 89 +++++++++++++++++++++++++++++++++- demo/test_package/package.json | 2 +- src/ace.js | 4 +- src/autocomplete.js | 62 ++++++++++++----------- src/ext/code_lens.js | 8 +-- src/ext/searchbox.js | 30 ++++++------ src/ext/static_highlight.js | 33 +++++++------ src/marker_group.js | 8 +-- src/tooltip.js | 42 ++++++++-------- tool/test-npm-package.sh | 5 ++ 14 files changed, 283 insertions(+), 134 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 21cd1cbaf8a..f3d6fa96ced 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -216,10 +216,10 @@ declare module "ace-code/src/ext/searchbox" { export class SearchBox { /** * @param {Editor} editor - * @param {undefined} [range] - * @param {undefined} [showReplaceForm] + * @param {never} [range] + * @param {never} [showReplaceForm] */ - constructor(editor: Editor, range?: undefined, showReplaceForm?: undefined); + constructor(editor: Editor, range?: never, showReplaceForm?: never); /**@type {any}*/ activeInput: any; /**@type {any}*/ @@ -318,8 +318,8 @@ declare module "ace-code/src/ext/beautify" { }[]; } declare module "ace-code/src/ext/code_lens" { - export function setLenses(session: EditSession, lenses: any): number; - export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: any): void; + export function setLenses(session: EditSession, lenses: import("ace-code").Ace.CodeLense[]): number; + export function registerCodeLensProvider(editor: import("ace-code/src/editor").Editor, codeLensProvider: import("ace-code").Ace.CodeLenseProvider): void; export function clear(session: EditSession): void; export type EditSession = import("ace-code/src/edit_session").EditSession; export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { @@ -703,22 +703,22 @@ declare module "ace-code/src/ext/static_highlight" { /** * * @param {HTMLElement} el - * @param opts + * @param {import("ace-code").Ace.StaticHighlightOptions} opts * @param [callback] * @returns {boolean} */ - function highlight(el: HTMLElement, opts: any, callback?: any): boolean; + function highlight(el: HTMLElement, opts: import("ace-code").Ace.StaticHighlightOptions, callback?: any): boolean; export namespace highlight { - export { render, renderSync, highlight }; + export { render, renderSync, highlight, SyntaxMode, Theme }; } /** * Transforms a given input code snippet into HTML using the given mode * * @param {string} input Code snippet - * @param {string|import("ace-code").Ace.SyntaxMode} mode String specifying the mode to load such as + * @param {string | SyntaxMode} mode String specifying the mode to load such as * `ace/mode/javascript` or, a mode loaded from `/ace/mode` * (use 'ServerSideHiglighter.getMode'). - * @param {string} theme String specifying the theme to load such as + * @param {string | Theme} theme String specifying the theme to load such as * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. * @param {number} lineStart A number indicating the first line number. Defaults * to 1. @@ -730,17 +730,19 @@ declare module "ace-code/src/ext/static_highlight" { * and `css`. * @returns {object} An object containing the properties `html` and `css`. */ - function render(input: string, mode: string | import("ace-code").Ace.SyntaxMode, theme: string, lineStart: number, disableGutter: boolean, callback?: Function): object; + function render(input: string, mode: string | SyntaxMode, theme: string | Theme, lineStart: number, disableGutter: boolean, callback?: Function): object; /** * Transforms a given input code snippet into HTML using the given mode * @param {string} input Code snippet - * @param {import("ace-code").Ace.SyntaxMode|string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {any} theme + * @param {SyntaxMode | string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') + * @param {Theme} theme * @param {any} lineStart * @param {boolean} disableGutter * @returns {object} An object containing: html, css */ - function renderSync(input: string, mode: import("ace-code").Ace.SyntaxMode | string, theme: any, lineStart: any, disableGutter: boolean): object; + function renderSync(input: string, mode: SyntaxMode | string, theme: Theme, lineStart: any, disableGutter: boolean): object; + type SyntaxMode = import("ace-code").Ace.SyntaxMode; + type Theme = import("ace-code").Ace.Theme; } declare module "ace-code/src/ext/statusbar" { export type Editor = import("ace-code/src/editor").Editor; @@ -800,10 +802,10 @@ declare module "ace-code/src/ext/textarea" { setModuleLoader: (moduleName: any, onLoad: any) => void; version: "1.36.2"; }; - edit: (el: string | (HTMLElement & { + edit: (el?: string | (HTMLElement & { env?: any; value?: any; - }), options?: any) => ace.Editor; + }) | null, options?: any) => ace.Editor; createEditSession: (text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; Range: typeof ace.Range; Editor: typeof ace.Editor; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index b57d0062294..bc72d412e92 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -38,7 +38,7 @@ export namespace Ace { themePath: string | null, basePath: string, suffix: string, - $moduleUrls: {[url: string]: string}, + $moduleUrls: { [url: string]: string }, loadWorkerFromBlob: boolean, sharedPopups: boolean, useStrictCSP: boolean | null @@ -499,7 +499,7 @@ export namespace Ace { * Emitted when text is copied. * @param text The copied text **/ - "copy": (e: {text: string}) => void; + "copy": (e: { text: string }) => void; /** * Emitted when text is pasted. **/ @@ -509,7 +509,7 @@ export namespace Ace { * @param data Contains one property, `data`, which indicates the new selection style **/ "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; - "changeMode": (e: {mode?: Ace.SyntaxMode, oldMode?: Ace.SyntaxMode}) => void; + "changeMode": (e: { mode?: Ace.SyntaxMode, oldMode?: Ace.SyntaxMode }) => void; //from searchbox extension "findSearchBox": (e: { match: boolean }) => void; @@ -517,7 +517,7 @@ export namespace Ace { //from code_lens extension "codeLensClick": (e: any) => void; - "select" : () => void; + "select": () => void; } interface AcePopupEvents { @@ -582,8 +582,8 @@ export namespace Ace { interface MultiSelectionEvents extends SelectionEvents { "multiSelect": () => void; - "addRange": (e: {range: Range}) => void; - "removeRange": (e: {ranges: Range[]}) => void; + "addRange": (e: { range: Range }) => void; + "removeRange": (e: { ranges: Range[] }) => void; "singleSelect": () => void; } @@ -814,7 +814,7 @@ export namespace Ace { type BehaviorMap = Record>; interface Behaviour { - $behaviours: {[behaviour: string]: any} + $behaviours: { [behaviour: string]: any } add(name: string, action: string, callback: BehaviorAction): void; @@ -969,13 +969,16 @@ export namespace Ace { callback: CompleterCallback): void; getDocTooltip?(item: Completion): void | string | Completion; + onSeen?: (editor: Ace.Editor, completion: Completion) => void; onInsert?: (editor: Ace.Editor, completion: Completion) => void; + cancel?(): void; id?: string; triggerCharacters?: string[]; hideInlinePreview?: boolean; + insertMatch?: (editor: Editor, data: Completion) => void; } interface CompletionOptions { @@ -1068,8 +1071,17 @@ export namespace Ace { $blockSelectEnabled?: boolean, } + interface CodeLenseProvider { + provideCodeLenses: (session: EditSession, callback: (err: any, payload: CodeLense[]) => void) => void; + } + + interface CodeLense { + start: Point, + command: any + } + interface CodeLenseEditorExtension { - codeLensProviders?: any[]; + codeLensProviders?: CodeLenseProvider[]; $codeLensClickHandler?: any; $updateLenses?: () => void; $updateLensesOnInput?: () => void; @@ -1179,7 +1191,7 @@ export namespace Ace { type TooltipCommandFunction = (editor: Ace.Editor) => T; export interface TooltipCommand extends Ace.Command { - enabled: TooltipCommandFunction | boolean, + enabled?: TooltipCommandFunction | boolean, getValue?: TooltipCommandFunction, type: "button" | "text" | "checkbox" iconCssClass?: string, @@ -1192,6 +1204,14 @@ export namespace Ace { className?: string, value: string, }>> + + export interface StaticHighlightOptions { + mode?: string | SyntaxMode, + theme?: string | Theme, + trim?: boolean, + firstLineNumber?: number, + showGutter?: boolean + } } @@ -1200,10 +1220,10 @@ export const config: Ace.Config; export function require(name: string): any; -export function edit(el: string | (Element & { +export function edit(el?: string | (Element & { env?: any; value?: any; -}), options?: Partial): Ace.Editor; +}) | null, options?: Partial): Ace.Editor; export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession; @@ -1231,6 +1251,7 @@ export type CommandBarTooltip = Ace.CommandBarTooltip; declare global { interface Element { setAttribute(name: string, value: boolean): void; + setAttribute(name: string, value: number): void; } } diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 46770481fea..95e9338816f 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -2146,16 +2146,16 @@ declare module "ace-code/src/tooltip" { */ isOutsideOfText(e: MouseEvent): boolean; /** - * @param {any} value + * @param {(event: MouseEvent, editor: Editor) => void} value */ - setDataProvider(value: any): void; + setDataProvider(value: (event: MouseEvent, editor: Editor) => void): void; /** * @param {Editor} editor * @param {Range} range - * @param {any} domNode + * @param {HTMLElement} domNode * @param {MouseEvent} startingEvent */ - showForRange(editor: Editor, range: Range, domNode: any, startingEvent: MouseEvent): void; + showForRange(editor: Editor, range: Range, domNode: HTMLElement, startingEvent: MouseEvent): void; range: Range; /** * @param {Range} range @@ -4178,7 +4178,15 @@ declare module "ace-code/src/autocomplete" { */ showPopup(editor: Editor, options?: CompletionOptions): void; editor: import("ace-code/src/editor").Editor; - getCompletionProvider(initialPosition: any): CompletionProvider; + /** + * + * @param {{pos: Position, prefix: string}} [initialPosition] + * @return {CompletionProvider} + */ + getCompletionProvider(initialPosition?: { + pos: Position; + prefix: string; + }): CompletionProvider; /** * This method is deprecated, it is only kept for backwards compatibility. * Use the same method include CompletionProvider instead for the same functionality. @@ -4216,14 +4224,14 @@ declare module "ace-code/src/autocomplete" { */ export class CompletionProvider { /** - * @param {{pos: import("ace-code").Ace.Position, prefix: string}} initialPosition + * @param {{pos: Position, prefix: string}} [initialPosition] */ - constructor(initialPosition: { - pos: import("ace-code").Ace.Position; + constructor(initialPosition?: { + pos: Position; prefix: string; }); initialPosition: { - pos: import("ace-code").Ace.Position; + pos: Position; prefix: string; }; active: boolean; @@ -4262,6 +4270,7 @@ declare module "ace-code/src/autocomplete" { export type Editor = import("ace-code/src/editor").Editor; export type CompletionProviderOptions = import("ace-code").Ace.CompletionProviderOptions; export type CompletionOptions = import("ace-code").Ace.CompletionOptions; + export type Position = import("ace-code").Ace.Position; export type BaseCompletion = { /** * - a numerical value that determines the order in which completions would be displayed. @@ -4306,9 +4315,7 @@ declare module "ace-code/src/autocomplete" { * - The text that would be inserted when selecting this completion. */ value?: string; - completer?: import("ace-code").Ace.Completer & { - insertMatch: (editor: Editor, data: Completion) => void; - }; + completer?: import("ace-code").Ace.Completer; hideInlinePreview?: boolean; }; export type SnippetCompletion = BaseCompletion & { @@ -4485,7 +4492,8 @@ declare module "ace-code/src/marker_group" { markerType: "fullLine" | "line" | undefined; }); markerType: "line" | "fullLine"; - markers: any[]; + /**@type {import("ace-code").Ace.MarkerGroupItem[]}*/ + markers: import("ace-code").Ace.MarkerGroupItem[]; /**@type {EditSession}*/ session: EditSession; /** diff --git a/ace.d.ts b/ace.d.ts index 1591732668c..e3f12095430 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -777,6 +777,7 @@ declare module "ace-code" { id?: string; triggerCharacters?: string[]; hideInlinePreview?: boolean; + insertMatch?: (editor: Editor, data: Completion) => void; } interface CompletionOptions { matches?: Completion[]; @@ -861,8 +862,15 @@ declare module "ace-code" { alignCursors: () => void; multiSelect?: any; } + interface CodeLenseProvider { + provideCodeLenses: (session: EditSession, callback: (err: any, payload: CodeLense[]) => void) => void; + } + interface CodeLense { + start: Point; + command: any; + } interface CodeLenseEditorExtension { - codeLensProviders?: any[]; + codeLensProviders?: CodeLenseProvider[]; } interface ElasticTabstopsEditorExtension { elasticTabstops?: import("ace-code/src/ext/elastic_tabstops_lite").ElasticTabstopsLite; @@ -931,7 +939,7 @@ declare module "ace-code" { type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; type TooltipCommandFunction = (editor: Ace.Editor) => T; export interface TooltipCommand extends Ace.Command { - enabled: TooltipCommandFunction | boolean; + enabled?: TooltipCommandFunction | boolean; getValue?: TooltipCommandFunction; type: "button" | "text" | "checkbox"; iconCssClass?: string; @@ -942,6 +950,13 @@ declare module "ace-code" { className?: string; value: string; }>>; + export interface StaticHighlightOptions { + mode?: string | SyntaxMode; + theme?: string | Theme; + trim?: boolean; + firstLineNumber?: number; + showGutter?: boolean; + } } export const config: { defineOptions(obj: any, path: string, options: { @@ -983,10 +998,10 @@ declare module "ace-code" { setModuleLoader: (moduleName: any, onLoad: any) => void; version: "1.36.2"; }; - export function edit(el: string | (HTMLElement & { + export function edit(el?: string | (HTMLElement & { env?: any; value?: any; - }), options?: any): Editor; + }) | null, options?: any): Editor; export function createEditSession(text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode): EditSession; import Editor_5 = require("ace-code/src/editor"); import Editor = Editor_5.Editor; diff --git a/demo/test_package/index.ts b/demo/test_package/index.ts index a47753a1249..dc331c59c8d 100644 --- a/demo/test_package/index.ts +++ b/demo/test_package/index.ts @@ -1,6 +1,21 @@ import * as ace from "ace-code"; +import {Range} from "ace-code"; +import {Autocomplete} from "ace-code/src/autocomplete"; +import {beautify} from "ace-code/src/ext/beautify"; +import {registerCodeLensProvider, setLenses} from "ace-code/src/ext/code_lens"; +import {CommandBarTooltip} from "ace-code/src/ext/command_bar"; +import {ElasticTabstopsLite} from "ace-code/src/ext/elastic_tabstops_lite"; +import {MarkerGroup, MarkerGroupItem} from "ace-code/src/marker_group"; +import {HoverTooltip} from "ace-code/src/tooltip"; +import {hardWrap} from "ace-code/src/ext/hardwrap"; +import {SearchBox} from "ace-code/src/ext/searchbox"; + +import("ace-code/src/ext/language_tools"); +import "../../src/test/mockdom.js"; +import {tokenize} from "ace-code/src/ext/simple_tokenizer"; +import {JavaScriptHighlightRules} from "ace-code/src/mode/javascript_highlight_rules"; +import {highlight} from "ace-code/src/ext/static_highlight"; -(globalThis as {document: Object}).document = {} const editor = ace.edit(null); // should not be an error editor.setTheme("ace/theme/monokai"); editor.session.setMode("ace/mode/javascript"); @@ -11,4 +26,76 @@ function configure(config: ace.Ace.Config) { showPrintMargin: false, }) } + configure(ace.config) // should not be a error + +Autocomplete.for(editor).getCompletionProvider() // should not be an error + +const markerGroup = new MarkerGroup(editor.session); +const markers: MarkerGroupItem[] = [ + { + range: new Range(0, 0, 10, 10), + className: "test-class" + } +] +markerGroup.setMarkers(markers); +markerGroup.markers.every(marker => { + console.log(marker.range); + return true; +}); + +const hover = new HoverTooltip(); +hover.setDataProvider((e, editor) => { + const domNode = document.createElement("div"); + hover.showForRange(editor, new Range(1, 3, 3, 1), domNode, e); +}); +hover.addToEditor(editor); + +beautify(editor.session); + +registerCodeLensProvider(editor, { + provideCodeLenses: function (session, callback) { + const lenses = [{ + start: {row: 2, column: 1}, + command: {title: "2"} + }]; + setTimeout(function () { + callback(null, [{ + start: {row: 2, column: 1}, + command: {title: "2"} + }]); + + setLenses(session, lenses); + }); + } +}); + +var commandBar = new CommandBarTooltip(editor.container); +var command: ace.Ace.TooltipCommand = { + name: "test", + exec: function (editor: ace.Editor) { + alert(editor.getValue()); + }, + type: "checkbox" +} +commandBar.registerCommand("test", command); + +const elasticTabStopLite = new ElasticTabstopsLite(editor); +elasticTabStopLite.processRows([1, 2, 4]); + + +hardWrap(editor, { + startRow: 1, + endRow: 2, +}); + + +const searchBox = new SearchBox(editor); + +searchBox.show("Test", true); + +tokenize("some content", new JavaScriptHighlightRules()); +highlight(editor.container, { + mode: "ace/mode/some", + showGutter: true +}) diff --git a/demo/test_package/package.json b/demo/test_package/package.json index 69e4815ddd7..a0c3782e21c 100644 --- a/demo/test_package/package.json +++ b/demo/test_package/package.json @@ -11,6 +11,6 @@ "ace-code": "file:../../ace-code-latest.tgz" }, "devDependencies": { - "typescript": "^4.5.5" + "typescript": "^5.6.2" } } diff --git a/src/ace.js b/src/ace.js index 32f4e89f480..2e2180fdd5a 100644 --- a/src/ace.js +++ b/src/ace.js @@ -28,7 +28,7 @@ exports.config = require("./config"); /** * Embeds the Ace editor into the DOM, at the element provided by `el`. - * @param {String | HTMLElement & {env?: any, value?: any}} el Either the id of an element, or the element itself + * @param {String | HTMLElement & {env?: any, value?: any} | null} [el] Either the id of an element, or the element itself * @param {Object } [options] Options for the editor * @returns {Editor} **/ @@ -86,5 +86,5 @@ exports.Editor = Editor; exports.EditSession = EditSession; exports.UndoManager = UndoManager; exports.VirtualRenderer = Renderer; -var version = exports.config.version; +var version = exports.config.version; exports.version = version; diff --git a/src/autocomplete.js b/src/autocomplete.js index de0fc9267e6..75a96e2f527 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -3,6 +3,7 @@ * @typedef {import("./editor").Editor} Editor * @typedef {import("../ace-internal").Ace.CompletionProviderOptions} CompletionProviderOptions * @typedef {import("../ace-internal").Ace.CompletionOptions} CompletionOptions + * @typedef {import("../ace-internal").Ace.Position} Position */ var HashHandler = require("./keyboard/hash_handler").HashHandler; var AcePopup = require("./autocomplete/popup").AcePopup; @@ -31,21 +32,21 @@ var preventParentScroll = require("./lib/scroll").preventParentScroll; * @property {string} [command] - A command to be executed after the completion is inserted (experimental) * @property {string} [snippet] - a text snippet that would be inserted when the completion is selected * @property {string} [value] - The text that would be inserted when selecting this completion. - * @property {import("../ace-internal").Ace.Completer & {insertMatch:(editor: Editor, data: Completion) => void}} [completer] + * @property {import("../ace-internal").Ace.Completer} [completer] * @property {boolean} [hideInlinePreview] * @export */ /** * @typedef {BaseCompletion & {snippet: string}} SnippetCompletion - * @property {string} snippet + * @property {string} snippet * @property {string} [value] * @export */ /** * @typedef {BaseCompletion & {value: string}} ValueCompletion - * @property {string} value + * @property {string} value * @property {string} [snippet] * @export */ @@ -80,9 +81,9 @@ class Autocomplete { this.hasSeen = new Set(); /** - * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled + * @property {Boolean} showLoadingState - A boolean indicating whether the loading states of the Autocompletion should be shown to the end-user. If enabled * it shows a loading indicator on the popup while autocomplete is loading. - * + * * Experimental: This visualisation is not yet considered stable and might change in the future. */ this.showLoadingState = false; @@ -129,7 +130,7 @@ class Autocomplete { $init() { /**@type {AcePopup}**/ - this.popup = new AcePopup(this.parentNode || document.body || document.documentElement); + this.popup = new AcePopup(this.parentNode || document.body || document.documentElement); this.popup.on("click", function(e) { this.insertMatch(); e.stop(); @@ -305,7 +306,7 @@ class Autocomplete { if (this.popup.tryShow(pos, lineHeight, "top")) { return; } - + this.popup.show(pos, lineHeight); } @@ -338,17 +339,17 @@ class Autocomplete { } editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - + var newRow; if (this.stickySelection) - newRow = this.popup.data.indexOf(previousSelectedItem); - if (!newRow || newRow === -1) + newRow = this.popup.data.indexOf(previousSelectedItem); + if (!newRow || newRow === -1) newRow = 0; - + this.popup.setRow(this.autoSelect ? newRow : -1); - + // If we stay on the same row, but the content is different, we want to update the popup. - if (newRow === oldRow && previousSelectedItem !== this.completions.filtered[newRow]) + if (newRow === oldRow && previousSelectedItem !== this.completions.filtered[newRow]) this.$onPopupChange(); // If we stay on the same line and have inlinePreview enabled, we want to make sure the @@ -471,7 +472,7 @@ class Autocomplete { this.detach(); return result; } - + /** * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions * @param {Editor} editor @@ -498,6 +499,11 @@ class Autocomplete { this.updateCompletions(false, options); } + /** + * + * @param {{pos: Position, prefix: string}} [initialPosition] + * @return {CompletionProvider} + */ getCompletionProvider(initialPosition) { if (!this.completionProvider) this.completionProvider = new CompletionProvider(initialPosition); @@ -533,7 +539,7 @@ class Autocomplete { this.openPopup(this.editor, prefix, keepPopupPosition); return; } - + if (options && options.matches) { var pos = this.editor.getSelectionRange().start; this.base = this.editor.session.doc.createAnchor(pos.row, pos.column); @@ -596,7 +602,7 @@ class Autocomplete { } // If showLoadingState is true and there is still a completer loading, show 'Loading...' // in the top row of the completer popup. - this.completions = !finished && this.showLoadingState ? + this.completions = !finished && this.showLoadingState ? new FilteredList( Autocomplete.completionsForLoading.concat(filtered), completions.filterText ) : @@ -624,7 +630,7 @@ class Autocomplete { var doc = null; if (!selected || !this.editor || !this.popup.isOpen) return this.hideDocTooltip(); - + var completersLength = this.editor.completers.length; for (var i = 0; i < completersLength; i++) { var completer = this.editor.completers[i]; @@ -813,10 +819,10 @@ Autocomplete.startCommand = { * This class is responsible for providing completions and inserting them to the editor */ class CompletionProvider { - + /** - * @param {{pos: import("../ace-internal").Ace.Position, prefix: string}} initialPosition + * @param {{pos: Position, prefix: string}} [initialPosition] */ constructor(initialPosition) { this.initialPosition = initialPosition; @@ -853,7 +859,7 @@ class CompletionProvider { // TODO add support for options.deleteSuffix if (!this.completions) return false; - + var replaceBefore = this.completions.filterText.length; var replaceAfter = 0; if (data.range && data.range.start.row === data.range.end.row) { @@ -876,7 +882,7 @@ class CompletionProvider { editor.session.remove(range); } } - + if (data.snippet) { snippetManager.insertSnippet(editor, data.snippet); } @@ -886,7 +892,7 @@ class CompletionProvider { if (data.completer && data.completer.onInsert && typeof data.completer.onInsert == "function") { data.completer.onInsert(editor, data); } - + if (data.command && data.command === "startAutocomplete") { editor.execCommand(data.command); } @@ -911,9 +917,9 @@ class CompletionProvider { gatherCompletions(editor, callback) { var session = editor.getSession(); var pos = editor.getCursorPosition(); - + var prefix = util.getCompletionPrefix(editor); - + var matches = []; this.completers = editor.completers; var total = editor.completers.length; @@ -987,7 +993,7 @@ class CompletionProvider { processResults(results); }.bind(this)); - + isImmediate = false; if (immediateResults) { var results = immediateResults; @@ -1014,7 +1020,7 @@ class FilteredList { this.exactMatch = false; this.ignoreCaption = false; } - + setFilter(str) { if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) var matches = this.filtered; @@ -1024,7 +1030,7 @@ class FilteredList { this.filterText = str; matches = this.filterCompletions(matches, this.filterText); matches = matches.sort(function(a, b) { - return b.exactMatch - a.exactMatch || b.$score - a.$score + return b.exactMatch - a.exactMatch || b.$score - a.$score || (a.caption || a.value).localeCompare(b.caption || b.value); }); @@ -1039,7 +1045,7 @@ class FilteredList { this.filtered = matches; } - + filterCompletions(items, needle) { var results = []; var upper = needle.toUpperCase(); diff --git a/src/ext/code_lens.js b/src/ext/code_lens.js index 8dd77924654..7098c1e9984 100644 --- a/src/ext/code_lens.js +++ b/src/ext/code_lens.js @@ -108,9 +108,9 @@ function clearCodeLensWidgets(session) { } /** - * + * * @param {EditSession} session - * @param lenses + * @param {import("../../ace-internal").Ace.CodeLense[]} lenses * @return {number} */ exports.setLenses = function(session, lenses) { @@ -189,7 +189,7 @@ function attachToEditor(editor) { var row = session.documentToScreenRow(cursor); var lineHeight = editor.renderer.layerConfig.lineHeight; var top = session.getScrollTop() + (row - oldRow) * lineHeight; - // special case for the lens on line 0, because it can't be scrolled into view with keyboard + // special case for the lens on line 0, because it can't be scrolled into view with keyboard if (firstRow == 0 && scrollTop < lineHeight /4 && scrollTop > -lineHeight/4) { top = -lineHeight; } @@ -215,7 +215,7 @@ function detachFromEditor(editor) { /** * @param {import("../editor").Editor} editor - * @param codeLensProvider + * @param {import("../../ace-internal").Ace.CodeLenseProvider} codeLensProvider */ exports.registerCodeLensProvider = function(editor, codeLensProvider) { editor.setOption("enableCodeLens", true); diff --git a/src/ext/searchbox.js b/src/ext/searchbox.js index f676da50803..e26a9003919 100644 --- a/src/ext/searchbox.js +++ b/src/ext/searchbox.js @@ -17,8 +17,8 @@ dom.importCssString(searchboxCss, "ace_searchbox", false); class SearchBox { /** * @param {Editor} editor - * @param {undefined} [range] - * @param {undefined} [showReplaceForm] + * @param {never} [range] + * @param {never} [showReplaceForm] */ constructor(editor, range, showReplaceForm) { /**@type {any}*/ @@ -66,7 +66,7 @@ class SearchBox { /**@type {Editor}*/ this.editor = editor; } - + setSession(e) { this.searchRange = null; this.$syncOptions(true); @@ -97,12 +97,12 @@ class SearchBox { /**@type {HTMLElement}*/ this.searchCounter = sb.querySelector(".ace_search_counter"); } - + $init() { var sb = this.element; - + this.$initElements(sb); - + var _this = this; event.addListener(sb, "mousedown", function(e) { setTimeout(function(){ @@ -213,11 +213,11 @@ class SearchBox { var value = this.searchRange ? editor.session.getTextRange(this.searchRange) : editor.getValue(); - + var offset = editor.session.doc.positionToIndex(editor.selection.anchor); if (this.searchRange) offset -= editor.session.doc.positionToIndex(this.searchRange.start); - + var last = regex.lastIndex = 0; var m; while ((m = regex.exec(value))) { @@ -243,7 +243,7 @@ class SearchBox { this.find(true, true); } findAll(){ - var range = this.editor.findAll(this.searchInput.value, { + var range = this.editor.findAll(this.searchInput.value, { regExp: this.regExpOption.checked, caseSensitive: this.caseSensitiveOption.checked, wholeWord: this.wholeWordOption.checked @@ -258,7 +258,7 @@ class SearchBox { replace() { if (!this.editor.getReadOnly()) this.editor.replace(this.replaceInput.value); - } + } replaceAndFindNext() { if (!this.editor.getReadOnly()) { this.editor.replace(this.replaceInput.value); @@ -274,7 +274,7 @@ class SearchBox { this.active = false; this.setSearchRange(null); this.editor.off("changeSession", this.setSession); - + this.element.style.display = "none"; this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); this.editor.focus(); @@ -289,15 +289,15 @@ class SearchBox { this.editor.on("changeSession", this.setSession); this.element.style.display = ""; this.replaceOption.checked = isReplace; - + if (value) this.searchInput.value = value; - + this.searchInput.focus(); this.searchInput.select(); this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - + this.$syncOptions(true); } @@ -404,7 +404,7 @@ SearchBox.prototype.$closeSearchBarKb = $closeSearchBarKb; exports.SearchBox = SearchBox; /** - * + * * @param {Editor} editor * @param {boolean} [isReplace] */ diff --git a/src/ext/static_highlight.js b/src/ext/static_highlight.js index 427f626a8d4..ada36bfc023 100644 --- a/src/ext/static_highlight.js +++ b/src/ext/static_highlight.js @@ -1,4 +1,9 @@ "use strict"; +/** + * @typedef {import("../../ace-internal").Ace.SyntaxMode} SyntaxMode + * @typedef {import("../../ace-internal").Ace.Theme} Theme + */ + var EditSession = require("../edit_session").EditSession; var TextLayer = require("../layer/text").Text; @@ -75,9 +80,9 @@ var SimpleTextLayer = function() { SimpleTextLayer.prototype = TextLayer.prototype; /** - * + * * @param {HTMLElement} el - * @param opts + * @param {import("../../ace-internal").Ace.StaticHighlightOptions} opts * @param [callback] * @returns {boolean} */ @@ -87,7 +92,7 @@ var highlight = function(el, opts, callback) { if (!mode) return false; var theme = opts.theme || "ace/theme/textmate"; - + var data = ""; var nodes = []; @@ -108,13 +113,13 @@ var highlight = function(el, opts, callback) { if (opts.trim) data = data.trim(); } - + highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { dom.importCssString(highlighted.css, "ace_highlight", true); el.innerHTML = highlighted.html; - /** + /** * TODO: check if child exists - * @type {any} + * @type {any} */ var container = el.firstChild.firstChild; for (var i = 0; i < nodes.length; i += 2) { @@ -131,10 +136,10 @@ var highlight = function(el, opts, callback) { * Transforms a given input code snippet into HTML using the given mode * * @param {string} input Code snippet - * @param {string|import("../../ace-internal").Ace.SyntaxMode} mode String specifying the mode to load such as + * @param {string | SyntaxMode} mode String specifying the mode to load such as * `ace/mode/javascript` or, a mode loaded from `/ace/mode` * (use 'ServerSideHiglighter.getMode'). - * @param {string} theme String specifying the theme to load such as + * @param {string | Theme} theme String specifying the theme to load such as * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. * @param {number} lineStart A number indicating the first line number. Defaults * to 1. @@ -177,7 +182,7 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba // loads or passes the specified mode module then calls renderer function done() { - var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter); + var result = highlight.renderSync(input, mode, /**@type{Theme}*/(theme), lineStart, disableGutter); return callback ? callback(result) : result; } return --waiting || done(); @@ -186,8 +191,8 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba /** * Transforms a given input code snippet into HTML using the given mode * @param {string} input Code snippet - * @param {import("../../ace-internal").Ace.SyntaxMode|string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {any} theme + * @param {SyntaxMode | string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') + * @param {Theme} theme * @param {any} lineStart * @param {boolean} disableGutter * @returns {object} An object containing: html, css @@ -212,10 +217,10 @@ highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { session.setValue(input); var length = session.getLength(); - + var outerEl = simpleDom.createElement("div"); outerEl.className = theme.cssClass; - + var innerEl = simpleDom.createElement("div"); innerEl.className = "ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter"); innerEl.style["counter-reset"] = "ace_line " + (lineStart - 1); @@ -223,7 +228,7 @@ highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { for (var ix = 0; ix < length; ix++) { var lineEl = simpleDom.createElement("div"); lineEl.className = "ace_line"; - + if (!disableGutter) { var gutterEl = simpleDom.createElement("span"); gutterEl.className ="ace_gutter ace_gutter-cell"; diff --git a/src/marker_group.js b/src/marker_group.js index 45304eb7255..2775f843cc1 100644 --- a/src/marker_group.js +++ b/src/marker_group.js @@ -25,7 +25,7 @@ class MarkerGroup { constructor(session, options) { if (options) this.markerType = options.markerType; - + /**@type {import("../ace-internal").Ace.MarkerGroupItem[]}*/ this.markers = []; /**@type {EditSession}*/ this.session = session; @@ -35,8 +35,8 @@ class MarkerGroup { /** * Finds the first marker containing pos - * @param {import("../ace-internal").Ace.Point} pos - * @returns {import("../ace-internal").Ace.MarkerGroupItem | undefined} + * @param {import("../ace-internal").Ace.Point} pos + * @returns {import("../ace-internal").Ace.MarkerGroupItem | undefined} */ getMarkerAtPosition(pos) { return this.markers.find(function(marker) { @@ -46,7 +46,7 @@ class MarkerGroup { /** * Comparator for Array.sort function, which sorts marker definitions by their positions - * + * * @param {MarkerGroupItem} a first marker. * @param {MarkerGroupItem} b second marker. * @returns {number} negative number if a should be before b, positive number if b should be before a, 0 otherwise. diff --git a/src/tooltip.js b/src/tooltip.js index 4590728a1be..f0f69951739 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -21,7 +21,7 @@ class Tooltip { this.$element = null; this.$parentNode = parentNode; } - + $init() { this.$element = dom.createElement("div"); this.$element.className = CLASSNAME; @@ -112,7 +112,7 @@ class Tooltip { getWidth() { return this.getElement().offsetWidth; } - + destroy() { this.isOpen = false; if (this.$element && this.$element.parentNode) { @@ -160,7 +160,7 @@ class PopupManager { break; } } - + if (shouldDisplay) { visiblepopups.push(popup); } else { @@ -192,23 +192,23 @@ exports.Tooltip = Tooltip; class HoverTooltip extends Tooltip { constructor(parentNode=document.body) { super(parentNode); - + this.timeout = undefined; this.lastT = 0; this.idleTime = 350; this.lastEvent = undefined; - + this.onMouseOut = this.onMouseOut.bind(this); this.onMouseMove = this.onMouseMove.bind(this); this.waitForHover = this.waitForHover.bind(this); this.hide = this.hide.bind(this); - + var el = this.getElement(); el.style.whiteSpace = "pre-wrap"; el.style.pointerEvents = "auto"; el.addEventListener("mouseout", this.onMouseOut); el.tabIndex = -1; - + el.addEventListener("blur", function() { if (!el.contains(document.activeElement)) this.hide(); }.bind(this)); @@ -250,7 +250,7 @@ class HoverTooltip extends Tooltip { if (this.isOpen) { var pos = this.lastEvent && this.lastEvent.getDocumentPosition(); if ( - !this.range + !this.range || !this.range.contains(pos.row, pos.column) || isMousePressed || this.isOutsideOfText(this.lastEvent) @@ -269,7 +269,7 @@ class HoverTooltip extends Tooltip { this.timeout = setTimeout(this.waitForHover, this.idleTime - dt); return; } - + this.timeout = null; if (this.lastEvent && !this.isOutsideOfText(this.lastEvent)) { this.$gatherData(this.lastEvent, this.lastEvent.editor); @@ -297,7 +297,7 @@ class HoverTooltip extends Tooltip { } /** - * @param {any} value + * @param {(event: MouseEvent, editor: Editor) => void} value */ setDataProvider(value) { this.$gatherData = value; @@ -306,14 +306,14 @@ class HoverTooltip extends Tooltip { /** * @param {Editor} editor * @param {Range} range - * @param {any} domNode + * @param {HTMLElement} domNode * @param {MouseEvent} startingEvent */ showForRange(editor, range, domNode, startingEvent) { var MARGIN = 10; if (startingEvent && startingEvent != this.lastEvent) return; if (this.isOpen && document.activeElement == this.getElement()) return; - + var renderer = editor.renderer; if (!this.isOpen) { popupManager.addPopup(this); @@ -321,23 +321,23 @@ class HoverTooltip extends Tooltip { this.setTheme(renderer.theme); } this.isOpen = true; - + this.addMarker(range, editor.session); this.range = Range.fromPoints(range.start, range.end); var position = renderer.textToScreenCoordinates(range.start.row, range.start.column); - + var rect = renderer.scroller.getBoundingClientRect(); // clip position to visible area of the editor if (position.pageX < rect.left) position.pageX = rect.left; - + var element = this.getElement(); element.innerHTML = ""; element.appendChild(domNode); - + element.style.maxHeight = ""; - element.style.display = "block"; - + element.style.display = "block"; + // measure the size of tooltip, without constraints on its height var labelHeight = element.clientHeight; var labelWidth = element.clientWidth; @@ -348,11 +348,11 @@ class HoverTooltip extends Tooltip { if (position.pageY - labelHeight < 0 && position.pageY < spaceBelow) { isAbove = false; } - + element.style.maxHeight = (isAbove ? position.pageY : spaceBelow) - MARGIN + "px"; element.style.top = isAbove ? "" : position.pageY + renderer.lineHeight + "px"; element.style.bottom = isAbove ? window.innerHeight - position.pageY + "px" : ""; - + // try to align tooltip left with the range, but keep it on screen element.style.left = Math.min(position.pageX, window.innerWidth - labelWidth - MARGIN) + "px"; } @@ -368,7 +368,7 @@ class HoverTooltip extends Tooltip { this.$markerSession = session; this.marker = session && session.addMarker(range, "ace_highlight-marker", "text"); } - + hide(e) { if (!e && document.activeElement == this.getElement()) return; diff --git a/tool/test-npm-package.sh b/tool/test-npm-package.sh index 8268248555a..abbe623b48e 100755 --- a/tool/test-npm-package.sh +++ b/tool/test-npm-package.sh @@ -19,6 +19,11 @@ mv "$PACKAGE_FILE" ace-code-latest.tgz # npm install "../../$PACKAGE_FILE" cd demo/test_package + +# Clean up previous installation +rm -rf node_modules/ace-code +rm -f package-lock.json + # Install TypeScript npm install From fa6993c33b6f1b77c3a94eb02e4c262b6d1fb0f3 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Thu, 7 Nov 2024 17:17:59 +0400 Subject: [PATCH 25/33] update to new version --- ace-ext.d.ts | 4 +- ace-internal.d.ts | 7 - ace-modes.d.ts | 72 +- ace-modules.d.ts | 134 +-- ace.d.ts | 2200 +++++++++++++++++++++------------------------ package.json | 2 +- 6 files changed, 1136 insertions(+), 1283 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index f3d6fa96ced..cd79024d3cb 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -800,7 +800,7 @@ declare module "ace-code/src/ext/textarea" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.2"; + version: "1.36.4"; }; edit: (el?: string | (HTMLElement & { env?: any; @@ -812,7 +812,7 @@ declare module "ace-code/src/ext/textarea" { EditSession: typeof ace.EditSession; UndoManager: typeof ace.UndoManager; VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.36.2"; + version: "1.36.4"; transformTextarea: (element: any, options: any) => ace.Editor; defaultOptions: { mode: string; diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 96d51a66eb3..b092f3d5044 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -1355,12 +1355,6 @@ declare module "./src/edit_session" { $occurMatchingLines?: any, $useEmacsStyleLineStart?: boolean, $selectLongWords?: boolean, - curOp?: { - command: {}, - args: string, - scrollTop: number, - [key: string]: any; - }, getSelectionMarkers(): any[], } @@ -1373,7 +1367,6 @@ declare module "./src/edit_session/fold" { } } -// @ts-expect-error declare module "./src/placeholder" { export interface PlaceHolder extends Ace.EventEmitter { } diff --git a/ace-modes.d.ts b/ace-modes.d.ts index feb9b534223..93c4d8f8fe4 100644 --- a/ace-modes.d.ts +++ b/ace-modes.d.ts @@ -119,11 +119,11 @@ declare module "ace-code/src/mode/autohotkey" { } declare module "ace-code/src/mode/basic_highlight_rules" { - export const BasicHighlightRules: new () => import(".").Ace.HighlightRules; + export const BasicHighlightRules: new () => import("ace-code").Ace.HighlightRules; } declare module "ace-code/src/mode/basic" { - export const Mode: new () => import(".").Ace.SyntaxMode; + export const Mode: new () => import("ace-code").Ace.SyntaxMode; } declare module "ace-code/src/mode/batchfile_highlight_rules" { @@ -139,31 +139,31 @@ declare module "ace-code/src/mode/behaviour" { } declare module "ace-code/src/mode/behaviour/css" { - export const CssBehaviour: new () => import(".").Ace.Behaviour; + export const CssBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/cstyle" { - export const CstyleBehaviour: new () => import(".").Ace.Behaviour; + export const CstyleBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/html" { - export const HtmlBehaviour: new () => import(".").Ace.Behaviour; + export const HtmlBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/javascript" { - export const JavaScriptBehaviour: new () => import(".").Ace.Behaviour; + export const JavaScriptBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/liquid" { - export const LiquidBehaviour: new () => import(".").Ace.Behaviour; + export const LiquidBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/xml" { - export const XmlBehaviour: new () => import(".").Ace.Behaviour; + export const XmlBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/behaviour/xquery" { - export const XQueryBehaviour: new () => import(".").Ace.Behaviour; + export const XQueryBehaviour: new () => import("ace-code").Ace.Behaviour; } declare module "ace-code/src/mode/bibtex_highlight_rules" { @@ -429,111 +429,111 @@ declare module "ace-code/src/mode/flix" { } declare module "ace-code/src/mode/folding/asciidoc" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/basic" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/c9search" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/coffee" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/csharp" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/cstyle" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/diff" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/drools" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/fold_mode" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/haskell_cabal" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/html" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/ini" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/java" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/javascript" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/latex" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/lua" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/markdown" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/mixed" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/php" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/pythonic" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/ruby" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/sql" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/sqlserver" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/vbscript" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/velocity" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/xml" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/folding/yaml" { - export const FoldMode: new () => import(".").Ace.Folding; + export const FoldMode: new () => import("ace-code").Ace.Folding; } declare module "ace-code/src/mode/forth_highlight_rules" { diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 95e9338816f..9d26537ddc6 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -446,7 +446,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.2"; + version: "1.36.4"; }; export = _exports; } @@ -1102,7 +1102,7 @@ declare module "ace-code/src/virtual_renderer" { * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. * @param {HTMLElement | null} [container] The root element of the editor * @param {String} [theme] The starting theme - + **/ constructor(container?: HTMLElement | null, theme?: string); container: HTMLElement; @@ -1174,7 +1174,7 @@ declare module "ace-code/src/virtual_renderer" { /** * Triggers a full update of all the layers, for all the rows. * @param {Boolean} [force] If `true`, forces the changes through - + **/ updateFull(force?: boolean): void; /** @@ -1185,96 +1185,96 @@ declare module "ace-code/src/virtual_renderer" { gutterWidth: any; /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. - + **/ adjustWrapLimit(): boolean; /** * Identifies whether you want to have an animated scroll or not. * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls - + **/ setAnimatedScroll(shouldAnimate: boolean): void; /** * Returns whether an animated scroll happens or not. * @returns {Boolean} - + **/ getAnimatedScroll(): boolean; /** * Identifies whether you want to show invisible characters or not. * @param {Boolean} showInvisibles Set to `true` to show invisibles - + **/ setShowInvisibles(showInvisibles: boolean): void; /** * Returns whether invisible characters are being shown or not. * @returns {Boolean} - + **/ getShowInvisibles(): boolean; /** * @return {boolean} - + */ getDisplayIndentGuides(): boolean; /** * @param {boolean} display - + */ setDisplayIndentGuides(display: boolean): void; /** - + * @return {boolean} */ getHighlightIndentGuides(): boolean; /** - + * @param {boolean} highlight */ setHighlightIndentGuides(highlight: boolean): void; /** * Identifies whether you want to show the print margin or not. * @param {Boolean} showPrintMargin Set to `true` to show the print margin - + **/ setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns whether the print margin is being shown or not. * @returns {Boolean} - + **/ getShowPrintMargin(): boolean; /** * Identifies whether you want to show the print margin column or not. * @param {number} printMarginColumn Set to `true` to show the print margin column - + **/ setPrintMarginColumn(printMarginColumn: number): void; /** * Returns whether the print margin column is being shown or not. * @returns {number} - + **/ getPrintMarginColumn(): number; /** * Returns `true` if the gutter is being shown. * @returns {Boolean} - + **/ getShowGutter(): boolean; /** * Identifies whether you want to show the gutter or not. * @param {Boolean} show Set to `true` to show the gutter - + **/ setShowGutter(show: boolean): void; /** - + * @returns {boolean} */ getFadeFoldWidgets(): boolean; /** - + * @param {boolean} show */ setFadeFoldWidgets(show: boolean): void; @@ -1284,7 +1284,7 @@ declare module "ace-code/src/virtual_renderer" { */ setHighlightGutterLine(shouldHighlight: boolean): void; /** - + * @returns {boolean} */ getHighlightGutterLine(): boolean; @@ -1332,7 +1332,7 @@ declare module "ace-code/src/virtual_renderer" { /** * Sets the padding for all the layers. * @param {Number} padding A new padding value (in pixels) - + **/ setPadding(padding: number): void; /** @@ -1341,7 +1341,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [bottom] * @param {number} [left] * @param {number} [right] - + */ setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; /** @@ -1350,25 +1350,25 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} [bottom] * @param {number} [left] * @param {number} [right] - + */ setMargin(top?: number, bottom?: number, left?: number, right?: number): void; /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} - + **/ getHScrollBarAlwaysVisible(): boolean; /** * Identifies whether you want to show the horizontal scrollbar or not. * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - + **/ setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; /** * Returns whether the horizontal scrollbar is set to be always visible. * @returns {Boolean} - + **/ getVScrollBarAlwaysVisible(): boolean; /** @@ -1486,14 +1486,14 @@ declare module "ace-code/src/virtual_renderer" { * @param {Boolean} center If `true`, centers the editor the to indicated line * @param {Boolean} animate If `true` animates scrolling * @param {() => void} [callback] Function to be called after the animation has finished - + **/ scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; /** * * @param fromValue * @param [callback] - + */ animateScrolling(fromValue: any, callback?: any): void; /** @@ -1531,7 +1531,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} x * @param {number} y * @returns {import("ace-code").Ace.ScreenCoordinates} - + */ pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; /** @@ -1539,7 +1539,7 @@ declare module "ace-code/src/virtual_renderer" { * @param {number} x * @param {number} y * @returns {Point} - + */ screenToTextCoordinates(x: number, y: number): Point; /** @@ -1565,20 +1565,20 @@ declare module "ace-code/src/virtual_renderer" { visualizeBlur(): void; /** * @param {Object} composition - + **/ showComposition(composition: any): void; /** * @param {String} text A string of text to use * * Sets the inner text of the current composition to `text`. - + **/ setCompositionText(text: string): void; /** * * Hides the current composition. - + **/ hideComposition(): void; /** @@ -1603,7 +1603,7 @@ declare module "ace-code/src/virtual_renderer" { * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} * @param {String | Theme} [theme] The path to a theme * @param {() => void} [cb] optional callback - + **/ setTheme(theme?: string | Theme, cb?: () => void): void; /** @@ -1634,7 +1634,7 @@ declare module "ace-code/src/virtual_renderer" { attachToShadowRoot(): void; /** * Destroys the text and cursor layers for this renderer. - + **/ destroy(): void; CHANGE_CURSOR: number; @@ -2834,18 +2834,18 @@ declare module "ace-code/src/editor" { /**@type {KeyBinding}*/ keyBinding: KeyBinding; startOperation(commandEvent: any): void; - prevOp: {}; - previousCommand: any; /** - * @type {{[key: string]: any;}} + * @arg e */ - curOp: { - [key: string]: any; - }; + endOperation(e: any): void; + onStartOperation(commandEvent: any): void; + curOp: {}; + prevOp: {}; + previousCommand: any; /** * @arg e */ - endOperation(e: any): any; + onEndOperation(e: any): void; mergeNextCommand: boolean; sequenceStartTime: number; /** @@ -2925,14 +2925,14 @@ declare module "ace-code/src/editor" { unsetStyle(style: string): void; /** * Gets the current font size of the editor text. - * @return {string} + * @return {string | number} */ - getFontSize(): string; + getFontSize(): string | number; /** * Set a new font size (in pixels) for the editor text. - * @param {String} size A font size ( _e.g._ "12px") + * @param {String | number} size A font size ( _e.g._ "12px") **/ - setFontSize(size: string): void; + setFontSize(size: string | number): void; /** * * Brings the current `textInput` into focus. @@ -5097,10 +5097,33 @@ declare module "ace-code/src/edit_session" { **/ constructor(text?: Document | string, mode?: SyntaxMode); /**@type {Document}*/ doc: Document; + prevOp: {}; id: string; bgTokenizer: BackgroundTokenizer; selection: Selection; destroyed: boolean; + curOp: { + command: { + name?: string; + }; + args: any; + }; + /** + * Start an Ace operation, which will then batch all the subsequent changes (to either content or selection) under a single atomic operation. + * @param {{command?: {name?: string}, args?: any}|undefined} [commandEvent] Optional name for the operation + */ + startOperation(commandEvent?: { + command?: { + name?: string; + }; + args?: any; + } | undefined): void; + /** + * End current Ace operation. + * Emits "beforeEndOperation" event just before clearing everything, where the current operation can be accessed through `curOp` property. + * @param {any} e + */ + endOperation(e: any): void; /** * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. * @@ -5115,6 +5138,7 @@ declare module "ace-code/src/edit_session" { getDocument(): Document; resetCaches(): void; mergeUndoDeltas: boolean; + onSelectionChange(): void; /** * Sets the session text. * @param {String} text The new text to place @@ -5705,12 +5729,6 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: { - command: {}; - args: string; - scrollTop: number; - [key: string]: any; - }; getSelectionMarkers(): any[]; } export namespace EditSession { @@ -5731,10 +5749,10 @@ declare module "ace-code/src/edit_session" { import Selection = Selection_1.Selection; import BidiHandler_1 = require("ace-code/src/bidihandler"); import BidiHandler = BidiHandler_1.BidiHandler; - import UndoManager_1 = require("ace-code/src/undomanager"); - import UndoManager = UndoManager_1.UndoManager; import Range_11 = require("ace-code/src/range"); import Range = Range_11.Range; + import UndoManager_1 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_1.UndoManager; function isFullWidth(c: any): boolean; var $uid: number; export { }; @@ -5756,12 +5774,6 @@ declare module "ace-code/src/edit_session" { gutterRenderer?: any; selectionMarkerCount?: number; multiSelect?: any; - curOp?: { - command: {}; - args: string; - scrollTop: number; - [key: string]: any; - }; getSelectionMarkers(): any[]; } } diff --git a/ace.d.ts b/ace.d.ts index 88560068eb7..55ac58f2532 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,1179 +1,1027 @@ +/// +/// +/// +/// +/// /// -/// - -export namespace Ace { - export type NewLineMode = 'auto' | 'unix' | 'windows'; - - export interface Anchor extends EventEmitter { - getPosition(): Position; - getDocument(): Document; - setPosition(row: number, column: number, noClip?: boolean): void; - detach(): void; - attach(doc: Document): void; - } - - export interface Document extends EventEmitter { - setValue(text: string): void; - getValue(): string; - createAnchor(row: number, column: number): Anchor; - getNewLineCharacter(): string; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - isNewLine(text: string): boolean; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getAllLines(): string[]; - getLength(): number; - getTextRange(range: Range): string; - getLinesForRange(range: Range): string[]; - insert(position: Position, text: string): Position; - insert(position: {row: number, column: number}, text: string): Position; - insertInLine(position: Position, text: string): Position; - insertNewLine(position: Point): Point; - clippedPos(row: number, column: number): Point; - clonePos(pos: Point): Point; - pos(row: number, column: number): Point; - insertFullLines(row: number, lines: string[]): void; - insertMergedLines(position: Position, lines: string[]): Point; - remove(range: Range): Position; - removeInLine(row: number, startColumn: number, endColumn: number): Position; - removeFullLines(firstRow: number, lastRow: number): string[]; - removeNewLine(row: number): void; - replace(range: Range, text: string): Position; - applyDeltas(deltas: Delta[]): void; - revertDeltas(deltas: Delta[]): void; - applyDelta(delta: Delta, doNotValidate?: boolean): void; - revertDelta(delta: Delta): void; - indexToPosition(index: number, startRow: number): Position; - positionToIndex(pos: Position, startRow?: number): number; - } - - export interface FoldLine { - folds: Fold[]; - range: Range; - start: Point; - end: Point; - - shiftRow(shift: number): void; - addFold(fold: Fold): void; - containsRow(row: number): boolean; - walk(callback: Function, endRow?: number, endColumn?: number): void; - getNextFoldTo(row: number, column: number): null | { fold: Fold, kind: string }; - addRemoveChars(row: number, column: number, len: number): void; - split(row: number, column: number): FoldLine; - merge(foldLineNext: FoldLine): void; - idxToPosition(idx: number): Point; - } - - export interface Fold { - range: Range; - start: Point; - end: Point; - foldLine?: FoldLine; - sameRow: boolean; - subFolds: Fold[]; - - setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - addSubFold(fold: Fold): Fold; - restoreRange(range: Range): void; - } - - interface Folding { - getFoldAt(row: number, column: number, side: number): Fold; - getFoldsInRange(range: Range): Fold[]; - getFoldsInRangeList(ranges: Range[]): Fold[]; - getAllFolds(): Fold[]; - getFoldStringAt(row: number, - column: number, - trim?: number, - foldLine?: FoldLine): string | null; - getFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getNextFoldLine(docRow: number, startFoldLine?: FoldLine): FoldLine | null; - getFoldedRowCount(first: number, last: number): number; - addFold(placeholder: string | Fold, range?: Range): Fold; - addFolds(folds: Fold[]): void; - removeFold(fold: Fold): void; - removeFolds(folds: Fold[]): void; - expandFold(fold: Fold): void; - expandFolds(folds: Fold[]): void; - unfold(location: null | number | Point | Range, - expandInner?: boolean): Fold[] | undefined; - isRowFolded(docRow: number, startFoldRow?: FoldLine): boolean; - getFoldRowEnd(docRow: number, startFoldRow?: FoldLine): number; - getFoldRowStart(docRow: number, startFoldRow?: FoldLine): number; - getFoldDisplayLine(foldLine: FoldLine, - endRow: number | null, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - getDisplayLine(row: number, - endColumn: number | null, - startRow: number | null, - startColumn: number | null): string; - toggleFold(tryToUnfold?: boolean): void; - getCommentFoldRange(row: number, - column: number, - dir: number): Range | undefined; - foldAll(startRow?: number, endRow?: number, depth?: number): void; - setFoldStyle(style: string): void; - getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { - range?: Range, - firstRange: Range +declare module "ace-code" { + export namespace Ace { + type Anchor = import("ace-code/src/anchor").Anchor; + type Editor = import("ace-code/src/editor").Editor; + type EditSession = import("ace-code/src/edit_session").EditSession; + type Document = import("ace-code/src/document").Document; + type Fold = import("ace-code/src/edit_session/fold").Fold; + type FoldLine = import("ace-code/src/edit_session/fold_line").FoldLine; + type Range = import("ace-code/src/range").Range; + type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + type UndoManager = import("ace-code/src/undomanager").UndoManager; + type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; + type TokenIterator = import("ace-code/src/token_iterator").TokenIterator; + type Selection = import("ace-code/src/selection").Selection; + type Autocomplete = import("ace-code/src/autocomplete").Autocomplete; + type InlineAutocomplete = import("ace-code/src/ext/inline_autocomplete").InlineAutocomplete; + type CompletionProvider = import("ace-code/src/autocomplete").CompletionProvider; + type AcePopup = import("ace-code/src/autocomplete/popup").AcePopup; + type AceInline = import("ace-code/src/autocomplete/inline").AceInline; + type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; + type RangeList = import("ace-code/src/range_list").RangeList; + type FilteredList = import("ace-code/src/autocomplete").FilteredList; + type LineWidgets = import("ace-code/src/line_widgets").LineWidgets; + type SearchBox = import("ace-code/src/ext/searchbox").SearchBox; + type Occur = import("ace-code/src/occur").Occur; + type DefaultHandlers = import("ace-code/src/mouse/default_handlers").DefaultHandlers; + type GutterHandler = import("ace-code/src/mouse/default_gutter_handler").GutterHandler; + type DragdropHandler = import("ace-code/src/mouse/dragdrop_handler").DragdropHandler; + type AppConfig = import("ace-code/src/lib/app_config").AppConfig; + type Config = typeof import("ace-code/src/config"); + type AfterLoadCallback = (err: Error | null, module: unknown) => void; + type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; + export interface ConfigOptions { + packaged: boolean; + workerPath: string | null; + modePath: string | null; + themePath: string | null; + basePath: string; + suffix: string; + loadWorkerFromBlob: boolean; + sharedPopups: boolean; + useStrictCSP: boolean | null; + } + interface Theme { + cssClass?: string; + cssText?: string; + padding?: number | string; + isDark?: boolean; + } + interface ScrollBar { + setVisible(visible: boolean): void; + [key: string]: any; + } + interface HScrollbar extends ScrollBar { + setWidth(width: number): void; + } + interface VScrollbar extends ScrollBar { + setHeight(width: number): void; + } + interface LayerConfig { + width: number; + padding: number; + firstRow: number; + firstRowScreen: number; + lastRow: number; + lineHeight: number; + characterWidth: number; + minHeight: number; + maxHeight: number; + offset: number; + height: number; + gutterOffset: number; + } + interface HardWrapOptions { + startRow: number; + endRow: number; + allowMerge?: boolean; + column?: number; + } + interface CommandBarOptions { + maxElementsOnTooltip: number; + alwaysShow: boolean; + showDelay: number; + hideDelay: number; + } + interface ScreenCoordinates { + row: number; + column: number; + side?: 1 | -1; + offsetX?: number; + } + interface Folding { + /** + * Looks up a fold at a given row/column. Possible values for side: + * -1: ignore a fold if fold.start = row/column + * +1: ignore a fold if fold.end = row/column + **/ + getFoldAt(row: number, column: number, side?: number): Ace.Fold; + /** + * Returns all folds in the given range. Note, that this will return folds + **/ + getFoldsInRange(range: Ace.Range | Ace.Delta): Ace.Fold[]; + getFoldsInRangeList(ranges: Ace.Range[] | Ace.Range): Ace.Fold[]; + /** + * Returns all folds in the document + */ + getAllFolds(): Ace.Fold[]; + /** + * Returns the string between folds at the given position. + * E.g. + * foob|arwolrd -> "bar" + * foobarwol|rd -> "world" + * foobarwolrd -> + * + * where | means the position of row/column + * + * The trim option determs if the return string should be trimed according + * to the "side" passed with the trim value: + * + * E.g. + * foob|arwolrd -trim=-1> "b" + * foobarwol|rd -trim=+1> "rld" + * fo|obarwolrd -trim=00> "foo" + */ + getFoldStringAt(row: number, column: number, trim?: number, foldLine?: Ace.FoldLine): string | null; + getFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + /** + * Returns the fold which starts after or contains docRow + */ + getNextFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + getFoldedRowCount(first: number, last: number): number; + /** + * Adds a new fold. + * @returns {Ace.Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + */ + addFold(placeholder: Ace.Fold | string, range?: Ace.Range): Ace.Fold; + addFolds(folds: Ace.Fold[]): void; + removeFold(fold: Ace.Fold): void; + removeFolds(folds: Ace.Fold[]): void; + expandFold(fold: Ace.Fold): void; + expandFolds(folds: Ace.Fold[]): void; + unfold(location?: number | null | Ace.Point | Ace.Range | Ace.Range[], expandInner?: boolean): Ace.Fold[] | undefined; + /** + * Checks if a given documentRow is folded. This is true if there are some + * folded parts such that some parts of the line is still visible. + **/ + isRowFolded(docRow: number, startFoldRow?: Ace.FoldLine): boolean; + getRowFoldEnd(docRow: number, startFoldRow?: Ace.FoldLine): number; + getRowFoldStart(docRow: number, startFoldRow?: Ace.FoldLine): number; + getFoldDisplayLine(foldLine: Ace.FoldLine, endRow?: number | null, endColumn?: number | null, startRow?: number | null, startColumn?: number | null): string; + getDisplayLine(row: number, endColumn: number | null, startRow: number | null, startColumn: number | null): string; + toggleFold(tryToUnfold?: boolean): void; + getCommentFoldRange(row: number, column: number, dir?: number): Ace.Range | undefined; + foldAll(startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function): void; + foldToLevel(level: number): void; + foldAllComments(): void; + setFoldStyle(style: string): void; + foldWidgets: any[]; + getFoldWidget: any; + getFoldWidgetRange: any; + getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { + range?: Ace.Range; + firstRange?: Ace.Range; + }; + onFoldWidgetClick(row: number, e: any): void; + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget(toggleParent?: boolean): void; + updateFoldWidgets(delta: Ace.Delta): void; + tokenizerUpdateFoldWidgets(e: any): void; + } + interface BracketMatch { + findMatchingBracket: (position: Point, chr?: string) => Point; + getBracketRange: (pos: Point) => null | Range; + /** + * Returns: + * * null if there is no any bracket at `pos`; + * * two Ranges if there is opening and closing brackets; + * * one Range if there is only one bracket + */ + getMatchingBracketRanges: (pos: Point, isBackwards?: boolean) => null | Range[]; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + */ + getMatchingTags: (pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + }; + } + interface IRange { + start: Point; + end: Point; + } + interface LineWidget { + el: HTMLElement; + rowCount: number; + hidden: boolean; + column?: number; + row?: number; + session: EditSession; + html?: string; + text?: string; + className?: string; + coverGutter?: boolean; + pixelHeight?: number; + editor: Editor; + coverLine?: boolean; + fixedWidth?: boolean; + fullWidth?: boolean; + screenWidth?: number; + rowsAbove?: number; + lenses?: any[]; + } + type NewLineMode = "auto" | "unix" | "windows"; + interface EditSessionOptions { + wrap: "off" | "free" | "printmargin" | boolean | number; + wrapMethod: "code" | "text" | "auto"; + indentedSoftWrap: boolean; + firstLineNumber: number; + useWorker: boolean; + useSoftTabs: boolean; + tabSize: number; + navigateWithinSoftTabs: boolean; + foldStyle: "markbegin" | "markbeginend" | "manual"; + overwrite: boolean; + newLineMode: NewLineMode; + mode: string; + } + interface VirtualRendererOptions { + animatedScroll: boolean; + showInvisibles: boolean; + showPrintMargin: boolean; + printMarginColumn: number; + printMargin: boolean | number; + showGutter: boolean; + fadeFoldWidgets: boolean; + showFoldWidgets: boolean; + showLineNumbers: boolean; + displayIndentGuides: boolean; + highlightIndentGuides: boolean; + highlightGutterLine: boolean; + hScrollBarAlwaysVisible: boolean; + vScrollBarAlwaysVisible: boolean; + fontSize: string | number; + fontFamily: string; + maxLines: number; + minLines: number; + scrollPastEnd: number; + fixedWidthGutter: boolean; + customScrollbar: boolean; + theme: string; + hasCssTransforms: boolean; + maxPixelHeight: number; + useSvgGutterIcons: boolean; + showFoldedAnnotations: boolean; + useResizeObserver: boolean; + } + interface MouseHandlerOptions { + scrollSpeed: number; + dragDelay: number; + dragEnabled: boolean; + focusTimeout: number; + tooltipFollowsMouse: boolean; + } + interface EditorOptions extends EditSessionOptions, MouseHandlerOptions, VirtualRendererOptions { + selectionStyle: "fullLine" | "screenLine" | "text" | "line"; + highlightActiveLine: boolean; + highlightSelectedWord: boolean; + readOnly: boolean; + copyWithEmptySelection: boolean; + cursorStyle: "ace" | "slim" | "smooth" | "wide"; + mergeUndoDeltas: true | false | "always"; + behavioursEnabled: boolean; + wrapBehavioursEnabled: boolean; + enableAutoIndent: boolean; + enableBasicAutocompletion: boolean | Completer[]; + enableLiveAutocompletion: boolean | Completer[]; + liveAutocompletionDelay: number; + liveAutocompletionThreshold: number; + enableSnippets: boolean; + autoScrollEditorIntoView: boolean; + keyboardHandler: string | null; + placeholder: string; + value: string; + session: EditSession; + relativeLineNumbers: boolean; + enableMultiselect: boolean; + enableKeyboardAccessibility: boolean; + enableCodeLens: boolean; + textInputAriaLabel: string; + enableMobileMenu: boolean; + } + interface EventsBase { + [key: string]: any; + } + interface EditSessionEvents { + /** + * Emitted when the document changes. + * @param delta + */ + "change": (delta: Delta) => void; + /** + * Emitted when the tab size changes, via [[EditSession.setTabSize]]. + */ + "changeTabSize": () => void; + /** + * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. + * @param overwrite + */ + "changeOverwrite": (overwrite: boolean) => void; + /** + * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. + * @param e + */ + "changeBreakpoint": (e?: { + row?: number; + breakpoint?: boolean; + }) => void; + /** + * Emitted when a front marker changes. + */ + "changeFrontMarker": () => void; + /** + * Emitted when a back marker changes. + */ + "changeBackMarker": () => void; + /** + * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. + */ + "changeAnnotation": (e: {}) => void; + /** + * Emitted when a background tokenizer asynchronously processes new rows. + */ + "tokenizerUpdate": (e: { + data: { + first: number; + last: number; + }; + }) => void; + /** + * Emitted when the current mode changes. + * @param e + */ + "changeMode": (e: any) => void; + /** + * Emitted when the wrap mode changes. + * @param e + */ + "changeWrapMode": (e: any) => void; + /** + * Emitted when the wrapping limit changes. + * @param e + */ + "changeWrapLimit": (e: any) => void; + /** + * Emitted when a code fold is added or removed. + * @param e + */ + "changeFold": (e: any, session?: EditSession) => void; + /** + * Emitted when the scroll top changes. + * @param scrollTop The new scroll top value + **/ + "changeScrollTop": (scrollTop: number) => void; + /** + * Emitted when the scroll left changes. + * @param scrollLeft The new scroll left value + **/ + "changeScrollLeft": (scrollLeft: number) => void; + "changeEditor": (e: { + editor?: Editor; + oldEditor?: Editor; + }) => void; + "changeSelection": () => void; + "startOperation": (op?: { + command?: { + name?: string; + }; + args?: any; + }) => void; + "endOperation": (op?: any) => void; + "beforeEndOperation": () => void; + } + interface EditorEvents { + "change": (delta: Delta) => void; + "changeSelection": () => void; + "input": () => void; + /** + * Emitted whenever the [[EditSession]] changes. + * @param e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. + **/ + "changeSession": (e: { + oldSession: EditSession; + session: EditSession; + }) => void; + "blur": (e: any) => void; + "mousedown": (e: MouseEvent) => void; + "mousemove": (e: MouseEvent & { + scrollTop?: any; + }, editor?: Editor) => void; + "changeStatus": (e: any) => void; + "keyboardActivity": (e: any) => void; + "mousewheel": (e: MouseEvent) => void; + "mouseup": (e: MouseEvent) => void; + "beforeEndOperation": (e: any) => void; + "nativecontextmenu": (e: any) => void; + "destroy": (e: any) => void; + "focus": (e?: any) => void; + /** + * Emitted when text is copied. + * @param text The copied text + **/ + "copy": (e: { + text: string; + }) => void; + /** + * Emitted when text is pasted. + **/ + "paste": (text: string, event: any) => void; + /** + * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. + * @param data Contains one property, `data`, which indicates the new selection style + **/ + "changeSelectionStyle": (data: "fullLine" | "screenLine" | "text" | "line") => void; + "changeMode": (e: { + mode?: Ace.SyntaxMode; + oldMode?: Ace.SyntaxMode; + }) => void; + //from searchbox extension + "findSearchBox": (e: { + match: boolean; + }) => void; + //from code_lens extension + "codeLensClick": (e: any) => void; + "select": () => void; + } + interface AcePopupEvents { + "click": (e: MouseEvent) => void; + "dblclick": (e: MouseEvent) => void; + "tripleclick": (e: MouseEvent) => void; + "quadclick": (e: MouseEvent) => void; + "show": () => void; + "hide": () => void; + "select": (hide: boolean) => void; + "changeHoverMarker": (e: any) => void; + } + interface DocumentEvents { + /** + * Fires whenever the document changes. + * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available: + * * `"insert"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being added + * * `"remove"` + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines being removed + * + **/ + "change": (e: Delta) => void; + "changeNewLineMode": () => void; + } + interface AnchorEvents { + /** + * Fires whenever the anchor position changes. + * Both of these objects have a `row` and `column` property corresponding to the position. + * Events that can trigger this function include [[Anchor.setPosition `setPosition()`]]. + * @param {Object} e An object containing information about the anchor position. It has two properties: + * - `old`: An object describing the old Anchor position + * - `value`: An object describing the new Anchor position + **/ + "change": (e: { + old: Point; + value: Point; + }) => void; + } + interface BackgroundTokenizerEvents { + /** + * Fires whenever the background tokeniziers between a range of rows are going to be updated. + * @param e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + **/ + "update": (e: { + data: { + first: number; + last: number; + }; + }) => void; + } + interface SelectionEvents { + /** + * Emitted when the cursor position changes. + **/ + "changeCursor": () => void; + /** + * Emitted when the cursor selection changes. + **/ + "changeSelection": () => void; + } + interface MultiSelectionEvents extends SelectionEvents { + "multiSelect": () => void; + "addRange": (e: { + range: Range; + }) => void; + "removeRange": (e: { + ranges: Range[]; + }) => void; + "singleSelect": () => void; + } + interface PlaceHolderEvents { + "cursorEnter": (e: any) => void; + "cursorLeave": (e: any) => void; + } + interface GutterEvents { + "changeGutterWidth": (width: number) => void; + "afterRender": () => void; + } + interface TextEvents { + "changeCharacterSize": (e: any) => void; + } + interface VirtualRendererEvents { + "afterRender": (e?: any, renderer?: VirtualRenderer) => void; + "beforeRender": (e: any, renderer?: VirtualRenderer) => void; + "themeLoaded": (e: { + theme: string | Theme; + }) => void; + "themeChange": (e: { + theme: string | Theme; + }) => void; + "scrollbarVisibilityChanged": () => void; + "changeCharacterSize": (e: any) => void; + "resize": (e?: any) => void; + "autosize": () => void; + } + class EventEmitter { + once(name: K, callback: T[K]): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K, callback: T[K], capturing?: boolean): T[K]; + addEventListener(name: K, callback: T[K], capturing?: boolean): T[K]; + off(name: K, callback: T[K]): void; + removeListener(name: K, callback: T[K]): void; + removeEventListener(name: K, callback: T[K]): void; + removeAllListeners(name?: string): void; + } + interface SearchOptions { + /**The string or regular expression you're looking for*/ + needle: string | RegExp; + preventScroll: boolean; + /**Whether to search backwards from where cursor currently is*/ + backwards: boolean; + /**The starting [[Range]] or cursor position to begin the search*/ + start: Range; + /**Whether or not to include the current line in the search*/ + skipCurrent: boolean; + /**The [[Range]] to search within. Set this to `null` for the whole document*/ + range: Range | null; + preserveCase: boolean; + /**Whether the search is a regular expression or not*/ + regExp: boolean; + /**Whether the search matches only on whole words*/ + wholeWord: boolean; + /**Whether the search ought to be case-sensitive*/ + caseSensitive: boolean; + /**Whether to wrap the search back to the beginning when it hits the end*/ + wrap: boolean; + re: any; + } + interface Point { + row: number; + column: number; + } + type Position = Point; + interface Delta { + action: "insert" | "remove"; + start: Point; + end: Point; + lines: string[]; + id?: number; + folds?: Fold[]; + } + interface Annotation { + row: number; + column: number; + text: string; + type: string; + } + export interface MarkerGroupItem { + range: Range; + className: string; + } + type MarkerGroup = import("ace-code/src/marker_group").MarkerGroup; + export interface Command { + name?: string; + bindKey?: string | { + mac?: string; + win?: string; + }; + readOnly?: boolean; + exec?: (editor?: Editor | any, args?: any) => void; + isAvailable?: (editor: Editor) => boolean; + description?: string; + multiSelectAction?: "forEach" | "forEachLine" | Function; + scrollIntoView?: true | "cursor" | "center" | "selectionPart" | "animate" | "selection" | "none"; + aceCommandGroup?: string; + passEvent?: boolean; + level?: number; + action?: string; + } + type CommandLike = Command | ((editor: Editor) => void) | ((sb: SearchBox) => void); + type KeyboardHandler = Partial & { + attach?: (editor: Editor) => void; + detach?: (editor: Editor) => void; + getStatusText?: (editor?: any, data?: any) => string; + }; + export interface MarkerLike { + range?: Range; + type: string; + renderer?: MarkerRenderer; + clazz: string; + inFront?: boolean; + id?: number; + update?: (html: string[], + // TODO maybe define Marker class + marker: any, session: EditSession, config: any) => void; + [key: string]: any; + } + type MarkerRenderer = (html: string[], range: Range, left: number, top: number, config: any) => void; + interface Token { + type: string; + value: string; + index?: number; + start?: number; + } + type BaseCompletion = import("ace-code/src/autocomplete").BaseCompletion; + type SnippetCompletion = import("ace-code/src/autocomplete").SnippetCompletion; + type ValueCompletion = import("ace-code/src/autocomplete").ValueCompletion; + type Completion = import("ace-code/src/autocomplete").Completion; + type HighlightRule = ({ + defaultToken: string; + } | { + include: string; + } | { + todo: string; + } | { + token: string | string[] | ((value: string) => string); + regex: string | RegExp; + next?: string | (() => void); + push?: string; + comment?: string; + caseInsensitive?: boolean; + nextState?: string; + }) & { + [key: string]: any; + }; + type HighlightRulesMap = Record; + type KeywordMapper = (keyword: string) => string; + interface HighlightRules { + addRules(rules: HighlightRulesMap, prefix?: string): void; + getRules(): HighlightRulesMap; + embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; + getEmbeds(): string[]; + normalizeRules(): void; + createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; + } + type FoldWidget = "start" | "end" | ""; + interface FoldMode { + foldingStartMarker: RegExp; + foldingStopMarker?: RegExp; + getFoldWidget(session: EditSession, foldStyle: string, row: number): FoldWidget; + getFoldWidgetRange(session: EditSession, foldStyle: string, row: number): Range | undefined; + indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; + 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 | string[], action: string, editor: Editor, session: EditSession, text: string | Range) => ({ + text: string; + selection: number[]; + } | Range) & { + [key: string]: any; + } | undefined; + type BehaviorMap = Record>; + interface Behaviour { + add(name: string, action: string, callback: BehaviorAction): void; + addBehaviours(behaviours: BehaviorMap): void; + remove(name: string): void; + inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; + getBehaviours(filter?: string[]): BehaviorMap; + } + interface Outdent { + checkOutdent(line: string, input: string): boolean; + autoOutdent(doc: Document, row: number): number | undefined; + } + interface SyntaxMode { + HighlightRules: { + new(config: any): HighlightRules; + }; //TODO: fix this + foldingRules?: FoldMode; + /** + * characters that indicate the start of a line comment + */ + lineCommentStart?: string; + /** + * characters that indicate the start and end of a block comment + */ + blockComment?: { + start: string; + end: string; + }; + tokenRe?: RegExp; + nonTokenRe?: RegExp; + completionKeywords: string[]; + transformAction: BehaviorAction; + path?: string; + getTokenizer(): Tokenizer; + 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 | string[], session: EditSession, pos: Point, prefix: string): Completion[]; + } + interface OptionsBase { + [key: string]: any; + } + class OptionsProvider { + setOptions(optList: Partial): void; + getOptions(optionNames?: Array | Partial): Partial; + setOption(name: K, value: T[K]): void; + getOption(name: K): T[K]; + } + type KeyBinding = import("ace-code/src/keyboard/keybinding").KeyBinding; + interface CommandMap { + [name: string]: Command; + } + type execEventHandler = (obj: { + editor: Editor; + command: Command; + args: any[]; + }) => void; + interface CommandManagerEvents { + on(name: "exec", callback: execEventHandler): Function; + on(name: "afterExec", callback: execEventHandler): Function; + } + type CommandManager = import("ace-code/src/commands/command_manager").CommandManager; + interface SavedSelection { + start: Point; + end: Point; + isBackwards: boolean; + } + var Selection: { + new(session: EditSession): Selection; + }; + interface TextInput { + resetSelection(): void; + setAriaOption(options?: { + activeDescendant: string; + role: string; + setLabel: any; + }): void; + } + type CompleterCallback = (error: any, completions: Completion[]) => void; + interface Completer { + identifierRegexps?: Array; + getCompletions(editor: Editor, session: EditSession, position: Point, prefix: string, callback: CompleterCallback): void; + getDocTooltip?(item: Completion): void | string | Completion; + onSeen?: (editor: Ace.Editor, completion: Completion) => void; + onInsert?: (editor: Ace.Editor, completion: Completion) => void; + cancel?(): void; + id?: string; + triggerCharacters?: string[]; + hideInlinePreview?: boolean; + insertMatch?: (editor: Editor, data: Completion) => void; + } + interface CompletionOptions { + matches?: Completion[]; + } + type CompletionProviderOptions = { + exactMatch?: boolean; + ignoreCaption?: boolean; + }; + type GatherCompletionRecord = { + prefix: string; + matches: Completion[]; + finished: boolean; + }; + type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; + type CompletionProviderCallback = (this: import("ace-code/src/autocomplete").Autocomplete, err: Error | undefined, completions: import("ace-code/src/autocomplete").FilteredList, finished: boolean) => void; + type AcePopupNavigation = "up" | "down" | "start" | "end"; + interface EditorMultiSelectProperties { + inMultiSelectMode?: boolean; + /** + * Updates the cursor and marker layers. + **/ + updateSelectionMarkers: () => void; + /** + * Adds the selection and cursor. + * @param orientedRange A range containing a cursor + **/ + addSelectionMarker: (orientedRange: Ace.Range & { + marker?: any; + }) => Ace.Range & { + marker?: any; + }; + /** + * Removes the selection marker. + * @param range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. + **/ + removeSelectionMarker: (range: Ace.Range & { + marker?: any; + }) => void; + removeSelectionMarkers: (ranges: (Ace.Range & { + marker?: any; + })[]) => void; + /** + * Executes a command for each selection range. + * @param cmd The command to execute + * @param [args] Any arguments for the command + **/ + forEachSelection: (cmd: Object, args?: string, options?: Object) => void; + /** + * Removes all the selections except the last added one. + **/ + exitMultiSelectMode: () => void; + getSelectedText: () => string; + /** + * Finds and selects all the occurrences of `needle`. + * @param needle The text to find + * @param options The search options + * @param additive keeps + * @returns {Number} The cumulative count of all found matches + **/ + findAll: (needle?: string, options?: Partial, additive?: boolean) => number; + /** + * Adds a cursor above or below the active cursor. + * @param dir The direction of lines to select: -1 for up, 1 for down + * @param [skip] If `true`, removes the active selection range + */ + selectMoreLines: (dir: number, skip?: boolean) => void; + /** + * Transposes the selected ranges. + * @param {Number} dir The direction to rotate selections + **/ + transposeSelections: (dir: number) => void; + /** + * Finds the next occurrence of text in an active selection and adds it to the selections. + * @param {Number} dir The direction of lines to select: -1 for up, 1 for down + * @param {Boolean} [skip] If `true`, removes the active selection range + * @param {Boolean} [stopAtFirst] + **/ + selectMore: (dir: number, skip?: boolean, stopAtFirst?: boolean) => void; + /** + * Aligns the cursors or selected text. + **/ + alignCursors: () => void; + multiSelect?: any; + } + interface CodeLenseProvider { + provideCodeLenses: (session: EditSession, callback: (err: any, payload: CodeLense[]) => void) => void; + } + interface CodeLense { + start: Point; + command: any; + } + interface CodeLenseEditorExtension { + codeLensProviders?: CodeLenseProvider[]; + } + interface ElasticTabstopsEditorExtension { + elasticTabstops?: import("ace-code/src/ext/elastic_tabstops_lite").ElasticTabstopsLite; + } + interface TextareaEditorExtension { + setDisplaySettings?: (settings: any) => void; + } + interface PromptEditorExtension { + cmdLine?: Editor; + } + interface OptionsEditorExtension { + } + interface MultiSelectProperties { + ranges: Ace.Range[] | null; + rangeList: Ace.RangeList | null; + /** + * Adds a range to a selection by entering multiselect mode, if necessary. + * @param {Ace.Range} range The new range to add + * @param {Boolean} [$blockChangeEvents] Whether or not to block changing events + **/ + addRange(range: Ace.Range, $blockChangeEvents?: boolean): any; + inMultiSelectMode: boolean; + /** + * @param {Ace.Range} [range] + **/ + toSingleRange(range?: Ace.Range): void; + /** + * Removes a Range containing pos (if it exists). + * @param {Ace.Point} pos The position to remove, as a `{row, column}` object + **/ + substractPoint(pos: Ace.Point): any; + /** + * Merges overlapping ranges ensuring consistency after changes + **/ + mergeOverlappingRanges(): void; + rangeCount: number; + /** + * Returns a concatenation of all the ranges. + * @returns {Ace.Range[]} + **/ + getAllRanges(): Ace.Range[]; + /** + * Splits all the ranges into lines. + **/ + splitIntoLines(): void; + /** + */ + joinSelections(): void; + /** + **/ + toggleBlockSelection(): void; + /** + * + * Gets list of ranges composing rectangular block on the screen + * + * @param {Ace.ScreenCoordinates} screenCursor The cursor to use + * @param {Ace.ScreenCoordinates} screenAnchor The anchor to use + * @param {Boolean} [includeEmptyLines] If true, this includes ranges inside the block which are empty due to clipping + * @returns {Ace.Range[]} + **/ + rectangularRangeBlock(screenCursor: Ace.ScreenCoordinates, screenAnchor: Ace.ScreenCoordinates, includeEmptyLines?: boolean): Ace.Range[]; + index?: number; + } + type AcePopupEventsCombined = Ace.EditorEvents & Ace.AcePopupEvents; + type AcePopupWithEditor = Ace.EventEmitter & Ace.Editor; + type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; + type TooltipCommandFunction = (editor: Ace.Editor) => T; + export interface TooltipCommand extends Ace.Command { + enabled?: TooltipCommandFunction | boolean; + getValue?: TooltipCommandFunction; + type: "button" | "text" | "checkbox"; + iconCssClass?: string; + cssClass?: string; + } + export type CommandBarTooltip = import("ace-code/src/ext/command_bar").CommandBarTooltip; + export type TokenizeResult = Array>; + export interface StaticHighlightOptions { + mode?: string | SyntaxMode; + theme?: string | Theme; + trim?: boolean; + firstLineNumber?: number; + showGutter?: boolean; + } + } + export const config: { + defineOptions(obj: any, path: string, options: { + [key: string]: any; + }): import("ace-code").Ace.AppConfig; + resetOptions(obj: any): void; + setDefaultValue(path: string, name: string, value: any): boolean; + setDefaultValues(path: string, optionHash: { + [key: string]: any; + }): void; + setMessages(value: any, options?: { + placeholders?: "dollarSigns" | "curlyBrackets"; + }): void; + nls(key: string, defaultString: string, params?: { + [x: string]: any; + }): any; + warn: (message: any, ...args: any[]) => void; + reportError: (msg: any, data: any) => void; + once(name: K, callback: any): void; + setDefaultHandler(name: string, callback: Function): void; + removeDefaultHandler(name: string, callback: Function): void; + on(name: K, callback: any, capturing?: boolean): any; + addEventListener(name: K, callback: any, capturing?: boolean): any; + off(name: K, callback: any): void; + removeListener(name: K, callback: any): void; + removeEventListener(name: K, callback: any): void; + removeAllListeners(name?: string): void; + get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; + set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; + all: () => import("ace-code").Ace.ConfigOptions; + moduleUrl: (name: string, component?: string) => string; + setModuleUrl: (name: string, subst: string) => string; + setLoader: (cb: any) => void; + dynamicModules: any; + loadModule: (moduleId: string | [ + string, + string + ], onLoad: (module: any) => void) => void; + setModuleLoader: (moduleName: any, onLoad: any) => void; + version: "1.36.4"; }; - toggleFoldWidget(toggleParent?: boolean): void; - updateFoldWidgets(delta: Delta): void; - } - - export interface Range { - start: Point; - end: Point; - - isEqual(range: Range): boolean; - toString(): string; - contains(row: number, column: number): boolean; - compareRange(range: Range): number; - comparePoint(p: Point): number; - containsRange(range: Range): boolean; - intersects(range: Range): boolean; - isEnd(row: number, column: number): boolean; - isStart(row: number, column: number): boolean; - setStart(row: number, column: number): void; - setEnd(row: number, column: number): void; - inside(row: number, column: number): boolean; - insideStart(row: number, column: number): boolean; - insideEnd(row: number, column: number): boolean; - compare(row: number, column: number): number; - compareStart(row: number, column: number): number; - compareEnd(row: number, column: number): number; - compareInside(row: number, column: number): number; - clipRows(firstRow: number, lastRow: number): Range; - extend(row: number, column: number): Range; - isEmpty(): boolean; - isMultiLine(): boolean; - clone(): Range; - collapseRows(): Range; - toScreenRange(session: EditSession): Range; - moveBy(row: number, column: number): void; - } - - export interface EditSessionOptions { - wrap: "off" | "free" | "printmargin" | boolean | number; - wrapMethod: 'code' | 'text' | 'auto'; - indentedSoftWrap: boolean; - firstLineNumber: number; - useWorker: boolean; - useSoftTabs: boolean; - tabSize: number; - navigateWithinSoftTabs: boolean; - foldStyle: 'markbegin' | 'markbeginend' | 'manual'; - overwrite: boolean; - newLineMode: NewLineMode; - mode: string; - } - - export interface VirtualRendererOptions { - animatedScroll: boolean; - showInvisibles: boolean; - showPrintMargin: boolean; - printMarginColumn: number; - printMargin: boolean | number; - showGutter: boolean; - fadeFoldWidgets: boolean; - showFoldWidgets: boolean; - showLineNumbers: boolean; - displayIndentGuides: boolean; - highlightIndentGuides: boolean; - highlightGutterLine: boolean; - hScrollBarAlwaysVisible: boolean; - vScrollBarAlwaysVisible: boolean; - fontSize: number; - fontFamily: string; - maxLines: number; - minLines: number; - scrollPastEnd: number; - fixedWidthGutter: boolean; - customScrollbar: boolean; - theme: string; - hasCssTransforms: boolean; - maxPixelHeight: number; - useSvgGutterIcons: boolean; - showFoldedAnnotations: boolean; - } - - export interface MouseHandlerOptions { - scrollSpeed: number; - dragDelay: number; - dragEnabled: boolean; - focusTimeout: number; - tooltipFollowsMouse: boolean; - } - - export interface EditorOptions extends EditSessionOptions, - MouseHandlerOptions, - VirtualRendererOptions { - selectionStyle: string; - highlightActiveLine: boolean; - highlightSelectedWord: boolean; - readOnly: boolean; - copyWithEmptySelection: boolean; - cursorStyle: 'ace' | 'slim' | 'smooth' | 'wide'; - mergeUndoDeltas: true | false | 'always'; - behavioursEnabled: boolean; - wrapBehavioursEnabled: boolean; - enableAutoIndent: boolean; - enableBasicAutocompletion: boolean | Completer[]; - enableLiveAutocompletion: boolean | Completer[]; - liveAutocompletionDelay: number; - liveAutocompletionThreshold: number; - enableSnippets: boolean; - autoScrollEditorIntoView: boolean; - keyboardHandler: string | null; - placeholder: string; - value: string; - session: EditSession; - relativeLineNumbers: boolean; - enableMultiselect: boolean; - enableKeyboardAccessibility: boolean; - textInputAriaLabel: string; - enableMobileMenu: boolean; - } - - export interface SearchOptions { - needle: string | RegExp; - preventScroll: boolean; - backwards: boolean; - start: Range; - skipCurrent: boolean; - range: Range; - preserveCase: boolean; - regExp: boolean; - wholeWord: boolean; - caseSensitive: boolean; - wrap: boolean; - } - - export interface EventEmitter { - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - removeAllListeners(name?: string): void; - } - - export interface Point { - row: number; - column: number; - } - - export interface Delta { - action: 'insert' | 'remove'; - start: Point; - end: Point; - lines: string[]; - } - - export interface Annotation { - row?: number; - column?: number; - text: string; - type: string; - } - - export interface MarkerGroupItem { - range: Range; - className: string; - } - - export class MarkerGroup { - constructor(session: EditSession, options?: {markerType?: "fullLine" | "line"}); - setMarkers(markers: MarkerGroupItem[]): void; - getMarkerAtPosition(pos: Position): MarkerGroupItem | undefined; - } - - - export interface Command { - name?: string; - bindKey?: string | { mac?: string, win?: string }; - readOnly?: boolean; - exec: (editor: Editor, args?: any) => void; - } - - export type CommandLike = Command | ((editor: Editor) => void); - - export interface KeyboardHandler { - handleKeyboard: Function; - } - - export interface MarkerLike { - range?: Range; - type: string; - renderer?: MarkerRenderer; - clazz: string; - inFront: boolean; - id: number; - update?: (html: string[], - // TODO maybe define Marker class - marker: any, - session: EditSession, - config: any) => void; - } - - export type MarkerRenderer = (html: string[], - range: Range, - left: number, - top: number, - config: any) => void; - - export interface Token { - type: string; - value: string; - index?: number; - start?: number; - } - - interface BaseCompletion { - score?: number; - meta?: string; - caption?: string; - docHTML?: string; - docText?: string; - completerId?: string; - } - - export interface SnippetCompletion extends BaseCompletion { - snippet: string; - } - - export interface ValueCompletion extends BaseCompletion { - value: string; - } - - export type Completion = SnippetCompletion | ValueCompletion - - export interface Tokenizer { - removeCapturingGroups(src: string): string; - createSplitterRegexp(src: string, flag?: string): RegExp; - getLineTokens(line: string, startState: string | string[]): Token[]; - } - - interface TokenIterator { - getCurrentToken(): Token; - getCurrentTokenColumn(): number; - getCurrentTokenRow(): number; - getCurrentTokenPosition(): Point; - getCurrentTokenRange(): Range; - stepBackward(): Token; - stepForward(): Token; - } - - export type HighlightRule = {defaultToken: string} | {include: string} | {todo: string} | { - token: string | string[] | ((value: string) => string); - regex: string | RegExp; - next?: string; - push?: string; - comment?: string; - caseInsensitive?: boolean; - } - - export type HighlightRulesMap = Record; - - export type KeywordMapper = (keyword: string) => string; - - export interface HighlightRules { - addRules(rules: HighlightRulesMap, prefix?: string): void; - getRules(): HighlightRulesMap; - embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; - getEmbeds(): string[]; - normalizeRules(): void; - createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; - } - - export interface FoldMode { - foldingStartMarker: RegExp; - foldingStopMarker?: RegExp; - getFoldWidget(session: EditSession, foldStyle: string, row: number): string; - getFoldWidgetRange(session: EditSession, foldStyle: string, row: number, forceMultiline?: boolean): Range | undefined; - indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; - 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) => {text: string, selection: number[]} | Range | undefined; - type BehaviorMap = Record>; - - export interface Behaviour { - add(name: string, action: string, callback: BehaviorAction): void; - addBehaviours(behaviours: BehaviorMap): void; - remove(name: string): void; - inherit(mode: SyntaxMode | (new () => SyntaxMode), filter: string[]): void; - getBehaviours(filter: string[]): BehaviorMap; - } - - export interface Outdent { - checkOutdent(line: string, input: string): boolean; - autoOutdent(doc: Document, row: number): number | undefined; - } - - export interface SyntaxMode { - HighlightRules: new () => HighlightRules; - foldingRules?: FoldMode; - $behaviour?: Behaviour; - $defaultBehaviour?: Behaviour; - lineCommentStart?: 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: Document, row: number): void; - // TODO implement WorkerClient types - createWorker(session: EditSession): any; - createModeDelegates(mapping: { [key: string]: string }): void; - transformAction: BehaviorAction; - getKeywords(append?: boolean): Array; - getCompletions(state: string, - session: EditSession, - pos: Point, - prefix: string): Completion[]; - } - - type AfterLoadCallback = (err: Error | null, module: unknown) => void; - type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void; - - export interface Config { - get(key: string): any; - set(key: string, value: any): void; - all(): { [key: string]: any }; - moduleUrl(name: string, component?: string): string; - setModuleUrl(name: string, subst: string): string; - setLoader(cb: LoaderFunction): void; - setModuleLoader(name: string, onLoad: Function): void; - loadModule(moduleName: string | [string, string], - onLoad?: (module: any) => void): void; - init(packaged: any): any; - defineOptions(obj: any, path: string, options: { [key: string]: any }): Config; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): void; - setDefaultValues(path: string, optionHash: { [key: string]: any }): void; - } - - export interface OptionsProvider { - setOptions(optList: { [key: string]: any }): void; - getOptions(optionNames?: string[] | { [key: string]: any }): { [key: string]: any }; - setOption(name: string, value: any): void; - getOption(name: string): any; - } - - export interface UndoManager { - addSession(session: EditSession): void; - add(delta: Delta, allowMerge: boolean, session: EditSession): void; - addSelection(selection: string, rev?: number): void; - startNewGroup(): void; - markIgnored(from: number, to?: number): void; - getSelection(rev: number, after?: boolean): { value: string, rev: number }; - getRevision(): number; - getDeltas(from: number, to?: number): Delta[]; - undo(session: EditSession, dontSelect?: boolean): void; - redo(session: EditSession, dontSelect?: boolean): void; - reset(): void; - canUndo(): boolean; - canRedo(): boolean; - bookmark(rev?: number): void; - isAtBookmark(): boolean; - hasUndo(): boolean; - hasRedo(): boolean; - isClean(): boolean; - markClean(rev?: number): void; - toJSON(): object; - fromJSON(json: object): void; - } - - export interface Position { - row: number, - column: number - } - - export interface EditSession extends EventEmitter, OptionsProvider, Folding { - selection: Selection; - curOp?: { - docChanged?: boolean; - selectionChanged?: boolean; - command?: { - name?: string; - }; - }; - - // TODO: define BackgroundTokenizer - - on(name: 'changeFold', - callback: (obj: { data: Fold, action: string }) => void): Function; - on(name: 'changeScrollLeft', callback: (scrollLeft: number) => void): Function; - on(name: 'changeScrollTop', callback: (scrollTop: number) => void): Function; - on(name: 'tokenizerUpdate', - callback: (obj: { data: { first: number, last: number } }) => void): Function; - on(name: 'change', callback: () => void): Function; - on(name: 'changeTabSize', callback: () => void): Function; - on(name: "beforeEndOperation", callback: () => void): Function; - - setOption(name: T, value: EditSessionOptions[T]): void; - getOption(name: T): EditSessionOptions[T]; - - readonly doc: Document; - - setDocument(doc: Document): void; - getDocument(): Document; - resetCaches(): void; - setValue(text: string): void; - getValue(): string; - getSelection(): Selection; - getState(row: number): string; - getTokens(row: number): Token[]; - getTokenAt(row: number, column: number): Token | null; - setUndoManager(undoManager: UndoManager): void; - markUndoGroup(): void; - getUndoManager(): UndoManager; - getTabString(): string; - setUseSoftTabs(val: boolean): void; - getUseSoftTabs(): boolean; - setTabSize(tabSize: number): void; - getTabSize(): number; - isTabStop(position: Position): boolean; - setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; - getNavigateWithinSoftTabs(): boolean; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - addGutterDecoration(row: number, className: string): void; - removeGutterDecoration(row: number, className: string): void; - getBreakpoints(): string[]; - setBreakpoints(rows: number[]): void; - clearBreakpoints(): void; - setBreakpoint(row: number, className: string): void; - clearBreakpoint(row: number): void; - addMarker(range: Range, - className: string, - type: "fullLine" | "screenLine" | "text" | MarkerRenderer, - inFront?: boolean): number; - addDynamicMarker(marker: MarkerLike, inFront: boolean): MarkerLike; - removeMarker(markerId: number): void; - getMarkers(inFront?: boolean): {[id: number]: MarkerLike}; - highlight(re: RegExp): void; - highlightLines(startRow: number, - endRow: number, - className: string, - inFront?: boolean): Range; - setAnnotations(annotations: Annotation[]): void; - getAnnotations(): Annotation[]; - clearAnnotations(): void; - getWordRange(row: number, column: number): Range; - getAWordRange(row: number, column: number): Range; - setNewLineMode(newLineMode: NewLineMode): void; - getNewLineMode(): NewLineMode; - setUseWorker(useWorker: boolean): void; - getUseWorker(): boolean; - setMode(mode: string | SyntaxMode, callback?: () => void): void; - getMode(): SyntaxMode; - setScrollTop(scrollTop: number): void; - getScrollTop(): number; - setScrollLeft(scrollLeft: number): void; - getScrollLeft(): number; - getScreenWidth(): number; - getLineWidgetMaxWidth(): number; - getLine(row: number): string; - getLines(firstRow: number, lastRow: number): string[]; - getLength(): number; - getTextRange(range: Range): string; - insert(position: Position, text: string): void; - remove(range: Range): void; - removeFullLines(firstRow: number, lastRow: number): void; - undoChanges(deltas: Delta[], dontSelect?: boolean): void; - redoChanges(deltas: Delta[], dontSelect?: boolean): void; - setUndoSelect(enable: boolean): void; - replace(range: Range, text: string): void; - moveText(fromRange: Range, toPosition: Position, copy?: boolean): void; - indentRows(startRow: number, endRow: number, indentString: string): void; - outdentRows(range: Range): void; - moveLinesUp(firstRow: number, lastRow: number): void; - moveLinesDown(firstRow: number, lastRow: number): void; - duplicateLines(firstRow: number, lastRow: number): void; - setUseWrapMode(useWrapMode: boolean): void; - getUseWrapMode(): boolean; - setWrapLimitRange(min: number, max: number): void; - adjustWrapLimit(desiredLimit: number): boolean; - getWrapLimit(): number; - setWrapLimit(limit: number): void; - getWrapLimitRange(): { min: number, max: number }; - getRowLineCount(row: number): number; - getRowWrapIndent(screenRow: number): number; - getScreenLastRowColumn(screenRow: number): number; - getDocumentLastRowColumn(docRow: number, docColumn: number): number; - getdocumentLastRowColumnPosition(docRow: number, docColumn: number): Position; - getRowSplitData(row: number): string | undefined; - getScreenTabSize(screenColumn: number): number; - screenToDocumentRow(screenRow: number, screenColumn: number): number; - screenToDocumentColumn(screenRow: number, screenColumn: number): number; - screenToDocumentPosition(screenRow: number, - screenColumn: number, - offsetX?: number): Position; - documentToScreenPosition(docRow: number, docColumn: number): Position; - documentToScreenPosition(position: Position): Position; - documentToScreenColumn(row: number, docColumn: number): number; - documentToScreenRow(docRow: number, docColumn: number): number; - getScreenLength(): number; - getPrecedingCharacter(): string; - startOperation(commandEvent: {command: {name: string}}): void; - endOperation(): void; - toJSON(): Object; - destroy(): void; - } - - export interface KeyBinding { - setDefaultHandler(handler: KeyboardHandler): void; - setKeyboardHandler(handler: KeyboardHandler): void; - addKeyboardHandler(handler: KeyboardHandler, pos?: number): void; - removeKeyboardHandler(handler: KeyboardHandler): boolean; - getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - onCommandKey(e: any, hashId: number, keyCode: number): boolean; - onTextInput(text: string): boolean; - } - - interface CommandMap { - [name: string]: Command; - } - - type execEventHandler = (obj: { - editor: Editor, - command: Command, - args: any[] - }) => void; - - export interface CommandManager extends EventEmitter { - byName: CommandMap, - commands: CommandMap, - on(name: 'exec', callback: execEventHandler): Function; - on(name: 'afterExec', callback: execEventHandler): Function; - once(name: string, callback: Function): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: string, callback: Function, capturing?: boolean): void; - addEventListener(name: string, callback: Function, capturing?: boolean): void; - off(name: string, callback: Function): void; - removeListener(name: string, callback: Function): void; - removeEventListener(name: string, callback: Function): void; - - exec(command: string | string[] | Command, editor: Editor, args: any): boolean; - canExecute(command: string | Command, editor: Editor): boolean; - toggleRecording(editor: Editor): void; - replay(editor: Editor): void; - addCommand(command: Command): void; - addCommands(command: Command[]): void; - removeCommand(command: Command | string, keepCommand?: boolean): void; - removeCommands(command: Command[]): void; - bindKey(key: string | { mac?: string, win?: string}, - command: CommandLike, - position?: number): void; - bindKeys(keys: {[s: string]: Function}): void; - parseKeys(keyPart: string): {key: string, hashId: number}; - findKeyCommand(hashId: number, keyString: string): string | undefined; - handleKeyboard(data: {}, hashId: number, keyString: string, keyCode: string | number): void | {command: string}; - getStatusText(editor: Editor, data: {}): string; - } - - export interface VirtualRenderer extends OptionsProvider, EventEmitter { - readonly container: HTMLElement; - readonly scroller: HTMLElement; - readonly content: HTMLElement; - readonly characterWidth: number; - readonly lineHeight: number; - readonly scrollLeft: number; - readonly scrollTop: number; - readonly $padding: number; - - setOption(name: T, value: VirtualRendererOptions[T]): void; - getOption(name: T): VirtualRendererOptions[T]; - - setSession(session: EditSession): void; - updateLines(firstRow: number, lastRow: number, force?: boolean): void; - updateText(): void; - updateFull(force?: boolean): void; - updateFontSize(): void; - adjustWrapLimit(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: boolean): void; - getPrintMarginColumn(): boolean; - setShowGutter(show: boolean): void; - getShowGutter(): boolean; - setFadeFoldWidgets(show: boolean): void; - getFadeFoldWidgets(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - getContainerElement(): HTMLElement; - getMouseEventTarget(): HTMLElement; - getTextAreaContainer(): HTMLElement; - getFirstVisibleRow(): number; - getFirstFullyVisibleRow(): number; - getLastFullyVisibleRow(): number; - getLastVisibleRow(): number; - setPadding(padding: number): void; - setScrollMargin(top: number, - bottom: number, - left: number, - right: number): void; - setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getHScrollBarAlwaysVisible(): boolean; - setVScrollBarAlwaysVisible(alwaysVisible: boolean): void; - getVScrollBarAlwaysVisible(): boolean; - freeze(): void; - unfreeze(): void; - updateFrontMarkers(): void; - updateBackMarkers(): void; - updateBreakpoints(): void; - setAnnotations(annotations: Annotation[]): void; - updateCursor(): void; - hideCursor(): void; - showCursor(): void; - scrollSelectionIntoView(anchor: Position, - lead: Position, - offset?: number): void; - scrollCursorIntoView(cursor: Position, offset?: number): void; - getScrollTop(): number; - getScrollLeft(): number; - getScrollTopRow(): number; - getScrollBottomRow(): number; - scrollToRow(row: number): void; - alignCursor(cursor: Position | number, alignment: number): number; - scrollToLine(line: number, - center: boolean, - animate: boolean, - callback: () => void): void; - animateScrolling(fromValue: number, callback: () => void): void; - scrollToY(scrollTop: number): void; - scrollToX(scrollLeft: number): void; - scrollTo(x: number, y: number): void; - scrollBy(deltaX: number, deltaY: number): void; - isScrollableBy(deltaX: number, deltaY: number): boolean; - textToScreenCoordinates(row: number, column: number): { pageX: number, pageY: number}; - pixelToScreenCoordinates(x: number, y: number): {row: number, column: number, side: 1|-1, offsetX: number}; - visualizeFocus(): void; - visualizeBlur(): void; - showComposition(position: number): void; - setCompositionText(text: string): void; - hideComposition(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string, include?: boolean): void; - unsetStyle(style: string): void; - setCursorStyle(style: string): void; - setMouseCursor(cursorStyle: string): void; - attachToShadowRoot(): void; - destroy(): void; - } - - - export interface Selection extends EventEmitter { - moveCursorWordLeft(): void; - moveCursorWordRight(): void; - fromOrientedRange(range: Range): void; - setSelectionRange(match: any): void; - getAllRanges(): Range[]; - addRange(range: Range): void; - isEmpty(): boolean; - isMultiLine(): boolean; - setCursor(row: number, column: number): void; - setAnchor(row: number, column: number): void; - getAnchor(): Position; - getCursor(): Position; - isBackwards(): boolean; - getRange(): Range; - clearSelection(): void; - selectAll(): void; - setRange(range: Range, reverse?: boolean): void; - selectTo(row: number, column: number): void; - selectToPosition(pos: any): void; - selectUp(): void; - selectDown(): void; - selectRight(): void; - selectLeft(): void; - selectLineStart(): void; - selectLineEnd(): void; - selectFileEnd(): void; - selectFileStart(): void; - selectWordRight(): void; - selectWordLeft(): void; - getWordRange(): void; - selectWord(): void; - selectAWord(): void; - selectLine(): void; - moveCursorUp(): void; - moveCursorDown(): void; - moveCursorLeft(): void; - moveCursorRight(): void; - moveCursorLineStart(): void; - moveCursorLineEnd(): void; - moveCursorFileEnd(): void; - moveCursorFileStart(): void; - moveCursorLongWordRight(): void; - moveCursorLongWordLeft(): void; - moveCursorBy(rows: number, chars: number): void; - moveCursorToPosition(position: any): void; - moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - - toJSON(): SavedSelection | SavedSelection[]; - fromJSON(selection: SavedSelection | SavedSelection[]): void; - } - interface SavedSelection { - start: Point; - end: Point; - isBackwards: boolean; - } - - var Selection: { - new(session: EditSession): Selection; - } - - export interface TextInput { - resetSelection(): void; - setAriaOption(activeDescendant: string, role: string): void; - } - - export interface Editor extends OptionsProvider, EventEmitter { - container: HTMLElement; - renderer: VirtualRenderer; - id: string; - commands: CommandManager; - keyBinding: KeyBinding; - session: EditSession; - selection: Selection; - textInput: TextInput; - - on(name: 'blur', callback: (e: Event) => void): void; - on(name: 'input', callback: () => void): void; - on(name: 'change', callback: (delta: Delta) => void): void; - on(name: 'changeSelectionStyle', callback: (obj: { data: string }) => void): void; - on(name: 'changeSession', - callback: (obj: { session: EditSession, oldSession: EditSession }) => void): void; - on(name: 'copy', callback: (obj: { text: string }) => void): void; - on(name: 'focus', callback: (e: Event) => void): void; - on(name: 'paste', callback: (obj: { text: string }) => void): void; - on(name: 'mousemove', callback: (e: any) => void): void; - on(name: 'mouseup', callback: (e: any) => void): void; - on(name: 'mousewheel', callback: (e: any) => void): void; - on(name: 'click', callback: (e: any) => void): void; - on(name: 'guttermousedown', callback: (e: any) => void): void; - on(name: 'gutterkeydown', callback: (e: any) => void): void; - - onPaste(text: string, event: any): void; - - setOption(name: T, value: EditorOptions[T]): void; - getOption(name: T): EditorOptions[T]; - - setKeyboardHandler(keyboardHandler: string, callback?: () => void): void; - setKeyboardHandler(keyboardHandler: KeyboardHandler|null): void; - getKeyboardHandler(): string; - setSession(session: EditSession | undefined): void; - getSession(): EditSession; - setValue(val: string, cursorPos?: number): string; - getValue(): string; - getSelection(): Selection; - resize(force?: boolean): void; - setTheme(theme: string, callback?: () => void): void; - getTheme(): string; - setStyle(style: string): void; - unsetStyle(style: string): void; - getFontSize(): string; - setFontSize(size: number|string): void; - focus(): void; - isFocused(): boolean; - blur(): void; - getSelectedText(): string; - getCopyText(): string; - execCommand(command: string | string[], args?: any): boolean; - insert(text: string, pasted?: boolean): void; - setOverwrite(overwrite: boolean): void; - getOverwrite(): boolean; - toggleOverwrite(): void; - setScrollSpeed(speed: number): void; - getScrollSpeed(): number; - setDragDelay(dragDelay: number): void; - getDragDelay(): number; - setSelectionStyle(val: string): void; - getSelectionStyle(): string; - setHighlightActiveLine(shouldHighlight: boolean): void; - getHighlightActiveLine(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - setHighlightSelectedWord(shouldHighlight: boolean): void; - getHighlightSelectedWord(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - getAnimatedScroll(): boolean; - setShowInvisibles(showInvisibles: boolean): void; - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setShowPrintMargin(showPrintMargin: boolean): void; - getShowPrintMargin(): boolean; - setPrintMarginColumn(showPrintMargin: number): void; - getPrintMarginColumn(): number; - setReadOnly(readOnly: boolean): void; - getReadOnly(): boolean; - setBehavioursEnabled(enabled: boolean): void; - getBehavioursEnabled(): boolean; - setWrapBehavioursEnabled(enabled: boolean): void; - getWrapBehavioursEnabled(): boolean; - setShowFoldWidgets(show: boolean): void; - getShowFoldWidgets(): boolean; - setFadeFoldWidgets(fade: boolean): void; - getFadeFoldWidgets(): boolean; - remove(dir?: 'left' | 'right'): void; - removeWordRight(): void; - removeWordLeft(): void; - removeLineToEnd(): void; - splitLine(): void; - setGhostText(text: string, position: Point): void; - removeGhostText(): void; - transposeLetters(): void; - toLowerCase(): void; - toUpperCase(): void; - indent(): void; - blockIndent(): void; - blockOutdent(): void; - sortLines(): void; - toggleCommentLines(): void; - toggleBlockComment(): void; - modifyNumber(amount: number): void; - removeLines(): void; - duplicateSelection(): void; - moveLinesDown(): void; - moveLinesUp(): void; - moveText(range: Range, toPosition: Point, copy?: boolean): Range; - copyLinesUp(): void; - copyLinesDown(): void; - getFirstVisibleRow(): number; - getLastVisibleRow(): number; - isRowVisible(row: number): boolean; - isRowFullyVisible(row: number): boolean; - selectPageDown(): void; - selectPageUp(): void; - gotoPageDown(): void; - gotoPageUp(): void; - scrollPageDown(): void; - scrollPageUp(): void; - scrollToRow(row: number): void; - scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void; - centerSelection(): void; - getCursorPosition(): Point; - getCursorPositionScreen(): Point; - getSelectionRange(): Range; - selectAll(): void; - clearSelection(): void; - moveCursorTo(row: number, column: number): void; - moveCursorToPosition(pos: Point): void; - jumpToMatching(select: boolean, expand: boolean): void; - gotoLine(lineNumber: number, column: number, animate: boolean): void; - navigateTo(row: number, column: number): void; - navigateUp(times?: number): void; - navigateDown(times?: number): void; - navigateLeft(times?: number): void; - navigateRight(times?: number): void; - navigateLineStart(): void; - navigateLineEnd(): void; - navigateFileEnd(): void; - navigateFileStart(): void; - navigateWordRight(): void; - navigateWordLeft(): void; - replace(replacement: string, options?: Partial): number; - replaceAll(replacement: string, options?: Partial): number; - getLastSearchOptions(): Partial; - find(needle: string | RegExp, options?: Partial, animate?: boolean): Ace.Range | undefined; - findNext(options?: Partial, animate?: boolean): void; - findPrevious(options?: Partial, animate?: boolean): void; - findAll(needle: string | RegExp, options?: Partial, additive?: boolean): number; - undo(): void; - redo(): void; - destroy(): void; - setAutoScrollEditorIntoView(enable: boolean): void; - completers: Completer[]; - } - - type CompleterCallback = (error: any, completions: Completion[]) => void; - - interface Completer { - identifierRegexps?: Array, - getCompletions(editor: Editor, - session: EditSession, - position: Point, - prefix: string, - callback: CompleterCallback): void; - getDocTooltip?(item: Completion): undefined | string | Completion; - onSeen?: (editor: Ace.Editor, completion: Completion) => void; - onInsert?: (editor: Ace.Editor, completion: Completion) => void; - cancel?(): void; - id?: string; - triggerCharacters?: string[]; - hideInlinePreview?: boolean; - } - - export class AceInline { - show(editor: Editor, completion: Completion, prefix: string): void; - isOpen(): void; - hide(): void; - destroy(): void; - } - - interface CompletionOptions { - matches?: Completion[]; - } - - type CompletionProviderOptions = { - exactMatch?: boolean; - ignoreCaption?: boolean; - } - - type CompletionRecord = { - all: Completion[]; - filtered: Completion[]; - filterText: string; - } | CompletionProviderOptions - - type GatherCompletionRecord = { - prefix: string; - matches: Completion[]; - finished: boolean; - } - - type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; - type CompletionProviderCallback = (err: Error | undefined, completions: CompletionRecord, finished: boolean) => void; - - export class CompletionProvider { - insertByIndex(editor: Editor, index: number, options: CompletionProviderOptions): boolean; - insertMatch(editor: Editor, data: Completion, options: CompletionProviderOptions): boolean; - completions: CompletionRecord; - gatherCompletions(editor: Editor, callback: CompletionCallbackFunction): boolean; - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: CompletionProviderCallback): void; - detach(): void; - } - - export class Autocomplete { - constructor(); - autoInsert?: boolean; - autoSelect?: boolean; - autoShown?: boolean; - exactMatch?: boolean; - inlineEnabled?: boolean; - parentNode?: HTMLElement; - setSelectOnHover?: Boolean; - stickySelectionDelay?: Number; - ignoreCaption?: Boolean; - showLoadingState?: Boolean; - emptyMessage?(prefix: String): String; - getPopup(): AcePopup; - showPopup(editor: Editor, options: CompletionOptions): void; - detach(): void; - destroy(): void; - } - - type AcePopupNavigation = "up" | "down" | "start" | "end"; - - export class AcePopup { - constructor(parentNode: HTMLElement); - setData(list: Completion[], filterText: string): void; - getData(row: number): Completion; - getRow(): number; - getRow(line: number): void; - hide(): void; - show(pos: Point, lineHeight: number, topdownOnly: boolean): void; - tryShow(pos: Point, lineHeight: number, anchor: "top" | "bottom" | undefined, forceShow?: boolean): boolean; - goTo(where: AcePopupNavigation): void; - } -} - - -export const version: string; -export const config: Ace.Config; -export function require(name: string): any; -export function edit(el: Element | string, options?: Partial): Ace.Editor; -export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession; -export const VirtualRenderer: { - new(container: HTMLElement, theme?: string): Ace.VirtualRenderer; -}; -export const EditSession: { - new(text: string | Ace.Document, mode?: Ace.SyntaxMode): Ace.EditSession; -}; -export const UndoManager: { - new(): Ace.UndoManager; -}; -export const Editor: { - new(): Ace.Editor; -}; -export const Range: { - new(startRow: number, startColumn: number, endRow: number, endColumn: number): Ace.Range; - fromPoints(start: Ace.Point, end: Ace.Point): Ace.Range; - comparePoints(p1: Ace.Point, p2: Ace.Point): number; -}; - - -type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; - -type TooltipCommandFunction = (editor: Ace.Editor) => T; - -interface TooltipCommand extends Ace.Command { - enabled: TooltipCommandFunction | boolean, - getValue?: TooltipCommandFunction, - type: "button" | "text" | "checkbox" - iconCssClass: string, - cssClass: string -} - -export class InlineAutocomplete { - constructor(); - getInlineRenderer(): Ace.AceInline; - getInlineTooltip(): CommandBarTooltip; - getCompletionProvider(): Ace.CompletionProvider; - show(editor: Ace.Editor): void; - isOpen(): boolean; - detach(): void; - destroy(): void; - goTo(action: InlineAutocompleteAction): void; - tooltipEnabled: boolean; - commands: Record - getIndex(): number; - setIndex(value: number): void; - getLength(): number; - getData(index?: number): Ace.Completion | undefined; - updateCompletions(options: Ace.CompletionOptions): void; -} - -export class CommandBarTooltip { - constructor(parentElement: HTMLElement); - registerCommand(id: string, command: TooltipCommand): void; - attach(editor: Ace.Editor): void; - updatePosition(): void; - update(): void; - isShown(): boolean; - getAlwaysShow(): boolean; - setAlwaysShow(alwaysShow: boolean): void; - detach(): void; - destroy(): void; + export function edit(el?: string | (HTMLElement & { + env?: any; + value?: any; + }) | null, options?: any): Editor; + export function createEditSession(text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode): EditSession; + import Editor_5 = require("ace-code/src/editor"); + import Editor = Editor_5.Editor; + import EditSession_3 = require("ace-code/src/edit_session"); + import EditSession = EditSession_3.EditSession; + import Range_13 = require("ace-code/src/range"); + import Range = Range_13.Range; + import UndoManager_2 = require("ace-code/src/undomanager"); + import UndoManager = UndoManager_2.UndoManager; + import Renderer_1 = require("ace-code/src/virtual_renderer"); + import Renderer = Renderer_1.VirtualRenderer; + export var version: "1.36.4"; + export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/package.json b/package.json index 73d9ac86ccb..4f9091d77eb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "^8.20.0", "istanbul": "^0.4.5", "standard-version": "^9.3.2", - "typescript": "^5.5.4" + "typescript": "^5.6.3" }, "mappings": { "ace": "." From 17c3e18edc10c807c4cea04645537701892276e3 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 13 Nov 2024 12:28:41 +0400 Subject: [PATCH 26/33] fix the new test --- ace-ext.d.ts | 2 +- ace-modules.d.ts | 3 ++- ace.d.ts | 2 +- demo/test_package/index.ts | 15 ++++++++++++++- src/config.js | 2 ++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index cd79024d3cb..1a36481dd33 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -793,7 +793,7 @@ declare module "ace-code/src/ext/textarea" { all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: any) => void; + setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; dynamicModules: any; loadModule: (moduleId: string | [ string, diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 9d26537ddc6..5ecc07b2bda 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -435,7 +435,8 @@ declare module "ace-code/src/config" { * @returns {string} */ setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: any) => void; + /** @arg {(name: string, callback: (error: any, module: any) => void) => void} cb */ + setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; dynamicModules: any; /** * @param {string | [string, string]} moduleId diff --git a/ace.d.ts b/ace.d.ts index 55ac58f2532..3d426f4c971 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -998,7 +998,7 @@ declare module "ace-code" { all: () => import("ace-code").Ace.ConfigOptions; moduleUrl: (name: string, component?: string) => string; setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: any) => void; + setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; dynamicModules: any; loadModule: (moduleId: string | [ string, diff --git a/demo/test_package/index.ts b/demo/test_package/index.ts index dc331c59c8d..b1e62243572 100644 --- a/demo/test_package/index.ts +++ b/demo/test_package/index.ts @@ -16,6 +16,15 @@ import {tokenize} from "ace-code/src/ext/simple_tokenizer"; import {JavaScriptHighlightRules} from "ace-code/src/mode/javascript_highlight_rules"; import {highlight} from "ace-code/src/ext/static_highlight"; +// TODO this does not work in node +// import "ace-code/esm-resolver"; +import { config } from "ace-code"; +config.setLoader(async function(moduleName, cb) { + moduleName = moduleName.replace("ace/", "ace-code/src/") + let module = await import(moduleName); + cb(null, module); +}); + const editor = ace.edit(null); // should not be an error editor.setTheme("ace/theme/monokai"); editor.session.setMode("ace/mode/javascript"); @@ -96,6 +105,10 @@ searchBox.show("Test", true); tokenize("some content", new JavaScriptHighlightRules()); highlight(editor.container, { - mode: "ace/mode/some", + mode: "ace/mode/abap", showGutter: true }) + +setTimeout(function() { + editor.destroy(); +}, 20) \ No newline at end of file diff --git a/src/config.js b/src/config.js index 9215bfaae31..45c8f033977 100644 --- a/src/config.js +++ b/src/config.js @@ -104,6 +104,8 @@ var loader = function(moduleName, cb) { console.error("loader is not configured"); }; var customLoader; + +/** @arg {(name: string, callback: (error: any, module: any) => void) => void} cb */ exports.setLoader = function(cb) { customLoader = cb; }; From 9f1a005c4806b702177d2b583f2f6c4418d7cf5e Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 11 Nov 2024 16:38:18 +0400 Subject: [PATCH 27/33] further types improving --- ace-ext.d.ts | 8 ++++---- ace-lib.d.ts | 9 +++++++-- src/ext/prompt.js | 2 +- src/lib/dom.js | 5 +++++ src/lib/event.js | 10 +++++++++- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 1a36481dd33..478e6b8f77d 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -571,11 +571,11 @@ declare module "ace-code/src/ext/prompt" { */ name: string; /** - * Defines which part of the predefined value should be highlited. + * Defines which part of the predefined value should be highlighted. */ selection: [ - start: number, - end: number + number, + number ]; /** * Set to true if prompt has description below input box. @@ -625,7 +625,7 @@ declare module "ace-code/src/ext/prompt" { * @typedef PromptOptions * @property {String} name Prompt name. * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). - * @property {[start: number, end: number]} selection Defines which part of the predefined value should be highlited. + * @property {[number, number]} selection Defines which part of the predefined value should be highlighted. * @property {Boolean} hasDescription Set to true if prompt has description below input box. * @property {String} prompt Description below input box. * @property {String} placeholder Placeholder for value. diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 936f1bed89c..4258d7cffac 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -46,7 +46,12 @@ declare module "ace-code/src/lib/dom" { export const HAS_CSS_TRANSFORMS: boolean; export const HI_DPI: boolean; export function translate(element: any, tx: any, ty: any): void; - export function importCssString(cssText: any, id: any, target: any): number; + /** + * @param {string} cssText + * @param {string} [id] + * @param {any} [target] + */ + export function importCssString(cssText: string, id?: string, target?: any): number; } declare module "ace-code/src/lib/oop" { export function inherits(ctor: any, superCtor: any): void; @@ -93,7 +98,7 @@ declare module "ace-code/src/lib/keys" { export function keyCodeToString(keyCode: number): string; } declare module "ace-code/src/lib/event" { - export function addListener(elem: any, type: any, callback: any, destroyer: any | null): void; + export function addListener(elem: any, type: string, callback: any, destroyer?: any): void; export function removeListener(elem: any, type: any, callback: any): void; export function stopEvent(e: any): boolean; export function stopPropagation(e: any): void; diff --git a/src/ext/prompt.js b/src/ext/prompt.js index 620fb8c9e69..9dc7e46e36f 100644 --- a/src/ext/prompt.js +++ b/src/ext/prompt.js @@ -21,7 +21,7 @@ var openPrompt; * @typedef PromptOptions * @property {String} name Prompt name. * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). - * @property {[start: number, end: number]} selection Defines which part of the predefined value should be highlited. + * @property {[number, number]} selection Defines which part of the predefined value should be highlighted. * @property {Boolean} hasDescription Set to true if prompt has description below input box. * @property {String} prompt Description below input box. * @property {String} placeholder Placeholder for value. diff --git a/src/lib/dom.js b/src/lib/dom.js index 6a53ef8ae11..8ed64b6dd21 100644 --- a/src/lib/dom.js +++ b/src/lib/dom.js @@ -230,6 +230,11 @@ function insertPendingStyles() { }); } +/** + * @param {string} cssText + * @param {string} [id] + * @param {any} [target] + */ function importCssString(cssText, id, target) { if (typeof document == "undefined") return; diff --git a/src/lib/event.js b/src/lib/event.js index 6025acfc17a..95e250f4cf3 100644 --- a/src/lib/event.js +++ b/src/lib/event.js @@ -35,7 +35,15 @@ EventListener.prototype.destroy = function() { this.elem = this.type = this.callback = undefined; }; -var addListener = exports.addListener = function(elem, type, callback, /**@type{any?}*/destroyer) { +/** + * Adds an event listener to the specified element. + * + * @param {any} elem - The element to add the event listener to. + * @param {string} type - The type of event to listen for. + * @param {any} callback - The callback function to be executed when the event is triggered. + * @param {any} [destroyer] - An optional object that will have the created EventListener instance added to its $toDestroy array, allowing it to be easily destroyed later. + */ +var addListener = exports.addListener = function(elem, type, callback, destroyer) { elem.addEventListener(type, callback, getListenerOptions()); if (destroyer) destroyer.$toDestroy.push(new EventListener(elem, type, callback)); From fd90e44149d7134b8de1574ae1e7a79ba42dc8c2 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 13 Nov 2024 18:48:25 +0400 Subject: [PATCH 28/33] update types; improve generation by removing undefined declarations --- ace-ext.d.ts | 79 +------- ace-lib.d.ts | 14 +- ace-modules.d.ts | 71 ++------ ace-theme.d.ts | 3 + ace.d.ts | 41 +---- src/keyboard/hash_handler.js | 6 +- src/lib/lang.js | 12 +- tool/ace_declaration_generator.js | 291 ++++++++++++++++++++---------- 8 files changed, 236 insertions(+), 281 deletions(-) diff --git a/ace-ext.d.ts b/ace-ext.d.ts index 478e6b8f77d..d3b41e52483 100644 --- a/ace-ext.d.ts +++ b/ace-ext.d.ts @@ -1,5 +1,4 @@ declare module "ace-code/src/ext/command_bar" { - const CommandBarTooltip_base: undefined; /** * Displays a command tooltip above the currently active line selection, with clickable elements. * @@ -78,7 +77,6 @@ declare module "ace-code/src/ext/command_bar" { import Tooltip = Tooltip_2.Tooltip; export var TOOLTIP_CLASS_NAME: string; export var BUTTON_CLASS_NAME: string; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -111,8 +109,8 @@ declare module "ace-code/src/ext/inline_autocomplete" { blurListener(e: any): void; changeListener(e: any): void; changeTimer: { - (timeout: any): void; - delay(timeout: any): void; + (timeout?: number): void; + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; @@ -509,7 +507,6 @@ declare module "ace-code/src/ext/modelist" { */ supportsFile(filename: string): RegExpMatchArray; } - export { }; } declare module "ace-code/src/ext/themelist" { export const themesByName: {}; @@ -521,7 +518,6 @@ declare module "ace-code/src/ext/themelist" { }[]; } declare module "ace-code/src/ext/options" { - const OptionPanel_base: undefined; export class OptionPanel { /** * @@ -557,7 +553,6 @@ declare module "ace-code/src/ext/options" { getOption(option: any): any; } export type Editor = import("ace-code/src/editor").Editor; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -671,7 +666,6 @@ declare module "ace-code/src/ext/prompt" { } } declare module "ace-code/src/ext/rtl" { - export { }; } declare module "ace-code/src/ext/settings_menu" { export function init(): void; @@ -760,75 +754,6 @@ declare module "ace-code/src/ext/statusbar" { updateStatus(editor: Editor): void; } } -declare module "ace-code/src/ext/textarea" { - const _exports: { - config: { - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): import("ace-code").Ace.AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): boolean; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any, options?: { - placeholders?: "dollarSigns" | "curlyBrackets"; - }): void; - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - warn: (message: any, ...args: any[]) => void; - reportError: (msg: any, data: any) => void; - once(name: K, callback: any): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: K, callback: any, capturing?: boolean): any; - addEventListener(name: K, callback: any, capturing?: boolean): any; - off(name: K, callback: any): void; - removeListener(name: K, callback: any): void; - removeEventListener(name: K, callback: any): void; - removeAllListeners(name?: string): void; - get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; - set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; - all: () => import("ace-code").Ace.ConfigOptions; - moduleUrl: (name: string, component?: string) => string; - setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; - dynamicModules: any; - loadModule: (moduleId: string | [ - string, - string - ], onLoad: (module: any) => void) => void; - setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.4"; - }; - edit: (el?: string | (HTMLElement & { - env?: any; - value?: any; - }) | null, options?: any) => ace.Editor; - createEditSession: (text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession; - Range: typeof ace.Range; - Editor: typeof ace.Editor; - EditSession: typeof ace.EditSession; - UndoManager: typeof ace.UndoManager; - VirtualRenderer: typeof ace.VirtualRenderer; - version: "1.36.4"; - transformTextarea: (element: any, options: any) => ace.Editor; - defaultOptions: { - mode: string; - theme: string; - wrap: string; - fontSize: string; - showGutter: string; - keybindings: string; - showPrintMargin: string; - useSoftTabs: string; - showInvisibles: string; - }; - }; - export = _exports; - import ace = require("ace-code"); -} declare module "ace-code/src/ext/whitespace" { export function $detectIndentation(lines: string[], fallback?: any): { ch?: string; diff --git a/ace-lib.d.ts b/ace-lib.d.ts index 4258d7cffac..d0db3426960 100644 --- a/ace-lib.d.ts +++ b/ace-lib.d.ts @@ -83,9 +83,12 @@ declare module "ace-code/src/lib/lang" { cancel(): any; isPending(): any; }; - export function delayedCall(fcn: any, defaultTimeout: any): { - (timeout: any): void; - delay(timeout: any): void; + export function delayedCall(fcn: any, defaultTimeout?: number): { + (timeout?: number): void; + /** + * @param {number} [timeout] + */ + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; @@ -110,7 +113,9 @@ declare module "ace-code/src/lib/event" { export function getModifierString(e: KeyboardEvent | MouseEvent): any; export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void; export function nextTick(callback: any, win: any): void; + export const $idleBlocked: boolean; export function onIdle(cb: any, timeout: any): number; + export const $idleBlockId: number; export function blockIdle(delay: any): void; export const nextFrame: any; } @@ -177,7 +182,6 @@ declare module "ace-code/src/lib/default_english_messages" { }; } declare module "ace-code/src/lib/app_config" { - const AppConfig_base: undefined; export class AppConfig { /** * @param {Object} obj @@ -224,7 +228,6 @@ declare module "ace-code/src/lib/app_config" { reportError: (msg: any, data: any) => void; } function warn(message: any, ...args: any[]): void; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -249,5 +252,4 @@ declare module "ace-code/src/lib/bidiutil" { export var EN: number; } declare module "ace-code/src/lib/fixoldbrowsers" { - export { }; } diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 5ecc07b2bda..691bad6abdf 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -1,5 +1,4 @@ declare module "ace-code/src/layer/font_metrics" { - const FontMetrics_base: undefined; export class FontMetrics { /** * @param {HTMLElement} parentEl @@ -21,7 +20,6 @@ declare module "ace-code/src/layer/font_metrics" { els: any[] | HTMLElement | Text; transformCoordinates(clientPos: any, elPos: any): any[]; } - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -32,7 +30,6 @@ declare module "ace-code/src/apply_delta" { export function applyDelta(docLines: string[], delta: import("ace-code").Ace.Delta, doNotValidate?: any): void; } declare module "ace-code/src/document" { - const Document_base: undefined; /** * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. @@ -310,7 +307,6 @@ declare module "ace-code/src/document" { import Anchor = Anchor_1.Anchor; import Range_1 = require("ace-code/src/range"); import Range = Range_1.Range; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type DocumentEvents = import("ace-code").Ace.DocumentEvents; @@ -319,7 +315,6 @@ declare module "ace-code/src/document" { } } declare module "ace-code/src/anchor" { - const Anchor_base: undefined; /** * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. **/ @@ -368,7 +363,6 @@ declare module "ace-code/src/anchor" { markerId?: number; } export type Document = import("ace-code/src/document").Document; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type AnchorEvents = import("ace-code").Ace.AnchorEvents; @@ -499,7 +493,6 @@ declare module "ace-code/src/layer/lines" { } } declare module "ace-code/src/layer/gutter" { - const Gutter_base: undefined; export class Gutter { /** * @param {HTMLElement} parentEl @@ -562,7 +555,6 @@ declare module "ace-code/src/layer/gutter" { export type LayerConfig = import("ace-code").Ace.LayerConfig; import Lines_1 = require("ace-code/src/layer/lines"); import Lines = Lines_1.Lines; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type GutterEvents = import("ace-code").Ace.GutterEvents; @@ -666,7 +658,6 @@ declare module "ace-code/src/layer/text_util" { export function isTextToken(tokenType: any): boolean; } declare module "ace-code/src/layer/text" { - const Text_base: undefined; export class Text { /** * @param {HTMLElement} parentEl @@ -742,7 +733,6 @@ declare module "ace-code/src/layer/text" { import dom = require("ace-code/src/lib/dom"); import Lines_2 = require("ace-code/src/layer/lines"); import Lines = Lines_2.Lines; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type TextEvents = import("ace-code").Ace.TextEvents; @@ -1092,8 +1082,6 @@ declare module "ace-code/src/layer/decorators" { } } declare module "ace-code/src/virtual_renderer" { - const VirtualRenderer_base: undefined; - const VirtualRenderer_base_1: undefined; /** * The class that is responsible for drawing everything you see on the screen! * @related editor.renderer @@ -1676,7 +1664,6 @@ declare module "ace-code/src/virtual_renderer" { import RenderLoop = RenderLoop_1.RenderLoop; import Decorator_1 = require("ace-code/src/layer/decorators"); import Decorator = Decorator_1.Decorator; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; @@ -1695,8 +1682,6 @@ declare module "ace-code/src/virtual_renderer" { } } declare module "ace-code/src/selection" { - const Selection_base: undefined; - const Selection_base_1: undefined; /** * @typedef {import("ace-code/src/edit_session").EditSession} EditSession * @typedef {import("ace-code/src/anchor").Anchor} Anchor @@ -1993,7 +1978,6 @@ declare module "ace-code/src/selection" { export type Point = import("ace-code").Ace.Point; import Range_3 = require("ace-code/src/range"); import Range = Range_3.Range; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type MultiSelectionEvents = import("ace-code").Ace.MultiSelectionEvents; @@ -2239,7 +2223,6 @@ declare module "ace-code/src/tooltip" { */ doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; } - export { }; export interface HoverTooltip { row: number; } @@ -2522,13 +2505,13 @@ declare module "ace-code/src/keyboard/hash_handler" { */ addCommands(commands?: Record | Command[]): void; /** - * @param {Record} commands + * @param {Record} commands */ - removeCommands(commands: Record): void; + removeCommands(commands: Record): void; /** - * @param {Record} keyList + * @param {Record} keyList */ - bindKeys(keyList: Record): void; + bindKeys(keyList: Record): void; /** * Accepts keys in the form ctrl+Enter or ctrl-Enter * keys without modifiers or shift only @@ -2546,14 +2529,13 @@ declare module "ace-code/src/keyboard/hash_handler" { */ findKeyCommand(hashId: number, keyString: string): Command; /** - * @param {{ $keyChain: string | any[]; }} data + * @param {any} data * @param {number} hashId * @param {string} keyString * @param {number} keyCode * @returns {{command: string} | void} */ - handleKeyboard(data: { - }, hashId: number, keyString: string, keyCode: number): { + handleKeyboard(data: any, hashId: number, keyString: string, keyCode: number): { command: string; } | void; /** @@ -2609,7 +2591,6 @@ declare module "ace-code/src/commands/command_manager" { export type Editor = import("ace-code/src/editor").Editor; import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -2796,14 +2777,6 @@ declare module "ace-code/src/keyboard/gutter_handler" { import GutterTooltip = GutterTooltip_1.GutterTooltip; } declare module "ace-code/src/editor" { - const Editor_base: undefined; - const Editor_base_1: undefined; - const Editor_base_2: undefined; - const Editor_base_3: undefined; - const Editor_base_4: undefined; - const Editor_base_5: undefined; - const Editor_base_6: undefined; - const Editor_base_7: undefined; /** * The main entry point into the Ace functionality. * @@ -3586,7 +3559,6 @@ declare module "ace-code/src/editor" { import Range_7 = require("ace-code/src/range"); import Range = Range_7.Range; var $uid: number; - export { }; namespace Ace { type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; type OptionsProvider = import("ace-code").Ace.OptionsProvider; @@ -3790,7 +3762,6 @@ declare module "ace-code/src/tokenizer" { } } declare module "ace-code/src/autocomplete/popup" { - const AcePopup_base: undefined; /** * This object is used in some places where needed to show popups - like prompt; autocomplete etc. */ @@ -3831,7 +3802,6 @@ declare module "ace-code/src/autocomplete/popup" { export function getAriaId(index: any): string; import Editor_1 = require("ace-code/src/editor"); import Editor = Editor_1.Editor; - export { }; namespace Ace { type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; type Completion = import("ace-code").Ace.Completion; @@ -4005,7 +3975,6 @@ declare module "ace-code/src/snippets" { } import Tokenizer_1 = require("ace-code/src/tokenizer"); import Tokenizer = Tokenizer_1.Tokenizer; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -4109,32 +4078,32 @@ declare module "ace-code/src/autocomplete" { mousedownListener(e: any): void; mousewheelListener(e: any): void; changeTimer: { - (timeout: any): void; - delay(timeout: any): void; + (timeout?: number): void; + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; isPending(): any; }; tooltipTimer: { - (timeout: any): void; - delay(timeout: any): void; + (timeout?: number): void; + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; isPending(): any; }; popupTimer: { - (timeout: any): void; - delay(timeout: any): void; + (timeout?: number): void; + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; isPending(): any; }; stickySelectionTimer: { - (timeout: any): void; - delay(timeout: any): void; + (timeout?: number): void; + delay(timeout?: number): void; schedule: any; call(): void; cancel(): void; @@ -4350,7 +4319,6 @@ declare module "ace-code/src/autocomplete" { function exec(editor: any, options: any): void; let bindKey: string; } - export { }; namespace Ace { type AcePopup = import("ace-code").Ace.AcePopup; type FilteredList = import("ace-code").Ace.FilteredList; @@ -4720,7 +4688,6 @@ declare module "ace-code/src/bidihandler" { import bidiUtil = require("ace-code/src/lib/bidiutil"); } declare module "ace-code/src/background_tokenizer" { - const BackgroundTokenizer_base: undefined; /** * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. * @@ -4787,7 +4754,6 @@ declare module "ace-code/src/background_tokenizer" { export type Document = import("ace-code/src/document").Document; export type EditSession = import("ace-code/src/edit_session").EditSession; export type Tokenizer = import("ace-code/src/tokenizer").Tokenizer; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type BackgroundTokenizerEvents = import("ace-code").Ace.BackgroundTokenizerEvents; @@ -5070,10 +5036,6 @@ declare module "ace-code/src/edit_session/bracket_match" { import Range = Range_10.Range; } declare module "ace-code/src/edit_session" { - const EditSession_base: undefined; - const EditSession_base_1: undefined; - const EditSession_base_2: undefined; - const EditSession_base_3: undefined; /** * @typedef TextMode * @type {SyntaxMode} @@ -5756,7 +5718,6 @@ declare module "ace-code/src/edit_session" { import UndoManager = UndoManager_1.UndoManager; function isFullWidth(c: any): boolean; var $uid: number; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type EditSessionEvents = import("ace-code").Ace.EditSessionEvents; @@ -6030,7 +5991,6 @@ declare module "ace-code/src/range" { * @returns {Number} */ function comparePoints(p1: Point, p2: Point): number; - export { }; namespace Ace { type Point = import("ace-code").Ace.Point; } @@ -6044,7 +6004,6 @@ declare module "ace-code/src/worker/worker_client" { export var WorkerClient: any; } declare module "ace-code/src/placeholder" { - const PlaceHolder_base: undefined; export class PlaceHolder { /** * @param {EditSession} session @@ -6108,7 +6067,6 @@ declare module "ace-code/src/placeholder" { export type EditSession = import("ace-code/src/edit_session").EditSession; import Range_12 = require("ace-code/src/range"); import Range = Range_12.Range; - export { }; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; @@ -6263,6 +6221,7 @@ declare module "ace-code/src/unicode" { export const wordChars: any; } declare module "ace-code/src/keyboard/textarea" { + export const handler: HashHandler; import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); import HashHandler = HashHandler_6.HashHandler; } diff --git a/ace-theme.d.ts b/ace-theme.d.ts index 037b5569c62..faab6975412 100644 --- a/ace-theme.d.ts +++ b/ace-theme.d.ts @@ -6,6 +6,7 @@ declare module "ace-code/src/theme/textmate" { export const isDark: false; export const cssClass: "ace-tm"; export const cssText: string; + export const $id: "ace/theme/textmate"; } declare module "ace-code/src/theme/ambiance-css" { const _exports: string; @@ -132,6 +133,7 @@ declare module "ace-code/src/theme/dracula" { export const isDark: true; export const cssClass: "ace-dracula"; export const cssText: string; + export const $selectionColorConflict: true; } declare module "ace-code/src/theme/dreamweaver-css" { const _exports: string; @@ -303,6 +305,7 @@ declare module "ace-code/src/theme/nord_dark" { export const isDark: true; export const cssClass: "ace-nord-dark"; export const cssText: string; + export const $selectionColorConflict: true; } declare module "ace-code/src/theme/one_dark-css" { const _exports: string; diff --git a/ace.d.ts b/ace.d.ts index 3d426f4c971..5166ffce55a 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -967,46 +967,7 @@ declare module "ace-code" { showGutter?: boolean; } } - export const config: { - defineOptions(obj: any, path: string, options: { - [key: string]: any; - }): import("ace-code").Ace.AppConfig; - resetOptions(obj: any): void; - setDefaultValue(path: string, name: string, value: any): boolean; - setDefaultValues(path: string, optionHash: { - [key: string]: any; - }): void; - setMessages(value: any, options?: { - placeholders?: "dollarSigns" | "curlyBrackets"; - }): void; - nls(key: string, defaultString: string, params?: { - [x: string]: any; - }): any; - warn: (message: any, ...args: any[]) => void; - reportError: (msg: any, data: any) => void; - once(name: K, callback: any): void; - setDefaultHandler(name: string, callback: Function): void; - removeDefaultHandler(name: string, callback: Function): void; - on(name: K, callback: any, capturing?: boolean): any; - addEventListener(name: K, callback: any, capturing?: boolean): any; - off(name: K, callback: any): void; - removeListener(name: K, callback: any): void; - removeEventListener(name: K, callback: any): void; - removeAllListeners(name?: string): void; - get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; - set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; - all: () => import("ace-code").Ace.ConfigOptions; - moduleUrl: (name: string, component?: string) => string; - setModuleUrl: (name: string, subst: string) => string; - setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; - dynamicModules: any; - loadModule: (moduleId: string | [ - string, - string - ], onLoad: (module: any) => void) => void; - setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.4"; - }; + export const config: typeof import("ace-code/src/config"); export function edit(el?: string | (HTMLElement & { env?: any; value?: any; diff --git a/src/keyboard/hash_handler.js b/src/keyboard/hash_handler.js index d445f5f2924..fb9eca6afdb 100644 --- a/src/keyboard/hash_handler.js +++ b/src/keyboard/hash_handler.js @@ -167,7 +167,7 @@ class MultiHashHandler { } /** - * @param {Record} commands + * @param {Record} commands */ removeCommands(commands) { Object.keys(commands).forEach(function(name) { @@ -176,7 +176,7 @@ class MultiHashHandler { } /** - * @param {Record} keyList + * @param {Record} keyList */ bindKeys(keyList) { Object.keys(keyList).forEach(function(key) { @@ -230,7 +230,7 @@ class MultiHashHandler { } /** - * @param {{ $keyChain: string | any[]; }} data + * @param {any} data * @param {number} hashId * @param {string} keyString * @param {number} keyCode diff --git a/src/lib/lang.js b/src/lib/lang.js index 857f1525839..9cd2d58b67d 100644 --- a/src/lib/lang.js +++ b/src/lib/lang.js @@ -143,19 +143,25 @@ exports.deferredCall = function(fcn) { return deferred; }; - +/** + * @param {number} [defaultTimeout] + */ exports.delayedCall = function(fcn, defaultTimeout) { var timer = null; var callback = function() { timer = null; fcn(); }; - + /** + * @param {number} [timeout] + */ var _self = function(timeout) { if (timer == null) timer = setTimeout(callback, timeout || defaultTimeout); }; - + /** + * @param {number} [timeout] + */ _self.delay = function(timeout) { timer && clearTimeout(timer); timer = setTimeout(callback, timeout || defaultTimeout); diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index ae27873abb9..09cc4f7f214 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -79,8 +79,10 @@ function generateInitialDeclaration(excludeDir) { } /** - * @param {string} fileName - * @param {string} content + * Creates a custom TypeScript compiler host that uses the provided source file content instead of reading from the file system. + * @param {string} fileName - The name of the source file. + * @param {string} content - The content of the source file. + * @returns {ts.CompilerHost} - A custom compiler host that uses the provided source file content. */ function createCustomCompilerHost(fileName, content) { const newSourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS); @@ -109,6 +111,142 @@ function createCustomCompilerHost(fileName, content) { }; } +function updateMainAceModule(node) { + if (node.body && ts.isModuleBlock(node.body)) { + const updatedStatements = node.body.statements.map(statement => { + //create type alias for config + if (ts.isVariableStatement(statement) && statement.declarationList.declarations[0]?.name?.text + === "config") { + + const originalDeclaration = statement.declarationList.declarations[0]; + + const importTypeNode = ts.factory.createImportTypeNode( + ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral('ace-code/src/config')), undefined, + undefined, false + ); + + const typeOfImportTypeNode = ts.factory.createTypeOperatorNode( + ts.SyntaxKind.TypeOfKeyword, importTypeNode); + + return ts.factory.updateVariableStatement(statement, statement.modifiers, + ts.factory.updateVariableDeclarationList(statement.declarationList, [ + ts.factory.updateVariableDeclaration(originalDeclaration, originalDeclaration.name, + originalDeclaration.exclamationToken, typeOfImportTypeNode, undefined + ) + ]) + ); + } + return statement; + }); + + return ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, + ts.factory.createModuleBlock(updatedStatements) + ); + } +} + +/** + * Updates the module declaration for the "keys" and "linking" modules by adding the corresponding internal statements + * to support mixins (EventEmitter, OptionsProvider, etc.). + * + * @param {ts.ModuleDeclaration} node - The module declaration node to update. + * @param {Object} internalStatements - An object containing the internal statements to add to the module. + * @returns {ts.ModuleDeclaration} - The updated module declaration. + */ +function updateKeysAndLinksStatements(node, internalStatements) { + let statements = []; + if (internalStatements[node.name.text]) { + statements = internalStatements[node.name.text]; + } + const newBody = ts.factory.createModuleBlock(statements); + return ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); +} + +/** + * Updates a module declaration by adding internal statements to support mixins (EventEmitter, OptionsProvider, etc.). + * + * @param {ts.ModuleDeclaration} node - The module declaration node to update. + * @param {Object} internalStatements - An object containing the internal statements to add to the module. + * @returns {ts.ModuleDeclaration} - The updated module declaration. + */ +function updateModuleWithInternalStatements(node, internalStatements) { + const newBody = ts.factory.createModuleBlock( + node.body.statements.concat(internalStatements[node.name.text]).filter(statement => { + if (node.name.text.endsWith("autocomplete")) { + return !(ts.isModuleDeclaration(statement) && statement.name.text === 'Autocomplete'); + } + return true; + })); + return ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); +} + +/** + * Fixes interfaces with empty extends clauses by either removing the entire interface declaration if it has no members, + * or by removing the empty extends clause. + * + * @param {ts.InterfaceDeclaration} node - The interface declaration node to fix. + * @param {ts.TransformationContext} context - The transformation context. + * @returns {ts.InterfaceDeclaration} - The updated interface declaration. + */ +function fixWrongInterfaces(node, context) { + for (const clause of node.heritageClauses) { + if (clause.token === ts.SyntaxKind.ExtendsKeyword && clause.types.length === 0) { + if (node.members.length === 0) { + return; // remove entire interface declaration + } + // Remove the extends clause if it's empty + return context.factory.updateInterfaceDeclaration(node, node.modifiers, node.name, node.typeParameters, [], + node.members + ); + } + } + return node; +} + +/** + * Fixes heritage clauses in class declarations by removing any inheritance from undefined types. + * + * @param {ts.ClassDeclaration} node - The class declaration node to fix. + * @param {ts.TransformationContext} context - The transformation context. + * @param {ts.TypeChecker} checker - The TypeScript type checker. + * @returns {ts.ClassDeclaration} - The updated class declaration with fixed heritage clauses. + */ +function fixWrongHeritageClauses(node, context, checker) { + let updatedHeritageClauses = []; + // remove inheritances from undefined types + for (let i = 0; i < node.heritageClauses.length; i++) { + let clause = node.heritageClauses[i]; + if (clause.token === ts.SyntaxKind.ExtendsKeyword) { + const updatedTypes = clause.types.filter(type => { + const symbol = checker.getSymbolAtLocation(type.expression); + if (symbol) { + const declaredType = checker.getDeclaredTypeOfSymbol(symbol); + + return declaredType.flags !== ts.TypeFlags.Undefined && declaredType["intrinsicName"] !== "error"; + } + return true; // keep the type if the symbol can't be resolved + }); + if (updatedTypes.length === 0) { + continue; + } + var updatedHeritageClause = clause; + if (updatedTypes.length !== clause.types.length) { + updatedHeritageClause = context.factory.createHeritageClause( + ts.SyntaxKind.ExtendsKeyword, updatedTypes); + } + } + if (updatedHeritageClause) { + updatedHeritageClauses.push(updatedHeritageClause); + } + else { + updatedHeritageClauses.push(clause); + } + } + return context.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, + updatedHeritageClauses, node.members + ); +} + /** * @param {string} content * @param {string} aceNamespacePath @@ -125,52 +263,24 @@ function fixDeclaration(content, aceNamespacePath) { const finalDeclarations = []; /** - * @param {ts.TransformationContext} context - * @return {function(*): *} + * Transforms the source file by updating certain module declarations and interface/class heritage clauses. + * + * @param {ts.TransformationContext} context - The transformation context. + * @returns {function(ts.SourceFile): ts.SourceFile} - A function that transforms the source file. */ function transformer(context) { return (sourceFile) => { function visit(node) { let updatedNode = node; + // Update module declarations for certain module names if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) { - // replace wrong generated modules - if (node.name.text.endsWith("lib/keys") || node.name.text.endsWith("linking")) { - let statements = []; - if (internalStatements[node.name.text]) { - statements = internalStatements[node.name.text]; - } - const newBody = ts.factory.createModuleBlock(statements); - updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); - } - else if (internalStatements[node.name.text]) { - // add corresponding internalStatements to support mixins (EventEmitter, OptionsProvider, etc.) - if (node.body && ts.isModuleBlock(node.body)) { - const newBody = ts.factory.createModuleBlock( - node.body.statements.concat(internalStatements[node.name.text]).filter(statement => { - if (node.name.text.endsWith("autocomplete")) { - return !(ts.isModuleDeclaration(statement) && statement.name.text - === 'Autocomplete'); - } - return true; - })); - updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); - } - } - else if (node.name.text.endsWith("/config") || node.name.text.endsWith("textarea")) { - //TODO: should be better way to do this - //correct mixed exports (export function + export = _exports) - if (node.body && ts.isModuleBlock(node.body)) { - const newBody = ts.factory.createModuleBlock(node.body.statements.filter(statement => { - const exportsStatement = ts.isVariableStatement(statement) - && statement.declarationList.declarations[0].name.getText() == "_exports"; - return exportsStatement || ts.isExportAssignment(statement) - || ts.isImportEqualsDeclaration(statement); - })); - updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); - - } - } - else if (node.name.text.endsWith("static_highlight")) { + if (node.name.text === "ace-code") { + return updateMainAceModule(node); + } else if (node.name.text.endsWith("lib/keys") || node.name.text.endsWith("linking")) { + updatedNode = updateKeysAndLinksStatements(node, internalStatements); + } else if (internalStatements[node.name.text]) { + updatedNode = updateModuleWithInternalStatements(node, internalStatements); + } else if (node.name.text.endsWith("static_highlight")) { if (node.body && ts.isModuleBlock(node.body)) { const newBody = ts.factory.createModuleBlock(node.body.statements.filter(statement => { return !ts.isExportAssignment(statement); @@ -179,57 +289,14 @@ function fixDeclaration(content, aceNamespacePath) { } } } + // Fix wrong interface and class heritage clauses else if (ts.isInterfaceDeclaration(node) && node.heritageClauses) { - for (const clause of node.heritageClauses) { - if (clause.token === ts.SyntaxKind.ExtendsKeyword && clause.types.length === 0) { - if (node.members.length === 0) { - return; // remove entire interface declaration - } - // Remove the extends clause if it's empty - return context.factory.updateInterfaceDeclaration(node, node.modifiers, node.name, - node.typeParameters, [], node.members - ); - } - } - } - else if (ts.isClassDeclaration(node) && node.heritageClauses) { - let updatedHeritageClauses = []; - // remove inheritances from undefined types - for (let i = 0; i < node.heritageClauses.length; i++) { - let clause = node.heritageClauses[i]; - if (clause.token === ts.SyntaxKind.ExtendsKeyword) { - const updatedTypes = clause.types.filter(type => { - const symbol = checker.getSymbolAtLocation(type.expression); - if (symbol) { - const declaredType = checker.getDeclaredTypeOfSymbol(symbol); - - return declaredType.flags !== ts.TypeFlags.Undefined - && declaredType["intrinsicName"] !== "error"; - } - return true; // keep the type if the symbol can't be resolved - }); - if (updatedTypes.length === 0) { - continue; - } - var updatedHeritageClause = clause; - if (updatedTypes.length !== clause.types.length) { - updatedHeritageClause = context.factory.createHeritageClause( - ts.SyntaxKind.ExtendsKeyword, updatedTypes); - } - } - if (updatedHeritageClause) { - updatedHeritageClauses.push(updatedHeritageClause); - } - else { - updatedHeritageClauses.push(clause); - } - } - return context.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, - updatedHeritageClauses, node.members - ); + return fixWrongInterfaces(node, context); + } else if (ts.isClassDeclaration(node) && node.heritageClauses) { + return fixWrongHeritageClauses(node, context, checker); } return ts.visitEachChild(updatedNode, visit, context); - } + }; return ts.visitNode(sourceFile, visit); }; @@ -280,22 +347,50 @@ function fixDeclaration(content, aceNamespacePath) { const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { substituteNode(hint, node) { + if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name) && node.name.text === "ace-code/src/ext/textarea") { + return ts.factory.createNotEmittedStatement(node); + } else // remove all private members if (ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) { const isPrivate = node.modifiers?.some( modifier => modifier.kind === ts.SyntaxKind.PrivateKeyword); - + const startsWithDollar = ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text); if (isPrivate || startsWithDollar || hasInternalTag(node)) { return ts.factory.createNotEmittedStatement(node); } } - else if (ts.isVariableStatement(node) && node.getText().indexOf("export const $") > -1) { + else if (ts.isVariableStatement(node)) { + if (node.text && node.getText().indexOf("export const $") > -1) { + return ts.factory.createNotEmittedStatement(node); + } + // Remove variable statements like 'const {any_identifier}_base: undefined;' + const declarations = node.declarationList.declarations; + + // Filter out declarations that match the pattern + const filteredDeclarations = declarations.filter(declaration => { + if (ts.isIdentifier(declaration.name) && /_base\w*$/.test(declaration.name.text) + && /:\s*undefined$/.test(declaration.getText())) { + return false; + } + return true; + }); + + if (filteredDeclarations.length === 0) { + return ts.factory.createNotEmittedStatement(node); + } + else if (filteredDeclarations.length < declarations.length) { + return ts.factory.updateVariableStatement(node, node.modifiers, + ts.factory.updateVariableDeclarationList(node.declarationList, filteredDeclarations) + ); + } + } + //remove empty exports + else if (ts.isExportDeclaration(node) && /export\s*{\s*}/.test(node.getText())) { return ts.factory.createNotEmittedStatement(node); } - return node; } }); let output = printer.printFile(newSourceFile); @@ -325,7 +420,7 @@ function fixDeclaration(content, aceNamespacePath) { function hasInternalTag(node) { const sourceFile = node.getSourceFile(); if (!sourceFile) return false; - + const jsDocs = ts.getJSDocTags(node).filter(tag => tag.tagName.text === 'internal'); return jsDocs.length > 0; } @@ -480,7 +575,7 @@ function cloneAceNamespace(aceNamespacePath) { } /** - * @param {string} aceNamespacePath + * @param {string} [aceNamespacePath] */ function generateDeclaration(aceNamespacePath) { if (!aceNamespacePath) { @@ -505,7 +600,11 @@ function generateDeclaration(aceNamespacePath) { } /** - * @param {string} content + * Updates the declaration module names in the provided content. + * This function replaces references to "ace-code" with "ace-builds" and "ace-builds-internal" as appropriate. + * + * @param {string} content - The content to update. + * @returns {string} The updated content with the module names replaced. */ function updateDeclarationModuleNames(content) { let output = content.replace( From b2f0316911ebe392ad44d67813248fd00dbb1cd8 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Mon, 18 Nov 2024 15:44:42 +0400 Subject: [PATCH 29/33] update to last version --- ace-internal.d.ts | 1 - ace-modules.d.ts | 167 +++++++++++++++++++++++++--------------------- ace.d.ts | 16 +++-- 3 files changed, 99 insertions(+), 85 deletions(-) diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 538863fa9da..154614fd961 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -1335,7 +1335,6 @@ declare module "./src/edit_session" { $useWorker?: boolean, $wrapAsCode?: boolean, $indentedSoftWrap?: boolean, - widgetManager?: any, $bracketHighlight?: any, $selectionMarker?: number, lineWidgetsWidth?: number, diff --git a/ace-modules.d.ts b/ace-modules.d.ts index 691bad6abdf..6dcd06b2c7d 100644 --- a/ace-modules.d.ts +++ b/ace-modules.d.ts @@ -441,7 +441,7 @@ declare module "ace-code/src/config" { string ], onLoad: (module: any) => void) => void; setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.4"; + version: "1.36.5"; }; export = _exports; } @@ -2656,80 +2656,6 @@ declare module "ace-code/src/token_iterator" { import Range_6 = require("ace-code/src/range"); import Range = Range_6.Range; } -declare module "ace-code/src/line_widgets" { - export class LineWidgets { - /** - * @param {EditSession} session - */ - constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; - /** - * - * @param {import("ace-code").Ace.Delta} delta - */ - updateOnChange(delta: import("ace-code").Ace.Delta): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ - renderWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ - measureWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {number} row - * @return {number} - */ - getRowLength(row: number): number; - /** - * - * @param {Editor} editor - */ - attach(editor: Editor): void; - /**@type {Editor} */ - editor: Editor; - detach(e: any): void; - /** - * - * @param e - * @param {EditSession} session - */ - updateOnFold(e: any, session: EditSession): void; - /** - * - * @param {LineWidget} w - * @return {LineWidget} - */ - addLineWidget(w: LineWidget): LineWidget; - /** - * @param {LineWidget} w - */ - removeLineWidget(w: LineWidget): void; - /** - * - * @param {number} row - * @return {LineWidget[]} - */ - getWidgetsAtRow(row: number): LineWidget[]; - firstRow: number; - lastRow: number; - lineWidgets: import("ace-code").Ace.LineWidget[]; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - export type Editor = import("ace-code/src/editor").Editor; - export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; - export type LineWidget = import("ace-code").Ace.LineWidget; - namespace Ace { - type LineWidget = import("ace-code").Ace.LineWidget; - type Editor = import("ace-code").Ace.Editor; - } - export interface LineWidgets { - lineWidgets: Ace.LineWidget[]; - editor: Ace.Editor; - } -} declare module "ace-code/src/keyboard/gutter_handler" { export class GutterKeyboardHandler { constructor(editor: any); @@ -4334,6 +4260,80 @@ declare module "ace-code/src/autocomplete" { declare module "ace-code/src/autocomplete/text_completer" { export function getCompletions(editor: any, session: any, pos: any, prefix: any, callback: any): void; } +declare module "ace-code/src/line_widgets" { + export class LineWidgets { + /** + * @param {EditSession} session + */ + constructor(session: EditSession); + session: import("ace-code/src/edit_session").EditSession; + /** + * + * @param {import("ace-code").Ace.Delta} delta + */ + updateOnChange(delta: import("ace-code").Ace.Delta): void; + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + renderWidgets(e: any, renderer: VirtualRenderer): void; + /** + * @param {any} e + * @param {VirtualRenderer} renderer + */ + measureWidgets(e: any, renderer: VirtualRenderer): void; + /** + * @param {number} row + * @return {number} + */ + getRowLength(row: number): number; + /** + * + * @param {Editor} editor + */ + attach(editor: Editor): void; + /**@type {Editor} */ + editor: Editor; + detach(e: any): void; + /** + * + * @param e + * @param {EditSession} session + */ + updateOnFold(e: any, session: EditSession): void; + /** + * + * @param {LineWidget} w + * @return {LineWidget} + */ + addLineWidget(w: LineWidget): LineWidget; + /** + * @param {LineWidget} w + */ + removeLineWidget(w: LineWidget): void; + /** + * + * @param {number} row + * @return {LineWidget[]} + */ + getWidgetsAtRow(row: number): LineWidget[]; + firstRow: number; + lastRow: number; + lineWidgets: import("ace-code").Ace.LineWidget[]; + } + export type EditSession = import("ace-code/src/edit_session").EditSession; + export type Editor = import("ace-code/src/editor").Editor; + export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer; + export type LineWidget = import("ace-code").Ace.LineWidget; + namespace Ace { + type LineWidget = import("ace-code").Ace.LineWidget; + type Editor = import("ace-code").Ace.Editor; + } + export interface LineWidgets { + lineWidgets: Ace.LineWidget[]; + editor: Ace.Editor; + } +} declare module "ace-code/src/search_highlight" { export type Marker = import("ace-code/src/layer/marker").Marker; export type EditSession = import("ace-code/src/edit_session").EditSession; @@ -5099,6 +5099,18 @@ declare module "ace-code/src/edit_session" { * @return {Document} **/ getDocument(): Document; + /** + * Set "widgetManager" in EditSession + * + * @returns void + */ + set widgetManager(value: LineWidgets); + /** + * Get "widgetManager" from EditSession + * + * @returns {LineWidgets} object + */ + get widgetManager(): LineWidgets; resetCaches(): void; mergeUndoDeltas: boolean; onSelectionChange(): void; @@ -5687,7 +5699,6 @@ declare module "ace-code/src/edit_session" { */ lineWidgets: null | import("ace-code").Ace.LineWidget[]; isFullWidth: typeof isFullWidth; - widgetManager?: any; lineWidgetsWidth?: number; gutterRenderer?: any; selectionMarkerCount?: number; @@ -5703,6 +5714,7 @@ declare module "ace-code/src/edit_session" { export type Delta = import("ace-code").Ace.Delta; export type IRange = import("ace-code").Ace.IRange; export type SyntaxMode = import("ace-code").Ace.SyntaxMode; + export type LineWidget = import("ace-code").Ace.LineWidget; export type TextMode = SyntaxMode; import Document_1 = require("ace-code/src/document"); import Document = Document_1.Document; @@ -5714,6 +5726,8 @@ declare module "ace-code/src/edit_session" { import BidiHandler = BidiHandler_1.BidiHandler; import Range_11 = require("ace-code/src/range"); import Range = Range_11.Range; + import LineWidgets_1 = require("ace-code/src/line_widgets"); + import LineWidgets = LineWidgets_1.LineWidgets; import UndoManager_1 = require("ace-code/src/undomanager"); import UndoManager = UndoManager_1.UndoManager; function isFullWidth(c: any): boolean; @@ -5731,7 +5745,6 @@ declare module "ace-code/src/edit_session" { } export interface EditSession extends Ace.EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace.BracketMatch { doc: Ace.Document; - widgetManager?: any; lineWidgetsWidth?: number; gutterRenderer?: any; selectionMarkerCount?: number; diff --git a/ace.d.ts b/ace.d.ts index 5166ffce55a..ce1b47210d5 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -204,18 +204,20 @@ declare module "ace-code" { end: Point; } interface LineWidget { - el: HTMLElement; - rowCount: number; - hidden: boolean; + editor?: Editor; + el?: HTMLElement; + rowCount?: number; + hidden?: boolean; column?: number; - row?: number; - session: EditSession; + row: number; + session?: EditSession; html?: string; text?: string; className?: string; coverGutter?: boolean; pixelHeight?: number; - editor: Editor; + type?: any; + destroy?: () => void; coverLine?: boolean; fixedWidth?: boolean; fullWidth?: boolean; @@ -983,6 +985,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.36.4"; + export var version: "1.36.5"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } From 44f7f07ece213f3a6dbcfad3d3418f415d844fb6 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 19 Nov 2024 17:51:39 +0400 Subject: [PATCH 30/33] remove duplicating types comments; move types to `types` directory --- ace.d.ts | 32 +- package.json | 6 +- src/document.js | 4 +- src/edit_session.js | 2 +- tool/ace_declaration_generator.js | 14 +- tsconfig.json | 2 +- ace-ext.d.ts => types/ace-ext.d.ts | 157 -- ace-lib.d.ts => types/ace-lib.d.ts | 36 - ace-modules.d.ts => types/ace-modules.d.ts | 1463 +----------------- ace-snippets.d.ts => types/ace-snippets.d.ts | 0 ace-theme.d.ts => types/ace-theme.d.ts | 0 11 files changed, 32 insertions(+), 1684 deletions(-) rename ace-ext.d.ts => types/ace-ext.d.ts (86%) rename ace-lib.d.ts => types/ace-lib.d.ts (91%) rename ace-modules.d.ts => types/ace-modules.d.ts (84%) rename ace-snippets.d.ts => types/ace-snippets.d.ts (100%) rename ace-theme.d.ts => types/ace-theme.d.ts (100%) diff --git a/ace.d.ts b/ace.d.ts index ce1b47210d5..611c7234b2d 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,8 +1,8 @@ -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// /// declare module "ace-code" { export namespace Ace { @@ -137,7 +137,6 @@ declare module "ace-code" { getFoldedRowCount(first: number, last: number): number; /** * Adds a new fold. - * @returns {Ace.Fold} * The new created Fold object or an existing fold object in case the * passed in range fits an existing fold exactly. */ @@ -171,10 +170,6 @@ declare module "ace-code" { firstRange?: Ace.Range; }; onFoldWidgetClick(row: number, e: any): void; - /** - * - * @param {boolean} [toggleParent] - */ toggleFoldWidget(toggleParent?: boolean): void; updateFoldWidgets(delta: Ace.Delta): void; tokenizerUpdateFoldWidgets(e: any): void; @@ -310,7 +305,6 @@ declare module "ace-code" { interface EditSessionEvents { /** * Emitted when the document changes. - * @param delta */ "change": (delta: Delta) => void; /** @@ -319,12 +313,10 @@ declare module "ace-code" { "changeTabSize": () => void; /** * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. - * @param overwrite */ "changeOverwrite": (overwrite: boolean) => void; /** * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. - * @param e */ "changeBreakpoint": (e?: { row?: number; @@ -353,22 +345,18 @@ declare module "ace-code" { }) => void; /** * Emitted when the current mode changes. - * @param e */ "changeMode": (e: any) => void; /** * Emitted when the wrap mode changes. - * @param e */ "changeWrapMode": (e: any) => void; /** * Emitted when the wrapping limit changes. - * @param e */ "changeWrapLimit": (e: any) => void; /** * Emitted when a code fold is added or removed. - * @param e */ "changeFold": (e: any, session?: EditSession) => void; /** @@ -864,7 +852,6 @@ declare module "ace-code" { * Finds the next occurrence of text in an active selection and adds it to the selections. * @param {Number} dir The direction of lines to select: -1 for up, 1 for down * @param {Boolean} [skip] If `true`, removes the active selection range - * @param {Boolean} [stopAtFirst] **/ selectMore: (dir: number, skip?: boolean, stopAtFirst?: boolean) => void; /** @@ -904,9 +891,6 @@ declare module "ace-code" { **/ addRange(range: Ace.Range, $blockChangeEvents?: boolean): any; inMultiSelectMode: boolean; - /** - * @param {Ace.Range} [range] - **/ toSingleRange(range?: Ace.Range): void; /** * Removes a Range containing pos (if it exists). @@ -920,18 +904,13 @@ declare module "ace-code" { rangeCount: number; /** * Returns a concatenation of all the ranges. - * @returns {Ace.Range[]} **/ getAllRanges(): Ace.Range[]; /** * Splits all the ranges into lines. **/ splitIntoLines(): void; - /** - */ joinSelections(): void; - /** - **/ toggleBlockSelection(): void; /** * @@ -940,7 +919,6 @@ declare module "ace-code" { * @param {Ace.ScreenCoordinates} screenCursor The cursor to use * @param {Ace.ScreenCoordinates} screenAnchor The anchor to use * @param {Boolean} [includeEmptyLines] If true, this includes ranges inside the block which are empty due to clipping - * @returns {Ace.Range[]} **/ rectangularRangeBlock(screenCursor: Ace.ScreenCoordinates, screenAnchor: Ace.ScreenCoordinates, includeEmptyLines?: boolean): Ace.Range[]; index?: number; diff --git a/package.json b/package.json index 63159115867..ca6d03ad47d 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,7 @@ "styles", "ace.d.ts", "ace-modes.d.ts", - "ace-ext.d.ts", - "ace-modules.d.ts", - "ace-snippets.d.ts", - "ace-theme.d.ts", - "ace-lib.d.ts", + "types", "esm-resolver.js", "translations", "!**/*_test.js", diff --git a/src/document.js b/src/document.js index 0d8d243f107..8501e1027fc 100644 --- a/src/document.js +++ b/src/document.js @@ -95,7 +95,7 @@ class Document { /** * [Sets the new line mode.]{: #Document.setNewLineMode.desc} - * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} + * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`] **/ setNewLineMode(newLineMode) { @@ -107,7 +107,7 @@ class Document { } /** - * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} + * Returns the type of newlines being used; either `windows`, `unix`, or `auto` * @returns {NewLineMode} **/ getNewLineMode() { diff --git a/src/edit_session.js b/src/edit_session.js index f9717aa4779..f7364e0c4be 100644 --- a/src/edit_session.js +++ b/src/edit_session.js @@ -1199,7 +1199,7 @@ class EditSession { /** * Reverts previous changes to your document. * @param {Delta[]} deltas An array of previous changes - * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} + * @param {Boolean} [dontSelect] If `true`, doesn't select the range of where the change occured **/ undoChanges(deltas, dontSelect) { if (!deltas.length) diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 09cc4f7f214..a8621502810 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -342,7 +342,7 @@ function fixDeclaration(content, aceNamespacePath) { modules.forEach(key => { const newSourceFile = context.factory.updateSourceFile(sourceFile, moduleOutputs[key]); const dirPath = path.dirname(aceNamespacePath.replace("ace-internal", "ace")); - const outputName = key === "ace" ? `${dirPath}/ace.d.ts` : `${dirPath}/ace-${key}.d.ts`; + const outputName = key === "ace" ? `${dirPath}/ace.d.ts` : `${dirPath}/types/ace-${key}.d.ts`; finalDeclarations.push(outputName); const printer = ts.createPrinter({newLine: ts.NewLineKind.LineFeed}, { @@ -396,11 +396,12 @@ function fixDeclaration(content, aceNamespacePath) { let output = printer.printFile(newSourceFile); if (key === "ace") { let referencePaths = modules.filter((el) => el != "ace").map((el) => { - return `/// `; + return `/// `; }); let allReferences = referencePaths.join("\n") + "\n/// \n"; output = allReferences + output; } + output = cleanComments(output); output = formatDts(outputName, output); fs.writeFileSync(outputName, output); }); @@ -417,6 +418,15 @@ function fixDeclaration(content, aceNamespacePath) { checkFinalDeclaration(finalDeclarations); } +function cleanComments(text) { + text = text.replace(/^\s*\*\s*@(param|template|returns?|this|typedef)\s*({.+})?(\s*\[?[$\w]+\]?)?\s*$/gm, ''); + text = text.replace(/@type\s*({.+})/g, ''); + text = text.replace(/\/\*(\s|\*)*\*\//g, ''); + text = text.replace(/^\s*[\r\n]/gm, ''); + + return text; +} + function hasInternalTag(node) { const sourceFile = node.getSourceFile(); if (!sourceFile) return false; diff --git a/tsconfig.json b/tsconfig.json index cac74a53e15..dee9e071dae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,6 @@ "include": [ "./src/**/*", "./ace.d.ts", - "./ace_*.d.ts" + "./types/ace_*.d.ts" ] } diff --git a/ace-ext.d.ts b/types/ace-ext.d.ts similarity index 86% rename from ace-ext.d.ts rename to types/ace-ext.d.ts index d3b41e52483..2f9ab9894a5 100644 --- a/ace-ext.d.ts +++ b/types/ace-ext.d.ts @@ -9,10 +9,6 @@ declare module "ace-code/src/ext/command_bar" { * with mouse, depending on the alwaysShow property. */ export class CommandBarTooltip { - /** - * @param {HTMLElement} parentNode - * @param {Partial} [options] - */ constructor(parentNode: HTMLElement, options?: Partial); parentNode: HTMLElement; tooltip: Tooltip; @@ -29,8 +25,6 @@ declare module "ace-code/src/ext/command_bar" { * The commands are added in sequential order. If there is not enough space on the main * toolbar, the remaining elements are added to the overflow menu. * - * @param {string} id - * @param {TooltipCommand} command */ registerCommand(id: string, command: TooltipCommand): void; isShown(): boolean; @@ -42,7 +36,6 @@ declare module "ace-code/src/ext/command_bar" { * When true, the tooltip is always displayed while it is attached to an editor. * When false, the tooltip is displayed only when the mouse hovers over the active editor line. * - * @param {boolean} alwaysShow */ setAlwaysShow(alwaysShow: boolean): void; /** @@ -51,7 +44,6 @@ declare module "ace-code/src/ext/command_bar" { * Depending on the alwaysShow parameter it either displays the tooltip immediately, * or subscribes to the necessary events to display the tooltip on hover. * - * @param {Editor} editor */ attach(editor: Editor): void; editor: import("ace-code/src/editor").Editor; @@ -87,9 +79,7 @@ declare module "ace-code/src/ext/language_tools" { export function setCompleters(val: any): void; export function addCompleter(completer: any): void; import textCompleter = require("ace-code/src/autocomplete/text_completer"); - /**@type {import("ace-code").Ace.Completer}*/ export var keyWordCompleter: import("ace-code").Ace.Completer; - /**@type {import("ace-code").Ace.Completer} */ export var snippetCompleter: import("ace-code").Ace.Completer; export { textCompleter }; } @@ -100,9 +90,6 @@ declare module "ace-code/src/ext/inline_autocomplete" { * There is an inline ghost text renderer and an optional command bar tooltip inside. */ export class InlineAutocomplete { - /** - * @param {Editor} editor - */ constructor(editor: Editor); editor: Editor; keyboardHandler: HashHandler; @@ -116,58 +103,30 @@ declare module "ace-code/src/ext/inline_autocomplete" { cancel(): void; isPending(): any; }; - /** - * - * @return {AceInline} - */ getInlineRenderer(): AceInline; inlineRenderer: AceInline; - /** - * @return {CommandBarTooltip} - */ getInlineTooltip(): CommandBarTooltip; inlineTooltip: CommandBarTooltip; /** * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; - * @param {import("ace-code").Ace.CompletionOptions} options */ show(options: import("ace-code").Ace.CompletionOptions): void; activated: boolean; insertMatch(): boolean; - /** - * @param {import("ace-code").Ace.InlineAutocompleteAction} where - */ goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; getLength(): any; - /** - * @param {number} [index] - * @returns {import("ace-code").Ace.Completion | undefined} - */ getData(index?: number): import("ace-code").Ace.Completion | undefined; getIndex(): number; isOpen(): boolean; - /** - * @param {number} value - */ setIndex(value: number): void; - /** - * @return {CompletionProvider} - */ getCompletionProvider(initialPosition: any): CompletionProvider; completionProvider: CompletionProvider; - /** - * @param {import("ace-code").Ace.CompletionOptions} [options] - */ updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; base: import("ace-code/src/anchor").Anchor; completions: FilteredList; detach(): void; destroy(): void; updateDocTooltip(): void; - /** - * - * @type {{[key: string]: import("ace-code").Ace.Command}} - */ commands: { [key: string]: import("ace-code").Ace.Command; }; @@ -212,55 +171,26 @@ declare module "ace-code/src/ext/searchbox" { export function Search(editor: Editor, isReplace?: boolean): void; export type Editor = import("ace-code/src/editor").Editor; export class SearchBox { - /** - * @param {Editor} editor - * @param {never} [range] - * @param {never} [showReplaceForm] - */ constructor(editor: Editor, range?: never, showReplaceForm?: never); - /**@type {any}*/ activeInput: any; - /**@type {any}*/ element: any; setSession(e: any): void; - /** - * @param {Editor} editor - */ setEditor(editor: Editor): void; - /**@type {Editor}*/ editor: Editor; searchRange: any; - /**@type {HTMLElement}*/ searchBox: HTMLElement; - /**@type {HTMLElement}*/ replaceBox: HTMLElement; - /**@type {HTMLInputElement}*/ searchOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ replaceOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ regExpOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ caseSensitiveOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ wholeWordOption: HTMLInputElement; - /**@type {HTMLInputElement}*/ searchInput: HTMLInputElement; - /**@type {HTMLInputElement}*/ replaceInput: HTMLInputElement; - /**@type {HTMLElement}*/ searchCounter: HTMLElement; setSearchRange(range: any): void; searchRangeMarker: number; - /** - * @param {RegExp} [re] - */ highlight(re?: RegExp): void; - /** - * @param {boolean} skipCurrent - * @param {boolean} backwards - * @param {any} [preventScroll] - */ find(skipCurrent: boolean, backwards: boolean, preventScroll?: any): void; updateCounter(): void; findNext(): void; @@ -271,10 +201,6 @@ declare module "ace-code/src/ext/searchbox" { replaceAll(): void; hide(): void; active: boolean; - /** - * @param {string} value - * @param {boolean} [isReplace] - */ show(value: string, isReplace?: boolean): void; isFocused(): boolean; } @@ -283,16 +209,10 @@ declare module "ace-code/src/ext/searchbox" { } declare module "ace-code/src/ext/elastic_tabstops_lite" { export class ElasticTabstopsLite { - /** - * @param {Editor} editor - */ constructor(editor: Editor); onAfterExec: () => void; onExec: () => void; onChange: (delta: any) => void; - /** - * @param {number[]} rows - */ processRows(rows: number[]): void; } import Editor_3 = require("ace-code/src/editor"); @@ -341,9 +261,6 @@ declare module "ace-code/src/ext/emmet" { * Implementation of {@link IEmmetEditor} interface for Ace */ export class AceEmmetEditor { - /** - * @param {Editor} editor - */ setupContext(editor: Editor): void; ace: Editor; indentation: string; @@ -352,7 +269,6 @@ declare module "ace-code/src/ext/emmet" { * and end properties. If there's no selection, should return * object with start and end properties referring * to current caret position - * @return {Object} * @example * var selection = editor.getSelectionRange(); * alert(selection.start + ', ' + selection.end); @@ -362,8 +278,6 @@ declare module "ace-code/src/ext/emmet" { * Creates selection from start to end character * indexes. If end is ommited, this method should place caret * and start index - * @param {Number} start - * @param {Number} [end] * @example * editor.createSelection(10, 40); * @@ -374,7 +288,6 @@ declare module "ace-code/src/ext/emmet" { /** * Returns current line's start and end indexes as object with start * and end properties - * @return {Object} * @example * var range = editor.getCurrentLineRange(); * alert(range.start + ', ' + range.end); @@ -382,7 +295,6 @@ declare module "ace-code/src/ext/emmet" { getCurrentLineRange(): any; /** * Returns current caret position - * @return {Number|null} */ getCaretPos(): number | null; /** @@ -392,7 +304,6 @@ declare module "ace-code/src/ext/emmet" { setCaretPos(index: number): void; /** * Returns content of current line - * @return {String} */ getCurrentLine(): string; /** @@ -418,17 +329,14 @@ declare module "ace-code/src/ext/emmet" { replaceContent(value: string, start?: number, end?: number, noIndent?: boolean): void; /** * Returns editor's content - * @return {String} */ getContent(): string; /** * Returns current editor's syntax mode - * @return {String} */ getSyntax(): string; /** * Returns current output profile name (@see emmet#setupProfile) - * @return {String} */ getProfileName(): string; /** @@ -440,23 +348,17 @@ declare module "ace-code/src/ext/emmet" { prompt(title: string): string; /** * Returns current selection - * @return {String} * @since 0.65 */ getSelection(): string; /** * Returns current editor's file path - * @return {String} * @since 0.65 */ getFilePath(): string; } } declare module "ace-code/src/ext/hardwrap" { - /** - * @param {import("ace-code/src/editor").Editor} editor - * @param {import("ace-code").Ace.HardWrapOptions} options - */ export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; import Editor_9 = require("ace-code/src/editor"); import Editor = Editor_9.Editor; @@ -491,20 +393,12 @@ declare module "ace-code/src/ext/modelist" { export var modes: any[]; export var modesByName: {}; class Mode { - /** - * @param {string} name - * @param {string} caption - * @param {string} extensions - */ constructor(name: string, caption: string, extensions: string); name: string; caption: string; mode: string; extensions: string; extRe: RegExp; - /** - * @param {string} filename - */ supportsFile(filename: string): RegExpMatchArray; } } @@ -519,11 +413,6 @@ declare module "ace-code/src/ext/themelist" { } declare module "ace-code/src/ext/options" { export class OptionPanel { - /** - * - * @param {Editor} editor - * @param {HTMLElement} [element] - */ constructor(editor: Editor, element?: HTMLElement); editor: import("ace-code/src/editor").Editor; container: HTMLElement; @@ -532,23 +421,10 @@ declare module "ace-code/src/ext/options" { add(config: any): void; render(): void; renderOptionGroup(group: any): any[]; - /** - * @param {string} key - * @param {Object} option - */ renderOptionControl(key: string, option: any): any; - /** - * - * @param key - * @param option - */ renderOption(key: any, option: any): (string | any[] | { class: string; })[]; - /** - * @param {string | number | Object} option - * @param {string | number | boolean} value - */ setOption(option: string | number | any, value: string | number | boolean): void; getOption(option: any): any; } @@ -617,7 +493,6 @@ declare module "ace-code/src/ext/prompt" { }; export type Editor = import("ace-code/src/editor").Editor; /** - * @typedef PromptOptions * @property {String} name Prompt name. * @property {String} $type Use prompt of specific type (gotoLine|commands|modes or default if empty). * @property {[number, number]} selection Defines which part of the predefined value should be highlighted. @@ -645,23 +520,8 @@ declare module "ace-code/src/ext/prompt" { * */ export function prompt(editor: Editor, message: string | Partial, options: Partial, callback?: Function): any; export namespace prompt { - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ function gotoLine(editor: Editor, callback?: Function): void; - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ function commands(editor: Editor, callback?: Function): void; - /** - * - * @param {Editor} editor - * @param {Function} [callback] - */ function modes(editor: Editor, callback?: Function): void; } } @@ -694,13 +554,6 @@ declare module "ace-code/src/ext/static-css" { export = _exports; } declare module "ace-code/src/ext/static_highlight" { - /** - * - * @param {HTMLElement} el - * @param {import("ace-code").Ace.StaticHighlightOptions} opts - * @param [callback] - * @returns {boolean} - */ function highlight(el: HTMLElement, opts: import("ace-code").Ace.StaticHighlightOptions, callback?: any): boolean; export namespace highlight { export { render, renderSync, highlight, SyntaxMode, Theme }; @@ -729,9 +582,6 @@ declare module "ace-code/src/ext/static_highlight" { * Transforms a given input code snippet into HTML using the given mode * @param {string} input Code snippet * @param {SyntaxMode | string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {Theme} theme - * @param {any} lineStart - * @param {boolean} disableGutter * @returns {object} An object containing: html, css */ function renderSync(input: string, mode: SyntaxMode | string, theme: Theme, lineStart: any, disableGutter: boolean): object; @@ -742,15 +592,8 @@ declare module "ace-code/src/ext/statusbar" { export type Editor = import("ace-code/src/editor").Editor; /** simple statusbar **/ export class StatusBar { - /** - * @param {Editor} editor - * @param {HTMLElement} parentNode - */ constructor(editor: Editor, parentNode: HTMLElement); element: HTMLDivElement; - /** - * @param {Editor} editor - */ updateStatus(editor: Editor): void; } } diff --git a/ace-lib.d.ts b/types/ace-lib.d.ts similarity index 91% rename from ace-lib.d.ts rename to types/ace-lib.d.ts index d0db3426960..2c0f59e32fb 100644 --- a/ace-lib.d.ts +++ b/types/ace-lib.d.ts @@ -46,11 +46,6 @@ declare module "ace-code/src/lib/dom" { export const HAS_CSS_TRANSFORMS: boolean; export const HI_DPI: boolean; export function translate(element: any, tx: any, ty: any): void; - /** - * @param {string} cssText - * @param {string} [id] - * @param {any} [target] - */ export function importCssString(cssText: string, id?: string, target?: any): number; } declare module "ace-code/src/lib/oop" { @@ -85,9 +80,6 @@ declare module "ace-code/src/lib/lang" { }; export function delayedCall(fcn: any, defaultTimeout?: number): { (timeout?: number): void; - /** - * @param {number} [timeout] - */ delay(timeout?: number): void; schedule: any; call(): void; @@ -120,7 +112,6 @@ declare module "ace-code/src/lib/event" { export const nextFrame: any; } declare module "ace-code/src/lib/event_emitter" { - /**@type {any}*/ export var EventEmitter: any; } declare module "ace-code/src/lib/net" { @@ -183,44 +174,17 @@ declare module "ace-code/src/lib/default_english_messages" { } declare module "ace-code/src/lib/app_config" { export class AppConfig { - /** - * @param {Object} obj - * @param {string} path - * @param {{ [key: string]: any }} options - * @returns {import("ace-code").Ace.AppConfig} - */ defineOptions(obj: any, path: string, options: { [key: string]: any; }): import("ace-code").Ace.AppConfig; - /** - * @param {Object} obj - */ resetOptions(obj: any): void; - /** - * @param {string} path - * @param {string} name - * @param {any} value - */ setDefaultValue(path: string, name: string, value: any): boolean; - /** - * @param {string} path - * @param {{ [key: string]: any; }} optionHash - */ setDefaultValues(path: string, optionHash: { [key: string]: any; }): void; - /** - * @param {any} value - * @param {{placeholders?: "dollarSigns" | "curlyBrackets"}} [options] - */ setMessages(value: any, options?: { placeholders?: "dollarSigns" | "curlyBrackets"; }): void; - /** - * @param {string} key - * @param {string} defaultString - * @param {{ [x: string]: any; }} [params] - */ nls(key: string, defaultString: string, params?: { [x: string]: any; }): any; diff --git a/ace-modules.d.ts b/types/ace-modules.d.ts similarity index 84% rename from ace-modules.d.ts rename to types/ace-modules.d.ts index 6dcd06b2c7d..79e5fd0e118 100644 --- a/ace-modules.d.ts +++ b/types/ace-modules.d.ts @@ -1,19 +1,10 @@ declare module "ace-code/src/layer/font_metrics" { export class FontMetrics { - /** - * @param {HTMLElement} parentEl - */ constructor(parentEl: HTMLElement); el: HTMLDivElement; - /** - * @param size - */ checkForSizeChanges(size: any): void; charSizes: any; allowBoldFonts: boolean; - /** - * @param {boolean} val - */ setPolling(val: boolean): void; getCharacterWidth(ch: any): any; destroy(): void; @@ -49,14 +40,12 @@ declare module "ace-code/src/document" { setValue(text: string): void; /** * Returns all the lines in the document as a single string, joined by the new line character. - * @returns {String} **/ getValue(): string; /** * Creates a new `Anchor` to define a floating point in the document. * @param {Number} row The row number to use * @param {Number} column The column number to use - * @returns {Anchor} **/ createAnchor(row: number, column: number): Anchor; /** @@ -69,77 +58,58 @@ declare module "ace-code/src/document" { getNewLineCharacter(): string; /** * [Sets the new line mode.]{: #Document.setNewLineMode.desc} - * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} - + * @param {NewLineMode} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`] **/ setNewLineMode(newLineMode: NewLineMode): void; /** - * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} - * @returns {NewLineMode} + * Returns the type of newlines being used; either `windows`, `unix`, or `auto` **/ getNewLineMode(): NewLineMode; /** * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * @param {String} text The text to check - * @returns {boolean} **/ isNewLine(text: string): boolean; /** * Returns a verbatim copy of the given line as it is in the document * @param {Number} row The row index to retrieve - * @returns {string} **/ getLine(row: number): string; /** * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * @param {Number} firstRow The first row index to retrieve * @param {Number} lastRow The final row index to retrieve - * @returns {string[]} **/ getLines(firstRow: number, lastRow: number): string[]; /** * Returns all lines in the document as string array. - * @returns {string[]} **/ getAllLines(): string[]; /** * Returns the number of rows in the document. - * @returns {Number} **/ getLength(): number; /** * Returns all the text within `range` as a single string. * @param {IRange} range The range to work with. * - * @returns {String} **/ getTextRange(range: IRange): string; /** * Returns all the text within `range` as an array of lines. * @param {IRange} range The range to work with. * - * @returns {string[]} **/ getLinesForRange(range: IRange): string[]; /** - * @param row - * @param lines - * @deprecated */ insertLines(row: any, lines: any): void; /** - * @param firstRow - * @param lastRow - * @returns {String[]} - * @deprecated */ removeLines(firstRow: any, lastRow: any): string[]; /** - * @param position - * @returns {Point} - * @deprecated */ insertNewLine(position: any): Point; @@ -148,7 +118,6 @@ declare module "ace-code/src/document" { * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` * @param {String} text A chunk of text to insert * @returns {Point} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - **/ insert(position: Point, text: string): Point; /** @@ -163,34 +132,17 @@ declare module "ace-code/src/document" { * @returns {Point} Returns the position of the end of the inserted text **/ insertInLine(position: Point, text: string): Point; - /** - * - * @param {number} row - * @param {number} column - * @return {Point} - */ clippedPos(row: number, column: number): Point; - /** - * @param {Point} pos - * @return {Point} - */ clonePos(pos: Point): Point; - /** - * @param {number} row - * @param {number} column - * @return {Point} - */ pos(row: number, column: number): Point; /** * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. * @param {Number} row The index of the row to insert at * @param {string[]} lines An array of strings - **/ insertFullLines(row: number, lines: string[]): void; /** * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. - * @param {Point} position * @param {string[]} lines An array of strings * @returns {Point} Contains the final row and column, like this: * ``` @@ -206,7 +158,6 @@ declare module "ace-code/src/document" { * Removes the `range` from the document. * @param {IRange} range A specified Range to remove * @returns {Point} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - **/ remove(range: IRange): Point; /** @@ -215,7 +166,6 @@ declare module "ace-code/src/document" { * @param {Number} startColumn The column to start removing at * @param {Number} endColumn The column to stop removing at * @returns {Point} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. - **/ removeInLine(row: number, startColumn: number, endColumn: number): Point; /** @@ -223,7 +173,6 @@ declare module "ace-code/src/document" { * @param {Number} firstRow The first row to be removed * @param {Number} lastRow The last row to be removed * @returns {String[]} Returns all the removed lines. - **/ removeFullLines(firstRow: number, lastRow: number): string[]; /** @@ -256,7 +205,6 @@ declare module "ace-code/src/document" { /** * Applies `delta` to the document. * @param {Delta} delta A delta object (can include "insert" and "remove" actions) - * @param {boolean} [doNotValidate] **/ applyDelta(delta: Delta, doNotValidate?: boolean): void; /** @@ -329,13 +277,11 @@ declare module "ace-code/src/anchor" { constructor(doc: Document, row: number | import("ace-code").Ace.Point, column?: number); /** * Returns an object identifying the `row` and `column` position of the current anchor. - * @returns {import("ace-code").Ace.Point} **/ getPosition(): import("ace-code").Ace.Point; /** * * Returns the current document. - * @returns {Document} **/ getDocument(): Document; /** @@ -358,7 +304,6 @@ declare module "ace-code/src/anchor" { * **/ attach(doc: Document): void; - /**@type{Document}*/ document: Document; markerId?: number; } @@ -401,41 +346,20 @@ declare module "ace-code/src/config" { removeEventListener(name: K, callback: any): void; removeAllListeners(name?: string): void; /** - * @template {keyof import("ace-code").Ace.ConfigOptions} K * @param {K} key - The key of the config option to retrieve. * @returns {import("ace-code").Ace.ConfigOptions[K]} - The value of the config option. */ get: (key: K) => import("ace-code").Ace.ConfigOptions[K]; - /** - * @template {keyof import("ace-code").Ace.ConfigOptions} K - * @param {K} key - * @param {import("ace-code").Ace.ConfigOptions[K]} value - */ set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; - /** - * @return {import("ace-code").Ace.ConfigOptions} - */ all: () => import("ace-code").Ace.ConfigOptions; /** * module loading - * @param {string} name - * @param {string} [component] - * @returns {string} */ moduleUrl: (name: string, component?: string) => string; - /** - * @param {string} name - * @param {string} subst - * @returns {string} - */ setModuleUrl: (name: string, subst: string) => string; /** @arg {(name: string, callback: (error: any, module: any) => void) => void} cb */ setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void; dynamicModules: any; - /** - * @param {string | [string, string]} moduleId - * @param {(module: any) => void} onLoad - */ loadModule: (moduleId: string | [ string, string @@ -449,40 +373,16 @@ declare module "ace-code/src/layer/lines" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; export class Lines { - /** - * @param {HTMLElement} element - * @param {number} [canvasHeight] - */ constructor(element: HTMLElement, canvasHeight?: number); element: HTMLElement; canvasHeight: number; cells: any[]; cellCache: any[]; - /** - * @param {LayerConfig} config - */ moveContainer(config: LayerConfig): void; - /** - * @param {LayerConfig} oldConfig - * @param {LayerConfig} newConfig - */ pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; - /** - * @param {number} row - * @param {Partial} config - * @param {EditSession} session - */ computeLineTop(row: number, config: Partial, session: EditSession): number; - /** - * @param {number} row - * @param {LayerConfig} config - * @param {EditSession} session - */ computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; getLength(): number; - /** - * @param {number} index - */ get(index: number): any; shift(): void; pop(): void; @@ -494,59 +394,24 @@ declare module "ace-code/src/layer/lines" { } declare module "ace-code/src/layer/gutter" { export class Gutter { - /** - * @param {HTMLElement} parentEl - */ constructor(parentEl: HTMLElement); element: HTMLDivElement; gutterWidth: number; - /** - * @param {EditSession} session - */ setSession(session: EditSession): void; session: import("ace-code/src/edit_session").EditSession; - /** - * @param {number} row - * @param {string} className - */ addGutterDecoration(row: number, className: string): void; - /** - * @param {number} row - * @param {string} className - */ removeGutterDecoration(row: number, className: string): void; - /** - * @param {any[]} annotations - */ setAnnotations(annotations: any[]): void; - /** - * @param {LayerConfig} config - */ update(config: LayerConfig): void; config: import("ace-code").Ace.LayerConfig; oldLastRow: number; updateLineHighlight(): void; - /** - * @param {LayerConfig} config - */ scrollLines(config: LayerConfig): void; - /** - * @param {boolean} highlightGutterLine - */ setHighlightGutterLine(highlightGutterLine: boolean): void; - /** - * @param {boolean} show - */ setShowLineNumbers(show: boolean): void; getShowLineNumbers(): boolean; - /** - * @param {boolean} [show] - */ setShowFoldWidgets(show?: boolean): void; getShowFoldWidgets(): boolean; - /** - * @param {{ x: number; }} point - */ getRegion(point: { x: number; }): "markers" | "foldWidgets"; @@ -566,89 +431,26 @@ declare module "ace-code/src/layer/marker" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; export class Marker { - /** - * @param {HTMLElement} parentEl - */ constructor(parentEl: HTMLElement); element: HTMLDivElement; - /** - * @param {number} padding - */ setPadding(padding: number): void; - /** - * @param {EditSession} session - */ setSession(session: EditSession): void; session: import("ace-code/src/edit_session").EditSession; - /** - * @param {{ [x: number]: import("ace-code").Ace.MarkerLike; }} markers - */ setMarkers(markers: { [x: number]: import("ace-code").Ace.MarkerLike; }): void; markers: { [x: number]: import("ace-code").Ace.MarkerLike; }; - /** - * @param {string} className - * @param {string} css - */ elt(className: string, css: string): void; i: number; - /** - * @param {LayerConfig} config - */ update(config: LayerConfig): void; config: import("ace-code").Ace.LayerConfig; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} layerConfig - * @param {string} [extraStyle] - */ drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {LayerConfig} config - * @param {string} [extraStyle] - */ drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {number} [extraLength] - * @param {string} [extraStyle] - */ drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {number} extraLength - * @param {string} extraStyle - */ drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {undefined} [extraStyle] - */ drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; - /** - * @param {undefined} stringBuilder - * @param {Range} range - * @param {string} clazz - * @param {Partial} config - * @param {undefined} [extraStyle] - */ drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; } import Range_2 = require("ace-code/src/range"); @@ -659,64 +461,28 @@ declare module "ace-code/src/layer/text_util" { } declare module "ace-code/src/layer/text" { export class Text { - /** - * @param {HTMLElement} parentEl - */ constructor(parentEl: HTMLElement); dom: typeof dom; element: HTMLDivElement; EOL_CHAR: any; - /** - * @param {number} padding - */ setPadding(padding: number): void; - /** - * @returns {number} - */ getLineHeight(): number; - /** - * @returns {number} - */ getCharacterWidth(): number; checkForSizeChanges(): void; - /** - * @param {EditSession} session - */ setSession(session: EditSession): void; - /**@type {EditSession}*/ session: EditSession; - /** - * @param {string} showInvisibles - */ setShowInvisibles(showInvisibles: string): boolean; showInvisibles: any; showSpaces: boolean; showTabs: boolean; showEOL: boolean; - /** - * @param {boolean} display - */ setDisplayIndentGuides(display: boolean): boolean; displayIndentGuides: any; - /** - * @param {boolean} highlight - */ setHighlightIndentGuides(highlight: boolean): boolean; tabSize: number; - /** - * @param {LayerConfig} config - * @param {number} firstRow - * @param {number} lastRow - */ updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; config?: import("ace-code").Ace.LayerConfig; - /** - * @param {LayerConfig} config - */ scrollLines(config: LayerConfig): void; - /** - * @param {LayerConfig} config - */ update(config: LayerConfig): void; renderIndentGuide(parent: any, value: any, max: any): any; EOF_CHAR: string; @@ -744,9 +510,6 @@ declare module "ace-code/src/layer/text" { } declare module "ace-code/src/layer/cursor" { export class Cursor { - /** - * @param {HTMLElement} parentEl - */ constructor(parentEl: HTMLElement); element: HTMLDivElement; isVisible: boolean; @@ -755,26 +518,11 @@ declare module "ace-code/src/layer/cursor" { smoothBlinking: boolean; cursors: any[]; cursor: HTMLDivElement; - /** - * @param {number} padding - */ setPadding(padding: number): void; - /** - * @param {EditSession} session - */ setSession(session: EditSession): void; session: import("ace-code/src/edit_session").EditSession; - /** - * @param {boolean} blinking - */ setBlinking(blinking: boolean): void; - /** - * @param {number} blinkInterval - */ setBlinkInterval(blinkInterval: number): void; - /** - * @param {boolean} smoothBlinking - */ setSmoothBlinking(smoothBlinking: boolean): void; addCursor(): HTMLDivElement; removeCursor(): any; @@ -782,10 +530,6 @@ declare module "ace-code/src/layer/cursor" { showCursor(): void; restartTimer(): void; intervalId: number; - /** - * @param {import("ace-code").Ace.Point} [position] - * @param {boolean} [onScreen] - */ getPixelPosition(position?: import("ace-code").Ace.Point, onScreen?: boolean): { left: number; top: number; @@ -820,7 +564,6 @@ declare module "ace-code/src/scrollbar" { width: number; /** * Returns the width of the scroll bar. - * @returns {Number} **/ getWidth(): number; /** @@ -860,7 +603,6 @@ declare module "ace-code/src/scrollbar" { height: any; /** * Returns the height of the scroll bar. - * @returns {Number} **/ getHeight(): number; /** @@ -892,7 +634,6 @@ declare module "ace-code/src/scrollbar" { /** * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. * @param {Element} parent A DOM element - * @param {string} classSuffix **/ constructor(parent: Element, classSuffix: string); element: HTMLDivElement; @@ -934,13 +675,10 @@ declare module "ace-code/src/scrollbar_custom" { getHeight(): number; /** * Returns new top for scroll thumb - * @param {Number}thumbTop - * @returns {Number} **/ scrollTopFromThumbTop(thumbTop: number): number; /** * Returns the width of the scroll bar. - * @returns {Number} **/ getWidth(): number; /** @@ -985,13 +723,10 @@ declare module "ace-code/src/scrollbar_custom" { renderer: any; /** * Returns the height of the scroll bar. - * @returns {Number} **/ getHeight(): number; /** * Returns new left for scroll thumb - * @param {Number} thumbLeft - * @returns {Number} **/ scrollLeftFromThumbLeft(thumbLeft: number): number; /** @@ -1025,7 +760,6 @@ declare module "ace-code/src/scrollbar_custom" { /** * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. * @param {Element} parent A DOM element - * @param {string} classSuffix **/ constructor(parent: Element, classSuffix: string); element: HTMLDivElement; @@ -1091,13 +825,10 @@ declare module "ace-code/src/virtual_renderer" { * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. * @param {HTMLElement | null} [container] The root element of the editor * @param {String} [theme] The starting theme - **/ constructor(container?: HTMLElement | null, theme?: string); container: HTMLElement; - /**@type {HTMLElement}*/ scroller: HTMLElement; - /**@type {HTMLElement}*/ content: HTMLElement; canvas: HTMLDivElement; scrollBar: VScrollBar; @@ -1153,7 +884,6 @@ declare module "ace-code/src/virtual_renderer" { * Triggers a partial update of the text, from the range given by the two parameters. * @param {Number} firstRow The first row to update * @param {Number} lastRow The last row to update - * @param {boolean} [force] **/ updateLines(firstRow: number, lastRow: number, force?: boolean): void; /** @@ -1163,7 +893,6 @@ declare module "ace-code/src/virtual_renderer" { /** * Triggers a full update of all the layers, for all the rows. * @param {Boolean} [force] If `true`, forces the changes through - **/ updateFull(force?: boolean): void; /** @@ -1174,190 +903,113 @@ declare module "ace-code/src/virtual_renderer" { gutterWidth: any; /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. - **/ adjustWrapLimit(): boolean; /** * Identifies whether you want to have an animated scroll or not. * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls - **/ setAnimatedScroll(shouldAnimate: boolean): void; /** * Returns whether an animated scroll happens or not. - * @returns {Boolean} - **/ getAnimatedScroll(): boolean; /** * Identifies whether you want to show invisible characters or not. * @param {Boolean} showInvisibles Set to `true` to show invisibles - **/ setShowInvisibles(showInvisibles: boolean): void; /** * Returns whether invisible characters are being shown or not. - * @returns {Boolean} - **/ getShowInvisibles(): boolean; - /** - * @return {boolean} - - */ getDisplayIndentGuides(): boolean; - /** - * @param {boolean} display - - */ setDisplayIndentGuides(display: boolean): void; - /** - - * @return {boolean} - */ getHighlightIndentGuides(): boolean; - /** - - * @param {boolean} highlight - */ setHighlightIndentGuides(highlight: boolean): void; /** * Identifies whether you want to show the print margin or not. * @param {Boolean} showPrintMargin Set to `true` to show the print margin - **/ setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns whether the print margin is being shown or not. - * @returns {Boolean} - **/ getShowPrintMargin(): boolean; /** * Identifies whether you want to show the print margin column or not. * @param {number} printMarginColumn Set to `true` to show the print margin column - **/ setPrintMarginColumn(printMarginColumn: number): void; /** * Returns whether the print margin column is being shown or not. - * @returns {number} - **/ getPrintMarginColumn(): number; /** * Returns `true` if the gutter is being shown. - * @returns {Boolean} - **/ getShowGutter(): boolean; /** * Identifies whether you want to show the gutter or not. * @param {Boolean} show Set to `true` to show the gutter - **/ setShowGutter(show: boolean): void; - /** - - * @returns {boolean} - */ getFadeFoldWidgets(): boolean; - /** - - * @param {boolean} show - */ setFadeFoldWidgets(show: boolean): void; - /** - * - * @param {boolean} shouldHighlight - */ setHighlightGutterLine(shouldHighlight: boolean): void; - /** - - * @returns {boolean} - */ getHighlightGutterLine(): boolean; /** * * Returns the root element containing this renderer. - * @returns {HTMLElement} **/ getContainerElement(): HTMLElement; /** * * Returns the element that the mouse events are attached to - * @returns {HTMLElement} **/ getMouseEventTarget(): HTMLElement; /** * * Returns the element to which the hidden text area is added. - * @returns {HTMLElement} **/ getTextAreaContainer(): HTMLElement; /** * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} - * @returns {Number} **/ getFirstVisibleRow(): number; /** * * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} **/ getFirstFullyVisibleRow(): number; /** * * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} **/ getLastFullyVisibleRow(): number; /** * * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} - * @returns {Number} **/ getLastVisibleRow(): number; /** * Sets the padding for all the layers. * @param {Number} padding A new padding value (in pixels) - **/ setPadding(padding: number): void; - /** - * - * @param {number} [top] - * @param {number} [bottom] - * @param {number} [left] - * @param {number} [right] - - */ setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** - * - * @param {number} [top] - * @param {number} [bottom] - * @param {number} [left] - * @param {number} [right] - - */ setMargin(top?: number, bottom?: number, left?: number, right?: number): void; /** * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ getHScrollBarAlwaysVisible(): boolean; /** * Identifies whether you want to show the horizontal scrollbar or not. * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; /** * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ getVScrollBarAlwaysVisible(): boolean; /** @@ -1391,7 +1043,6 @@ declare module "ace-code/src/virtual_renderer" { /** * * Redraw breakpoints. - * @param {any} [rows] */ updateBreakpoints(rows?: any): void; /** @@ -1415,19 +1066,10 @@ declare module "ace-code/src/virtual_renderer" { * Shows the cursor icon. **/ showCursor(): void; - /** - * - * @param {Point} anchor - * @param {Point} lead - * @param {number} [offset] - */ scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; /** * * Scrolls the cursor into the first visibile area of the editor - * @param {Point} [cursor] - * @param {number} [offset] - * @param {{ top?: any; bottom?: any; }} [$viewMargin] */ scrollCursorIntoView(cursor?: Point, offset?: number, $viewMargin?: { top?: any; @@ -1436,23 +1078,19 @@ declare module "ace-code/src/virtual_renderer" { /** * {:EditSession.getScrollTop} * @related EditSession.getScrollTop - * @returns {Number} **/ getScrollTop(): number; /** * {:EditSession.getScrollLeft} * @related EditSession.getScrollLeft - * @returns {Number} **/ getScrollLeft(): number; /** * Returns the first visible row, regardless of whether it's fully visible or not. - * @returns {Number} **/ getScrollTopRow(): number; /** * Returns the last visible row, regardless of whether it's fully visible or not. - * @returns {Number} **/ getScrollBottomRow(): number; /** @@ -1462,12 +1100,6 @@ declare module "ace-code/src/virtual_renderer" { * @related EditSession.setScrollTop **/ scrollToRow(row: number): void; - /** - * - * @param {Point} cursor - * @param {number} [alignment] - * @returns {number} - */ alignCursor(cursor: Point, alignment?: number): number; /** * Gracefully scrolls the editor to the row indicated. @@ -1475,15 +1107,8 @@ declare module "ace-code/src/virtual_renderer" { * @param {Boolean} center If `true`, centers the editor the to indicated line * @param {Boolean} animate If `true` animates scrolling * @param {() => void} [callback] Function to be called after the animation has finished - **/ scrollToLine(line: number, center: boolean, animate: boolean, callback?: () => void): void; - /** - * - * @param fromValue - * @param [callback] - - */ animateScrolling(fromValue: any, callback?: any): void; /** * Scrolls the editor to the y pixel indicated. @@ -1512,31 +1137,15 @@ declare module "ace-code/src/virtual_renderer" { * @param {Number} deltaX The x value to scroll by * @param {Number} deltaY The y value to scroll by * - * @returns {Boolean} **/ isScrollableBy(deltaX: number, deltaY: number): boolean; - /** - * - * @param {number} x - * @param {number} y - * @returns {import("ace-code").Ace.ScreenCoordinates} - - */ pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; - /** - * - * @param {number} x - * @param {number} y - * @returns {Point} - - */ screenToTextCoordinates(x: number, y: number): Point; /** * Returns an object containing the `pageX` and `pageY` coordinates of the document position. * @param {Number} row The document row position * @param {Number} column The document column position * - * @returns {{ pageX: number, pageY: number}} **/ textToScreenCoordinates(row: number, column: number): { pageX: number; @@ -1552,36 +1161,20 @@ declare module "ace-code/src/virtual_renderer" { * Blurs the current container. **/ visualizeBlur(): void; - /** - * @param {Object} composition - - **/ showComposition(composition: any): void; /** * @param {String} text A string of text to use * * Sets the inner text of the current composition to `text`. - **/ setCompositionText(text: string): void; /** * * Hides the current composition. - **/ hideComposition(): void; - /** - * @param {string} text - * @param {Point} [position] - */ setGhostText(text: string, position?: Point): void; removeGhostText(): void; - /** - * @param {string} text - * @param {string} type - * @param {number} row - * @param {number} [column] - */ addToken(text: string, type: string, row: number, column?: number): void; hideTokensAfterPosition(row: any, column: any): { type: string; @@ -1592,18 +1185,15 @@ declare module "ace-code/src/virtual_renderer" { * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} * @param {String | Theme} [theme] The path to a theme * @param {() => void} [cb] optional callback - **/ setTheme(theme?: string | Theme, cb?: () => void): void; /** * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} - * @returns {String} **/ getTheme(): string; /** * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} * @param {String} style A class name - * @param {boolean}[include] **/ setStyle(style: string, include?: boolean): void; /** @@ -1612,9 +1202,6 @@ declare module "ace-code/src/virtual_renderer" { * **/ unsetStyle(style: string): void; - /** - * @param {string} style - */ setCursorStyle(style: string): void; /** * @param {String} cursorStyle A css cursor style @@ -1623,7 +1210,6 @@ declare module "ace-code/src/virtual_renderer" { attachToShadowRoot(): void; /** * Destroys the text and cursor layers for this renderer. - **/ destroy(): void; CHANGE_CURSOR: number; @@ -1682,11 +1268,6 @@ declare module "ace-code/src/virtual_renderer" { } } declare module "ace-code/src/selection" { - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code/src/anchor").Anchor} Anchor - * @typedef {import("ace-code").Ace.Point} Point - */ export class Selection { /** * Creates a new `Selection` object. @@ -1694,28 +1275,21 @@ declare module "ace-code/src/selection" { * @constructor **/ constructor(session: EditSession); - /**@type {EditSession}*/ session: EditSession; - /**@type {import("ace-code/src/document").Document}*/ doc: import("ace-code/src/document").Document; - /**@type {Anchor}*/ cursor: Anchor; lead: Anchor; - /**@type {Anchor}*/ anchor: Anchor; /** * Returns `true` if the selection is empty. - * @returns {Boolean} **/ isEmpty(): boolean; /** * Returns `true` if the selection is a multi-line. - * @returns {Boolean} **/ isMultiLine(): boolean; /** * Returns an object containing the `row` and `column` current position of the cursor. - * @returns {Point} **/ getCursor(): Point; /** @@ -1728,23 +1302,19 @@ declare module "ace-code/src/selection" { /** * Returns an object containing the `row` and `column` of the calling selection anchor. * - * @returns {Point} * @related Anchor.getPosition **/ getAnchor(): Point; /** * Returns an object containing the `row` and `column` of the calling selection lead. - * @returns {Object} **/ getSelectionLead(): any; /** * Returns `true` if the selection is going backwards in the document. - * @returns {Boolean} **/ isBackwards(): boolean; /** * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} - * @returns {Range} **/ getRange(): Range; /** @@ -1912,26 +1482,18 @@ declare module "ace-code/src/selection" { * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} * @param {Number} row The row to move to * @param {Number} column The column to move to - * @param {Boolean} [keepDesiredColumn] [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} **/ moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; /** * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} * @param {Number} row The row to move to * @param {Number} column The column to move to - * @param {Boolean} keepDesiredColumn {:preventUpdateBool} **/ moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; detach(): void; - /** - * @param {Range & {desiredColumn?: number}} range - */ fromOrientedRange(range: Range & { desiredColumn?: number; }): void; - /** - * @param {Range & {desiredColumn?: number}} [range] - */ toOrientedRange(range?: Range & { desiredColumn?: number; }): Range & { @@ -1942,24 +1504,10 @@ declare module "ace-code/src/selection" { * postion. The result is the range of the starting and eventual cursor position. * Will reset the cursor position. * @param {Function} func The callback that should change the cursor position - * @returns {Range} **/ getRangeOfMovements(func: Function): Range; - /** - * - * @returns {Range|Range[]} - */ toJSON(): Range | Range[]; - /** - * - * @param data - */ fromJSON(data: any): void; - /** - * - * @param data - * @return {boolean} - */ isEqual(data: any): boolean; /** * Left for backward compatibility @@ -1998,9 +1546,9 @@ declare module "ace-code/src/keyboard/textinput" { declare module "ace-code/src/mouse/mouse_event" { export class MouseEvent { constructor(domEvent: any, editor: any); - /** @type {number} */ speed: number; - /** @type {number} */ wheelX: number; - /** @type {number} */ wheelY: number; + speed: number; + wheelX: number; + wheelY: number; domEvent: any; editor: any; x: any; @@ -2051,59 +1599,17 @@ declare module "ace-code/src/mouse/default_handlers" { export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; export type MouseEvent = import("ace-code/src/mouse/mouse_event").MouseEvent; export class DefaultHandlers { - /** - * @param {MouseHandler} mouseHandler - */ constructor(mouseHandler: MouseHandler); - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - /** - * - * @param {import("ace-code").Ace.Position} [pos] - * @param {boolean} [waitForClickSelection] - * @this {MouseHandler} - */ startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; - /** - * @this {MouseHandler} - */ select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @param {string | number} unitName - * @this {MouseHandler} - */ extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; - /** - * @this {MouseHandler} - */ selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @this {MouseHandler} - */ focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - /** - * @param {MouseEvent} ev - * @this {MouseHandler} - */ onMouseWheel(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; selectEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; selectAllEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler) => void; @@ -2118,34 +1624,12 @@ declare module "ace-code/src/tooltip" { idleTime: number; lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; waitForHover(): void; - /** - * @param {Editor} editor - */ addToEditor(editor: Editor): void; - /** - * @param {Editor} editor - */ removeFromEditor(editor: Editor): void; - /** - * @param {MouseEvent} e - */ isOutsideOfText(e: MouseEvent): boolean; - /** - * @param {(event: MouseEvent, editor: Editor) => void} value - */ setDataProvider(value: (event: MouseEvent, editor: Editor) => void): void; - /** - * @param {Editor} editor - * @param {Range} range - * @param {HTMLElement} domNode - * @param {MouseEvent} startingEvent - */ showForRange(editor: Editor, range: Range, domNode: HTMLElement, startingEvent: MouseEvent): void; range: Range; - /** - * @param {Range} range - * @param {EditSession} [session] - */ addMarker(range: Range, session?: EditSession): void; marker: number; row: number; @@ -2155,72 +1639,27 @@ declare module "ace-code/src/tooltip" { export type EditSession = import("ace-code/src/edit_session").EditSession; export var popupManager: PopupManager; export class Tooltip { - /** - * @param {Element} parentNode - **/ constructor(parentNode: Element); isOpen: boolean; - /** - * @returns {HTMLElement} - **/ getElement(): HTMLElement; - /** - * @param {String} text - **/ setText(text: string): void; - /** - * @param {String} html - **/ setHtml(html: string): void; - /** - * @param {Number} x - * @param {Number} y - **/ setPosition(x: number, y: number): void; - /** - * @param {String} className - **/ setClassName(className: string): void; - /** - * @param {import("ace-code").Ace.Theme} theme - */ setTheme(theme: import("ace-code").Ace.Theme): void; - /** - * @param {String} [text] - * @param {Number} [x] - * @param {Number} [y] - **/ show(text?: string, x?: number, y?: number): void; hide(e: any): void; - /** - * @returns {Number} - **/ getHeight(): number; - /** - * @returns {Number} - **/ getWidth(): number; destroy(): void; } import Range_4 = require("ace-code/src/range"); import Range = Range_4.Range; class PopupManager { - /**@type{Tooltip[]} */ popups: Tooltip[]; - /** - * @param {Tooltip} popup - */ addPopup(popup: Tooltip): void; - /** - * @param {Tooltip} popup - */ removePopup(popup: Tooltip): void; updatePopups(): void; - /** - * @param {Tooltip} popupA - * @param {Tooltip} popupB - * @return {boolean} - */ doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; } export interface HoverTooltip { @@ -2228,10 +1667,6 @@ declare module "ace-code/src/tooltip" { } } declare module "ace-code/src/mouse/default_gutter_handler" { - /** - * @param {MouseHandler} mouseHandler - * @this {MouseHandler} - */ export function GutterHandler(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, mouseHandler: MouseHandler): void; export interface GutterHandler { } @@ -2273,45 +1708,14 @@ declare module "ace-code/src/mouse/default_gutter_handler" { } declare module "ace-code/src/mouse/dragdrop_handler" { export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - /** - * @param {MouseHandler} mouseHandler - */ export function DragdropHandler(mouseHandler: MouseHandler): void; export class DragdropHandler { - /** - * @param {MouseHandler} mouseHandler - */ constructor(mouseHandler: MouseHandler); - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ onDragStart: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ onDragEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ onDragEnter: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ onDragOver: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; onDragLeave: (e: any) => void; - /** - * @param e - * @this {MouseHandler} - * @return {*} - */ onDrop: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; } } @@ -2320,18 +1724,11 @@ declare module "ace-code/src/mouse/touch_handler" { } declare module "ace-code/src/mouse/mouse_handler" { export class MouseHandler { - /** - * @param {Editor} editor - */ constructor(editor: Editor); - /** @type {MouseEvent} */ mouseEvent: MouseEvent; + mouseEvent: MouseEvent; editor: import("ace-code/src/editor").Editor; onMouseEvent(name: any, e: any): void; onMouseMove(name: any, e: any): void; - /** - * @param {any} name - * @param {{ wheelX: number; wheelY: number; }} e - */ onMouseWheel(name: any, e: { wheelX: number; wheelY: number; @@ -2376,37 +1773,17 @@ declare module "ace-code/src/keyboard/keybinding" { export type Editor = import("ace-code/src/editor").Editor; export type KeyboardHandler = import("ace-code").Ace.KeyboardHandler; export class KeyBinding { - /** - * @param {Editor} editor - */ constructor(editor: Editor); - /** - * @param {KeyboardHandler} kb - */ setDefaultHandler(kb: KeyboardHandler): void; - /** - * @param {KeyboardHandler} kb - */ setKeyboardHandler(kb: KeyboardHandler): void; - /** - * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} [kb] - * @param {number} [pos] - */ addKeyboardHandler(kb?: KeyboardHandler & { attach?: (editor: any) => void; detach?: (editor: any) => void; }, pos?: number): void; - /** - * @param {KeyboardHandler & {attach?: (editor: any) => void, detach?: (editor: any) => void;}} kb - * @returns {boolean} - */ removeKeyboardHandler(kb: KeyboardHandler & { attach?: (editor: any) => void; detach?: (editor: any) => void; }): boolean; - /** - * @return {KeyboardHandler} - */ getKeyboardHandler(): KeyboardHandler; getStatusText(): string; } @@ -2421,13 +1798,11 @@ declare module "ace-code/src/search" { /** * Sets the search options via the `options` parameter. * @param {Partial} options An object containing all the new search properties - * @returns {Search} * @chainable **/ set(options: Partial): Search; /** * [Returns an object containing all the search options.]{: #Search.getOptions} - * @returns {Partial} **/ getOptions(): Partial; /** @@ -2439,13 +1814,11 @@ declare module "ace-code/src/search" { /** * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with - * @returns {Range|false} **/ find(session: EditSession): Range | false; /** * Searches for all occurrances `options.needle`. If found, this method returns an array of [[Range `Range`s]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. * @param {EditSession} session The session to search with - * @returns {Range[]} **/ findAll(session: EditSession): Range[]; /** @@ -2456,7 +1829,6 @@ declare module "ace-code/src/search" { * If `options.needle` was not found, this function returns `null`. * * - * @returns {String} **/ replace(input: string, replacement: any): string; } @@ -2472,77 +1844,32 @@ declare module "ace-code/src/keyboard/hash_handler" { function call(thisArg: any, config: any, platform: any): void; } export class MultiHashHandler { - /** - * @param {Record | Command[]} [config] - * @param {string} [platform] - */ constructor(config?: Record | Command[], platform?: string); platform: string; - /**@type {Record}*/ commands: Record; commandKeyBinding: {}; - /** - * @param {Command} command - */ addCommand(command: Command): void; - /** - * @param {Command | string} command - * @param {boolean} [keepCommand] - */ removeCommand(command: Command | string, keepCommand?: boolean): void; - /** - * @param {string | { win?: string; mac?: string; position?:number}} key - * @param {CommandLike | string} command - * @param {number} [position] - */ bindKey(key: string | { win?: string; mac?: string; position?: number; }, command: CommandLike | string, position?: number): void; - /** - * @param {Record | Command[]} [commands] - */ addCommands(commands?: Record | Command[]): void; - /** - * @param {Record} commands - */ removeCommands(commands: Record): void; - /** - * @param {Record} keyList - */ bindKeys(keyList: Record): void; /** * Accepts keys in the form ctrl+Enter or ctrl-Enter * keys without modifiers or shift only - * @param {string} keys - * @returns {{key: string, hashId: number} | false} */ parseKeys(keys: string): { key: string; hashId: number; } | false; - /** - * @param {number} hashId - * @param {string} keyString - * @returns {Command} - */ findKeyCommand(hashId: number, keyString: string): Command; - /** - * @param {any} data - * @param {number} hashId - * @param {string} keyString - * @param {number} keyCode - * @returns {{command: string} | void} - */ handleKeyboard(data: any, hashId: number, keyString: string, keyCode: number): { command: string; } | void; - /** - * @param {any} [editor] - * @param {any} [data] - * @returns {string} - */ getStatusText(editor?: any, data?: any): string; } export namespace MultiHashHandler { @@ -2559,32 +1886,12 @@ declare module "ace-code/src/commands/command_manager" { **/ constructor(platform: string, commands: any[]); byName: Record; - /** - * - * @param {string | string[] | import("ace-code").Ace.Command} command - * @param {Editor} editor - * @param {any} args - * @returns {boolean} - */ exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; - /** - * - * @param {string | import("ace-code").Ace.Command} command - * @param {Editor} editor - * @returns {boolean} - */ canExecute(command: string | import("ace-code").Ace.Command, editor: Editor): boolean; - /** - * @param {Editor} editor - * @returns {boolean} - */ toggleRecording(editor: Editor): boolean; macro: any; recording: boolean; oldMacro: any; - /** - * @param {Editor} editor - */ replay(editor: Editor): boolean; trimMacro(m: any): any; } @@ -2616,40 +1923,33 @@ declare module "ace-code/src/token_iterator" { constructor(session: EditSession, initialRow: number, initialColumn: number); /** * Moves iterator position to the start of previous token. - * @returns {import("ace-code").Ace.Token|null} **/ stepBackward(): import("ace-code").Ace.Token | null; /** * Moves iterator position to the start of next token. - * @returns {import("ace-code").Ace.Token|null} **/ stepForward(): import("ace-code").Ace.Token | null; /** * * Returns current token. - * @returns {import("ace-code").Ace.Token} **/ getCurrentToken(): import("ace-code").Ace.Token; /** * * Returns the current row. - * @returns {Number} **/ getCurrentTokenRow(): number; /** * * Returns the current column. - * @returns {Number} **/ getCurrentTokenColumn(): number; /** * Return the current token position. - * @returns {import("ace-code").Ace.Point} */ getCurrentTokenPosition(): import("ace-code").Ace.Point; /** * Return the current token range. - * @returns {Range} */ getCurrentTokenRange(): Range; } @@ -2719,19 +2019,15 @@ declare module "ace-code/src/editor" { * @param {Partial} [options] The default options **/ constructor(renderer: VirtualRenderer, session?: EditSession, options?: Partial); - /**@type{EditSession}*/ session: EditSession; - /**@type {HTMLElement & {env?:any, value?:any}}*/ + session: EditSession; container: HTMLElement & { env?: any; value?: any; }; - /**@type {VirtualRenderer}*/ renderer: VirtualRenderer; - /**@type {string}*/ id: string; commands: CommandManager; textInput: any; - /**@type {KeyBinding}*/ keyBinding: KeyBinding; startOperation(commandEvent: any): void; /** @@ -2751,12 +2047,10 @@ declare module "ace-code/src/editor" { /** * Sets a new key handler, such as "vim" or "windows". * @param {String | import("ace-code").Ace.KeyboardHandler | null} keyboardHandler The new key handler - * @param {() => void} [cb] **/ setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; /** * Returns the keyboard handler, such as "vim" or "windows". - * @returns {Object} **/ getKeyboardHandler(): any; /** @@ -2767,7 +2061,6 @@ declare module "ace-code/src/editor" { selection: import("ace-code/src/selection").Selection; /** * Returns the current session being used. - * @returns {EditSession} **/ getSession(): EditSession; /** @@ -2782,7 +2075,6 @@ declare module "ace-code/src/editor" { /** * Returns the current session's content. * - * @returns {String} * @related EditSession.getValue **/ getValue(): string; @@ -2820,12 +2112,10 @@ declare module "ace-code/src/editor" { /** * {:VirtualRenderer.unsetStyle} * @related VirtualRenderer.unsetStyle - * @param {string} style */ unsetStyle(style: string): void; /** * Gets the current font size of the editor text. - * @return {string | number} */ getFontSize(): string | number; /** @@ -2840,7 +2130,6 @@ declare module "ace-code/src/editor" { focus(): void; /** * Returns `true` if the current `textInput` is in focus. - * @return {Boolean} **/ isFocused(): boolean; /** @@ -2850,27 +2139,15 @@ declare module "ace-code/src/editor" { blur(): void; /** * Returns the string of text currently highlighted. - * @returns {String} **/ getCopyText(): string; - /** - * - * @param {string | string[]} command - * @param [args] - * @return {boolean} - */ execCommand(command: string | string[], args?: any): boolean; /** * Inserts `text` into wherever the cursor is pointing. * @param {String} text The new text to add - * @param {boolean} [pasted] **/ insert(text: string, pasted?: boolean): void; autoIndent(): void; - /** - * @param {string} [text] - * @param {any} [composition] - */ applyComposition(text?: string, composition?: any): void; /** * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event. @@ -2880,7 +2157,6 @@ declare module "ace-code/src/editor" { setOverwrite(overwrite: boolean): void; /** * Returns `true` if overwrites are enabled; `false` otherwise. - * @returns {Boolean} * @related EditSession.getOverwrite **/ getOverwrite(): boolean; @@ -2896,7 +2172,6 @@ declare module "ace-code/src/editor" { setScrollSpeed(speed: number): void; /** * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). - * @returns {Number} **/ getScrollSpeed(): number; /** @@ -2906,7 +2181,6 @@ declare module "ace-code/src/editor" { setDragDelay(dragDelay: number): void; /** * Returns the current mouse drag delay. - * @returns {Number} **/ getDragDelay(): number; /** @@ -2916,7 +2190,6 @@ declare module "ace-code/src/editor" { setSelectionStyle(val: "fullLine" | "screenLine" | "text" | "line"): void; /** * Returns the current selection style. - * @returns {import("ace-code").Ace.EditorOptions["selectionStyle"]} **/ getSelectionStyle(): import("ace-code").Ace.EditorOptions["selectionStyle"]; /** @@ -2926,16 +2199,9 @@ declare module "ace-code/src/editor" { setHighlightActiveLine(shouldHighlight: boolean): void; /** * Returns `true` if current lines are always highlighted. - * @return {Boolean} **/ getHighlightActiveLine(): boolean; - /** - * @param {boolean} shouldHighlight - */ setHighlightGutterLine(shouldHighlight: boolean): void; - /** - * @returns {Boolean} - */ getHighlightGutterLine(): boolean; /** * Determines if the currently selected word should be highlighted. @@ -2944,16 +2210,9 @@ declare module "ace-code/src/editor" { setHighlightSelectedWord(shouldHighlight: boolean): void; /** * Returns `true` if currently highlighted words are to be highlighted. - * @returns {Boolean} **/ getHighlightSelectedWord(): boolean; - /** - * @param {boolean} shouldAnimate - */ setAnimatedScroll(shouldAnimate: boolean): void; - /** - * @return {boolean} - */ getAnimatedScroll(): boolean; /** * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. @@ -2962,24 +2221,11 @@ declare module "ace-code/src/editor" { setShowInvisibles(showInvisibles: boolean): void; /** * Returns `true` if invisible characters are being shown. - * @returns {Boolean} **/ getShowInvisibles(): boolean; - /** - * @param {boolean} display - */ setDisplayIndentGuides(display: boolean): void; - /** - * @return {boolean} - */ getDisplayIndentGuides(): boolean; - /** - * @param {boolean} highlight - */ setHighlightIndentGuides(highlight: boolean): void; - /** - * @return {boolean} - */ getHighlightIndentGuides(): boolean; /** * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. @@ -2989,7 +2235,6 @@ declare module "ace-code/src/editor" { setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns `true` if the print margin is being shown. - * @returns {Boolean} **/ getShowPrintMargin(): boolean; /** @@ -3000,7 +2245,6 @@ declare module "ace-code/src/editor" { setPrintMarginColumn(showPrintMargin: number): void; /** * Returns the column number of where the print margin is. - * @returns {Number} **/ getPrintMarginColumn(): number; /** @@ -3010,7 +2254,6 @@ declare module "ace-code/src/editor" { setReadOnly(readOnly: boolean): void; /** * Returns `true` if the editor is set to read-only mode. - * @returns {Boolean} **/ getReadOnly(): boolean; /** @@ -3020,7 +2263,6 @@ declare module "ace-code/src/editor" { setBehavioursEnabled(enabled: boolean): void; /** * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} - * @returns {Boolean} **/ getBehavioursEnabled(): boolean; /** @@ -3031,7 +2273,6 @@ declare module "ace-code/src/editor" { setWrapBehavioursEnabled(enabled: boolean): void; /** * Returns `true` if the wrapping behaviors are currently enabled. - * @returns {boolean} **/ getWrapBehavioursEnabled(): boolean; /** @@ -3041,16 +2282,9 @@ declare module "ace-code/src/editor" { setShowFoldWidgets(show: boolean): void; /** * Returns `true` if the fold widgets are shown. - * @return {Boolean} **/ getShowFoldWidgets(): boolean; - /** - * @param {boolean} fade - */ setFadeFoldWidgets(fade: boolean): void; - /** - * @returns {boolean} - */ getFadeFoldWidgets(): boolean; /** * Removes the current selection or one character. @@ -3126,7 +2360,6 @@ declare module "ace-code/src/editor" { toggleBlockComment(): void; /** * Works like [[EditSession.getTokenAt]], except it returns a number. - * @returns {any} **/ getNumberAt(row: any, column: any): any; /** @@ -3134,17 +2367,13 @@ declare module "ace-code/src/editor" { * @param {Number} amount The value to change the numeral by (can be negative to decrease value) **/ modifyNumber(amount: number): void; - /** - */ toggleWord(): void; /** * Finds link at defined {row} and {column} - * @returns {String} **/ findLinkAt(row: any, column: any): string; /** * Open valid url under cursor in another tab - * @returns {Boolean} **/ openLink(): boolean; /** @@ -3171,7 +2400,6 @@ declare module "ace-code/src/editor" { * ``` * @param {Range} range The range of text you want moved within the document * @param {Point} toPosition The location (row and column) where you want to move the text to - * @param {boolean} [copy] * * @returns {Range} The new range where the text was moved to. * @related EditSession.moveText @@ -3192,14 +2420,12 @@ declare module "ace-code/src/editor" { /** * {:VirtualRenderer.getFirstVisibleRow} * - * @returns {Number} * @related VirtualRenderer.getFirstVisibleRow **/ getFirstVisibleRow(): number; /** * {:VirtualRenderer.getLastVisibleRow} * - * @returns {Number} * @related VirtualRenderer.getLastVisibleRow **/ getLastVisibleRow(): number; @@ -3207,7 +2433,6 @@ declare module "ace-code/src/editor" { * Indicates if the row is currently visible on the screen. * @param {Number} row The row to check * - * @returns {Boolean} **/ isRowVisible(row: number): boolean; /** @@ -3215,7 +2440,6 @@ declare module "ace-code/src/editor" { * @param {Number} row The row to check * * - * @returns {Boolean} **/ isRowFullyVisible(row: number): boolean; /** @@ -3245,7 +2469,6 @@ declare module "ace-code/src/editor" { /** * Moves the editor to the specified row. * @related VirtualRenderer.scrollToRow - * @param {number} row */ scrollToRow(row: number): void; /** @@ -3275,13 +2498,11 @@ declare module "ace-code/src/editor" { getCursorPosition(): Point; /** * Returns the screen position of the cursor. - * @returns {Point} * @related EditSession.documentToScreenPosition **/ getCursorPositionScreen(): Point; /** * {:Selection.getRange} - * @returns {Range} * @related Selection.getRange **/ getSelectionRange(): Range; @@ -3310,8 +2531,6 @@ declare module "ace-code/src/editor" { moveCursorToPosition(pos: Point): void; /** * Moves the cursor's row and column to the next matching bracket or HTML tag. - * @param {boolean} [select] - * @param {boolean} [expand] */ jumpToMatching(select?: boolean, expand?: boolean): void; /** @@ -3387,20 +2606,17 @@ declare module "ace-code/src/editor" { * Replaces the first occurrence of `options.needle` with the value in `replacement`. * @param {String} [replacement] The text to replace with * @param {Partial} [options] The [[Search `Search`]] options to use - * @return {number} **/ replace(replacement?: string, options?: Partial): number; /** * Replaces all occurrences of `options.needle` with the value in `replacement`. * @param {String} [replacement] The text to replace with * @param {Partial} [options] The [[Search `Search`]] options to use - * @return {number} **/ replaceAll(replacement?: string, options?: Partial): number; /** * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. * @related Search.getOptions - * @returns {Partial} **/ getLastSearchOptions(): Partial; /** @@ -3427,11 +2643,6 @@ declare module "ace-code/src/editor" { * @related Editor.find **/ findPrevious(options?: Partial, animate?: boolean): void; - /** - * - * @param {Range} range - * @param {boolean} [animate] - */ revealRange(range: Range, animate?: boolean): void; /** * {:UndoManager.undo} @@ -3519,20 +2730,10 @@ declare module "ace-code/src/undomanager" { export type Delta = import("ace-code").Ace.Delta; export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code").Ace.Delta} Delta - * @typedef {import("ace-code").Ace.Point} Point - * @typedef {import("ace-code").Ace.IRange} IRange - */ /** * This object maintains the undo stack for an [[EditSession `EditSession`]]. **/ - export class UndoManager { - /** - * - * @param {EditSession} session - */ + export class UndoManager { addSession(session: EditSession): void; /** * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: @@ -3540,68 +2741,26 @@ declare module "ace-code/src/undomanager" { * - `args[0]` is an array of deltas * - `args[1]` is the document to associate with * - * @param {import("ace-code").Ace.Delta} delta - * @param {boolean} allowMerge - * @param {EditSession} [session] **/ add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; lastDeltas: any[]; - /** - * - * @param {any} selection - * @param {number} [rev] - */ addSelection(selection: any, rev?: number): void; startNewGroup(): any; - /** - * - * @param {number} from - * @param {number} [to] - */ markIgnored(from: number, to?: number): void; - /** - * - * @param {number} rev - * @param {boolean} [after] - * @return {{ value: string, rev: number }} - */ getSelection(rev: number, after?: boolean): { value: string; rev: number; }; - /** - * @return {number} - */ getRevision(): number; - /** - * - * @param {number} from - * @param {number} [to] - * @return {import("ace-code").Ace.Delta[]} - */ getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; - /** - * - * @param {number} from - * @param {number} [to] - */ getChangedRanges(from: number, to?: number): void; - /** - * - * @param {number} from - * @param {number} [to] - */ getChangedLines(from: number, to?: number): void; /** * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} - * @param {EditSession} session - * @param {Boolean} [dontSelect] {:dontSelect} **/ undo(session: EditSession, dontSelect?: boolean): void; /** * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} - * @param {EditSession} session - * @param {Boolean} [dontSelect] {:dontSelect} * **/ redo(session: EditSession, dontSelect?: boolean): void; @@ -3613,34 +2772,28 @@ declare module "ace-code/src/undomanager" { selections: any[]; /** * Returns `true` if there are undo operations left to perform. - * @returns {Boolean} **/ canUndo(): boolean; /** * Returns `true` if there are redo operations left to perform. - * @returns {Boolean} **/ canRedo(): boolean; /** * Marks the current status clean - * @param {number} [rev] */ bookmark(rev?: number): void; /** * Returns if the current status is clean - * @returns {Boolean} **/ isAtBookmark(): boolean; /** * Returns an object which can be safely stringified into JSON - * @returns {object} */ toJSON(): object; /** * Takes in an object which was returned from the toJSON method above, * and resets the current undoManager instance to use the previously exported * instance state. - * @param {object} json */ fromJSON(json: object): void; hasUndo: () => boolean; @@ -3659,26 +2812,14 @@ declare module "ace-code/src/tokenizer" { * @param {Object} rules The highlighting rules **/ constructor(rules: any); - /**@type {RegExp}*/ splitRegex: RegExp; states: any; regExps: {}; matchMappings: {}; - /** - * @param {string} src - * @returns {string} - */ removeCapturingGroups(src: string): string; - /** - * @param {string} src - * @param {string} flag - */ createSplitterRegexp(src: string, flag: string): RegExp; /** * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @param {string} line - * @param {string | string[]} startState - * @returns {{tokens:import("ace-code").Ace.Token[], state: string|string[]}} */ getLineTokens(line: string, startState: string | string[]): { tokens: import("ace-code").Ace.Token[]; @@ -3694,7 +2835,6 @@ declare module "ace-code/src/autocomplete/popup" { export class AcePopup { /** * Creates and renders single line editor in popup window. If `parentNode` param is isset, then attaching it to this element. - * @param {Element} [parentNode] */ constructor(parentNode?: Element); setSelectOnHover: (val: boolean) => void; @@ -3719,11 +2859,6 @@ declare module "ace-code/src/autocomplete/popup" { isMouseOver?: boolean; selectedNode?: HTMLElement; } - /** - * - * @param {HTMLElement} [el] - * @return {Editor} - */ export function $singleLineEditor(el?: HTMLElement): Editor; export function getAriaId(index: any): string; import Editor_1 = require("ace-code/src/editor"); @@ -3763,48 +2898,16 @@ declare module "ace-code/src/range_list" { export type Point = import("ace-code").Ace.Point; export class RangeList { ranges: any[]; - /** - * @param {Point} pos - * @param {boolean} [excludeEdges] - * @param {number} [startIndex] - * @return {number} - */ pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; - /** - * @param {Range} range - */ add(range: Range): any[]; - /** - * @param {Range[]} list - */ addList(list: Range[]): any[]; - /** - * @param {Point} pos - */ substractPoint(pos: Point): any[]; merge(): any[]; - /** - * @param {number} row - * @param {number} column - */ contains(row: number, column: number): boolean; - /** - * @param {Point} pos - */ containsPoint(pos: Point): boolean; - /** - * @param {Point} pos - */ rangeAtPoint(pos: Point): any; - /** - * @param {number} startRow - * @param {number} endRow - */ clipRows(startRow: number, endRow: number): any[]; removeAll(): any[]; - /** - * @param {EditSession} session - */ attach(session: EditSession): void; session: import("ace-code/src/edit_session").EditSession; onChange: any; @@ -3867,9 +2970,6 @@ declare module "ace-code/src/snippets" { CURRENT_MINUTE: any; CURRENT_SECOND: any; }; - /** - * @return {Tokenizer} - */ getTokenizer(): Tokenizer; createTokenizer(): any; tokenizeTmSnippet(str: any, startState: any): (string | import("ace-code").Ace.Token)[]; @@ -3883,17 +2983,7 @@ declare module "ace-code/src/snippets" { getActiveScopes(editor: any): any[]; expandWithTab(editor: any, options: any): any; expandSnippetForSelection(editor: any, options: any): boolean; - /** - * @param {Snippet[]} snippetList - * @param {string} before - * @param {string} after - * @return {Snippet} - */ findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; - /** - * @param {any[]} snippets - * @param {string} scope - */ register(snippets: any[], scope: string): void; unregister(snippets: any, scope: any): void; parseSnippetFile(str: any): Snippet[]; @@ -3914,14 +3004,12 @@ declare module "ace-code/src/autocomplete/inline_screenreader" { export class AceInlineScreenReader { /** * Creates the off-screen div in which the ghost text content in redered and which the screen reader reads. - * @param {import("ace-code/src/editor").Editor} editor */ constructor(editor: import("ace-code/src/editor").Editor); editor: import("ace-code/src/editor").Editor; screenReaderDiv: HTMLDivElement; /** * Set the ghost text content to the screen reader div - * @param {string} content */ setScreenReaderContent(content: string): void; popup: import("ace-code/src/autocomplete/popup").AcePopup; @@ -3941,9 +3029,6 @@ declare module "ace-code/src/autocomplete/inline" { editor: any; /** * Renders the completion as ghost text to the current cursor position - * @param {Editor} editor - * @param {import("ace-code").Ace.Completion} completion - * @param {string} prefix * @returns {boolean} True if the completion could be rendered to the editor, false otherwise */ show(editor: Editor, completion: import("ace-code").Ace.Completion, prefix: string): boolean; @@ -3973,10 +3058,6 @@ declare module "ace-code/src/autocomplete" { caption: any; value: string; }[]; - /** - * @param {Editor} editor - * @return {Autocomplete} - */ static for(editor: Editor): Autocomplete; autoInsert: boolean; autoSelect: boolean; @@ -4035,21 +3116,12 @@ declare module "ace-code/src/autocomplete" { cancel(): void; isPending(): any; }; - /**@type {AcePopup}**/ popup: AcePopup; inlineRenderer: AceInline; - /** - * @return {AcePopup} - */ getPopup(): AcePopup; stickySelection: boolean; observeLayoutChanges(): void; unObserveLayoutChanges(): void; - /** - * @param {Editor} editor - * @param {string} prefix - * @param {boolean} [keepPopupPosition] - */ openPopup(editor: Editor, prefix: string, keepPopupPosition?: boolean): void; /** * Detaches all elements from the editor, and cleans up the data for the session @@ -4061,24 +3133,12 @@ declare module "ace-code/src/autocomplete" { base: import("ace-code/src/anchor").Anchor; mouseOutListener(e: any): void; goTo(where: any): void; - /** - * @param {Completion} data - * @param {undefined} [options] - * @return {boolean | void} - */ insertMatch(data: Completion, options?: undefined): boolean | void; /** * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions - * @param {Editor} editor - * @param {CompletionOptions} [options] */ showPopup(editor: Editor, options?: CompletionOptions): void; editor: import("ace-code/src/editor").Editor; - /** - * - * @param {{pos: Position, prefix: string}} [initialPosition] - * @return {CompletionProvider} - */ getCompletionProvider(initialPosition?: { pos: Position; prefix: string; @@ -4089,10 +3149,6 @@ declare module "ace-code/src/autocomplete" { * @deprecated */ gatherCompletions(editor: any, callback: any): boolean; - /** - * @param {boolean} keepPopupPosition - * @param {CompletionOptions} [options] - */ updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; cancelContextMenu(): void; updateDocTooltip(): void; @@ -4119,9 +3175,6 @@ declare module "ace-code/src/autocomplete" { * This class is responsible for providing completions and inserting them to the editor */ export class CompletionProvider { - /** - * @param {{pos: Position, prefix: string}} [initialPosition] - */ constructor(initialPosition?: { pos: Position; prefix: string; @@ -4131,32 +3184,13 @@ declare module "ace-code/src/autocomplete" { prefix: string; }; active: boolean; - /** - * @param {Editor} editor - * @param {number} index - * @param {CompletionProviderOptions} [options] - * @returns {boolean} - */ insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; - /** - * @param {Editor} editor - * @param {Completion} data - * @param {CompletionProviderOptions} [options] - * @returns {boolean} - */ insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; - /** - * @param {Editor} editor - * @param {import("ace-code").Ace.CompletionCallbackFunction} callback - */ gatherCompletions(editor: Editor, callback: import("ace-code").Ace.CompletionCallbackFunction): boolean; completers: import("ace-code").Ace.Completer[]; /** * This is the entry point to the class, it gathers, then provides the completions asynchronously via callback. * The callback function may be called multiple times, the last invokation is marked with a `finished` flag - * @param {Editor} editor - * @param {CompletionProviderOptions} options - * @param {(err: Error | undefined, completions: FilteredList | [], finished: boolean) => void} callback */ provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ ], finished: boolean) => void): void; @@ -4262,60 +3296,18 @@ declare module "ace-code/src/autocomplete/text_completer" { } declare module "ace-code/src/line_widgets" { export class LineWidgets { - /** - * @param {EditSession} session - */ constructor(session: EditSession); session: import("ace-code/src/edit_session").EditSession; - /** - * - * @param {import("ace-code").Ace.Delta} delta - */ updateOnChange(delta: import("ace-code").Ace.Delta): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ renderWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {any} e - * @param {VirtualRenderer} renderer - */ measureWidgets(e: any, renderer: VirtualRenderer): void; - /** - * @param {number} row - * @return {number} - */ getRowLength(row: number): number; - /** - * - * @param {Editor} editor - */ attach(editor: Editor): void; - /**@type {Editor} */ editor: Editor; detach(e: any): void; - /** - * - * @param e - * @param {EditSession} session - */ updateOnFold(e: any, session: EditSession): void; - /** - * - * @param {LineWidget} w - * @return {LineWidget} - */ addLineWidget(w: LineWidget): LineWidget; - /** - * @param {LineWidget} w - */ removeLineWidget(w: LineWidget): void; - /** - * - * @param {number} row - * @return {LineWidget[]} - */ getWidgetsAtRow(row: number): LineWidget[]; firstRow: number; lastRow: number; @@ -4338,22 +3330,12 @@ declare module "ace-code/src/search_highlight" { export type Marker = import("ace-code/src/layer/marker").Marker; export type EditSession = import("ace-code/src/edit_session").EditSession; export class SearchHighlight { - /** - * @param {any} regExp - * @param {string} clazz - */ constructor(regExp: any, clazz: string, type?: string); clazz: string; type: string; setRegexp(regExp: any): void; regExp: any; cache: any[]; - /** - * @param {any} html - * @param {Marker} markerLayer - * @param {EditSession} session - * @param {Partial} config - */ update(html: any, markerLayer: Marker, session: EditSession, config: Partial): void; MAX_RANGES: number; } @@ -4374,7 +3356,6 @@ declare module "ace-code/src/occur" { * and these are then used as the content of a new [[Document * `Document`]]. The current cursor position of editor will be translated * so that the cursor is on the matching row/column as it was before. - * @param {Editor} editor * @param {Object} options options.needle should be a String * @return {Boolean} Whether occur activation was successful * @@ -4384,25 +3365,13 @@ declare module "ace-code/src/occur" { * Disables occur mode. Resets the [[Sessions `EditSession`]] [[Document * `Document`]] back to the original doc. If options.translatePosition is * truthy also maps the [[Editors `Editor`]] cursor position accordingly. - * @param {Editor} editor * @param {Object} options options.translatePosition * @return {Boolean} Whether occur deactivation was successful * **/ exit(editor: Editor, options: any): boolean; - /** - * @param {EditSession} sess - * @param {RegExp} regexp - */ highlight(sess: EditSession, regexp: RegExp): void; - /** - * @param {Editor} editor - * @param {Partial} options - */ displayOccurContent(editor: Editor, options: Partial): void; - /** - * @param {Editor} editor - */ displayOriginalContent(editor: Editor): void; /** * Translates the position from the original document to the occur lines in @@ -4418,13 +3387,8 @@ declare module "ace-code/src/occur" { * or `pos` if not found. * @param {EditSession} session The occur session * @param {Point} pos The position in the occur session document - * @return {Point} position **/ occurToOriginalPosition(session: EditSession, pos: Point): Point; - /** - * @param {EditSession} session - * @param {Partial} options - */ matchingLines(session: EditSession, options: Partial): any[]; } import Search_2 = require("ace-code/src/search"); @@ -4440,17 +3404,8 @@ declare module "ace-code/src/marker_group" { }; export type LayerConfig = import("ace-code").Ace.LayerConfig; export type Marker = import("ace-code/src/layer/marker").Marker; - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {{range: import("ace-code/src/range").Range, className: string}} MarkerGroupItem - * @typedef {import("ace-code").Ace.LayerConfig} LayerConfig - */ - /** - * @typedef {import("ace-code/src/layer/marker").Marker} Marker - */ export class MarkerGroup { /** - * @param {EditSession} session * @param {{markerType: "fullLine" | "line" | undefined}} [options] Options controlling the behvaiour of the marker. * User `markerType` to control how the markers which are part of this group will be rendered: * - `undefined`: uses `text` type markers where only text characters within the range will be highlighted. @@ -4461,14 +3416,10 @@ declare module "ace-code/src/marker_group" { markerType: "fullLine" | "line" | undefined; }); markerType: "line" | "fullLine"; - /**@type {import("ace-code").Ace.MarkerGroupItem[]}*/ markers: import("ace-code").Ace.MarkerGroupItem[]; - /**@type {EditSession}*/ session: EditSession; /** * Finds the first marker containing pos - * @param {import("ace-code").Ace.Point} pos - * @returns {import("ace-code").Ace.MarkerGroupItem | undefined} */ getMarkerAtPosition(pos: import("ace-code").Ace.Point): import("ace-code").Ace.MarkerGroupItem | undefined; /** @@ -4484,22 +3435,12 @@ declare module "ace-code/src/marker_group" { * @param {MarkerGroupItem[]} markers an array of marker definitions. */ setMarkers(markers: MarkerGroupItem[]): void; - /** - * @param {any} html - * @param {Marker} markerLayer - * @param {EditSession} session - * @param {LayerConfig} config - */ update(html: any, markerLayer: Marker, session: EditSession, config: LayerConfig): void; MAX_MARKERS: number; } } declare module "ace-code/src/edit_session/fold" { export class Fold extends RangeList { - /** - * @param {Range} range - * @param {any} placeholder - */ constructor(range: Range, placeholder: any); foldLine: import("ace-code/src/edit_session/fold_line").FoldLine; placeholder: any; @@ -4507,20 +3448,10 @@ declare module "ace-code/src/edit_session/fold" { start: import("ace-code").Ace.Point; end: import("ace-code").Ace.Point; sameRow: boolean; - /**@type {Fold[]}*/ subFolds: Fold[]; - /** - * @param {FoldLine} foldLine - */ setFoldLine(foldLine: FoldLine): void; clone(): Fold; - /** - * @param {Fold} fold - */ addSubFold(fold: Fold): any; - /** - * @param {IRange} range - */ restoreRange(range: IRange): void; collapseChildren?: number; } @@ -4539,65 +3470,28 @@ declare module "ace-code/src/edit_session/fold_line" { export class FoldLine { /** * If an array is passed in, the folds are expected to be sorted already. - * @param {FoldLine[]} foldData - * @param {Fold[]|Fold} folds */ constructor(foldData: FoldLine[], folds: Fold[] | Fold); foldData: FoldLine[]; - /**@type {Fold[]} */ folds: Fold[]; range: Range; start: import("ace-code").Ace.Point; end: import("ace-code").Ace.Point; /** * Note: This doesn't update wrapData! - * @param {number} shift */ shiftRow(shift: number): void; - /** - * @param {Fold} fold - */ addFold(fold: Fold): void; - /** - * @param {number} row - */ containsRow(row: number): boolean; - /** - * @param {Function} callback - * @param {number} endRow - * @param {number} endColumn - */ walk(callback: Function, endRow: number, endColumn: number): void; - /** - * @param {number} row - * @param {number} column - * @return {{ fold: Fold, kind: string } | null} - */ getNextFoldTo(row: number, column: number): { fold: Fold; kind: string; } | null; - /** - * @param {number} row - * @param {number} column - * @param {number} len - */ addRemoveChars(row: number, column: number, len: number): void; - /** - * @param {number} row - * @param {number} column - * @return {FoldLine | null} - */ split(row: number, column: number): FoldLine | null; - /** - * @param {FoldLine} foldLineNext - */ merge(foldLineNext: FoldLine): void; toString(): string; - /** - * @param {number} idx - * @return {import("ace-code").Ace.Point} - */ idxToPosition(idx: number): import("ace-code").Ace.Point; } import Range_9 = require("ace-code/src/range"); @@ -4700,10 +3594,8 @@ declare module "ace-code/src/background_tokenizer" { * @param {EditSession} [session] The editor session to associate with **/ constructor(tokenizer: Tokenizer, session?: EditSession); - /**@type {false|number}*/ running: false | number; lines: any[]; - /**@type {string[]|string[][]}*/ states: string[] | string[][]; currentLine: number; tokenizer: import("ace-code/src/tokenizer").Tokenizer; @@ -4740,13 +3632,11 @@ declare module "ace-code/src/background_tokenizer" { /** * Gives list of [[Token]]'s of the row. (tokens are cached) * @param {Number} row The row to get tokens at - * @returns {import("ace-code").Ace.Token[]} **/ getTokens(row: number): import("ace-code").Ace.Token[]; /** * Returns the state of tokenization at the end of a row. * @param {Number} row The row to get state at - * @returns {string | string[]} **/ getState(row: number): string | string[]; cleanup(): void; @@ -4764,41 +3654,21 @@ declare module "ace-code/src/background_tokenizer" { declare module "ace-code/src/edit_session/folding" { export type IFolding = import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding; export type Delta = import("ace-code").Ace.Delta; - /** - * @typedef {import("ace-code/src/edit_session").EditSession & import("ace-code").Ace.Folding} IFolding - * @typedef {import("ace-code").Ace.Delta } Delta - */ - /** - * @this {IFolding} - * @type {IFolding} - */ export function Folding(this: IFolding): void; export class Folding { /** * Looks up a fold at a given row/column. Possible values for side: * -1: ignore a fold if fold.start = row/column * +1: ignore a fold if fold.end = row/column - * @param {number} row - * @param {number} column - * @param {number} [side] - * @return {Fold} **/ getFoldAt: (row: number, column: number, side?: number) => import("ace-code").Ace.Fold; /** * Returns all folds in the given range. Note, that this will return folds - * @param {Range| Delta} range - * @returns {Fold[]} **/ getFoldsInRange: (range: import("ace-code").Ace.Range | import("ace-code").Ace.Delta) => import("ace-code").Ace.Fold[]; - /** - * - * @param {Range[]|Range}ranges - * @returns {Fold[]} - */ getFoldsInRangeList: (ranges: import("ace-code").Ace.Range[] | import("ace-code").Ace.Range) => import("ace-code").Ace.Fold[]; /** * Returns all folds in the document - * @returns {Fold[]} */ getAllFolds: () => import("ace-code").Ace.Fold[]; /** @@ -4817,175 +3687,49 @@ declare module "ace-code/src/edit_session/folding" { * foob|arwolrd -trim=-1> "b" * foobarwol|rd -trim=+1> "rld" * fo|obarwolrd -trim=00> "foo" - * @param {number} row - * @param {number} column - * @param {number} [trim] - * @param {FoldLine} [foldLine] - * @returns {string | null} */ getFoldStringAt: (row: number, column: number, trim?: number, foldLine?: import("ace-code").Ace.FoldLine) => string | null; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldLine] - * @returns {null|FoldLine} - */ getFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; /** * Returns the fold which starts after or contains docRow - * @param {number} docRow - * @param {FoldLine} [startFoldLine] - * @returns {null|FoldLine} */ getNextFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; - /** - * - * @param {number} first - * @param {number} last - * @return {number} - */ getFoldedRowCount: (first: number, last: number) => number; /** * Adds a new fold. * - * @param {Fold|string} placeholder - * @param {Range} [range] - * @returns {Fold} * The new created Fold object or an existing fold object in case the * passed in range fits an existing fold exactly. - * @this {IFolding} */ addFold: (placeholder: import("ace-code").Ace.Fold | string, range?: import("ace-code").Ace.Range) => import("ace-code").Ace.Fold; - /** - * @param {Fold[]} folds - */ addFolds: (folds: import("ace-code").Ace.Fold[]) => void; - /** - * - * @param {Fold} fold - */ removeFold: (fold: import("ace-code").Ace.Fold) => void; - /** - * - * @param {Fold[]} folds - */ removeFolds: (folds: import("ace-code").Ace.Fold[]) => void; - /** - * @param {Fold} fold - */ expandFold: (fold: import("ace-code").Ace.Fold) => void; - /** - * @param {Fold[]}folds - */ expandFolds: (folds: import("ace-code").Ace.Fold[]) => void; - /** - * - * @param {number|null|import("ace-code").Ace.Point|Range|Range[]} [location] - * @param {boolean} [expandInner] - * @return {Fold[]| undefined} - */ unfold: (location?: number | null | import("ace-code").Ace.Point | import("ace-code").Ace.Range | import("ace-code").Ace.Range[], expandInner?: boolean) => import("ace-code").Ace.Fold[] | undefined; /** * Checks if a given documentRow is folded. This is true if there are some * folded parts such that some parts of the line is still visible. - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @returns {boolean} **/ isRowFolded: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => boolean; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @return {number} - */ getRowFoldEnd: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; - /** - * - * @param {number} docRow - * @param {FoldLine} [startFoldRow] - * @returns {number} - */ getRowFoldStart: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; - /** - * - * @param {FoldLine} foldLine - * @param {number | null} [endRow] - * @param {number | null} [endColumn] - * @param {number | null} [startRow] - * @param {number | null} [startColumn] - * @return {string} - */ getFoldDisplayLine: (foldLine: import("ace-code").Ace.FoldLine, endRow?: number | null, endColumn?: number | null, startRow?: number | null, startColumn?: number | null) => string; - /** - * - * @param {number} row - * @param {number | null} endColumn - * @param {number | null} startRow - * @param {number | null} startColumn - * @return {string} - */ getDisplayLine: (row: number, endColumn: number | null, startRow: number | null, startColumn: number | null) => string; - /** - * @param {boolean} [tryToUnfold] - */ toggleFold: (tryToUnfold?: boolean) => void; - /** - * - * @param {number} row - * @param {number} column - * @param {number} [dir] - * @return {Range | undefined} - */ getCommentFoldRange: (row: number, column: number, dir?: number) => import("ace-code").Ace.Range | undefined; - /** - * - * @param {number | null} [startRow] - * @param {number | null} [endRow] - * @param {number | null} [depth] - * @param {Function} [test] - */ foldAll: (startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function) => void; - /** - * - * @param {number} level - */ foldToLevel: (level: number) => void; - /** - * - */ foldAllComments: () => void; - /** - * @param {string} style - */ setFoldStyle: (style: string) => void; - /** - * @param {number} row - * @param {boolean} [ignoreCurrent] - * @return {{range?: Range, firstRange?: Range}} - */ getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { range?: import("ace-code").Ace.Range; firstRange?: import("ace-code").Ace.Range; }; - /** - * - * @param {number} row - * @param {any} e - */ onFoldWidgetClick: (row: number, e: any) => void; - /** - * - * @param {boolean} [toggleParent] - */ toggleFoldWidget: (toggleParent?: boolean) => void; - /** - * @param {Delta} delta - */ updateFoldWidgets: (delta: import("ace-code").Ace.Delta) => void; - /** - * @param e - */ tokenizerUpdateFoldWidgets: (e: any) => void; } } @@ -4994,18 +3738,7 @@ declare module "ace-code/src/edit_session/bracket_match" { export type Point = import("ace-code/src/edit_session").Point; export function BracketMatch(): void; export class BracketMatch { - /** - * - * @param {Point} position - * @param {string} [chr] - * @this {EditSession} - */ findMatchingBracket: (this: import("ace-code/src/edit_session").EditSession, position: Point, chr?: string) => import("ace-code").Ace.Point; - /** - * @param {Point} pos - * @return {null|Range} - * @this {EditSession} - */ getBracketRange: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => null | Range; /** * Returns: @@ -5013,17 +3746,10 @@ declare module "ace-code/src/edit_session/bracket_match" { * * two Ranges if there is opening and closing brackets; * * one Range if there is only one bracket * - * @param {Point} pos - * @param {boolean} [isBackwards] - * @returns {null|Range[]} - * @this {EditSession} */ getMatchingBracketRanges: (this: import("ace-code/src/edit_session").EditSession, pos: Point, isBackwards?: boolean) => null | Range[]; /** * Returns [[Range]]'s for matching tags and tag names, if there are any - * @param {Point} pos - * @returns {{closeTag: Range, closeTagName: Range, openTag: Range, openTagName: Range} | undefined} - * @this {EditSession} */ getMatchingTags: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => { closeTag: Range; @@ -5036,10 +3762,6 @@ declare module "ace-code/src/edit_session/bracket_match" { import Range = Range_10.Range; } declare module "ace-code/src/edit_session" { - /** - * @typedef TextMode - * @type {SyntaxMode} - */ /** * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. * @@ -5050,16 +3772,13 @@ declare module "ace-code/src/edit_session" { * Returns a new instance of EditSession with state from JSON. * @method fromJSON * @param {string|object} session The EditSession state. - * @returns {EditSession} */ static fromJSON(session: string | object): EditSession; /** * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. - * @param {Document | String} [text] [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} - * @param {SyntaxMode} [mode] [The initial language mode to use for the document]{: #modeParam} **/ constructor(text?: Document | string, mode?: SyntaxMode); - /**@type {Document}*/ doc: Document; + doc: Document; prevOp: {}; id: string; bgTokenizer: BackgroundTokenizer; @@ -5084,7 +3803,6 @@ declare module "ace-code/src/edit_session" { /** * End current Ace operation. * Emits "beforeEndOperation" event just before clearing everything, where the current operation can be accessed through `curOp` property. - * @param {any} e */ endOperation(e: any): void; /** @@ -5096,19 +3814,16 @@ declare module "ace-code/src/edit_session" { setDocument(doc: Document): void; /** * Returns the `Document` associated with this session. - * @return {Document} **/ getDocument(): Document; /** * Set "widgetManager" in EditSession * - * @returns void */ set widgetManager(value: LineWidgets); /** * Get "widgetManager" from EditSession * - * @returns {LineWidgets} object */ get widgetManager(): LineWidgets; resetCaches(): void; @@ -5122,32 +3837,27 @@ declare module "ace-code/src/edit_session" { /** * Returns the current edit session. * @method toJSON - * @returns {Object} */ toJSON(): any; /** * Returns selection object. - * @returns {Selection} **/ getSelection(): Selection; /** * {:BackgroundTokenizer.getState} * @param {Number} row The row to start at - * @returns {string | string[]} * @related BackgroundTokenizer.getState **/ 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 - * @returns {import("ace-code").Ace.Token[]} **/ getTokens(row: number): import("ace-code").Ace.Token[]; /** * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. * @param {Number} row The row number to retrieve from * @param {Number} column The column number to retrieve from - * @returns {import("ace-code").Ace.Token} * **/ getTokenAt(row: number, column: number): import("ace-code").Ace.Token; @@ -5162,12 +3872,10 @@ declare module "ace-code/src/edit_session" { markUndoGroup(): void; /** * Returns the current undo manager. - * @returns {UndoManager} **/ getUndoManager(): UndoManager; /** * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - * @returns {String} **/ getTabString(): string; /** @@ -5177,7 +3885,6 @@ declare module "ace-code/src/edit_session" { setUseSoftTabs(val: boolean): void; /** * Returns `true` if soft tabs are being used, `false` otherwise. - * @returns {Boolean} **/ getUseSoftTabs(): boolean; /** @@ -5187,7 +3894,6 @@ declare module "ace-code/src/edit_session" { setTabSize(tabSize: number): void; /** * Returns the current tab size. - * @return {number} **/ getTabSize(): number; /** @@ -5202,7 +3908,6 @@ declare module "ace-code/src/edit_session" { setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void; /** * Returns `true` if keyboard navigation moves the cursor within soft tabs, `false` if it moves the cursor over soft tabs. - * @returns {Boolean} **/ getNavigateWithinSoftTabs(): boolean; /** @@ -5236,7 +3941,6 @@ declare module "ace-code/src/edit_session" { removeGutterDecoration(row: number, className: string): void; /** * Returns an array of strings, indicating the breakpoint class (if any) applied to each row. - * @returns {String[]} **/ getBreakpoints(): string[]; /** @@ -5286,22 +3990,13 @@ declare module "ace-code/src/edit_session" { * Returns an object containing all of the markers, either front or back. * @param {Boolean} [inFront] If `true`, indicates you only want front markers; `false` indicates only back markers * - * @returns {{[id: number]: import("ace-code").Ace.MarkerLike}} **/ getMarkers(inFront?: boolean): { [id: number]: import("ace-code").Ace.MarkerLike; }; - /** - * @param {RegExp} re - */ highlight(re: RegExp): void; /** * experimental - * @param {number} startRow - * @param {number} endRow - * @param {string} clazz - * @param {boolean} [inFront] - * @return {Range} */ highlightLines(startRow: number, endRow: number, clazz: string, inFront?: boolean): Range; /** @@ -5311,7 +4006,6 @@ declare module "ace-code/src/edit_session" { setAnnotations(annotations: import("ace-code").Ace.Annotation[]): void; /** * Returns the annotations for the `EditSession`. - * @returns {import("ace-code").Ace.Annotation[]} **/ getAnnotations(): import("ace-code").Ace.Annotation[]; /** @@ -5323,7 +4017,6 @@ declare module "ace-code/src/edit_session" { * @param {Number} row The row to start at * @param {Number} column The column to start at * - * @returns {Range} **/ getWordRange(row: number, column: number): Range; /** @@ -5331,12 +4024,10 @@ declare module "ace-code/src/edit_session" { * @param {Number} row The row number to start from * @param {Number} column The column number to start from * - * @return {Range} **/ getAWordRange(row: number, column: number): Range; /** * {:Document.setNewLineMode.desc} - * @param {import("ace-code").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} * * * @related Document.setNewLineMode @@ -5345,7 +4036,6 @@ declare module "ace-code/src/edit_session" { /** * * Returns the current new line mode. - * @returns {import("ace-code").Ace.NewLineMode} * @related Document.getNewLineMode **/ getNewLineMode(): import("ace-code").Ace.NewLineMode; @@ -5364,9 +4054,7 @@ declare module "ace-code/src/edit_session" { * @param {() => void} [cb] optional callback **/ setMode(mode: SyntaxMode | string, cb?: () => void): void; - /**@type {RegExp}*/ tokenRe: RegExp; - /**@type {RegExp}*/ nonTokenRe: RegExp; /** * Returns the current text mode. @@ -5380,34 +4068,26 @@ declare module "ace-code/src/edit_session" { setScrollTop(scrollTop: number): void; /** * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - * @returns {Number} **/ getScrollTop(): number; /** * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - * @param {number} scrollLeft */ setScrollLeft(scrollLeft: number): void; /** * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - * @returns {Number} **/ getScrollLeft(): number; /** * Returns the width of the screen. - * @returns {Number} **/ getScreenWidth(): number; - /** - * @return {number} - */ getLineWidgetMaxWidth(): number; lineWidgetWidth: number; screenWidth: any; /** * Returns a verbatim copy of the given line as it is in the document * @param {Number} row The row to retrieve from - * @returns {String} **/ getLine(row: number): string; /** @@ -5415,20 +4095,17 @@ declare module "ace-code/src/edit_session" { * @param {Number} firstRow The first row index to retrieve * @param {Number} lastRow The final row index to retrieve * - * @returns {String[]} * **/ getLines(firstRow: number, lastRow: number): string[]; /** * Returns the number of rows in the document. - * @returns {Number} **/ getLength(): number; /** * {:Document.getTextRange.desc} * @param {IRange} [range] The range to work with * - * @returns {String} **/ getTextRange(range?: IRange): string; /** @@ -5457,13 +4134,12 @@ declare module "ace-code/src/edit_session" { /** * Reverts previous changes to your document. * @param {Delta[]} deltas An array of previous changes - * @param {Boolean} [dontSelect] [If `true`, doesn't select the range of where the change occured]{: #dontSelect} + * @param {Boolean} [dontSelect] If `true`, doesn't select the range of where the change occured **/ undoChanges(deltas: Delta[], dontSelect?: boolean): void; /** * Re-implements a previously undone change to your document. * @param {Delta[]} deltas An array of previous changes - * @param {Boolean} [dontSelect] {:dontSelect} **/ redoChanges(deltas: Delta[], dontSelect?: boolean): void; /** @@ -5494,7 +4170,6 @@ declare module "ace-code/src/edit_session" { * ``` * @param {Range} fromRange The range of text you want moved within the document * @param {Point} toPosition The location (row and column) where you want to move the text to - * @param {boolean} [copy] * @returns {Range} The new range where the text was moved to. **/ moveText(fromRange: Range, toPosition: Point, copy?: boolean): Range; @@ -5540,7 +4215,6 @@ declare module "ace-code/src/edit_session" { setUseWrapMode(useWrapMode: boolean): void; /** * Returns `true` if wrap mode is being used; `false` otherwise. - * @returns {Boolean} **/ getUseWrapMode(): boolean; /** @@ -5552,8 +4226,6 @@ declare module "ace-code/src/edit_session" { /** * This should generally only be called by the renderer when a resize is detected. * @param {Number} desiredLimit The new wrap limit - * @param [$printMargin] - * @returns {Boolean} **/ adjustWrapLimit(desiredLimit: number, $printMargin?: any): boolean; /** @@ -5573,7 +4245,6 @@ declare module "ace-code/src/edit_session" { * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - * @returns {{ min: number, max: number }} **/ getWrapLimitRange(): { min: number; @@ -5582,65 +4253,36 @@ declare module "ace-code/src/edit_session" { /** * Returns number of screenrows in a wrapped line. * @param {Number} row The row number to check - * @returns {Number} **/ getRowLength(row: number): number; - /** - * @param {Number} row - * @returns {Number} - **/ getRowLineCount(row: number): number; - /** - * @param {Number} screenRow - * @returns {Number} - **/ getRowWrapIndent(screenRow: number): number; /** * Returns the position (on screen) for the last character in the provided screen row. * @param {Number} screenRow The screen row to check - * @returns {Number} * * @related EditSession.documentToScreenColumn **/ getScreenLastRowColumn(screenRow: number): number; /** * For the given document row and column, this returns the column position of the last screen row. - * @param {Number} docRow - * @param {Number} docColumn - * @returns {number} **/ getDocumentLastRowColumn(docRow: number, docColumn: number): number; /** * For the given document row and column, this returns the document position of the last row. - * @param {Number} docRow - * @param {Number} docColumn - * @returns {Point} **/ getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; /** * For the given row, this returns the split data. - * @param {number} row - * @returns {String | undefined} */ getRowSplitData(row: number): string | undefined; /** * The distance to the next tab stop at the specified screen column. * @param {Number} screenColumn The screen column to check * - * @returns {Number} **/ getScreenTabSize(screenColumn: number): number; - /** - * @param {number} screenRow - * @param {number} screenColumn - * @returns {number} - */ screenToDocumentRow(screenRow: number, screenColumn: number): number; - /** - * @param {number} screenRow - * @param {number} screenColumn - * @returns {number} - */ screenToDocumentColumn(screenRow: number, screenColumn: number): number; /** * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} @@ -5664,21 +4306,14 @@ declare module "ace-code/src/edit_session" { documentToScreenPosition(docRow: number | Point, docColumn?: number | undefined): Point; /** * For the given document row and column, returns the screen column. - * @param {Number|Point} row - * @param {Number} [docColumn] - * @returns {Number} **/ documentToScreenColumn(row: number | Point, docColumn?: number): number; /** * For the given document row and column, returns the screen row. - * @param {Number|Point} docRow - * @param {Number} [docColumn] - * @returns {number} **/ documentToScreenRow(docRow: number | Point, docColumn?: number): number; /** * Returns the length of the screen. - * @returns {Number} **/ getScreenLength(): number; /** @@ -5689,14 +4324,9 @@ declare module "ace-code/src/edit_session" { /** * Returns the current [[Document `Document`]] as a string. * @method getValue - * @returns {String} * @alias EditSession.toString **/ getValue: () => string; - /** - * - * @type {null | import("ace-code").Ace.LineWidget[]} - */ lineWidgets: null | import("ace-code").Ace.LineWidget[]; isFullWidth: typeof isFullWidth; lineWidgetsWidth?: number; @@ -5753,11 +4383,6 @@ declare module "ace-code/src/edit_session" { } } declare module "ace-code/src/range" { - /** - * @typedef {import("ace-code/src/edit_session").EditSession} EditSession - * @typedef {import("ace-code").Ace.IRange} IRange - * @typedef {import("ace-code").Ace.Point} Point - */ /** * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogous to a range, as ranges contain a starting row and starting column, and an ending row, and ending column. **/ @@ -5771,14 +4396,11 @@ declare module "ace-code/src/range" { * @constructor **/ constructor(startRow?: number, startColumn?: number, endRow?: number, endColumn?: number); - /**@type {Point}*/ start: Point; - /**@type {Point}*/ end: Point; /** * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. * @param {IRange} range A range to check against - * @return {Boolean} **/ isEqual(range: IRange): boolean; /** @@ -5786,7 +4408,6 @@ declare module "ace-code/src/range" { * ``` * [start.row/start.column] -> [end.row/end.column] * ``` - * @return {String} **/ toString(): string; /** @@ -5797,7 +4418,6 @@ declare module "ace-code/src/range" { * ``` * @param {Number} row A row to check for * @param {Number} column A column to check for - * @returns {Boolean} * @related [[Range.compare]] **/ contains(row: number, column: number): boolean; @@ -5818,34 +4438,29 @@ declare module "ace-code/src/range" { * Compares the row and column of `p` with the starting and ending [[Point]]'s of the calling range (by calling [[Range.compare]]). * @param {Point} p A point to compare with * @related [[Range.compare]] - * @returns {Number} **/ comparePoint(p: Point): number; /** * Checks the start and end [[Point]]'s of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range. * @param {IRange} range A range to compare with - * @returns {Boolean} * @related [[Range.comparePoint]] **/ containsRange(range: IRange): boolean; /** * Returns `true` if passed in `range` intersects with the one calling this method. * @param {IRange} range A range to compare with - * @returns {Boolean} **/ intersects(range: IRange): boolean; /** * Returns `true` if the caller's ending row is the same as `row`, and if the caller's ending column is the same as `column`. * @param {Number} row A row to compare with * @param {Number} column A column to compare with - * @returns {Boolean} **/ isEnd(row: number, column: number): boolean; /** * Returns `true` if the caller's starting row is the same as `row`, and if the caller's starting column is the same as `column`. * @param {Number} row A row to compare with * @param {Number} column A column to compare with - * @returns {Boolean} **/ isStart(row: number, column: number): boolean; /** @@ -5866,7 +4481,6 @@ declare module "ace-code/src/range" { * Returns `true` if the `row` and `column` are within the given range. * @param {Number} row A row to compare with * @param {Number} column A column to compare with - * @returns {Boolean} * @related [[Range.compare]] **/ inside(row: number, column: number): boolean; @@ -5874,7 +4488,6 @@ declare module "ace-code/src/range" { * Returns `true` if the `row` and `column` are within the given range's starting [[Point]]. * @param {Number} row A row to compare with * @param {Number} column A column to compare with - * @returns {Boolean} * @related [[Range.compare]] **/ insideStart(row: number, column: number): boolean; @@ -5882,7 +4495,6 @@ declare module "ace-code/src/range" { * Returns `true` if the `row` and `column` are within the given range's ending [[Point]]. * @param {Number} row A row to compare with * @param {Number} column A column to compare with - * @returns {Boolean} * @related [[Range.compare]] * **/ @@ -5937,7 +4549,6 @@ declare module "ace-code/src/range" { * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object. * @param {Number} firstRow The starting row * @param {Number} lastRow The ending row - * @returns {Range} **/ clipRows(firstRow: number, lastRow: number): Range; /** @@ -5949,34 +4560,27 @@ declare module "ace-code/src/range" { extend(row: number, column: number): Range; /** * Returns `true` if the calling range is empty (starting [[Point]] == ending [[Point]]). - * @returns {Boolean} **/ isEmpty(): boolean; /** * Returns `true` if the range spans across multiple lines. - * @returns {Boolean} **/ isMultiLine(): boolean; /** * Returns a duplicate of the calling range. - * @returns {Range} **/ clone(): Range; /** * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. - * @returns {Range} **/ collapseRows(): Range; /** * Given the current `Range`, this function converts those starting and ending [[Point]]'s into screen positions, and then returns a new `Range` object. * @param {EditSession} session The `EditSession` to retrieve coordinates from - * @returns {Range} **/ toScreenRange(session: EditSession): Range; /** * Shift the calling range by `row` and `column` values. - * @param {Number} row - * @param {Number} column * @experimental */ moveBy(row: number, column: number): void; @@ -5994,14 +4598,10 @@ declare module "ace-code/src/range" { * Creates and returns a new `Range` based on the `start` [[Point]] and `end` [[Point]] of the given parameters. * @param {Point} start A starting point to use * @param {Point} end An ending point to use - * @returns {Range} **/ function fromPoints(start: Point, end: Point): Range; /** * Compares `p1` and `p2` [[Point]]'s, useful for sorting - * @param {Point} p1 - * @param {Point} p2 - * @returns {Number} */ function comparePoints(p1: Point, p2: Point): number; namespace Ace { @@ -6018,14 +4618,6 @@ declare module "ace-code/src/worker/worker_client" { } declare module "ace-code/src/placeholder" { export class PlaceHolder { - /** - * @param {EditSession} session - * @param {Number} length - * @param {import("ace-code").Ace.Point} pos - * @param {any[]} others - * @param {String} mainClass - * @param {String} othersClass - **/ constructor(session: EditSession, length: number, pos: import("ace-code").Ace.Point, others: any[], mainClass: string, othersClass: string); length: number; session: import("ace-code/src/edit_session").EditSession; @@ -6057,9 +4649,6 @@ declare module "ace-code/src/placeholder" { * **/ hideOtherMarkers(): void; - /** - * @param {import("ace-code").Ace.Delta} delta - */ updateAnchors(delta: import("ace-code").Ace.Delta): void; updateMarkers(): void; /** @@ -6103,9 +4692,6 @@ declare module "ace-code/src/multi_select" { export type Anchor = import("ace-code/src/anchor").Anchor; export type Point = import("ace-code").Ace.Point; export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; - /** - * @param {Editor} editor - */ export function MultiSelect(editor: Editor): void; import Editor_4 = require("ace-code/src/editor"); import Editor = Editor_4.Editor; @@ -6163,38 +4749,13 @@ declare module "ace-code/src/incremental_search" { * **/ export class IncrementalSearch extends Search { - /** - * @param {boolean} backwards - */ activate(editor: any, backwards: boolean): void; - /** - * @param {boolean} [reset] - */ deactivate(reset?: boolean): void; - /** - * @param {Editor} editor - */ selectionFix(editor: Editor): void; - /** - * @param {RegExp} regexp - */ highlight(regexp: RegExp): void; - /** - * @param {boolean} [reset] - */ cancelSearch(reset?: boolean): Range; - /** - * @param {boolean} moveToNext - * @param {Function} needleUpdateFunc - */ highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; - /** - * @param {string} s - */ addString(s: string): false | Range; - /** - * @param {any} c - */ removeChar(c: any): false | Range; next(options: any): false | Range; convertNeedleToRegExp(): false | Range; @@ -6214,16 +4775,12 @@ declare module "ace-code/src/split" { export type ISplit = import("ace-code").Ace.EventEmitter & { [key: string]: any; }; - /** - * @typedef {import("ace-code").Ace.EventEmitter & {[key: string]: any}} ISplit - */ export var Split: any; } declare module "ace-code/src/tokenizer_dev" { export class Tokenizer extends BaseTokenizer { /** * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} **/ getLineTokens(line: any, startState: any): any; } diff --git a/ace-snippets.d.ts b/types/ace-snippets.d.ts similarity index 100% rename from ace-snippets.d.ts rename to types/ace-snippets.d.ts diff --git a/ace-theme.d.ts b/types/ace-theme.d.ts similarity index 100% rename from ace-theme.d.ts rename to types/ace-theme.d.ts From 2583e1c301a6bfb7bcf0bfabf60e4e1124a9d272 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 19 Nov 2024 18:58:28 +0400 Subject: [PATCH 31/33] corrects import statements --- ace.d.ts | 15 +-- tool/ace_declaration_generator.js | 18 ++++ types/ace-ext.d.ts | 42 +++----- types/ace-modules.d.ts | 162 ++++++++++-------------------- 4 files changed, 91 insertions(+), 146 deletions(-) diff --git a/ace.d.ts b/ace.d.ts index 611c7234b2d..d26e52ee012 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -953,16 +953,11 @@ declare module "ace-code" { value?: any; }) | null, options?: any): Editor; export function createEditSession(text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode): EditSession; - import Editor_5 = require("ace-code/src/editor"); - import Editor = Editor_5.Editor; - import EditSession_3 = require("ace-code/src/edit_session"); - import EditSession = EditSession_3.EditSession; - import Range_13 = require("ace-code/src/range"); - import Range = Range_13.Range; - import UndoManager_2 = require("ace-code/src/undomanager"); - import UndoManager = UndoManager_2.UndoManager; - import Renderer_1 = require("ace-code/src/virtual_renderer"); - import Renderer = Renderer_1.VirtualRenderer; + import { Editor } from "ace-code/src/editor"; + import { EditSession } from "ace-code/src/edit_session"; + import { Range } from "ace-code/src/range"; + import { UndoManager } from "ace-code/src/undomanager"; + import { VirtualRenderer as Renderer } from "ace-code/src/virtual_renderer"; export var version: "1.36.5"; export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer }; } diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index a8621502810..a167b6eff6b 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -401,6 +401,7 @@ function fixDeclaration(content, aceNamespacePath) { let allReferences = referencePaths.join("\n") + "\n/// \n"; output = allReferences + output; } + output = correctImportStatements(output); output = cleanComments(output); output = formatDts(outputName, output); fs.writeFileSync(outputName, output); @@ -418,6 +419,23 @@ function fixDeclaration(content, aceNamespacePath) { checkFinalDeclaration(finalDeclarations); } +/** + * Corrects the import statements in the provided text by replacing the old-style + * `require()` imports with modern ES6 `import` statements. + */ +function correctImportStatements(text) { + text = text.replace( + /import\s*\w+_\d+\s*=\s*require\(([\w\/"-]+)\);?.\s*import\s*(\w+)\s*=\s*\w+_\d+\.(\w+);?/gs, + (match, path, importName, exportName) => { + if (importName !== exportName) { + return `import {${exportName} as ${importName}} from ${path};`; + } + return `import {${exportName}} from ${path};`; + } + ); + return text; +} + function cleanComments(text) { text = text.replace(/^\s*\*\s*@(param|template|returns?|this|typedef)\s*({.+})?(\s*\[?[$\w]+\]?)?\s*$/gm, ''); text = text.replace(/@type\s*({.+})/g, ''); diff --git a/types/ace-ext.d.ts b/types/ace-ext.d.ts index 2f9ab9894a5..e4935b6cfff 100644 --- a/types/ace-ext.d.ts +++ b/types/ace-ext.d.ts @@ -65,8 +65,7 @@ declare module "ace-code/src/ext/command_bar" { } export type Editor = import("ace-code/src/editor").Editor; export type TooltipCommand = import("ace-code").Ace.TooltipCommand; - import Tooltip_2 = require("ace-code/src/tooltip"); - import Tooltip = Tooltip_2.Tooltip; + import { Tooltip } from "ace-code/src/tooltip"; export var TOOLTIP_CLASS_NAME: string; export var BUTTON_CLASS_NAME: string; namespace Ace { @@ -150,18 +149,12 @@ declare module "ace-code/src/ext/inline_autocomplete" { */ export function createInlineTooltip(parentEl: HTMLElement): CommandBarTooltip; } - import Editor_2 = require("ace-code/src/editor"); - import Editor = Editor_2.Editor; - import HashHandler_2 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_2.HashHandler; - import AceInline_2 = require("ace-code/src/autocomplete/inline"); - import AceInline = AceInline_2.AceInline; - import CommandBarTooltip_1 = require("ace-code/src/ext/command_bar"); - import CommandBarTooltip = CommandBarTooltip_1.CommandBarTooltip; - import CompletionProvider_1 = require("ace-code/src/autocomplete"); - import CompletionProvider = CompletionProvider_1.CompletionProvider; - import FilteredList_1 = require("ace-code/src/autocomplete"); - import FilteredList = FilteredList_1.FilteredList; + import { Editor } from "ace-code/src/editor"; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; + import { AceInline } from "ace-code/src/autocomplete/inline"; + import { CommandBarTooltip } from "ace-code/src/ext/command_bar"; + import { CompletionProvider } from "ace-code/src/autocomplete"; + import { FilteredList } from "ace-code/src/autocomplete"; } declare module "ace-code/src/ext/searchbox-css" { const _exports: string; @@ -204,8 +197,7 @@ declare module "ace-code/src/ext/searchbox" { show(value: string, isReplace?: boolean): void; isFocused(): boolean; } - import HashHandler_3 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_3.HashHandler; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; } declare module "ace-code/src/ext/elastic_tabstops_lite" { export class ElasticTabstopsLite { @@ -215,8 +207,7 @@ declare module "ace-code/src/ext/elastic_tabstops_lite" { onChange: (delta: any) => void; processRows(rows: number[]): void; } - import Editor_3 = require("ace-code/src/editor"); - import Editor = Editor_3.Editor; + import { Editor } from "ace-code/src/editor"; } declare module "ace-code/src/ext/error_marker" { export function showErrorMarker(editor: import("ace-code/src/editor").Editor, dir: number): void; @@ -242,8 +233,7 @@ declare module "ace-code/src/ext/code_lens" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type VirtualRenderer = import("ace-code/src/virtual_renderer").VirtualRenderer & { }; - import Editor_7 = require("ace-code/src/editor"); - import Editor = Editor_7.Editor; + import { Editor } from "ace-code/src/editor"; } declare module "ace-code/src/ext/emmet" { export const commands: HashHandler; @@ -253,10 +243,8 @@ declare module "ace-code/src/ext/emmet" { export function isAvailable(editor: Editor, command: string): boolean; export function load(cb: any): boolean; export function setCore(e: any): void; - import HashHandler_5 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_5.HashHandler; - import Editor_8 = require("ace-code/src/editor"); - import Editor = Editor_8.Editor; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; + import { Editor } from "ace-code/src/editor"; /** * Implementation of {@link IEmmetEditor} interface for Ace */ @@ -360,8 +348,7 @@ declare module "ace-code/src/ext/emmet" { } declare module "ace-code/src/ext/hardwrap" { export function hardWrap(editor: import("ace-code/src/editor").Editor, options: import("ace-code").Ace.HardWrapOptions): void; - import Editor_9 = require("ace-code/src/editor"); - import Editor = Editor_9.Editor; + import { Editor } from "ace-code/src/editor"; } declare module "ace-code/src/ext/menu_tools/settings_menu.css" { const _exports: string; @@ -378,8 +365,7 @@ declare module "ace-code/src/ext/menu_tools/get_editor_keyboard_shortcuts" { } declare module "ace-code/src/ext/keybinding_menu" { export function init(editor: Editor): void; - import Editor_10 = require("ace-code/src/editor"); - import Editor = Editor_10.Editor; + import { Editor } from "ace-code/src/editor"; } declare module "ace-code/src/ext/linking" { } declare module "ace-code/src/ext/modelist" { diff --git a/types/ace-modules.d.ts b/types/ace-modules.d.ts index 79e5fd0e118..bb4b6e256ba 100644 --- a/types/ace-modules.d.ts +++ b/types/ace-modules.d.ts @@ -251,10 +251,8 @@ declare module "ace-code/src/document" { export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; export type NewLineMode = import("ace-code").Ace.NewLineMode; - import Anchor_1 = require("ace-code/src/anchor"); - import Anchor = Anchor_1.Anchor; - import Range_1 = require("ace-code/src/range"); - import Range = Range_1.Range; + import { Anchor } from "ace-code/src/anchor"; + import { Range } from "ace-code/src/range"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type DocumentEvents = import("ace-code").Ace.DocumentEvents; @@ -418,8 +416,7 @@ declare module "ace-code/src/layer/gutter" { } export type EditSession = import("ace-code/src/edit_session").EditSession; export type LayerConfig = import("ace-code").Ace.LayerConfig; - import Lines_1 = require("ace-code/src/layer/lines"); - import Lines = Lines_1.Lines; + import { Lines } from "ace-code/src/layer/lines"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type GutterEvents = import("ace-code").Ace.GutterEvents; @@ -453,8 +450,7 @@ declare module "ace-code/src/layer/marker" { drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraStyle?: undefined): void; } - import Range_2 = require("ace-code/src/range"); - import Range = Range_2.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/layer/text_util" { export function isTextToken(tokenType: any): boolean; @@ -497,8 +493,7 @@ declare module "ace-code/src/layer/text" { export type LayerConfig = import("ace-code").Ace.LayerConfig; export type EditSession = import("ace-code/src/edit_session").EditSession; import dom = require("ace-code/src/lib/dom"); - import Lines_2 = require("ace-code/src/layer/lines"); - import Lines = Lines_2.Lines; + import { Lines } from "ace-code/src/layer/lines"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type TextEvents = import("ace-code").Ace.TextEvents; @@ -1234,22 +1229,14 @@ declare module "ace-code/src/virtual_renderer" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type Point = import("ace-code").Ace.Point; export type Theme = import("ace-code").Ace.Theme; - import GutterLayer_1 = require("ace-code/src/layer/gutter"); - import GutterLayer = GutterLayer_1.Gutter; - import MarkerLayer_1 = require("ace-code/src/layer/marker"); - import MarkerLayer = MarkerLayer_1.Marker; - import TextLayer_1 = require("ace-code/src/layer/text"); - import TextLayer = TextLayer_1.Text; - import CursorLayer_1 = require("ace-code/src/layer/cursor"); - import CursorLayer = CursorLayer_1.Cursor; - import VScrollBar_1 = require("ace-code/src/scrollbar"); - import VScrollBar = VScrollBar_1.VScrollBar; - import FontMetrics_1 = require("ace-code/src/layer/font_metrics"); - import FontMetrics = FontMetrics_1.FontMetrics; - import RenderLoop_1 = require("ace-code/src/renderloop"); - import RenderLoop = RenderLoop_1.RenderLoop; - import Decorator_1 = require("ace-code/src/layer/decorators"); - import Decorator = Decorator_1.Decorator; + import { Gutter as GutterLayer } from "ace-code/src/layer/gutter"; + import { Marker as MarkerLayer } from "ace-code/src/layer/marker"; + import { Text as TextLayer } from "ace-code/src/layer/text"; + import { Cursor as CursorLayer } from "ace-code/src/layer/cursor"; + import { VScrollBar } from "ace-code/src/scrollbar"; + import { FontMetrics } from "ace-code/src/layer/font_metrics"; + import { RenderLoop } from "ace-code/src/renderloop"; + import { Decorator } from "ace-code/src/layer/decorators"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type VirtualRendererEvents = import("ace-code").Ace.VirtualRendererEvents; @@ -1524,8 +1511,7 @@ declare module "ace-code/src/selection" { export type EditSession = import("ace-code/src/edit_session").EditSession; export type Anchor = import("ace-code/src/anchor").Anchor; export type Point = import("ace-code").Ace.Point; - import Range_3 = require("ace-code/src/range"); - import Range = Range_3.Range; + import { Range } from "ace-code/src/range"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type MultiSelectionEvents = import("ace-code").Ace.MultiSelectionEvents; @@ -1653,8 +1639,7 @@ declare module "ace-code/src/tooltip" { getWidth(): number; destroy(): void; } - import Range_4 = require("ace-code/src/range"); - import Range = Range_4.Range; + import { Range } from "ace-code/src/range"; class PopupManager { popups: Tooltip[]; addPopup(popup: Tooltip): void; @@ -1701,8 +1686,7 @@ declare module "ace-code/src/mouse/default_gutter_handler" { showTooltip(row: any): void; hideTooltip(): void; } - import Tooltip_1 = require("ace-code/src/tooltip"); - import Tooltip = Tooltip_1.Tooltip; + import { Tooltip } from "ace-code/src/tooltip"; export interface GutterHandler { } } @@ -1749,8 +1733,7 @@ declare module "ace-code/src/mouse/mouse_handler" { selectEnd?: () => void; } export type Editor = import("ace-code/src/editor").Editor; - import MouseEvent_1 = require("ace-code/src/mouse/mouse_event"); - import MouseEvent = MouseEvent_1.MouseEvent; + import { MouseEvent } from "ace-code/src/mouse/mouse_event"; namespace Ace { type Range = import("ace-code").Ace.Range; type MouseEvent = import("ace-code").Ace.MouseEvent; @@ -1832,8 +1815,7 @@ declare module "ace-code/src/search" { **/ replace(input: string, replacement: any): string; } - import Range_5 = require("ace-code/src/range"); - import Range = Range_5.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/keyboard/hash_handler" { export type Command = import("ace-code").Ace.Command; @@ -1896,8 +1878,7 @@ declare module "ace-code/src/commands/command_manager" { trimMacro(m: any): any; } export type Editor = import("ace-code/src/editor").Editor; - import MultiHashHandler_1 = require("ace-code/src/keyboard/hash_handler"); - import MultiHashHandler = MultiHashHandler_1.MultiHashHandler; + import { MultiHashHandler } from "ace-code/src/keyboard/hash_handler"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -1953,8 +1934,7 @@ declare module "ace-code/src/token_iterator" { */ getCurrentTokenRange(): Range; } - import Range_6 = require("ace-code/src/range"); - import Range = Range_6.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/keyboard/gutter_handler" { export class GutterKeyboardHandler { @@ -1999,8 +1979,7 @@ declare module "ace-code/src/keyboard/gutter_handler" { */ isInFoldLane(): boolean; } - import GutterTooltip_1 = require("ace-code/src/mouse/default_gutter_handler"); - import GutterTooltip = GutterTooltip_1.GutterTooltip; + import { GutterTooltip } from "ace-code/src/mouse/default_gutter_handler"; } declare module "ace-code/src/editor" { /** @@ -2683,18 +2662,12 @@ declare module "ace-code/src/editor" { export type Selection = import("ace-code/src/selection").Selection; export type Point = import("ace-code").Ace.Point; export type SearchOptions = import("ace-code").Ace.SearchOptions; - import EditSession_1 = require("ace-code/src/edit_session"); - import EditSession = EditSession_1.EditSession; - import CommandManager_1 = require("ace-code/src/commands/command_manager"); - import CommandManager = CommandManager_1.CommandManager; - import MouseHandler_1 = require("ace-code/src/mouse/mouse_handler"); - import MouseHandler = MouseHandler_1.MouseHandler; - import KeyBinding_1 = require("ace-code/src/keyboard/keybinding"); - import KeyBinding = KeyBinding_1.KeyBinding; - import Search_1 = require("ace-code/src/search"); - import Search = Search_1.Search; - import Range_7 = require("ace-code/src/range"); - import Range = Range_7.Range; + import { EditSession } from "ace-code/src/edit_session"; + import { CommandManager } from "ace-code/src/commands/command_manager"; + import { MouseHandler } from "ace-code/src/mouse/mouse_handler"; + import { KeyBinding } from "ace-code/src/keyboard/keybinding"; + import { Search } from "ace-code/src/search"; + import { Range } from "ace-code/src/range"; var $uid: number; namespace Ace { type EditorMultiSelectProperties = import("ace-code").Ace.EditorMultiSelectProperties; @@ -2861,8 +2834,7 @@ declare module "ace-code/src/autocomplete/popup" { } export function $singleLineEditor(el?: HTMLElement): Editor; export function getAriaId(index: any): string; - import Editor_1 = require("ace-code/src/editor"); - import Editor = Editor_1.Editor; + import { Editor } from "ace-code/src/editor"; namespace Ace { type AcePopupWithEditor = import("ace-code").Ace.AcePopupWithEditor; type Completion = import("ace-code").Ace.Completion; @@ -2914,8 +2886,7 @@ declare module "ace-code/src/range_list" { detach(): void; comparePoints: (p1: import("ace-code/src/range").Point, p2: import("ace-code/src/range").Point) => number; } - import Range_8 = require("ace-code/src/range"); - import Range = Range_8.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/snippets" { export const snippetManager: SnippetManager; @@ -2989,8 +2960,7 @@ declare module "ace-code/src/snippets" { parseSnippetFile(str: any): Snippet[]; getSnippetByName(name: any, editor: any): undefined; } - import Tokenizer_1 = require("ace-code/src/tokenizer"); - import Tokenizer = Tokenizer_1.Tokenizer; + import { Tokenizer } from "ace-code/src/tokenizer"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; } @@ -3037,8 +3007,7 @@ declare module "ace-code/src/autocomplete/inline" { hide(): boolean; destroy(): void; } - import AceInlineScreenReader_1 = require("ace-code/src/autocomplete/inline_screenreader"); - import AceInlineScreenReader = AceInlineScreenReader_1.AceInlineScreenReader; + import { AceInlineScreenReader } from "ace-code/src/autocomplete/inline_screenreader"; } declare module "ace-code/src/autocomplete/util" { export function parForEach(array: any, fn: any, callback: any): void; @@ -3258,12 +3227,9 @@ declare module "ace-code/src/autocomplete" { * Represents a suggested text snippet intended to complete a user's input */ export type Completion = SnippetCompletion | ValueCompletion; - import HashHandler_1 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_1.HashHandler; - import AcePopup_1 = require("ace-code/src/autocomplete/popup"); - import AcePopup = AcePopup_1.AcePopup; - import AceInline_1 = require("ace-code/src/autocomplete/inline"); - import AceInline = AceInline_1.AceInline; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; + import { AcePopup } from "ace-code/src/autocomplete/popup"; + import { AceInline } from "ace-code/src/autocomplete/inline"; export class FilteredList { constructor(array: any, filterText: any); all: any; @@ -3391,10 +3357,8 @@ declare module "ace-code/src/occur" { occurToOriginalPosition(session: EditSession, pos: Point): Point; matchingLines(session: EditSession, options: Partial): any[]; } - import Search_2 = require("ace-code/src/search"); - import Search = Search_2.Search; - import EditSession_2 = require("ace-code/src/edit_session"); - import EditSession = EditSession_2.EditSession; + import { Search } from "ace-code/src/search"; + import { EditSession } from "ace-code/src/edit_session"; } declare module "ace-code/src/marker_group" { export type EditSession = import("ace-code/src/edit_session").EditSession; @@ -3459,8 +3423,7 @@ declare module "ace-code/src/edit_session/fold" { export type Range = import("ace-code/src/range").Range; export type Point = import("ace-code").Ace.Point; export type IRange = import("ace-code").Ace.IRange; - import RangeList_1 = require("ace-code/src/range_list"); - import RangeList = RangeList_1.RangeList; + import { RangeList } from "ace-code/src/range_list"; export interface Fold { collapseChildren?: number; } @@ -3494,8 +3457,7 @@ declare module "ace-code/src/edit_session/fold_line" { toString(): string; idxToPosition(idx: number): import("ace-code").Ace.Point; } - import Range_9 = require("ace-code/src/range"); - import Range = Range_9.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/bidihandler" { export type EditSession = import("ace-code/src/edit_session").EditSession; @@ -3758,8 +3720,7 @@ declare module "ace-code/src/edit_session/bracket_match" { openTagName: Range; } | undefined; } - import Range_10 = require("ace-code/src/range"); - import Range = Range_10.Range; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/edit_session" { /** @@ -4346,20 +4307,13 @@ declare module "ace-code/src/edit_session" { export type SyntaxMode = import("ace-code").Ace.SyntaxMode; export type LineWidget = import("ace-code").Ace.LineWidget; export type TextMode = SyntaxMode; - import Document_1 = require("ace-code/src/document"); - import Document = Document_1.Document; - import BackgroundTokenizer_1 = require("ace-code/src/background_tokenizer"); - import BackgroundTokenizer = BackgroundTokenizer_1.BackgroundTokenizer; - import Selection_1 = require("ace-code/src/selection"); - import Selection = Selection_1.Selection; - import BidiHandler_1 = require("ace-code/src/bidihandler"); - import BidiHandler = BidiHandler_1.BidiHandler; - import Range_11 = require("ace-code/src/range"); - import Range = Range_11.Range; - import LineWidgets_1 = require("ace-code/src/line_widgets"); - import LineWidgets = LineWidgets_1.LineWidgets; - import UndoManager_1 = require("ace-code/src/undomanager"); - import UndoManager = UndoManager_1.UndoManager; + import { Document } from "ace-code/src/document"; + import { BackgroundTokenizer } from "ace-code/src/background_tokenizer"; + import { Selection } from "ace-code/src/selection"; + import { BidiHandler } from "ace-code/src/bidihandler"; + import { Range } from "ace-code/src/range"; + import { LineWidgets } from "ace-code/src/line_widgets"; + import { UndoManager } from "ace-code/src/undomanager"; function isFullWidth(c: any): boolean; var $uid: number; namespace Ace { @@ -4667,8 +4621,7 @@ declare module "ace-code/src/placeholder" { cancel(): void; } export type EditSession = import("ace-code/src/edit_session").EditSession; - import Range_12 = require("ace-code/src/range"); - import Range = Range_12.Range; + import { Range } from "ace-code/src/range"; namespace Ace { type EventEmitter = import("ace-code").Ace.EventEmitter; type PlaceHolderEvents = import("ace-code").Ace.PlaceHolderEvents; @@ -4683,8 +4636,7 @@ declare module "ace-code/src/commands/multi_select_commands" { export const defaultCommands: import("ace-code").Ace.Command[]; export const multiSelectCommands: import("ace-code").Ace.Command[]; export const keyboardHandler: HashHandler; - import HashHandler_4 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_4.HashHandler; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; } declare module "ace-code/src/multi_select" { export const commands: import("ace-code").Ace.Command[]; @@ -4693,8 +4645,7 @@ declare module "ace-code/src/multi_select" { export type Point = import("ace-code").Ace.Point; export type ScreenCoordinates = import("ace-code").Ace.ScreenCoordinates; export function MultiSelect(editor: Editor): void; - import Editor_4 = require("ace-code/src/editor"); - import Editor = Editor_4.Editor; + import { Editor } from "ace-code/src/editor"; } declare module "ace-code/src/commands/occur_commands" { export namespace occurStartCommand { @@ -4763,13 +4714,10 @@ declare module "ace-code/src/incremental_search" { statusMessage(found: any): void; message(msg: any): void; } - import Search_3 = require("ace-code/src/search"); - import Search = Search_3.Search; + import { Search } from "ace-code/src/search"; import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); - import Editor_6 = require("ace-code/src/editor"); - import Editor = Editor_6.Editor; - import Range_14 = require("ace-code/src/range"); - import Range = Range_14.Range; + import { Editor } from "ace-code/src/editor"; + import { Range } from "ace-code/src/range"; } declare module "ace-code/src/split" { export type ISplit = import("ace-code").Ace.EventEmitter & { @@ -4784,14 +4732,12 @@ declare module "ace-code/src/tokenizer_dev" { **/ getLineTokens(line: any, startState: any): any; } - import BaseTokenizer_1 = require("ace-code/src/tokenizer"); - import BaseTokenizer = BaseTokenizer_1.Tokenizer; + import { Tokenizer as BaseTokenizer } from "ace-code/src/tokenizer"; } declare module "ace-code/src/unicode" { export const wordChars: any; } declare module "ace-code/src/keyboard/textarea" { export const handler: HashHandler; - import HashHandler_6 = require("ace-code/src/keyboard/hash_handler"); - import HashHandler = HashHandler_6.HashHandler; + import { HashHandler } from "ace-code/src/keyboard/hash_handler"; } From 6f05004c2c6c8b99870246c6fa95a74d3f2e7185 Mon Sep 17 00:00:00 2001 From: mkslanc Date: Tue, 19 Nov 2024 19:41:52 +0400 Subject: [PATCH 32/33] fix: create `type` dir, if it doesn't exist --- Makefile.dryice.js | 10 ++++++++-- tool/ace_declaration_generator.js | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 11f0130b6ea..5c4eeaef012 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -192,6 +192,12 @@ function buildTypes() { // ace-builds package has different structure and can't use mode types defined for the ace-code. var paths = fs.readdirSync(BUILD_DIR + '/src-noconflict'); + var typeDir = BUILD_DIR + "/types"; + + if (!fs.existsSync(typeDir)) { + fs.mkdirSync(typeDir); + } + fs.readdirSync(BUILD_DIR + '/src-noconflict/snippets').forEach(function(path) { paths.push("snippets/" + path); }); @@ -219,8 +225,8 @@ function buildTypes() { allModules.push("modules"); // core modules allModules.forEach(function (key) { let fileName = '/ace-' + key + '.d.ts'; - fs.copyFileSync(ACE_HOME + fileName, BUILD_DIR + fileName); - correctDeclarationsForBuild(BUILD_DIR + fileName); + fs.copyFileSync(ACE_HOME + '/types' + fileName, BUILD_DIR + '/types' + fileName); + correctDeclarationsForBuild(BUILD_DIR + '/types' + fileName); }); var esmUrls = []; diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index a167b6eff6b..838d25591f1 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -342,6 +342,9 @@ function fixDeclaration(content, aceNamespacePath) { modules.forEach(key => { const newSourceFile = context.factory.updateSourceFile(sourceFile, moduleOutputs[key]); const dirPath = path.dirname(aceNamespacePath.replace("ace-internal", "ace")); + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath); + } const outputName = key === "ace" ? `${dirPath}/ace.d.ts` : `${dirPath}/types/ace-${key}.d.ts`; finalDeclarations.push(outputName); From b0f9f2c85c9f6731c4dfae584f5d2c601c5cf7cc Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 20 Nov 2024 14:48:55 +0400 Subject: [PATCH 33/33] add auto generated header to type declarations --- ace.d.ts | 2 ++ tool/ace_declaration_generator.js | 3 +++ types/ace-ext.d.ts | 2 ++ types/ace-lib.d.ts | 2 ++ types/ace-modules.d.ts | 2 ++ types/ace-snippets.d.ts | 2 ++ types/ace-theme.d.ts | 2 ++ 7 files changed, 15 insertions(+) diff --git a/ace.d.ts b/ace.d.ts index d26e52ee012..190a64cf866 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + /// /// /// diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 838d25591f1..40b4b8bd44d 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -4,6 +4,8 @@ const path = require("path"); const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity +const AUTO_GENERATED_HEADER = "/* This file is generated using `npm run update-types` */\n\n"; + const defaultFormatCodeSettings = { baseIndentSize: 0, indentSize: 4, @@ -407,6 +409,7 @@ function fixDeclaration(content, aceNamespacePath) { output = correctImportStatements(output); output = cleanComments(output); output = formatDts(outputName, output); + output = AUTO_GENERATED_HEADER + output; fs.writeFileSync(outputName, output); }); diff --git a/types/ace-ext.d.ts b/types/ace-ext.d.ts index e4935b6cfff..984dcdce743 100644 --- a/types/ace-ext.d.ts +++ b/types/ace-ext.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/ext/command_bar" { /** * Displays a command tooltip above the currently active line selection, with clickable elements. diff --git a/types/ace-lib.d.ts b/types/ace-lib.d.ts index 2c0f59e32fb..6135bd4d95b 100644 --- a/types/ace-lib.d.ts +++ b/types/ace-lib.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/lib/useragent" { export namespace OS { let LINUX: string; diff --git a/types/ace-modules.d.ts b/types/ace-modules.d.ts index bb4b6e256ba..dcd0faae0cd 100644 --- a/types/ace-modules.d.ts +++ b/types/ace-modules.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/layer/font_metrics" { export class FontMetrics { constructor(parentEl: HTMLElement); diff --git a/types/ace-snippets.d.ts b/types/ace-snippets.d.ts index 1f1085da24a..a3a14cb8cbe 100644 --- a/types/ace-snippets.d.ts +++ b/types/ace-snippets.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/snippets/abc.snippets" { const _exports: string; export = _exports; diff --git a/types/ace-theme.d.ts b/types/ace-theme.d.ts index faab6975412..363dd69b787 100644 --- a/types/ace-theme.d.ts +++ b/types/ace-theme.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/theme/textmate-css" { const _exports: string; export = _exports;