diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 5c4eeaef012..7c57ed2e400 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -38,7 +38,7 @@ var build = require('architect-build/build'); var { updateDeclarationModuleNames, generateDeclaration, - SEPARATE_MODULES + bundleDtsFiles, } = require('./tool/ace_declaration_generator'); var ACE_HOME = __dirname; @@ -179,25 +179,16 @@ function ace() { } } -function correctDeclarationsForBuild(path, additionalDeclarations) { +function correctDeclarationsForBuild(path) { var definitions = fs.readFileSync(path, 'utf8'); var newDefinitions = updateDeclarationModuleNames(definitions); - if (additionalDeclarations) { - newDefinitions = newDefinitions + '\n' + additionalDeclarations; - } - fs.writeFileSync(path, newDefinitions); + fs.writeFileSync(path, newDefinitions, "utf-8"); } 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); }); @@ -215,20 +206,11 @@ function buildTypes() { } }).filter(Boolean)).join("\n") + "\n"; - fs.copyFileSync(ACE_HOME + '/ace-internal.d.ts', BUILD_DIR + '/ace.d.ts'); - generateDeclaration(BUILD_DIR + '/ace.d.ts'); + generateDeclaration(); 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'); + const finalDeclaration = bundleDtsFiles() + "\n" + pathModules; - let allModules = SEPARATE_MODULES; - allModules.push("modules"); // core modules - allModules.forEach(function (key) { - let fileName = '/ace-' + key + '.d.ts'; - fs.copyFileSync(ACE_HOME + '/types' + fileName, BUILD_DIR + '/types' + fileName); - correctDeclarationsForBuild(BUILD_DIR + '/types' + fileName); - }); - var esmUrls = []; var loader = paths.map(function(path) { @@ -243,6 +225,7 @@ function buildTypes() { }).join('\n'); var esmLoader = esmUrls.join('\n'); + fs.writeFileSync(BUILD_DIR + '/ace.d.ts', finalDeclaration, "utf8"); fs.writeFileSync(BUILD_DIR + '/webpack-resolver.js', loader, "utf8"); fs.writeFileSync(BUILD_DIR + '/esm-resolver.js', esmLoader, "utf8"); } diff --git a/ace-internal.d.ts b/ace-internal.d.ts index 86fab157d74..a32b6d4995d 100644 --- a/ace-internal.d.ts +++ b/ace-internal.d.ts @@ -1,3 +1,16 @@ +import * as i from "./interfaces"; +import {Autocomplete, Completion} from "./src/autocomplete"; +import {AcePopup} from "./src/autocomplete/popup"; +import {Document} from "./src/document"; +import {EditSession} from "./src/edit_session"; +import {SearchBox} from "./src/ext/searchbox"; +import {LineWidgets} from "./src/line_widgets"; +import {Occur} from "./src/occur"; +import {MouseEvent} from "./src/mouse/mouse_event"; +import {Editor} from "./src/editor"; +import {InlineAutocomplete} from "./src/ext/inline_autocomplete"; +import {Range} from "./src/range"; + export namespace Ace { type Anchor = import("./src/anchor").Anchor; type Editor = import("./src/editor").Editor; @@ -28,1243 +41,192 @@ export namespace Ace { 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; - - 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 - } - - interface Theme { - cssClass?: string; - cssText?: string; - $id?: 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 { - $foldData: FoldLine[]; - - /** - * 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; + type AfterLoadCallback = import("./interfaces").AfterLoadCallback + type LoaderFunction = import("./interfaces").LoaderFunction; - /** - * Returns all folds in the given range. Note, that this will return folds - **/ - getFoldsInRange(range: Ace.Range | Ace.Delta): Ace.Fold[]; + type ConfigOptions = import("./interfaces").ConfigOptions; - getFoldsInRangeList(ranges: Ace.Range[] | Ace.Range): Ace.Fold[]; + type Theme = import("./interfaces").Theme; - /** - * Returns all folds in the document - */ - getAllFolds(): Ace.Fold[]; + type ScrollBar = import("./interfaces").ScrollBar; - /** - * 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; + type HScrollbar = import("./interfaces").HScrollbar; - getFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + type VScrollbar = import("./interfaces").VScrollbar; - /** - * Returns the fold which starts after or contains docRow - */ - getNextFoldLine(docRow: number, startFoldLine?: Ace.FoldLine): null | Ace.FoldLine; + type LayerConfig = import("./interfaces").LayerConfig; - getFoldedRowCount(first: number, last: number): number; + type HardWrapOptions = import("./interfaces").HardWrapOptions; - $addFoldLine(foldLine: FoldLine): Ace.FoldLine; + type CommandBarOptions = import("./interfaces").CommandBarOptions; - /** - * 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; + type ScreenCoordinates = import("./interfaces").ScreenCoordinates; - $modified: boolean; + type Folding = import("./interfaces").Folding; - addFolds(folds: Ace.Fold[]): void; + type BracketMatch = import("./interfaces").BracketMatch; - removeFold(fold: Ace.Fold): void; + type IRange = import("./interfaces").IRange; - removeFolds(folds: Ace.Fold[]): void; + type LineWidget = import("./interfaces").LineWidget; - expandFold(fold: Ace.Fold): void; + type NewLineMode = import("./interfaces").NewLineMode; - expandFolds(folds: Ace.Fold[]): void; + type EditSessionOptions = import("./interfaces").EditSessionOptions; - unfold(location?: number | null | Ace.Point | Ace.Range | Ace.Range[], expandInner?: boolean): Ace.Fold[] | undefined; + type VirtualRendererOptions = import("./interfaces").VirtualRendererOptions; - /** - * 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; + type MouseHandlerOptions = import("./interfaces").MouseHandlerOptions; - getRowFoldEnd(docRow: number, startFoldRow?: Ace.FoldLine): number; + type EditorOptions = import("./interfaces").EditorOptions; - getRowFoldStart(docRow: number, startFoldRow?: Ace.FoldLine): number; + type EventsBase = import("./interfaces").EventsBase; - 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; - - $cloneFoldData(): Ace.FoldLine[]; - - 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; - - $foldStyles: { - manual: number; - markbegin: number; - markbeginend: number; - }; - $foldStyle: string; - - setFoldStyle(style: string): void; - - $setFolding(foldMode: Ace.FoldMode): void; - - $foldMode: any; - foldWidgets: any[]; - getFoldWidget: any; - getFoldWidgetRange: any; - $updateFoldWidgets: any; - $tokenizerUpdateFoldWidgets: any; - - getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { - range?: Ace.Range; - firstRange?: Ace.Range; - }; - - onFoldWidgetClick(row: number, e: any): void; - - $toggleFoldWidget(row: number, options: any): Fold | any; - - /** - * - * @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[]; - $brackets: { - ")": string; - "(": string; - "]": string; - "[": string; - "{": string; - "}": string; - "<": string; - ">": string; - }; - $findOpeningBracket: (bracket: string, position: Point, typeRe?: RegExp) => Point | null; - $findClosingBracket: (bracket: string, position: Point, typeRe?: RegExp) => Point | null; - /** - * Returns [[Range]]'s for matching tags and tag names, if there are any - */ - getMatchingTags: (pos: Point) => { - closeTag: Range; - closeTagName: Range; - openTag: Range; - openTagName: Range; - }; - $findTagName: (iterator: any) => any; - $findClosingTag: (iterator: any, token: any) => { - openTag: Range; - closeTag: Range; - openTagName: Range; - closeTagName: Range; - }; - $findOpeningTag: (iterator: any, token: any) => { - openTag: Range; - closeTag: Range; - openTagName: Range; - closeTagName: Range; - }; - } - - interface IRange { - start: Point; - end: Point; - } - - interface LineWidget { - editor?: Editor, - el?: HTMLElement; - rowCount?: number; - hidden?: boolean; - _inDocument?: boolean; - column?: number; - row: number; - $oldWidget?: LineWidget, - session?: EditSession, - html?: string, - text?: string, - className?: string, - coverGutter?: boolean, - pixelHeight?: number, - $fold?: Fold, - type?: any, - destroy?: () => void; - 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; - } + type EditSessionEvents = import("./interfaces").EditSessionEvents; - export class EventEmitter any }> { - once(name: K, callback: T[K]): void; + type EditorEvents = import("./interfaces").EditorEvents; - setDefaultHandler(name: string, callback: Function): void; + type AcePopupEvents = import("./interfaces").AcePopupEvents; - removeDefaultHandler(name: string, callback: Function): void; + type DocumentEvents = import("./interfaces").DocumentEvents; - on(name: K, callback: T[K], capturing?: boolean): T[K]; + type AnchorEvents = import("./interfaces").AnchorEvents; - addEventListener(name: K, callback: T[K], capturing?: boolean): T[K]; + type BackgroundTokenizerEvents = import("./interfaces").BackgroundTokenizerEvents; - off(name: K, callback: T[K]): void; + type SelectionEvents = import("./interfaces").SelectionEvents; - removeListener(name: K, callback: T[K]): void; + type MultiSelectionEvents = import("./interfaces").MultiSelectionEvents; - removeEventListener(name: K, callback: T[K]): void; + type PlaceHolderEvents = import("./interfaces").PlaceHolderEvents; - removeAllListeners(name?: string): void; + type GutterEvents = import("./interfaces").GutterEvents; - _signal(eventName: K, ...args: Parameters): void; + type TextEvents = import("./interfaces").TextEvents; - _emit(eventName: K, ...args: Parameters): void; + type VirtualRendererEvents = import("./interfaces").VirtualRendererEvents; - _dispatchEvent(eventName: K, ...args: Parameters): void; - } + type EventEmitter any }> = import("./interfaces").EventEmitter; - 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; - /**true, if needle has \n or \r\n*/ - $isMultiLine: boolean; - /** - * internal property, determine if browser supports unicode flag - * @private - * */ - $supportsUnicodeFlag: boolean; - } + type SearchOptions = import("./interfaces").SearchOptions; - interface Point { - row: number; - column: number; - } + type Point = import("./interfaces").Point; type Position = Point; - interface Delta { - action: 'insert' | 'remove'; - start: Point; - end: Point; - lines: string[]; - id?: number, - folds?: Fold[] - } + type Delta = import("./interfaces").Delta; - interface Annotation { - row: number; - column: number; - text: string; - type: string; - } + type Annotation = import("./interfaces").Annotation; - export interface MarkerGroupItem { - range: Range; - className: string; - } + type MarkerGroupItem = import("./interfaces").MarkerGroupItem; type MarkerGroup = import("./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 Command = import("./interfaces").Command; - type CommandLike = Command | ((editor: Editor) => void) | ((sb: SearchBox) => void); + type CommandLike = import("./interfaces").CommandLike; - type KeyboardHandler = Partial & { - attach?: (editor: Editor) => void; - detach?: (editor: Editor) => void; - getStatusText?: (editor?: any, data?: any) => string; - } + type KeyboardHandler = import("./interfaces").KeyboardHandler; - 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; + type MarkerLike = import("./interfaces").MarkerLike; - [key: string]: any; - } + type MarkerRenderer = import("./interfaces").MarkerRenderer; - type MarkerRenderer = (html: string[], - range: Range, - left: number, - top: number, - config: any) => void; - - interface Token { - type: string; - value: string; - index?: number; - start?: number; - } + type Token = import("./interfaces").Token; type BaseCompletion = import("./src/autocomplete").BaseCompletion; type SnippetCompletion = import("./src/autocomplete").SnippetCompletion; type ValueCompletion = import("./src/autocomplete").ValueCompletion; type Completion = import("./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 { - $rules: HighlightRulesMap; - $embeds: string[]; - $keywords: any[]; - $keywordList: string[]; + type HighlightRule = import("./interfaces").HighlightRule; - addRules(rules: HighlightRulesMap, prefix?: string): void; + type HighlightRulesMap = import("./interfaces").HighlightRulesMap; - getRules(): HighlightRulesMap; + type KeywordMapper = import("./interfaces").KeywordMapper; - embedRules(rules: (new () => HighlightRules) | HighlightRulesMap, prefix: string, escapeRules?: boolean, append?: boolean): void; + type HighlightRules = import("./interfaces").HighlightRules; - getEmbeds(): string[]; + type FoldWidget = import("./interfaces").FoldWidget; - normalizeRules(): void; + type FoldMode = import("./interfaces").FoldMode; - createKeywordMapper(map: Record, defaultToken?: string, ignoreCase?: boolean, splitChar?: string): KeywordMapper; - } - - type FoldWidget = "start" | "end" | "" - - interface FoldMode { - foldingStartMarker: RegExp; - foldingStopMarker?: RegExp; + type BehaviorAction = import("./interfaces").BehaviorAction; + type BehaviorMap = import("./interfaces").BehaviorMap; - getFoldWidget(session: EditSession, foldStyle: string, row: number): FoldWidget; + type Behaviour = import("./interfaces").Behaviour; - getFoldWidgetRange(session: EditSession, foldStyle: string, row: number): Range | undefined; + type Outdent = import("./interfaces").Outdent; - indentationBlock(session: EditSession, row: number, column?: number): Range | undefined; + type SyntaxMode = import("./interfaces").SyntaxMode; - 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 OptionsBase = import("./interfaces").OptionsBase; - 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 { - $behaviours: { [behaviour: string]: any } - - 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 { - /** - * quotes used by language mode - */ - $quotes: { [quote: string]: string }; - HighlightRules: { - new(config?: any): HighlightRules - }; //TODO: fix this - foldingRules?: FoldMode; - $behaviour?: Behaviour; - $defaultBehaviour?: Behaviour; - /** - * 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; - /** - * An object containing conditions to determine whether to apply matching quote or not. - */ - $pairQuotesAfter: { [quote: string]: RegExp } - $tokenizer: Tokenizer; - $highlightRules: HighlightRules; - $embeds?: string[]; - $modes?: SyntaxMode[]; - $keywordList?: string[]; - $highlightRuleConfig?: any; - 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[]; - - $getIndent(line: string): string; - - $createKeywordList(): string[]; - - $delegator(method: string, args: IArguments, defaultHandler: any): any; - - } - - 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 OptionsProvider = import("./interfaces").OptionsProvider type KeyBinding = import("./src/keyboard/keybinding").KeyBinding; - interface CommandMap { - [name: string]: Command; - } - - type execEventHandler = (obj: { - editor: Editor, - command: Command, - args: any[] - }) => void; + type CommandMap = import("./interfaces").CommandMap; - interface CommandManagerEvents { - on(name: 'exec', callback: execEventHandler): Function; + type execEventHandler = import("./interfaces").execEventHandler; - on(name: 'afterExec', callback: execEventHandler): Function; - } + type CommandManagerEvents = import("./interfaces").CommandManagerEvents; type CommandManager = import("./src/commands/command_manager").CommandManager; + type SavedSelection = import("./interfaces").SavedSelection; - 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; + type TextInput = import("./interfaces").TextInput; - getDocTooltip?(item: Completion): void | string | Completion; + type CompleterCallback = import("./interfaces").CompleterCallback; - onSeen?: (editor: Ace.Editor, completion: Completion) => void; - onInsert?: (editor: Ace.Editor, completion: Completion) => void; + type Completer = import("./interfaces").Completer; - cancel?(): void; + type CompletionOptions = import("./interfaces").CompletionOptions; - id?: string; - triggerCharacters?: string[]; - hideInlinePreview?: boolean; - insertMatch?: (editor: Editor, data: Completion) => void; - } - - interface CompletionOptions { - matches?: Completion[]; - } + type CompletionProviderOptions = import("./interfaces").CompletionProviderOptions; - type CompletionProviderOptions = { - exactMatch?: boolean; - ignoreCaption?: boolean; - } + type GatherCompletionRecord = import("./interfaces").GatherCompletionRecord; - type GatherCompletionRecord = { - prefix: string; - matches: Completion[]; - finished: boolean; - } + type CompletionCallbackFunction = import("./interfaces").CompletionCallbackFunction; + type CompletionProviderCallback = import("./interfaces").CompletionProviderCallback; + type AcePopupNavigation = import("./interfaces").AcePopupNavigation; - type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; - type CompletionProviderCallback = (this: import("./src/autocomplete").Autocomplete, err: Error | undefined, completions: import("./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, - $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 - * @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, - $checkMultiselectChange: (e: any, anchor: Ace.Anchor) => void, - /** - * 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, - $reAlignText: (lines: string[], forceLeft: boolean) => string[], - multiSelect?: any, - $multiselectOnSessionChange?: any, - $blockSelectEnabled?: boolean, - } + type EditorMultiSelectProperties = import("./interfaces").EditorMultiSelectProperties; - interface CodeLenseProvider { - provideCodeLenses: (session: EditSession, callback: (err: any, payload: CodeLense[]) => void) => void; - } + type CodeLenseProvider = import("./interfaces").CodeLenseProvider; - interface CodeLense { - start: Point, - command: any - } + type CodeLense = import("./interfaces").CodeLense; - interface CodeLenseEditorExtension { - codeLensProviders?: CodeLenseProvider[]; - $codeLensClickHandler?: any; - $updateLenses?: () => void; - $updateLensesOnInput?: () => void; - } + type CodeLenseEditorExtension = import("./interfaces").CodeLenseEditorExtension; - interface ElasticTabstopsEditorExtension { - elasticTabstops?: import("./src/ext/elastic_tabstops_lite").ElasticTabstopsLite; - } + type ElasticTabstopsEditorExtension = import("./interfaces").ElasticTabstopsEditorExtension; - interface TextareaEditorExtension { - setDisplaySettings?: (settings: any) => void; - } + type TextareaEditorExtension = import("./interfaces").TextareaEditorExtension; - interface PromptEditorExtension { - cmdLine?: Editor; - } + type PromptEditorExtension = import("./interfaces").PromptEditorExtension; - interface OptionsEditorExtension { - $options?: any; - } + type OptionsEditorExtension = import("./interfaces").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; - - /** - * @param {Ace.Range} range - */ - $onAddRange(range: Ace.Range): void; - - rangeCount: number; - - /** - * - * @param {Ace.Range[]} removed - */ - $onRemoveRange(removed: Ace.Range[]): void; - - /** - * adds multicursor support to selection - */ - $initRangeList(): void; - - /** - * 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[]; - - _eventRegistry?: any; - index?: number; - } + type MultiSelectProperties = import("./interfaces").MultiSelectProperties; - type AcePopupEventsCombined = Ace.EditorEvents & Ace.AcePopupEvents; - type AcePopupWithEditor = Ace.EventEmitter & Ace.Editor; - type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; + type AcePopupEventsCombined = import("./interfaces").AcePopupEventsCombined; + type AcePopupWithEditor = import("./interfaces").AcePopupWithEditor; + type InlineAutocompleteAction = import("./interfaces").InlineAutocompleteAction; - type TooltipCommandFunction = (editor: Ace.Editor) => T; + type TooltipCommandFunction = import("./interfaces").TooltipCommandFunction; - export interface TooltipCommand extends Ace.Command { - enabled?: TooltipCommandFunction | boolean, - getValue?: TooltipCommandFunction, - type: "button" | "text" | "checkbox" - iconCssClass?: string, - cssClass?: string - } + type TooltipCommand = import("./interfaces").TooltipCommand; export type CommandBarTooltip = import("./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 type TokenizeResult = import("./interfaces").TokenizeResult; - export interface Operation { - command: { - name?: string; - }; - args: any; - selectionBefore?: Range | Range[]; - selectionAfter?: Range | Range[]; - docChanged?: boolean; - selectionChanged?: boolean; - } + type StaticHighlightOptions = import("./interfaces").StaticHighlightOptions; + type Operation = import("./interfaces").Operation; } - -export const version: string; -export const config: Ace.Config; - -export function require(name: string): any; - -export function edit(el?: string | (Element & { - env?: any; - value?: any; -}) | null, 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(renderer: Ace.VirtualRenderer, session?: Ace.EditSession, options?: Partial): 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; -}; - -export type InlineAutocomplete = Ace.InlineAutocomplete; -export type CommandBarTooltip = Ace.CommandBarTooltip; - declare global { interface Element { setAttribute(name: string, value: boolean): void; @@ -1274,42 +236,42 @@ declare global { } declare module "./src/anchor" { - export interface Anchor extends Ace.EventEmitter { + + export interface Anchor extends i.EventEmitter { markerId?: number; - document: Ace.Document; + document: Document; } - } declare module "./src/autocomplete" { export interface Autocomplete { - popup: Ace.AcePopup; + popup: AcePopup; emptyMessage?: Function, } export interface CompletionProvider { - completions: Ace.FilteredList; + completions: FilteredList; } } declare module "./src/background_tokenizer" { - export interface BackgroundTokenizer extends Ace.EventEmitter { + export interface BackgroundTokenizer extends i.EventEmitter { } } declare module "./src/document" { - export interface Document extends Ace.EventEmitter { + export interface Document extends i.EventEmitter { } } declare module "./src/editor" { - export interface Editor extends Ace.EditorMultiSelectProperties, Ace.OptionsProvider, - Ace.EventEmitter, Ace.CodeLenseEditorExtension, Ace.ElasticTabstopsEditorExtension, - Ace.TextareaEditorExtension, Ace.PromptEditorExtension, Ace.OptionsEditorExtension { - session: Ace.EditSession; + export interface Editor extends i.EditorMultiSelectProperties, i.OptionsProvider, + i.EventEmitter, i.CodeLenseEditorExtension, i.ElasticTabstopsEditorExtension, + i.TextareaEditorExtension, i.PromptEditorExtension, i.OptionsEditorExtension { + session: EditSession; $mergeUndoDeltas?: any, $highlightSelectedWord?: boolean, $updatePlaceholder?: Function, @@ -1320,25 +282,25 @@ declare module "./src/editor" { $copyWithEmptySelection?: any $selectionStyle?: string, env?: any; - widgetManager?: Ace.LineWidgets, - completer?: Ace.Autocomplete | Ace.InlineAutocomplete, - completers: Ace.Completer[], + widgetManager?: LineWidgets, + completer?: Autocomplete | InlineAutocomplete, + completers: i.Completer[], $highlightTagPending?: boolean, showKeyboardShortcuts?: () => void, showSettingsMenu?: () => void, - searchBox?: Ace.SearchBox, + searchBox?: SearchBox, _eventRegistry?: any, } } declare module "./src/edit_session" { - export interface EditSession extends Ace.EventEmitter, - Ace.OptionsProvider, - Ace.Folding, Ace.BracketMatch { - doc: Ace.Document, + export interface EditSession extends i.EventEmitter, + i.OptionsProvider, + i.Folding, i.BracketMatch { + doc: Document, $highlightLineMarker?: { - start: Ace.Point, - end: Ace.Point, + start: i.Point, + end: i.Point, id?: number } $useSoftTabs?: boolean, @@ -1363,11 +325,11 @@ declare module "./src/edit_session" { selectionMarkerCount?: number, multiSelect?: any, $occurHighlight?: any, - $occur?: Ace.Occur, + $occur?: Occur, $occurMatchingLines?: any, $useEmacsStyleLineStart?: boolean, $selectLongWords?: boolean, - curOp: Ace.Operation | null, + curOp: i.Operation | null, getSelectionMarkers(): any[], } @@ -1381,48 +343,48 @@ declare module "./src/edit_session/fold" { } declare module "./src/placeholder" { - export interface PlaceHolder extends Ace.EventEmitter { + export interface PlaceHolder extends i.EventEmitter { } } declare module "./src/scrollbar" { - export interface VScrollBar extends Ace.EventEmitter { + export interface VScrollBar extends i.EventEmitter { } - export interface HScrollBar extends Ace.EventEmitter { + export interface HScrollBar extends i.EventEmitter { } } declare module "./src/scrollbar_custom" { - export interface VScrollBar extends Ace.EventEmitter { + export interface VScrollBar extends i.EventEmitter { } - export interface HScrollBar extends Ace.EventEmitter { + export interface HScrollBar extends i.EventEmitter { } } declare module "./src/line_widgets" { export interface LineWidgets { - lineWidgets: Ace.LineWidget[]; - editor: Ace.Editor; + lineWidgets: i.LineWidget[]; + editor: Editor; } } declare module "./src/selection" { - export interface Selection extends Ace.EventEmitter, Ace.MultiSelectProperties { + export interface Selection extends i.EventEmitter, i.MultiSelectProperties { } } declare module "./src/range" { export interface Range { id?: number; - cursor?: Ace.Point; + cursor?: i.Point; isBackwards?: boolean; } } declare module "./src/virtual_renderer" { - export interface VirtualRenderer extends Ace.EventEmitter, Ace.OptionsProvider { + export interface VirtualRenderer extends i.EventEmitter, i.OptionsProvider { $customScrollbar?: boolean, $extraHeight?: number, $showGutter?: boolean, @@ -1447,31 +409,31 @@ declare module "./src/virtual_renderer" { theme?: any, $theme?: any, destroyed?: boolean, - session: Ace.EditSession, + session: EditSession, keyboardFocusClassName?: string, } } declare module "./src/snippets" { - interface SnippetManager extends Ace.EventEmitter { + interface SnippetManager extends i.EventEmitter { } } declare module "./src/ext/command_bar" { - export interface CommandBarTooltip extends Ace.EventEmitter { + export interface CommandBarTooltip extends i.EventEmitter { $shouldHideMoreOptions?: boolean, } } declare module "./src/commands/command_manager" { - export interface CommandManager extends Ace.EventEmitter { + export interface CommandManager extends i.EventEmitter { $checkCommandState?: boolean } } declare module "./src/autocomplete/popup" { - export interface AcePopup extends Ace.AcePopupWithEditor { + export interface AcePopup extends i.AcePopupWithEditor { setSelectOnHover: (val: boolean) => void, setRow: (line: number) => void, getRow: () => number, @@ -1480,16 +442,16 @@ declare module "./src/autocomplete/popup" { isOpen: boolean, isTopdown: boolean, autoSelect: boolean, - data: Ace.Completion[], - setData: (data: Ace.Completion[], filterText?: string) => void, - getData: (row: number) => Ace.Completion, + data: Completion[], + setData: (data: Completion[], filterText?: string) => void, + getData: (row: number) => Completion, hide: () => void, anchor: "top" | "bottom", - anchorPosition: Ace.Point, + anchorPosition: i.Point, tryShow: (pos: any, lineHeight: number, anchor: "top" | "bottom", forceShow?: boolean) => boolean, $borderSize: number, show: (pos: any, lineHeight: number, topdownOnly?: boolean) => void, - goTo: (where: Ace.AcePopupNavigation) => void, + goTo: (where: i.AcePopupNavigation) => void, getTextLeftOffset: () => number, $imageSize: number, anchorPos: any, @@ -1505,20 +467,19 @@ declare module "./src/layer/cursor" { } declare module "./src/layer/gutter" { - export interface Gutter extends Ace.EventEmitter { + export interface Gutter extends i.EventEmitter { $useSvgGutterIcons?: boolean, $showFoldedAnnotations?: boolean, } } declare module "./src/layer/text" { - export interface Text extends Ace.EventEmitter { - config: Ace.LayerConfig + export interface Text extends i.EventEmitter { } } declare module "./src/lib/app_config" { - export interface AppConfig extends Ace.EventEmitter { + export interface AppConfig extends i.EventEmitter { } } @@ -1534,9 +495,9 @@ declare module "./src/mouse/mouse_handler" { $tooltipFollowsMouse?: boolean, cancelDrag?: boolean //from DefaultHandlers - $clickSelection?: Ace.Range, - mousedownEvent?: Ace.MouseEvent, - startSelect?: (pos?: Ace.Point, waitForClickSelection?: boolean) => void, + $clickSelection?: Range, + mousedownEvent?: MouseEvent, + startSelect?: (pos?: i.Point, waitForClickSelection?: boolean) => void, select?: () => void $lastScroll?: { t: number, vx: number, vy: number, allowed: number } selectEnd?: () => void @@ -1544,12 +505,12 @@ declare module "./src/mouse/mouse_handler" { } declare module "./src/ext/options" { - export interface OptionPanel extends Ace.EventEmitter { + export interface OptionPanel extends i.EventEmitter { } } declare module "./src/layer/font_metrics" { - export interface FontMetrics extends Ace.EventEmitter { + export interface FontMetrics extends i.EventEmitter { } } diff --git a/ace.d.ts b/ace.d.ts deleted file mode 100644 index 051b46421c3..00000000000 --- a/ace.d.ts +++ /dev/null @@ -1,977 +0,0 @@ -/* This file is generated using `npm run update-types` */ - -/// -/// -/// -/// -/// -/// -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. - * 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; - 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 { - editor?: Editor; - el?: HTMLElement; - rowCount?: number; - hidden?: boolean; - column?: number; - row: number; - session?: EditSession; - html?: string; - text?: string; - className?: string; - coverGutter?: boolean; - pixelHeight?: number; - type?: any; - destroy?: () => void; - 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. - */ - "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]]. - */ - "changeOverwrite": (overwrite: boolean) => void; - /** - * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. - */ - "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. - */ - "changeMode": (e: any) => void; - /** - * Emitted when the wrap mode changes. - */ - "changeWrapMode": (e: any) => void; - /** - * Emitted when the wrapping limit changes. - */ - "changeWrapLimit": (e: any) => void; - /** - * Emitted when a code fold is added or removed. - */ - "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; - } - export class EventEmitter any; - }> { - 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 - **/ - 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; - 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. - **/ - 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 - **/ - 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 interface Operation { - command: { - name?: string; - }; - args: any; - selectionBefore?: Range | Range[]; - selectionAfter?: Range | Range[]; - docChanged?: boolean; - selectionChanged?: boolean; - } - } - export const config: typeof import("ace-code/src/config"); - 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 } 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/demo/test_package/index.ts b/demo/test_package/index.ts index 3e0b12f7593..af34f7960a6 100644 --- a/demo/test_package/index.ts +++ b/demo/test_package/index.ts @@ -11,7 +11,7 @@ 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 "ace-code/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"; diff --git a/demo/test_package/tsconfig.json b/demo/test_package/tsconfig.json index a522a7e7e91..58993c0b020 100644 --- a/demo/test_package/tsconfig.json +++ b/demo/test_package/tsconfig.json @@ -18,7 +18,9 @@ "forceConsistentCasingInFileNames": true, "module": "commonjs", "target": "es2020", - "moduleResolution": "node" + "moduleResolution": "node", + "checkJs": true, + "allowJs": true }, "include": ["*.ts"], "exclude": ["node_modules"] diff --git a/interfaces.d.ts b/interfaces.d.ts new file mode 100644 index 00000000000..2a60eabaff1 --- /dev/null +++ b/interfaces.d.ts @@ -0,0 +1,1200 @@ +import type {Fold} from "./src/edit_session/fold"; +import type {FoldLine} from "./src/edit_session/fold_line"; +import type {Editor} from "./src/editor"; +import type {Range} from "./src/range"; +import type {EditSession} from "./src/edit_session"; +import type {VirtualRenderer} from "./src/virtual_renderer"; +import type {SearchBox} from "./src/ext/searchbox"; +import type {HashHandler} from "./src/keyboard/hash_handler"; +import type {Tokenizer} from "./src/tokenizer"; +import type {Autocomplete, Completion, FilteredList} from "./src/autocomplete"; +import type {Anchor} from "./src/anchor"; +import type {RangeList} from "./src/range_list"; +import type {ElasticTabstopsLite} from "./src/ext/elastic_tabstops_lite"; +import type {MouseEvent} from "./src/mouse/mouse_event"; +export type AfterLoadCallback = (err: Error | null, module: unknown) => void; +export 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 +} + +export interface Theme { + cssClass?: string; + cssText?: string; + $id?: string; + padding?: number | string; + isDark?: boolean; +} + +export interface ScrollBar { + setVisible(visible: boolean): void; + + [key: string]: any; +} + +export interface HScrollbar extends ScrollBar { + setWidth(width: number): void; +} + +export interface VScrollbar extends ScrollBar { + setHeight(width: number): void; +} + +export 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 +} + +export interface HardWrapOptions { + startRow: number; + endRow: number; + allowMerge?: boolean; + column?: number; +} + +export interface CommandBarOptions { + maxElementsOnTooltip: number; + alwaysShow: boolean; + showDelay: number; + hideDelay: number; +} + +export interface ScreenCoordinates { + row: number, + column: number, + side?: 1 | -1, + offsetX?: number +} + +export interface Folding { + $foldData: FoldLine[]; + + /** + * 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): Fold; + + /** + * Returns all folds in the given range. Note, that this will return folds + **/ + getFoldsInRange(range: Range | Delta): Fold[]; + + getFoldsInRangeList(ranges: Range[] | Range): Fold[]; + + /** + * Returns all folds in the document + */ + 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" + */ + getFoldStringAt(row: number, column: number, trim?: number, foldLine?: FoldLine): string | null; + + getFoldLine(docRow: number, startFoldLine?: FoldLine): null | FoldLine; + + /** + * Returns the fold which starts after or contains docRow + */ + getNextFoldLine(docRow: number, startFoldLine?: FoldLine): null | FoldLine; + + getFoldedRowCount(first: number, last: number): number; + + $addFoldLine(foldLine: FoldLine): FoldLine; + + /** + * Adds a new fold. + * @returns {Fold} + * The new created Fold object or an existing fold object in case the + * passed in range fits an existing fold exactly. + */ + addFold(placeholder: Fold | string, range?: Range): Fold; + + $modified: boolean; + + addFolds(folds: Fold[]): void; + + removeFold(fold: Fold): void; + + removeFolds(folds: Fold[]): void; + + expandFold(fold: Fold): void; + + expandFolds(folds: Fold[]): void; + + unfold(location?: number | null | Point | Range | Range[], expandInner?: boolean): 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?: FoldLine): boolean; + + getRowFoldEnd(docRow: number, startFoldRow?: FoldLine): number; + + getRowFoldStart(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; + + $cloneFoldData(): FoldLine[]; + + toggleFold(tryToUnfold?: boolean): void; + + getCommentFoldRange(row: number, column: number, dir?: number): Range | undefined; + + foldAll(startRow?: number | null, endRow?: number | null, depth?: number | null, test?: Function): void; + + foldToLevel(level: number): void; + + foldAllComments(): void; + + $foldStyles: { + manual: number; + markbegin: number; + markbeginend: number; + }; + $foldStyle: string; + + setFoldStyle(style: string): void; + + $setFolding(foldMode: FoldMode): void; + + $foldMode: any; + foldWidgets: any[]; + getFoldWidget: any; + getFoldWidgetRange: any; + $updateFoldWidgets: any; + $tokenizerUpdateFoldWidgets: any; + + getParentFoldRangeData(row: number, ignoreCurrent?: boolean): { + range?: Range; + firstRange?: Range; + }; + + onFoldWidgetClick(row: number, e: any): void; + + $toggleFoldWidget(row: number, options: any): Fold | any; + + /** + * + * @param {boolean} [toggleParent] + */ + toggleFoldWidget(toggleParent?: boolean): void; + + updateFoldWidgets(delta: Delta): void; + + tokenizerUpdateFoldWidgets(e: any): void; +} + +export class 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[]; + $brackets: { + ")": string; + "(": string; + "]": string; + "[": string; + "{": string; + "}": string; + "<": string; + ">": string; + }; + $findOpeningBracket: (bracket: string, position: Point, typeRe?: RegExp) => Point | null; + $findClosingBracket: (bracket: string, position: Point, typeRe?: RegExp) => Point | null; + /** + * Returns [[Range]]'s for matching tags and tag names, if there are any + */ + getMatchingTags: (pos: Point) => { + closeTag: Range; + closeTagName: Range; + openTag: Range; + openTagName: Range; + }; + $findTagName: (iterator: any) => any; + $findClosingTag: (iterator: any, token: any) => { + openTag: Range; + closeTag: Range; + openTagName: Range; + closeTagName: Range; + }; + $findOpeningTag: (iterator: any, token: any) => { + openTag: Range; + closeTag: Range; + openTagName: Range; + closeTagName: Range; + }; +} + +export interface IRange { + start: Point; + end: Point; +} + +export interface LineWidget { + editor?: Editor, + el?: HTMLElement; + rowCount?: number; + hidden?: boolean; + _inDocument?: boolean; + column?: number; + row: number; + $oldWidget?: LineWidget, + session?: EditSession, + html?: string, + text?: string, + className?: string, + coverGutter?: boolean, + pixelHeight?: number, + $fold?: Fold, + type?: any, + destroy?: () => void; + coverLine?: boolean, + fixedWidth?: boolean, + fullWidth?: boolean, + screenWidth?: number, + rowsAbove?: number, + lenses?: any[], +} + +type NewLineMode = 'auto' | 'unix' | 'windows'; + +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: 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; +} + +export interface MouseHandlerOptions { + scrollSpeed: number; + dragDelay: number; + dragEnabled: boolean; + focusTimeout: number; + tooltipFollowsMouse: boolean; +} + +export 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; +} + +export interface EventsBase { + [key: string]: any; +} + +export 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; +} + +export 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?: SyntaxMode, oldMode?: SyntaxMode }) => void; + + //from searchbox extension + "findSearchBox": (e: { match: boolean }) => void; + + //from code_lens extension + "codeLensClick": (e: any) => void; + + "select": () => void; +} + +export 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; +} + +export 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; +} + +export 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; +} + +export 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; +} + +export interface SelectionEvents { + /** + * Emitted when the cursor position changes. + **/ + "changeCursor": () => void; + /** + * Emitted when the cursor selection changes. + **/ + "changeSelection": () => void; +} + +export interface MultiSelectionEvents extends SelectionEvents { + "multiSelect": () => void; + "addRange": (e: { range: Range }) => void; + "removeRange": (e: { ranges: Range[] }) => void; + "singleSelect": () => void; +} + +export interface PlaceHolderEvents { + "cursorEnter": (e: any) => void; + "cursorLeave": (e: any) => void; +} + +export interface GutterEvents { + "changeGutterWidth": (width: number) => void; + "afterRender": () => void; +} + +export interface TextEvents { + "changeCharacterSize": (e: any) => void; +} + +export 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; +} + +export class EventEmitter any }> { + 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; + + _signal(eventName: K, ...args: Parameters): void; + + _emit(eventName: K, ...args: Parameters): void; + + _dispatchEvent(eventName: K, ...args: Parameters): void; +} + +export 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; + /**true, if needle has \n or \r\n*/ + $isMultiLine: boolean; + /** + * internal property, determine if browser supports unicode flag + * @private + * */ + $supportsUnicodeFlag: boolean; +} + +export interface Point { + row: number; + column: number; +} + +export type Position = Point; + +export interface Delta { + action: 'insert' | 'remove'; + start: Point; + end: Point; + lines: string[]; + id?: number, + folds?: Fold[] +} + +export interface Annotation { + row: number; + column: number; + text: string; + type: string; +} + +export interface MarkerGroupItem { + range: Range; + className: string; +} + +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, +} + +export type CommandLike = Command | ((editor: Editor) => void) | ((sb: SearchBox) => void); + +export 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; +} + +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; +} + +export 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 }; + +export type HighlightRulesMap = Record; + +export type KeywordMapper = (keyword: string) => string; + +export interface HighlightRules { + $rules: HighlightRulesMap; + $embeds: string[]; + $keywords: any[]; + $keywordList: string[]; + + 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 type FoldWidget = "start" | "end" | "" + +export 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; +} + +export 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>; + +export interface Behaviour { + $behaviours: { [behaviour: string]: any } + + 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 { + /** + * quotes used by language mode + */ + $quotes: { [quote: string]: string }; + HighlightRules: { + new(config?: any): HighlightRules + }; //TODO: fix this + foldingRules?: FoldMode; + $behaviour?: Behaviour; + $defaultBehaviour?: Behaviour; + /** + * 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; + /** + * An object containing conditions to determine whether to apply matching quote or not. + */ + $pairQuotesAfter: { [quote: string]: RegExp } + $tokenizer: Tokenizer; + $highlightRules: HighlightRules; + $embeds?: string[]; + $modes?: SyntaxMode[]; + $keywordList?: string[]; + $highlightRuleConfig?: any; + 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[]; + + $getIndent(line: string): string; + + $createKeywordList(): string[]; + + $delegator(method: string, args: IArguments, defaultHandler: any): any; + +} + +export interface OptionsBase { + [key: string]: any; +} + +export class OptionsProvider { + setOptions(optList: Partial): void; + + getOptions(optionNames?: Array | Partial): Partial; + + setOption(name: K, value: T[K]): void; + + getOption(name: K): T[K]; +} + +export interface CommandMap { + [name: string]: Command; +} + +export type execEventHandler = (obj: { + editor: Editor, + command: Command, + args: any[] +}) => void; + +export interface CommandManagerEvents { + on(name: 'exec', callback: execEventHandler): Function; + + on(name: 'afterExec', callback: execEventHandler): Function; +} + +export interface SavedSelection { + start: Point; + end: Point; + isBackwards: boolean; +} + +export var Selection: { + new(session: EditSession): Selection; +} + +export interface TextInput { + resetSelection(): void; + + setAriaOption(options?: { activeDescendant: string, role: string, setLabel: any }): void; +} + +export type CompleterCallback = (error: any, completions: Completion[]) => void; + +export interface Completer { + identifierRegexps?: Array, + + getCompletions(editor: Editor, + session: EditSession, + position: Point, + prefix: string, + callback: CompleterCallback): void; + + getDocTooltip?(item: Completion): void | string | Completion; + + onSeen?: (editor: Editor, completion: Completion) => void; + onInsert?: (editor: Editor, completion: Completion) => void; + + cancel?(): void; + + id?: string; + triggerCharacters?: string[]; + hideInlinePreview?: boolean; + insertMatch?: (editor: Editor, data: Completion) => void; +} + +export interface CompletionOptions { + matches?: Completion[]; +} + +export type CompletionProviderOptions = { + exactMatch?: boolean; + ignoreCaption?: boolean; +} + +export type GatherCompletionRecord = { + prefix: string; + matches: Completion[]; + finished: boolean; +} + +export type CompletionCallbackFunction = (err: Error | undefined, data: GatherCompletionRecord) => void; +export type CompletionProviderCallback = (this: Autocomplete, err: Error | undefined, completions: FilteredList, finished: boolean) => void; + +export type AcePopupNavigation = "up" | "down" | "start" | "end"; + +export 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: Range & { marker?: any }) => Range & { marker?: any }, + /** + * Removes the selection marker. + * @param range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. + **/ + removeSelectionMarker: (range: Range & { marker?: any }) => void, + removeSelectionMarkers: (ranges: (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 + * @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, + $checkMultiselectChange: (e: any, anchor: Anchor) => void, + /** + * 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, + $reAlignText: (lines: string[], forceLeft: boolean) => string[], + multiSelect?: any, + $multiselectOnSessionChange?: any, + $blockSelectEnabled?: boolean, +} + +export interface CodeLenseProvider { + provideCodeLenses: (session: EditSession, callback: (err: any, payload: CodeLense[]) => void) => void; +} + +export interface CodeLense { + start: Point, + command: any +} + +export interface CodeLenseEditorExtension { + codeLensProviders?: CodeLenseProvider[]; + $codeLensClickHandler?: any; + $updateLenses?: () => void; + $updateLensesOnInput?: () => void; +} + +export interface ElasticTabstopsEditorExtension { + elasticTabstops?: ElasticTabstopsLite; +} + +export interface TextareaEditorExtension { + setDisplaySettings?: (settings: any) => void; +} + +export interface PromptEditorExtension { + cmdLine?: Editor; +} + +export interface OptionsEditorExtension { + $options?: any; +} + +export interface MultiSelectProperties { + ranges: Range[] | null; + rangeList: RangeList | null; + + /** + * Adds a range to a selection by entering multiselect mode, if necessary. + * @param {Range} range The new range to add + * @param {Boolean} [$blockChangeEvents] Whether or not to block changing events + **/ + addRange(range: Range, $blockChangeEvents?: boolean): any; + + inMultiSelectMode: boolean; + + /** + * @param {Range} [range] + **/ + toSingleRange(range?: Range): void; + + /** + * Removes a Range containing pos (if it exists). + * @param {Point} pos The position to remove, as a `{row, column}` object + **/ + substractPoint(pos: Point): any; + + /** + * Merges overlapping ranges ensuring consistency after changes + **/ + mergeOverlappingRanges(): void; + + /** + * @param {Range} range + */ + $onAddRange(range: Range): void; + + rangeCount: number; + + /** + * + * @param {Range[]} removed + */ + $onRemoveRange(removed: Range[]): void; + + /** + * adds multicursor support to selection + */ + $initRangeList(): void; + + /** + * Returns a concatenation of all the ranges. + * @returns {Range[]} + **/ + getAllRanges(): Range[]; + + /** + * Splits all the ranges into lines. + **/ + splitIntoLines(): void; + + /** + */ + joinSelections(): void; + + /** + **/ + toggleBlockSelection(): void; + + /** + * + * Gets list of ranges composing rectangular block on the screen + * + * @param {ScreenCoordinates} screenCursor The cursor to use + * @param {ScreenCoordinates} screenAnchor The anchor to use + * @param {Boolean} [includeEmptyLines] If true, this includes ranges inside the block which are empty due to clipping + * @returns {Range[]} + **/ + rectangularRangeBlock(screenCursor: ScreenCoordinates, screenAnchor: ScreenCoordinates, includeEmptyLines?: boolean): Range[]; + + _eventRegistry?: any; + index?: number; +} + +export type AcePopupEventsCombined = EditorEvents & AcePopupEvents; +export type AcePopupWithEditor = EventEmitter & Editor; +export type InlineAutocompleteAction = "prev" | "next" | "first" | "last"; + +export type TooltipCommandFunction = (editor: Editor) => T; + +export interface TooltipCommand extends Command { + enabled?: TooltipCommandFunction | boolean, + getValue?: TooltipCommandFunction, + type: "button" | "text" | "checkbox" + iconCssClass?: string, + cssClass?: string +} + +export type TokenizeResult = Array> + +export interface StaticHighlightOptions { + mode?: string | SyntaxMode, + theme?: string | Theme, + trim?: boolean, + firstLineNumber?: number, + showGutter?: boolean +} + +export interface Operation { + command: { + name?: string; + }; + args: any; + selectionBefore?: Range | Range[]; + selectionAfter?: Range | Range[]; + docChanged?: boolean; + selectionChanged?: boolean; +} \ No newline at end of file diff --git a/package.json b/package.json index ca6d03ad47d..7e85c27a110 100644 --- a/package.json +++ b/package.json @@ -32,19 +32,20 @@ "styles", "ace.d.ts", "ace-modes.d.ts", - "types", "esm-resolver.js", "translations", "!**/*_test.js", - "!**/_test" + "!**/_test", + "interfaces.d.ts" ], "scripts": { + "clean:dts": "node -e \"require('./tool/fs_utilities').cleanDeclarationFiles()\"", "start": "node static.js", "test": "node src/test/all.js", "cover": "istanbul cover src/test/all.js", "lint": "eslint \"src/**/*.js\" \"*.js\"", "fix": "npm run lint -- --fix", - "typecheck": "tsc -p tsconfig.json", + "typecheck": "npm run clean:dts && tsc -p tsconfig.json", "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/src/ace.js b/src/ace.js index 2e2180fdd5a..f73deddca5a 100644 --- a/src/ace.js +++ b/src/ace.js @@ -73,7 +73,7 @@ exports.edit = function(el, options) { /** * Creates a new [[EditSession]], and returns the associated [[Document]]. * @param {import('./document').Document | String} text {:textParam} - * @param {import("../ace-internal").Ace.SyntaxMode} [mode] {:modeParam} + * @param {import("../interfaces").SyntaxMode} [mode] {:modeParam} * @returns {EditSession} **/ exports.createEditSession = function(text, mode) { diff --git a/src/anchor.js b/src/anchor.js index 4959ec1fa0e..a0c3632b2d3 100644 --- a/src/anchor.js +++ b/src/anchor.js @@ -12,8 +12,8 @@ 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-internal").Ace.Point} row The starting row position + * @param {import("./document").Document} doc The document to associate with the anchor + * @param {Number|import("../interfaces").Point} row The starting row position * @param {Number} [column] The starting column position **/ constructor(doc, row, column) { @@ -28,7 +28,7 @@ class Anchor { /** * Returns an object identifying the `row` and `column` position of the current anchor. - * @returns {import("../ace-internal").Ace.Point} + * @returns {import("../interfaces").Point} **/ getPosition() { return this.$clipPositionToDocument(this.row, this.column); @@ -45,7 +45,7 @@ class Anchor { /** * Internal function called when `"change"` event fired. - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta * @internal */ onChange(delta) { @@ -115,7 +115,7 @@ class Anchor { * Clips the anchor position to the specified row and column. * @param {Number} row The row index to clip the anchor to * @param {Number} column The column index to clip the anchor to - * @returns {import("../ace-internal").Ace.Point} + * @returns {import("../interfaces").Point} * **/ $clipPositionToDocument(row, column) { diff --git a/src/apply_delta.js b/src/apply_delta.js index 5d2fffb1925..faa1d34d14f 100644 --- a/src/apply_delta.js +++ b/src/apply_delta.js @@ -43,7 +43,7 @@ function validateDelta(docLines, delta) { /** * Applies a delta to a document. * @param {string[]} docLines - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta * @param [doNotValidate] */ exports.applyDelta = function(docLines, delta, doNotValidate) { diff --git a/src/autocomplete.js b/src/autocomplete.js index adbca40642c..77e1d3f27c0 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -1,9 +1,9 @@ "use strict"; /** * @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 + * @typedef {import("../interfaces").CompletionProviderOptions} CompletionProviderOptions + * @typedef {import("../interfaces").CompletionOptions} CompletionOptions + * @typedef {import("../interfaces").Position} Position */ var HashHandler = require("./keyboard/hash_handler").HashHandler; var AcePopup = require("./autocomplete/popup").AcePopup; @@ -28,11 +28,11 @@ var preventParentScroll = require("./lib/scroll").preventParentScroll; * @property {string} [docText] - a plain text that would be displayed as an additional popup. If `docHTML` exists, * it would be used instead of `docText`. * @property {string} [completerId] - the identifier of the completer - * @property {import("../ace-internal").Ace.IRange} [range] - An object specifying the range of text to be replaced with the new completion value (experimental) + * @property {import("../interfaces").IRange} [range] - An object specifying the range of text to be replaced with the new completion value (experimental) * @property {any} [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} [completer] + * @property {import("../interfaces").Completer} [completer] * @property {boolean} [hideInlinePreview] * @export */ @@ -912,7 +912,7 @@ class CompletionProvider { /** * @param {Editor} editor - * @param {import("../ace-internal").Ace.CompletionCallbackFunction} callback + * @param {import("../interfaces").CompletionCallbackFunction} callback */ gatherCompletions(editor, callback) { var session = editor.getSession(); diff --git a/src/autocomplete/inline.js b/src/autocomplete/inline.js index 67b02d0f838..c6760208a84 100644 --- a/src/autocomplete/inline.js +++ b/src/autocomplete/inline.js @@ -19,7 +19,7 @@ class AceInline { /** * Renders the completion as ghost text to the current cursor position * @param {Editor} editor - * @param {import("../../ace-internal").Ace.Completion} completion + * @param {import("../autocomplete").Completion} completion * @param {string} prefix * @returns {boolean} True if the completion could be rendered to the editor, false otherwise */ diff --git a/src/autocomplete/popup.js b/src/autocomplete/popup.js index 2a164758ce8..2392968353a 100644 --- a/src/autocomplete/popup.js +++ b/src/autocomplete/popup.js @@ -192,7 +192,7 @@ class AcePopup { var bgTokenizer = popup.session.bgTokenizer; bgTokenizer.$tokenizeRow = function(row) { - /**@type {import("../../ace-internal").Ace.Completion &{name?, className?, matchMask?, message?}}*/ + /**@type {import("../autocomplete").Completion &{name?, className?, matchMask?, message?}}*/ var data = popup.data[row]; var tokens = []; if (!data) diff --git a/src/background_tokenizer.js b/src/background_tokenizer.js index f96599350b8..67c343a76bb 100644 --- a/src/background_tokenizer.js +++ b/src/background_tokenizer.js @@ -133,7 +133,7 @@ class BackgroundTokenizer { } /** - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta */ $updateOnChange(delta) { var startRow = delta.start.row; @@ -168,7 +168,7 @@ class BackgroundTokenizer { /** * Gives list of [[Token]]'s of the row. (tokens are cached) * @param {Number} row The row to get tokens at - * @returns {import("../ace-internal").Ace.Token[]} + * @returns {import("../interfaces").Token[]} **/ getTokens(row) { return this.lines[row] || this.$tokenizeRow(row); diff --git a/src/bidihandler.js b/src/bidihandler.js index 20f023613e2..86c4613c1d8 100644 --- a/src/bidihandler.js +++ b/src/bidihandler.js @@ -60,7 +60,7 @@ class BidiHandler { } /** - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta * @internal */ onChange(delta) { diff --git a/src/commands/command_manager.js b/src/commands/command_manager.js index 81bacf2b5fd..5222b009567 100644 --- a/src/commands/command_manager.js +++ b/src/commands/command_manager.js @@ -26,7 +26,7 @@ class CommandManager extends MultiHashHandler{ /** * - * @param {string | string[] | import("../../ace-internal").Ace.Command} command + * @param {string | string[] | import("../../interfaces").Command} command * @param {Editor} editor * @param {any} args * @returns {boolean} @@ -55,7 +55,7 @@ class CommandManager extends MultiHashHandler{ /** * - * @param {string | import("../../ace-internal").Ace.Command} command + * @param {string | import("../../interfaces").Command} command * @param {Editor} editor * @returns {boolean} */ diff --git a/src/commands/default_commands.js b/src/commands/default_commands.js index 6c1816e8bc6..4d77d20d31e 100644 --- a/src/commands/default_commands.js +++ b/src/commands/default_commands.js @@ -12,7 +12,7 @@ function bindKey(win, mac) { multiSelectAction: "forEach"|"forEachLine"|function|undefined, scrollIntoView: true|"cursor"|"center"|"selectionPart" */ -/**@type {import("../../ace-internal").Ace.Command[]} */ +/**@type {import("../../interfaces").Command[]} */ exports.commands = [{ name: "showSettingsMenu", description: "Show settings menu", diff --git a/src/commands/multi_select_commands.js b/src/commands/multi_select_commands.js index 3635c8bc119..a374dff700a 100644 --- a/src/commands/multi_select_commands.js +++ b/src/commands/multi_select_commands.js @@ -1,7 +1,7 @@ /** * commands to enter multiselect mode - * @type {import("../../ace-internal").Ace.Command[]} + * @type {import("../../interfaces").Command[]} */ exports.defaultCommands = [{ name: "addCursorAbove", @@ -92,7 +92,7 @@ exports.defaultCommands = [{ /** * commands active only in multiselect mode - * @type {import("../../ace-internal").Ace.Command[]} + * @type {import("../../interfaces").Command[]} */ exports.multiSelectCommands = [{ name: "singleSelection", diff --git a/src/config.js b/src/config.js index a00a27ff614..c63497cc045 100644 --- a/src/config.js +++ b/src/config.js @@ -7,7 +7,7 @@ var AppConfig = require("./lib/app_config").AppConfig; module.exports = exports = new AppConfig(); -/** @type {import("../ace-internal").Ace.ConfigOptions} */ +/** @type {import("../interfaces").ConfigOptions} */ var options = { packaged: false, workerPath: null, @@ -22,9 +22,9 @@ var options = { }; /** - * @template {keyof import("../ace-internal").Ace.ConfigOptions} K + * @template {keyof import("../interfaces").ConfigOptions} K * @param {K} key - The key of the config option to retrieve. - * @returns {import("../ace-internal").Ace.ConfigOptions[K]} - The value of the config option. + * @returns {import("../interfaces").ConfigOptions[K]} - The value of the config option. */ exports.get = function(key) { if (!options.hasOwnProperty(key)) @@ -33,9 +33,9 @@ exports.get = function(key) { }; /** - * @template {keyof import("../ace-internal").Ace.ConfigOptions} K + * @template {keyof import("../interfaces").ConfigOptions} K * @param {K} key - * @param {import("../ace-internal").Ace.ConfigOptions[K]} value + * @param {import("../interfaces").ConfigOptions[K]} value */ exports.set = function(key, value) { if (options.hasOwnProperty(key)) @@ -46,7 +46,7 @@ exports.set = function(key, value) { dom.useStrictCSP(value); }; /** - * @return {import("../ace-internal").Ace.ConfigOptions} + * @return {import("../interfaces").ConfigOptions} */ exports.all = function() { return lang.copyObject(options); diff --git a/src/document.js b/src/document.js index 8501e1027fc..539207df8d4 100644 --- a/src/document.js +++ b/src/document.js @@ -1,10 +1,10 @@ "use strict"; /** - * @typedef {import("../ace-internal").Ace.Delta} Delta - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.IRange} IRange - * @typedef {import("../ace-internal").Ace.NewLineMode} NewLineMode + * @typedef {import("../interfaces").Delta} Delta + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").IRange} IRange + * @typedef {import("../interfaces").NewLineMode} NewLineMode */ var oop = require("./lib/oop"); var applyDelta = require("./apply_delta").applyDelta; diff --git a/src/edit_session.js b/src/edit_session.js index 292e31c7cab..3d50cdb34cc 100644 --- a/src/edit_session.js +++ b/src/edit_session.js @@ -2,11 +2,11 @@ /** * @typedef {import("./layer/font_metrics").FontMetrics} FontMetrics * @typedef {import("./edit_session/fold_line").FoldLine} FoldLine - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.Delta} Delta - * @typedef {import("../ace-internal").Ace.IRange} IRange - * @typedef {import("../ace-internal").Ace.SyntaxMode} SyntaxMode - * @typedef {import("../ace-internal").Ace.LineWidget} LineWidget + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").Delta} Delta + * @typedef {import("../interfaces").IRange} IRange + * @typedef {import("../interfaces").SyntaxMode} SyntaxMode + * @typedef {import("../interfaces").LineWidget} LineWidget */ var oop = require("./lib/oop"); @@ -90,7 +90,7 @@ class EditSession { } $initOperationListeners() { - /**@type {import("../ace-internal").Ace.Operation | null}*/ + /**@type {import("../interfaces").Operation | null}*/ this.curOp = null; this.on("change", () => { if (!this.curOp) { @@ -407,7 +407,7 @@ class EditSession { /** * 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-internal").Ace.Token[]} + * @returns {import("../interfaces").Token[]} **/ getTokens(row) { return this.bgTokenizer.getTokens(row); @@ -417,7 +417,7 @@ class EditSession { * 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-internal").Ace.Token} + * @returns {import("../interfaces").Token} * **/ getTokenAt(row, column) { @@ -651,7 +651,7 @@ class EditSession { * 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-internal").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 {import("../interfaces").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 @@ -681,10 +681,10 @@ class EditSession { /** * Adds a dynamic marker to the session. - * @param {import("../ace-internal").Ace.MarkerLike} marker object with update method + * @param {import("../interfaces").MarkerLike} marker object with update method * @param {Boolean} [inFront] Set to `true` to establish a front marker * - * @return {import("../ace-internal").Ace.MarkerLike} The added marker + * @return {import("../interfaces").MarkerLike} The added marker **/ addDynamicMarker(marker, inFront) { if (!marker.update) @@ -722,7 +722,7 @@ class EditSession { * 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-internal").Ace.MarkerLike}} + * @returns {{[id: number]: import("../interfaces").MarkerLike}} **/ getMarkers(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; @@ -771,7 +771,7 @@ class EditSession { */ /** * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - * @param {import("../ace-internal").Ace.Annotation[]} annotations A list of annotations + * @param {import("../interfaces").Annotation[]} annotations A list of annotations **/ setAnnotations(annotations) { this.$annotations = annotations; @@ -780,7 +780,7 @@ class EditSession { /** * Returns the annotations for the `EditSession`. - * @returns {import("../ace-internal").Ace.Annotation[]} + * @returns {import("../interfaces").Annotation[]} **/ getAnnotations() { return this.$annotations || []; @@ -867,7 +867,7 @@ class EditSession { /** * {:Document.setNewLineMode.desc} - * @param {import("../ace-internal").Ace.NewLineMode} newLineMode {:Document.setNewLineMode.param} + * @param {import("../interfaces").NewLineMode} newLineMode {:Document.setNewLineMode.param} * * * @related Document.setNewLineMode @@ -879,7 +879,7 @@ class EditSession { /** * * Returns the current new line mode. - * @returns {import("../ace-internal").Ace.NewLineMode} + * @returns {import("../interfaces").NewLineMode} * @related Document.getNewLineMode **/ getNewLineMode() { @@ -2562,7 +2562,7 @@ EditSession.prototype.$wrapLimitRange = { }; /** * - * @type {null | import("../ace-internal").Ace.LineWidget[]} + * @type {null | import("../interfaces").LineWidget[]} */ EditSession.prototype.lineWidgets = null; EditSession.prototype.isFullWidth = isFullWidth; diff --git a/src/edit_session/bracket_match.js b/src/edit_session/bracket_match.js index abc872ba174..90617a72bba 100644 --- a/src/edit_session/bracket_match.js +++ b/src/edit_session/bracket_match.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../edit_session").EditSession} EditSession - * @typedef {import("../edit_session").Point} Point + * @typedef {import("../../interfaces").Point} Point */ var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; diff --git a/src/edit_session/fold.js b/src/edit_session/fold.js index fe2b9d5dc6c..c46512dfdcf 100644 --- a/src/edit_session/fold.js +++ b/src/edit_session/fold.js @@ -2,8 +2,8 @@ /** * @typedef {import("./fold_line").FoldLine} FoldLine * @typedef {import("../range").Range} Range - * @typedef {import("../../ace-internal").Ace.Point} Point - * @typedef {import("../../ace-internal").Ace.IRange} IRange + * @typedef {import("../../interfaces").Point} Point + * @typedef {import("../../interfaces").IRange} IRange */ var RangeList = require("../range_list").RangeList; diff --git a/src/edit_session/fold_line.js b/src/edit_session/fold_line.js index 892fd128e73..0cb465517d3 100644 --- a/src/edit_session/fold_line.js +++ b/src/edit_session/fold_line.js @@ -243,7 +243,7 @@ class FoldLine { /** * @param {number} idx - * @return {import("../../ace-internal").Ace.Point} + * @return {import("../../interfaces").Point} */ idxToPosition(idx) { var lastFoldEndColumn = 0; diff --git a/src/edit_session/folding.js b/src/edit_session/folding.js index 2951d695c76..01f5a6eacfb 100644 --- a/src/edit_session/folding.js +++ b/src/edit_session/folding.js @@ -8,8 +8,8 @@ var TokenIterator = require("../token_iterator").TokenIterator; var MouseEvent = require("../mouse/mouse_event").MouseEvent; /** - * @typedef {import("../edit_session").EditSession & import("../../ace-internal").Ace.Folding} IFolding - * @typedef {import("../../ace-internal").Ace.Delta } Delta + * @typedef {import("../edit_session").EditSession & import("../../interfaces").Folding} IFolding + * @typedef {import("../../interfaces").Delta } Delta */ /** @@ -477,7 +477,7 @@ function Folding() { /** * - * @param {number|null|import("../../ace-internal").Ace.Point|Range|Range[]} [location] + * @param {number|null|import("../../interfaces").Point|Range|Range[]} [location] * @param {boolean} [expandInner] * @return {Fold[]| undefined} */ @@ -842,7 +842,7 @@ function Folding() { }; /** - * @param {import("../../ace-internal").Ace.FoldMode} foldMode + * @param {import("../../interfaces").FoldMode} foldMode */ this.$setFolding = function(foldMode) { if (this.$foldMode == foldMode) diff --git a/src/editor.js b/src/editor.js index db888515deb..83c4a05a023 100644 --- a/src/editor.js +++ b/src/editor.js @@ -3,8 +3,8 @@ /** * @typedef {import("./virtual_renderer").VirtualRenderer} VirtualRenderer * @typedef {import("./selection").Selection} Selection - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.SearchOptions} SearchOptions + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").SearchOptions} SearchOptions */ var oop = require("./lib/oop"); @@ -43,7 +43,7 @@ class Editor { * * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything * @param {EditSession} [session] The `EditSession` to refer to - * @param {Partial} [options] The default options + * @param {Partial} [options] The default options **/ constructor(renderer, session, options) { /**@type{EditSession}*/this.session; @@ -208,7 +208,7 @@ class Editor { /** * Sets a new key handler, such as "vim" or "windows". - * @param {String | import("../ace-internal").Ace.KeyboardHandler | null} keyboardHandler The new key handler + * @param {String | import("../interfaces").KeyboardHandler | null} keyboardHandler The new key handler * @param {() => void} [cb] **/ setKeyboardHandler(keyboardHandler, cb) { @@ -423,7 +423,7 @@ class Editor { /** * {:VirtualRenderer.setTheme} - * @param {string | import("../ace-internal").Ace.Theme} theme The path to a theme + * @param {string | import("../interfaces").Theme} theme The path to a theme * @param {() => void} [cb] optional callback called when theme is loaded **/ setTheme(theme, cb) { @@ -604,7 +604,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 + * @param {import("../interfaces").Delta} delta Contains a single property, `data`, which has the delta of changes * @internal **/ onDocumentChange(delta) { @@ -1155,7 +1155,7 @@ class Editor { /** * Returns the current selection style. - * @returns {import("../ace-internal").Ace.EditorOptions["selectionStyle"]} + * @returns {import("../interfaces").EditorOptions["selectionStyle"]} **/ getSelectionStyle() { return this.getOption("selectionStyle"); @@ -2558,7 +2558,7 @@ class Editor { } /** - * @param {import("../ace-internal").Ace.IRange} range + * @param {import("../interfaces").IRange} range * @param {string} [replacement] */ $tryReplace(range, replacement) { diff --git a/src/ext/code_lens.js b/src/ext/code_lens.js index 44748bec7b5..43a4a356534 100644 --- a/src/ext/code_lens.js +++ b/src/ext/code_lens.js @@ -109,7 +109,7 @@ function clearCodeLensWidgets(session) { /** * * @param {EditSession} session - * @param {import("../../ace-internal").Ace.CodeLense[]} lenses + * @param {import("../../interfaces").CodeLense[]} lenses * @return {number} */ exports.setLenses = function(session, lenses) { @@ -209,7 +209,7 @@ function detachFromEditor(editor) { /** * @param {import("../editor").Editor} editor - * @param {import("../../ace-internal").Ace.CodeLenseProvider} codeLensProvider + * @param {import("../../interfaces").CodeLenseProvider} codeLensProvider */ exports.registerCodeLensProvider = function(editor, codeLensProvider) { editor.setOption("enableCodeLens", true); diff --git a/src/ext/command_bar.js b/src/ext/command_bar.js index 4ee68c31e07..a0210346ad8 100644 --- a/src/ext/command_bar.js +++ b/src/ext/command_bar.js @@ -1,6 +1,6 @@ /** * @typedef {import("../editor").Editor} Editor - * @typedef {import("../../ace-internal").Ace.TooltipCommand} TooltipCommand + * @typedef {import("../../interfaces").TooltipCommand} TooltipCommand */ var Tooltip = require("../tooltip").Tooltip; var EventEmitter = require("../lib/event_emitter").EventEmitter; @@ -53,7 +53,7 @@ var keyDisplayMap = { class CommandBarTooltip { /** * @param {HTMLElement} parentNode - * @param {Partial} [options] + * @param {Partial} [options] */ constructor(parentNode, options) { options = options || {}; diff --git a/src/ext/hardwrap.js b/src/ext/hardwrap.js index cc545ac98be..12c9f77a9a8 100644 --- a/src/ext/hardwrap.js +++ b/src/ext/hardwrap.js @@ -4,7 +4,7 @@ var Range = require("../range").Range; /** * @param {import("../editor").Editor} editor - * @param {import("../../ace-internal").Ace.HardWrapOptions} options + * @param {import("../../interfaces").HardWrapOptions} options */ function hardWrap(editor, options) { var max = options.column || editor.getOption("printMarginColumn"); diff --git a/src/ext/inline_autocomplete.js b/src/ext/inline_autocomplete.js index 67edac3c7fd..2c28a08283a 100644 --- a/src/ext/inline_autocomplete.js +++ b/src/ext/inline_autocomplete.js @@ -65,7 +65,7 @@ class InlineAutocomplete { /** * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; - * @param {import("../../ace-internal").Ace.CompletionOptions} options + * @param {import("../../interfaces").CompletionOptions} options */ show(options) { this.activated = true; @@ -121,7 +121,7 @@ class InlineAutocomplete { } /** - * @param {import("../../ace-internal").Ace.InlineAutocompleteAction} where + * @param {import("../../interfaces").InlineAutocompleteAction} where */ goTo(where) { if (!this.completions || !this.completions.filtered) { @@ -153,7 +153,7 @@ class InlineAutocomplete { /** * @param {number} [index] - * @returns {import("../../ace-internal").Ace.Completion | undefined} + * @returns {import("../autocomplete").Completion | undefined} */ getData(index) { if (index == undefined || index === null) { @@ -223,7 +223,7 @@ class InlineAutocomplete { } /** - * @param {import("../../ace-internal").Ace.CompletionOptions} [options] + * @param {import("../../interfaces").CompletionOptions} [options] */ updateCompletions(options) { var prefix = ""; @@ -327,7 +327,7 @@ class InlineAutocomplete { /** * - * @type {{[key: string]: import("../../ace-internal").Ace.Command}} + * @type {{[key: string]: import("../../interfaces").Command}} */ InlineAutocomplete.prototype.commands = { "Previous": { diff --git a/src/ext/language_tools.js b/src/ext/language_tools.js index b34a8a6680d..06b69a7a936 100644 --- a/src/ext/language_tools.js +++ b/src/ext/language_tools.js @@ -7,7 +7,7 @@ var lang = require("../lib/lang"); var util = require("../autocomplete/util"); var textCompleter = require("../autocomplete/text_completer"); -/**@type {import("../../ace-internal").Ace.Completer}*/ +/**@type {import("../../interfaces").Completer}*/ var keyWordCompleter = { getCompletions: function(editor, session, pos, prefix, callback) { if (session.$mode.completer) { @@ -32,7 +32,7 @@ var transformSnippetTooltip = function(str) { return record[p1]; }); }; -/**@type {import("../../ace-internal").Ace.Completer} */ +/**@type {import("../../interfaces").Completer} */ var snippetCompleter = { getCompletions: function(editor, session, pos, prefix, callback) { var scopes = []; diff --git a/src/ext/rtl.js b/src/ext/rtl.js index 7c8e1f60edb..da59a4c85fc 100644 --- a/src/ext/rtl.js +++ b/src/ext/rtl.js @@ -93,7 +93,7 @@ function onCommandEmitted(commadEvent) { * Whenever the document is changed make sure that line break operatin * on right-to-left line (like pressing Enter or pasting multi-line text) * produces new right-to-left lines - * @param {import("../../ace-internal").Ace.Delta} delta + * @param {import("../../interfaces").Delta} delta * @param {Editor} editor */ function onChange(delta, editor) { diff --git a/src/ext/simple_tokenizer.js b/src/ext/simple_tokenizer.js index c5e88f64e6b..9231f4a40bc 100644 --- a/src/ext/simple_tokenizer.js +++ b/src/ext/simple_tokenizer.js @@ -15,7 +15,7 @@ class SimpleTokenizer { /** * @param {number} row - * @returns {import("../../ace-internal").Ace.Token[]} + * @returns {import("../../interfaces").Token[]} */ getTokens(row) { const line = this._lines[row]; @@ -40,8 +40,8 @@ class SimpleTokenizer { * 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-internal").Ace.HighlightRules} highlightRules defining the language grammar - * @returns {import("../../ace-internal").Ace.TokenizeResult} tokenization result containing a list of token for each of the lines from content + * @param {import("../../interfaces").HighlightRules} highlightRules defining the language grammar + * @returns {import("../../interfaces").TokenizeResult} tokenization result containing a list of token for each of the lines from content */ function tokenize(content, highlightRules) { const tokenizer = new SimpleTokenizer(content, new Tokenizer(highlightRules.getRules())); diff --git a/src/ext/static_highlight.js b/src/ext/static_highlight.js index ada36bfc023..46fdfe495e4 100644 --- a/src/ext/static_highlight.js +++ b/src/ext/static_highlight.js @@ -1,7 +1,7 @@ "use strict"; /** - * @typedef {import("../../ace-internal").Ace.SyntaxMode} SyntaxMode - * @typedef {import("../../ace-internal").Ace.Theme} Theme + * @typedef {import("../../interfaces").SyntaxMode} SyntaxMode + * @typedef {import("../../interfaces").Theme} Theme */ @@ -82,7 +82,7 @@ SimpleTextLayer.prototype = TextLayer.prototype; /** * * @param {HTMLElement} el - * @param {import("../../ace-internal").Ace.StaticHighlightOptions} opts + * @param {import("../../interfaces").StaticHighlightOptions} opts * @param [callback] * @returns {boolean} */ diff --git a/src/keyboard/hash_handler.js b/src/keyboard/hash_handler.js index fb9eca6afdb..9241476a3ef 100644 --- a/src/keyboard/hash_handler.js +++ b/src/keyboard/hash_handler.js @@ -1,8 +1,8 @@ "use strict"; /** - * @typedef {import("../../ace-internal").Ace.Command} Command - * @typedef {import("../../ace-internal").Ace.CommandLike} CommandLike + * @typedef {import("../../interfaces").Command} Command + * @typedef {import("../../interfaces").CommandLike} CommandLike */ /** @type {any} */var keyUtil = require("../lib/keys"); diff --git a/src/keyboard/keybinding.js b/src/keyboard/keybinding.js index 16cff02b4de..0f9f6c2de9f 100644 --- a/src/keyboard/keybinding.js +++ b/src/keyboard/keybinding.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../editor").Editor} Editor - * @typedef {import("../../ace-internal").Ace.KeyboardHandler} KeyboardHandler + * @typedef {import("../../interfaces").KeyboardHandler} KeyboardHandler */ var keyUtil = require("../lib/keys"); var event = require("../lib/event"); diff --git a/src/layer/cursor.js b/src/layer/cursor.js index 873f8022949..964e0d78736 100644 --- a/src/layer/cursor.js +++ b/src/layer/cursor.js @@ -171,7 +171,7 @@ class Cursor { } /** - * @param {import("../../ace-internal").Ace.Point} [position] + * @param {import("../../interfaces").Point} [position] * @param {boolean} [onScreen] */ getPixelPosition(position, onScreen) { diff --git a/src/layer/gutter.js b/src/layer/gutter.js index 0b0e922f527..b70df8ded18 100644 --- a/src/layer/gutter.js +++ b/src/layer/gutter.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../edit_session").EditSession} EditSession - * @typedef {import("../../ace-internal").Ace.LayerConfig} LayerConfig + * @typedef {import("../../interfaces").LayerConfig} LayerConfig */ var dom = require("../lib/dom"); var oop = require("../lib/oop"); @@ -103,7 +103,7 @@ class Gutter{ } /** - * @param {import("../../ace-internal").Ace.Delta} delta + * @param {import("../../interfaces").Delta} delta */ $updateAnnotations(delta) { if (!this.$annotations.length) @@ -321,7 +321,7 @@ class Gutter{ /** * @param {any} cell * @param {LayerConfig} config - * @param {import("../../ace-internal").Ace.IRange | undefined} fold + * @param {import("../../interfaces").IRange | undefined} fold * @param {number} row */ $renderCell(cell, config, fold, row) { diff --git a/src/layer/lines.js b/src/layer/lines.js index ae0cb71e262..eacfbb62e54 100644 --- a/src/layer/lines.js +++ b/src/layer/lines.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../edit_session").EditSession} EditSession - * @typedef {import("../../ace-internal").Ace.LayerConfig} LayerConfig + * @typedef {import("../../interfaces").LayerConfig} LayerConfig */ var dom = require("../lib/dom"); diff --git a/src/layer/marker.js b/src/layer/marker.js index 3307c7b89b9..91f70aba0e8 100644 --- a/src/layer/marker.js +++ b/src/layer/marker.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("../edit_session").EditSession} EditSession - * @typedef {import("../../ace-internal").Ace.LayerConfig} LayerConfig + * @typedef {import("../../interfaces").LayerConfig} LayerConfig */ var Range = require("../range").Range; var dom = require("../lib/dom"); @@ -32,7 +32,7 @@ class Marker { } /** - * @param {{ [x: number]: import("../../ace-internal").Ace.MarkerLike; }} markers + * @param {{ [x: number]: import("../../interfaces").MarkerLike; }} markers */ setMarkers(markers) { this.markers = markers; diff --git a/src/layer/text.js b/src/layer/text.js index 3f0c992a786..71784d6da2c 100644 --- a/src/layer/text.js +++ b/src/layer/text.js @@ -1,6 +1,6 @@ "use strict"; /** - * @typedef {import("../../ace-internal").Ace.LayerConfig} LayerConfig + * @typedef {import("../../interfaces").LayerConfig} LayerConfig * @typedef {import("../edit_session").EditSession} EditSession */ var oop = require("../lib/oop"); @@ -699,8 +699,8 @@ class Text { /** * @param {number} row - * @param {import("../../ace-internal").Ace.FoldLine} foldLine - * @return {import("../../ace-internal").Ace.Token[]} + * @param {import("../edit_session/fold_line").FoldLine} foldLine + * @return {import("../../interfaces").Token[]} */ $getFoldLineTokens(row, foldLine) { var session = this.session; diff --git a/src/lib/app_config.js b/src/lib/app_config.js index 3b7e53765b7..3814463882e 100644 --- a/src/lib/app_config.js +++ b/src/lib/app_config.js @@ -72,7 +72,6 @@ class AppConfig { * @param {Object} obj * @param {string} path * @param {{ [key: string]: any }} options - * @returns {import("../../ace-internal").Ace.AppConfig} */ defineOptions(obj, path, options) { if (!obj.$options) diff --git a/src/line_widgets.js b/src/line_widgets.js index 238b2fb4f71..1c1d48865d0 100644 --- a/src/line_widgets.js +++ b/src/line_widgets.js @@ -3,7 +3,7 @@ * @typedef {import("./edit_session").EditSession} EditSession * @typedef {import("./editor").Editor} Editor * @typedef {import("./virtual_renderer").VirtualRenderer} VirtualRenderer - * @typedef {import("../ace-internal").Ace.LineWidget} LineWidget + * @typedef {import("../interfaces").LineWidget} LineWidget */ var dom = require("./lib/dom"); @@ -135,7 +135,7 @@ class LineWidgets { /** * - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta */ updateOnChange(delta) { var lineWidgets = this.session.lineWidgets; diff --git a/src/marker_group.js b/src/marker_group.js index 2775f843cc1..43ddec19084 100644 --- a/src/marker_group.js +++ b/src/marker_group.js @@ -2,7 +2,7 @@ /** * @typedef {import("./edit_session").EditSession} EditSession * @typedef {{range: import("./range").Range, className: string}} MarkerGroupItem - * @typedef {import("../ace-internal").Ace.LayerConfig} LayerConfig + * @typedef {import("../interfaces").LayerConfig} LayerConfig */ /** * @typedef {import("./layer/marker").Marker} Marker @@ -25,7 +25,7 @@ class MarkerGroup { constructor(session, options) { if (options) this.markerType = options.markerType; - /**@type {import("../ace-internal").Ace.MarkerGroupItem[]}*/ + /**@type {import("../interfaces").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("../interfaces").Point} pos + * @returns {import("../interfaces").MarkerGroupItem | undefined} */ getMarkerAtPosition(pos) { return this.markers.find(function(marker) { diff --git a/src/mode/behaviour/css.js b/src/mode/behaviour/css.js index 39da652cc38..7f4ec244915 100644 --- a/src/mode/behaviour/css.js +++ b/src/mode/behaviour/css.js @@ -4,7 +4,7 @@ var Behaviour = require("../behaviour").Behaviour; var CstyleBehaviour = require("./cstyle").CstyleBehaviour; var TokenIterator = require("../../token_iterator").TokenIterator; -/**@type {(new() => Partial)}*/ +/**@type {(new() => Partial)}*/ var CssBehaviour = function () { this.inherit(CstyleBehaviour); diff --git a/src/mode/behaviour/html.js b/src/mode/behaviour/html.js index da248493a3d..112a8486ede 100644 --- a/src/mode/behaviour/html.js +++ b/src/mode/behaviour/html.js @@ -3,7 +3,7 @@ var oop = require("../../lib/oop"); var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; -/**@type {(new() => Partial)}*/ +/**@type {(new() => Partial)}*/ var HtmlBehaviour = function () { XmlBehaviour.call(this); diff --git a/src/mode/behaviour/liquid.js b/src/mode/behaviour/liquid.js index abbc864ab36..def008921c7 100644 --- a/src/mode/behaviour/liquid.js +++ b/src/mode/behaviour/liquid.js @@ -10,7 +10,7 @@ return token && token.type.lastIndexOf(type + ".xml") > -1; } -/**@type {(new() => Partial)}*/ +/**@type {(new() => Partial)}*/ var LiquidBehaviour = function () { XmlBehaviour.call(this); this.add("autoBraceTagClosing","insertion", function (state, action, editor, session, text) { diff --git a/src/mode/behaviour/xml.js b/src/mode/behaviour/xml.js index 3b785a695a3..8eac611c3a0 100644 --- a/src/mode/behaviour/xml.js +++ b/src/mode/behaviour/xml.js @@ -8,7 +8,7 @@ function is(token, type) { return token && token.type.lastIndexOf(type + ".xml") > -1; } -/**@type {(new() => Partial)}*/ +/**@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 38bd9d399f6..5184a20f1f5 100644 --- a/src/mode/behaviour/xquery.js +++ b/src/mode/behaviour/xquery.js @@ -19,7 +19,7 @@ function hasType(token, type) { return hasType; } -/**@type {(new() => Partial)}*/ +/**@type {(new() => Partial)}*/ var XQueryBehaviour = function () { this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour diff --git a/src/mode/text.js b/src/mode/text.js index 7bdc201a8ee..1f1aa585b2b 100644 --- a/src/mode/text.js +++ b/src/mode/text.js @@ -1,6 +1,6 @@ "use strict"; /** - * @typedef {import("../../ace-internal").Ace.SyntaxMode} SyntaxMode + * @typedef {import("../../interfaces").SyntaxMode} SyntaxMode */ var config = require("../config"); @@ -280,7 +280,7 @@ Mode = function() { var functionName = delegations[i]; var defaultHandler = scope[functionName]; scope[delegations[i]] = - /** @this {import("../../ace-internal").Ace.SyntaxMode} */ + /** @this {import("../../interfaces").SyntaxMode} */ function () { return this.$delegator(functionName, arguments, defaultHandler); }; diff --git a/src/mode/text_highlight_rules.js b/src/mode/text_highlight_rules.js index a866846445e..889d947a956 100644 --- a/src/mode/text_highlight_rules.js +++ b/src/mode/text_highlight_rules.js @@ -2,7 +2,7 @@ const deepCopy = require("../lib/deep_copy").deepCopy; -/**@type {(new() => Partial) & {prototype: import("../../ace-internal").Ace.HighlightRules}}*/ +/**@type {(new() => Partial) & {prototype: import("../../interfaces").HighlightRules}}*/ var TextHighlightRules; TextHighlightRules = function() { @@ -22,9 +22,9 @@ TextHighlightRules = function() { (function() { /** - * @param {import("../../ace-internal").Ace.HighlightRulesMap} rules + * @param {import("../../interfaces").HighlightRulesMap} rules * @param {string} [prefix] - * @this {import("../../ace-internal").Ace.HighlightRules} + * @this {import("../../interfaces").HighlightRules} */ this.addRules = function(rules, prefix) { if (!prefix) { @@ -50,8 +50,8 @@ TextHighlightRules = function() { }; /** - * @returns {import("../../ace-internal").Ace.HighlightRulesMap} - * @this {import("../../ace-internal").Ace.HighlightRules} + * @returns {import("../../interfaces").HighlightRulesMap} + * @this {import("../../interfaces").HighlightRules} */ this.getRules = function() { return this.$rules; @@ -63,7 +63,7 @@ TextHighlightRules = function() { * @param escapeRules * @param states * @param append - * @this {import("../../ace-internal").Ace.HighlightRules} + * @this {import("../../interfaces").HighlightRules} */ this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { var embedRules = typeof HighlightRules == "function" @@ -92,7 +92,7 @@ TextHighlightRules = function() { }; /** - * @this {import("../../ace-internal").Ace.HighlightRules} + * @this {import("../../interfaces").HighlightRules} */ this.getEmbeds = function() { return this.$embeds; @@ -110,7 +110,7 @@ TextHighlightRules = function() { }; /** - * @this {import("../../ace-internal").Ace.HighlightRules} + * @this {import("../../interfaces").HighlightRules} */ this.normalizeRules = function() { var id = 0; @@ -229,7 +229,7 @@ TextHighlightRules = function() { }; /** - * @this {import("../../ace-internal").Ace.HighlightRules} + * @this {import("../../interfaces").HighlightRules} */ this.getKeywords = function() { return this.$keywords; diff --git a/src/mouse/default_handlers.js b/src/mouse/default_handlers.js index d04954df8a9..7e0e161b8d1 100644 --- a/src/mouse/default_handlers.js +++ b/src/mouse/default_handlers.js @@ -79,7 +79,7 @@ class DefaultHandlers { /** * - * @param {import("../../ace-internal").Ace.Position} [pos] + * @param {import("../../interfaces").Position} [pos] * @param {boolean} [waitForClickSelection] * @this {MouseHandler} */ diff --git a/src/multi_select.js b/src/multi_select.js index d2a39007522..30cf40f3d78 100644 --- a/src/multi_select.js +++ b/src/multi_select.js @@ -1,7 +1,7 @@ /** * @typedef {import("./anchor").Anchor} Anchor - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.ScreenCoordinates} ScreenCoordinates + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").ScreenCoordinates} ScreenCoordinates */ var RangeList = require("./range_list").RangeList; @@ -590,7 +590,7 @@ var Editor = require("./editor").Editor; /** * Finds and selects all the occurrences of `needle`. * @param {String} [needle] The text to find - * @param {Partial} [options] The search options + * @param {Partial} [options] The search options * @param {Boolean} [additive] keeps * * @returns {Number} The cumulative count of all found matches diff --git a/src/occur.js b/src/occur.js index 734cd07b86e..031448b00aa 100644 --- a/src/occur.js +++ b/src/occur.js @@ -1,8 +1,8 @@ "use strict"; /** * @typedef {import("./editor").Editor} Editor - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.SearchOptions} SearchOptions + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").SearchOptions} SearchOptions */ var oop = require("./lib/oop"); diff --git a/src/placeholder.js b/src/placeholder.js index 2f3548b54ef..17fa1b486bf 100644 --- a/src/placeholder.js +++ b/src/placeholder.js @@ -10,7 +10,7 @@ class PlaceHolder { /** * @param {EditSession} session * @param {Number} length - * @param {import("../ace-internal").Ace.Point} pos + * @param {import("../interfaces").Point} pos * @param {any[]} others * @param {String} mainClass * @param {String} othersClass @@ -105,7 +105,7 @@ class PlaceHolder { * PlaceHolder@onUpdate(e) * * Emitted when the place holder updates. - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta * @internal */ onUpdate(delta) { @@ -146,7 +146,7 @@ class PlaceHolder { } /** - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta */ updateAnchors(delta) { this.pos.onChange(delta); diff --git a/src/range.js b/src/range.js index 321ad67d2d6..44a0e8020d2 100644 --- a/src/range.js +++ b/src/range.js @@ -2,8 +2,8 @@ /** * @typedef {import("./edit_session").EditSession} EditSession - * @typedef {import("../ace-internal").Ace.IRange} IRange - * @typedef {import("../ace-internal").Ace.Point} Point + * @typedef {import("../interfaces").IRange} IRange + * @typedef {import("../interfaces").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. diff --git a/src/range_list.js b/src/range_list.js index 463aea29a9e..a6f952fc372 100644 --- a/src/range_list.js +++ b/src/range_list.js @@ -1,9 +1,12 @@ "use strict"; /** * @typedef {import("./edit_session").EditSession} EditSession - * @typedef {import("../ace-internal").Ace.Point} Point + * @typedef {import("../interfaces").Point} Point */ var Range = require("./range").Range; +/** + * @type {(p1: Point, p2: Point) => number} + */ var comparePoints = Range.comparePoints; class RangeList { @@ -187,7 +190,7 @@ class RangeList { } /** - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta */ $onChange(delta) { var start = delta.start; diff --git a/src/search.js b/src/search.js index 17a7c63222d..4f584413ae7 100644 --- a/src/search.js +++ b/src/search.js @@ -1,7 +1,7 @@ "use strict"; /** * @typedef {import("./edit_session").EditSession} EditSession - * @typedef {import("../ace-internal").Ace.SearchOptions} SearchOptions + * @typedef {import("../interfaces").SearchOptions} SearchOptions */ var lang = require("./lib/lang"); var oop = require("./lib/oop"); diff --git a/src/search_highlight.js b/src/search_highlight.js index 6a5e864c74d..3a21b0def2d 100644 --- a/src/search_highlight.js +++ b/src/search_highlight.js @@ -28,7 +28,7 @@ class SearchHighlight { * @param {any} html * @param {Marker} markerLayer * @param {EditSession} session - * @param {Partial} config + * @param {Partial} config */ update(html, markerLayer, session, config) { if (!this.regExp) diff --git a/src/selection.js b/src/selection.js index 6ab284305af..d9aa3c5bee8 100644 --- a/src/selection.js +++ b/src/selection.js @@ -7,7 +7,7 @@ var Range = require("./range").Range; /** * @typedef {import("./edit_session").EditSession} EditSession * @typedef {import("./anchor").Anchor} Anchor - * @typedef {import("../ace-internal").Ace.Point} Point + * @typedef {import("../interfaces").Point} Point */ class Selection { @@ -153,7 +153,7 @@ class Selection { /** * Sets the selection to the provided range. - * @param {import("../ace-internal").Ace.IRange} range The range of text to select + * @param {import("../interfaces").IRange} range The range of text to select * @param {Boolean} [reverse] Indicates if the range should go backwards (`true`) or not **/ setRange(range, reverse) { diff --git a/src/split.js b/src/split.js index c1a8cbdcb66..0b845452bcc 100644 --- a/src/split.js +++ b/src/split.js @@ -8,7 +8,7 @@ var Renderer = require("./virtual_renderer").VirtualRenderer; var EditSession = require("./edit_session").EditSession; /** - * @typedef {import("../ace-internal").Ace.EventEmitter & {[key: string]: any}} ISplit + * @typedef {import("../interfaces").EventEmitter & {[key: string]: any}} ISplit */ var Split; diff --git a/src/token_iterator.js b/src/token_iterator.js index 3e3ffee8854..8069888a2bb 100644 --- a/src/token_iterator.js +++ b/src/token_iterator.js @@ -26,7 +26,7 @@ class TokenIterator { /** * Moves iterator position to the start of previous token. - * @returns {import("../ace-internal").Ace.Token|null} + * @returns {import("../interfaces").Token|null} **/ stepBackward() { this.$tokenIndex -= 1; @@ -47,7 +47,7 @@ class TokenIterator { /** * Moves iterator position to the start of next token. - * @returns {import("../ace-internal").Ace.Token|null} + * @returns {import("../interfaces").Token|null} **/ stepForward() { this.$tokenIndex += 1; @@ -71,7 +71,7 @@ class TokenIterator { /** * * Returns current token. - * @returns {import("../ace-internal").Ace.Token} + * @returns {import("../interfaces").Token} **/ getCurrentToken() { return this.$rowTokens[this.$tokenIndex]; @@ -111,7 +111,7 @@ class TokenIterator { /** * Return the current token position. - * @returns {import("../ace-internal").Ace.Point} + * @returns {import("../interfaces").Point} */ getCurrentTokenPosition() { return {row: this.$row, column: this.getCurrentTokenColumn()}; diff --git a/src/tokenizer.js b/src/tokenizer.js index 900651d7ca3..21280de9fcf 100644 --- a/src/tokenizer.js +++ b/src/tokenizer.js @@ -111,7 +111,7 @@ class Tokenizer { /** * @param {string} str - * @return {import("../ace-internal").Ace.Token[]} + * @return {import("../interfaces").Token[]} */ $applyToken(str) { var values = this.splitRegex.exec(str).slice(1); @@ -135,7 +135,7 @@ class Tokenizer { /** * @param {string} str - * @return {import("../ace-internal").Ace.Token[] | string} + * @return {import("../interfaces").Token[] | string} */ $arrayTokens(str) { if (!str) @@ -215,7 +215,7 @@ class Tokenizer { * 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-internal").Ace.Token[], state: string|string[]}} + * @returns {{tokens:import("../interfaces").Token[], state: string|string[]}} */ getLineTokens(line, startState) { if (startState && typeof startState != "string") { diff --git a/src/tooltip.js b/src/tooltip.js index f0f69951739..d67997ec41a 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -68,7 +68,7 @@ class Tooltip { } /** - * @param {import("../ace-internal").Ace.Theme} theme + * @param {import("../interfaces").Theme} theme */ setTheme(theme) { this.$element.className = CLASSNAME + " " + diff --git a/src/undomanager.js b/src/undomanager.js index 92c40fd3800..1a7a95f469b 100644 --- a/src/undomanager.js +++ b/src/undomanager.js @@ -1,9 +1,9 @@ "use strict"; /** * @typedef {import("./edit_session").EditSession} EditSession - * @typedef {import("../ace-internal").Ace.Delta} Delta - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.IRange} IRange + * @typedef {import("../interfaces").Delta} Delta + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").IRange} IRange */ /** @@ -35,7 +35,7 @@ class UndoManager { * - `args[0]` is an array of deltas * - `args[1]` is the document to associate with * - * @param {import("../ace-internal").Ace.Delta} delta + * @param {import("../interfaces").Delta} delta * @param {boolean} allowMerge * @param {EditSession} [session] **/ @@ -121,7 +121,7 @@ class UndoManager { * * @param {number} from * @param {number} [to] - * @return {import("../ace-internal").Ace.Delta[]} + * @return {import("../interfaces").Delta[]} */ getDeltas(from, to) { if (to == null) to = this.$rev + 1; diff --git a/src/virtual_renderer.js b/src/virtual_renderer.js index 6efa58d7d6b..fee19278d55 100644 --- a/src/virtual_renderer.js +++ b/src/virtual_renderer.js @@ -1,8 +1,8 @@ "use strict"; /** * @typedef {import("./edit_session").EditSession} EditSession - * @typedef {import("../ace-internal").Ace.Point} Point - * @typedef {import("../ace-internal").Ace.Theme} Theme + * @typedef {import("../interfaces").Point} Point + * @typedef {import("../interfaces").Theme} Theme */ var oop = require("./lib/oop"); var dom = require("./lib/dom"); @@ -1285,7 +1285,7 @@ class VirtualRenderer { /** * Sets annotations for the gutter. - * @param {import("../ace-internal").Ace.Annotation[]} annotations An array containing annotations + * @param {import("../interfaces").Annotation[]} annotations An array containing annotations * **/ setAnnotations(annotations) { @@ -1620,7 +1620,7 @@ class VirtualRenderer { * * @param {number} x * @param {number} y - * @returns {import("../ace-internal").Ace.ScreenCoordinates} + * @returns {import("../interfaces").ScreenCoordinates} */ pixelToScreenCoordinates(x, y) { @@ -2104,9 +2104,9 @@ class VirtualRenderer { delete this.$scrollDecorator; } if (val === true) { - /**@type {import("../ace-internal").Ace.VScrollbar}*/ + /**@type {import("../interfaces").VScrollbar}*/ this.scrollBarV = new VScrollBarCustom(this.container, this); - /**@type {import("../ace-internal").Ace.HScrollbar}*/ + /**@type {import("../interfaces").HScrollbar}*/ this.scrollBarH = new HScrollBarCustom(this.container, this); this.scrollBarV.setHeight(this.$size.scrollerHeight); this.scrollBarH.setWidth(this.$size.scrollerWidth); diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index abf37023292..3c286c8c8ac 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -1,11 +1,12 @@ const ts = require('typescript'); const fs = require("fs"); const path = require("path"); - -const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity +var {getAllFiles, cleanDeclarationFiles} = require("./fs_utilities"); const AUTO_GENERATED_HEADER = "/* This file is generated using `npm run update-types` */\n\n"; +const MODE_REFERENCE = "/// "; + const defaultFormatCodeSettings = { baseIndentSize: 0, indentSize: 4, @@ -47,24 +48,23 @@ function getParsedConfigFromDirectory(directoryPath) { }; 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); } /** - * @return {string} + * @return {Map} */ -function generateInitialDeclaration(excludeDir) { +function generateInitialDeclarations(excludeDir) { const baseDirectory = path.resolve(__dirname, '..'); const parsedConfig = getParsedConfigFromDirectory(baseDirectory); const defaultCompilerHost = ts.createCompilerHost({}); - let fileContent; + const fileContents = new Map(); const customCompilerHost = { ...defaultCompilerHost, writeFile: function (fileName, content) { - fileContent = content; + fileContents.set(fileName.replace(/src\/src/, "src"), content); return; }, getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { @@ -77,36 +77,39 @@ function generateInitialDeclaration(excludeDir) { const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options, customCompilerHost); program.emit(); - return fileContent; + return fileContents; } /** * 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. + * @param {Map} fileMap - A map of file paths to their corresponding content. * @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); +function createCustomCompilerHost(fileMap) { + const sourceFiles = new Map(); + for (const [filePath, content] of fileMap) { + sourceFiles.set( + filePath, ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS)); + } const defaultCompilerHost = ts.createCompilerHost({}); return { ...defaultCompilerHost, getSourceFile: (name, languageVersion) => { - if (name === fileName) { - return newSourceFile; + if (fileMap.has(name)) { + return sourceFiles.get(name); } return defaultCompilerHost.getSourceFile(name, languageVersion); }, fileExists: (name) => { - if (name === fileName) { + if (fileMap.has(name)) { return true; } return defaultCompilerHost.fileExists(name); }, readFile: (name) => { - if (name === fileName) { - return content; + if (fileMap.has(name)) { + return fileMap.get(name); } return defaultCompilerHost.readFile(name); } @@ -114,72 +117,53 @@ 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]; + return node.statements.map(statement => { + //create type alias for config + if (ts.isVariableStatement(statement) && statement.declarationList.declarations[0]?.name?.text === "config") { - const importTypeNode = ts.factory.createImportTypeNode( - ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral('ace-code/src/config')), undefined, - undefined, false - ); + const originalDeclaration = statement.declarationList.declarations[0]; - const typeOfImportTypeNode = ts.factory.createTypeOperatorNode( - ts.SyntaxKind.TypeOfKeyword, importTypeNode); + const importTypeNode = ts.factory.createImportTypeNode( + ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral('./config')), undefined, + undefined, false + ); - return ts.factory.updateVariableStatement(statement, statement.modifiers, - ts.factory.updateVariableDeclarationList(statement.declarationList, [ - ts.factory.updateVariableDeclaration(originalDeclaration, originalDeclaration.name, - originalDeclaration.exclamationToken, typeOfImportTypeNode, undefined - ) - ]) - ); - } - return statement; - }); + const typeOfImportTypeNode = ts.factory.createTypeOperatorNode(ts.SyntaxKind.TypeOfKeyword, importTypeNode); - return ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, - ts.factory.createModuleBlock(updatedStatements) - ); - } + return ts.factory.updateVariableStatement(statement, statement.modifiers, + ts.factory.updateVariableDeclarationList(statement.declarationList, [ + ts.factory.updateVariableDeclaration(originalDeclaration, originalDeclaration.name, + originalDeclaration.exclamationToken, typeOfImportTypeNode, undefined + ) + ]) + ); + } + return statement; + }); } /** - * 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. + * Updates a module declaration by adding internal statements to support mixins (EventEmitter, OptionsProvider, etc.). + * @param {ts.SourceFile} sourceFile - The module declaration node to update. + * @param {ts.Statement[]} statements - An object containing the internal statements to add to the module. + * @param {boolean} [replace] - Replace all statements if true, otherwise append them. + * @returns {ts.SourceFile} - The updated module declaration. + */ -function updateKeysAndLinksStatements(node, internalStatements) { - let statements = []; - if (internalStatements[node.name.text]) { - statements = internalStatements[node.name.text]; +function updateModuleWithInternalStatements(sourceFile, statements, replace) { + let newStatements; + if (replace) { + newStatements = statements; + } + else { + newStatements = [...sourceFile.statements, ...statements]; } - 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); + sourceFile = ts.factory.updateSourceFile(sourceFile, newStatements, sourceFile.isDeclarationFile, + sourceFile.referencedFiles, sourceFile.typeReferenceDirectives, sourceFile.hasNoDefaultLib, + sourceFile.libReferenceDirectives + ); + return sourceFile; } /** @@ -250,13 +234,12 @@ function fixWrongHeritageClauses(node, context, checker) { } /** - * @param {string} content + * @param {Map} sourcesByPath * @param {string} aceNamespacePath */ -function fixDeclaration(content, aceNamespacePath) { - const temporaryName = "temp.d.ts"; - const customCompilerHost = createCustomCompilerHost(temporaryName, content); - const program = ts.createProgram([temporaryName], { +function fixDeclarations(sourcesByPath, aceNamespacePath) { + const customCompilerHost = createCustomCompilerHost(sourcesByPath); + const program = ts.createProgram(Array.from(sourcesByPath.keys()), { noEmit: true }, customCompilerHost); @@ -274,164 +257,158 @@ function fixDeclaration(content, aceNamespacePath) { return (sourceFile) => { function visit(node) { let updatedNode = node; - // Update module declarations for certain module names - if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name)) { - 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); - })); - updatedNode = ts.factory.updateModuleDeclaration(node, node.modifiers, node.name, newBody); - } - } - } // Fix wrong interface and class heritage clauses - else if (ts.isInterfaceDeclaration(node) && node.heritageClauses) { + if (ts.isInterfaceDeclaration(node) && node.heritageClauses) { return fixWrongInterfaces(node, context); - } else if (ts.isClassDeclaration(node) && node.heritageClauses) { + } + else if (ts.isClassDeclaration(node) && node.heritageClauses) { return fixWrongHeritageClauses(node, context, checker); } return ts.visitEachChild(updatedNode, visit, context); }; + let modulePath = sourceFile.fileName.replace(/.+(?=src\/)/, ""); + + if (internalStatements[modulePath]) { + sourceFile = updateModuleWithInternalStatements(sourceFile, internalStatements[modulePath]); + } + else if (modulePath.endsWith("static_highlight.d.ts")) { + sourceFile = ts.factory.updateSourceFile(sourceFile, sourceFile.statements.filter(statement => { + return !ts.isExportAssignment(statement); + }), sourceFile.isDeclarationFile, sourceFile.referencedFiles, sourceFile.typeReferenceDirectives, + sourceFile.hasNoDefaultLib, sourceFile.libReferenceDirectives + ); + } + else if (modulePath.endsWith("/ace.d.ts")) { + sourceFile = updateModuleWithInternalStatements(sourceFile, updateMainAceModule(sourceFile), true); + } + return ts.visitNode(sourceFile, visit); }; } function pathBasedTransformer(context) { return (sourceFile) => { - const moduleOutputs = {}; + 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)) { + const isPrivate = node.modifiers?.some( + modifier => modifier.kind === ts.SyntaxKind.PrivateKeyword); - 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); + const startsWithDollar = ts.isIdentifier(node.name) && /^[$_]/.test(node.name.text); + + if (isPrivate || (startsWithDollar && !hasExternalTag(node)) || hasInternalTag(node)) { + return ts.factory.createNotEmittedStatement(node); + } } - else { - SEPARATE_MODULES.some(module => { - if (node.name.text.includes("/" + module + "/")) { - pathKey = module; - return true; + else if (ts.isVariableStatement(node)) { + if (node.text && node.getText().indexOf("declare 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) + && declaration.type.kind == ts.SyntaxKind.UndefinedKeyword) { + return false; } + return true; }); - if (!moduleOutputs[pathKey]) { - moduleOutputs[pathKey] = []; - } - moduleOutputs[pathKey].push(node); - } - - return node; - } - return ts.visitEachChild(node, visit, context); - } - - ts.visitNode(sourceFile, visit); - - // 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")); - if (!fs.existsSync(dirPath)) { - fs.mkdirSync(dirPath); - } - 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}, { - substituteNode(hint, node) { - if (ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name) && node.name.text === "ace-code/src/ext/textarea") { + if (filteredDeclarations.length === 0) { 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 && !hasExternalTag(node)) || hasInternalTag(node)) { - return ts.factory.createNotEmittedStatement(node); - } } - 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) - ); - } + 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())) { + } + //remove empty exports + else if (ts.isExportDeclaration(node)) { + if (node.exportClause && ts.isNamedExports(node.exportClause) + && node.exportClause.elements.length === 0) { return ts.factory.createNotEmittedStatement(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; } + }); + if (sourceFile.fileName.includes("src/") && !sourceFile.fileName.endsWith("lib/keys.d.ts") + && !sourceFile.fileName.endsWith("linking.d.ts") && !sourceFile.fileName.endsWith("textarea.d.ts")) { + let output = printer.printFile(sourceFile); output = correctImportStatements(output); + output = output.replace(/declare\s+(namespace)/g, "export $1"); output = cleanComments(output); - output = formatDts(outputName, output); + output = formatDts(sourceFile.fileName, output); + if (/\Wi\./.test(output)) { + const level = countSlashesAfterSrc(sourceFile.fileName); + output = `import * as i from "../${"../".repeat(level)}interfaces";\n\n ${output}`; + } + output = correctIndividualDeclaration(sourceFile, output, aceNamespacePath); output = AUTO_GENERATED_HEADER + output; - fs.writeFileSync(outputName, output); - }); - + fs.writeFileSync(sourceFile.fileName, output); + finalDeclarations.push(sourceFile.fileName); + } return sourceFile; }; } - const sourceCode = program.getSourceFile(temporaryName); - const result = ts.transform(sourceCode, [transformer, pathBasedTransformer]); + const result = ts.transform(program.getSourceFiles(), [transformer, pathBasedTransformer]); result.dispose(); - checkFinalDeclaration(finalDeclarations); + useTsQuickFix(finalDeclarations) + checkFinalDeclarations(finalDeclarations); } +/** + * This function is responsible for handling specific cases where the generated + * declaration files need to be modified. It checks the file name and applies + * the necessary changes to the output. + * + * @param {ts.SourceFile} sourceFile The TypeScript source file being processed. + * @param {string} content The content of the declaration file. + * @param {string} aceNamespacePath The path to the Ace namespace. + * @returns The corrected declaration file content. + */ +function correctIndividualDeclaration(sourceFile, content, aceNamespacePath) { + let output = content; + // copy the ace.d.ts file to the root of the project with ACE namespace for backwards compatibility + if (sourceFile.fileName.endsWith("/ace.d.ts")) { + const ace = cloneAceNamespace(aceNamespacePath, true); + const mainDeclaration = AUTO_GENERATED_HEADER + ace + `\nexport * from "./src/ace";`; + fs.writeFileSync(__dirname + "/../ace.d.ts", mainDeclaration); + } else + if (sourceFile.fileName.endsWith("/snippets.d.ts")) { + output = output.replace(/(interface SnippetManager)/, "declare $1"); + } else + if (sourceFile.fileName.endsWith("/static_highlight.d.ts")) { + output = output.replace(/declare\s+(function highlight)/, "export $1"); + } + return output; +} + + +function countSlashesAfterSrc(filepath) { + const srcIndex = filepath.indexOf('src/'); + if (srcIndex === -1) return 0; + + const pathAfterSrc = filepath.slice(srcIndex + 4); + return (pathAfterSrc.match(/\//g) || []).length; +} + + /** * Corrects the import statements in the provided text by replacing the old-style * `require()` imports with modern ES6 `import` statements. + * @param {string} text */ function correctImportStatements(text) { - text = text.replace( - /import\s*\w+_\d+\s*=\s*require\(([\w\/"-]+)\);?.\s*import\s*(\w+)\s*=\s*\w+_\d+\.(\w+);?/gs, + 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};`; @@ -439,12 +416,21 @@ function correctImportStatements(text) { return `import {${exportName}} from ${path};`; } ); + // replace unnecessary export types with import + text = text.replace(/export\s+type\s+(\w+)\s*=\s*import\(([\w\/"-.]+)\)\.(\w+);/g, + (match, importName, path, 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, ''); + text = text.replace(/@type\s*{[^}]+}/g, ''); text = text.replace(/\/\*(\s|\*)*\*\//g, ''); text = text.replace(/^\s*[\r\n]/gm, ''); @@ -467,34 +453,42 @@ function hasExternalTag(node) { return jsDocs.length > 0; } -function createMinimalLanguageServiceHost() { +/** + * @return {ts.LanguageServiceHost} + */ +function createMinimalLanguageServiceHost(filename, text) { + const snapshot = ts.ScriptSnapshot.fromString(text); + ; return { - files: {}, - addFile(fileName, text) { - this.files[fileName] = ts.ScriptSnapshot.fromString(text); - }, "getCompilationSettings": function () { return ts.getDefaultCompilerOptions(); }, "getScriptFileNames": function () { - return Object.keys(this.files); + return Object.keys([filename]); }, "getScriptVersion": function (_fileName) { return "0"; }, "getScriptSnapshot": function (fileName) { - return this.files[fileName]; + return snapshot; }, "getCurrentDirectory": function () { return ""; + }, + "fileExists": function (path) { + return path == filename; + }, + "readFile": function (path) { + return text; + }, + "getDefaultLibFileName": function () { + return "lib.d.ts"; } }; - } function formatDts(filename, text) { - var host = createMinimalLanguageServiceHost(); - host.addFile(filename, text); + var host = createMinimalLanguageServiceHost(filename, text); const languageService = ts.createLanguageService(host); let formatEdits = languageService.getFormattingEditsForDocument(filename, defaultFormatCodeSettings); formatEdits @@ -512,7 +506,8 @@ function formatDts(filename, text) { /** * @param {string[]} declarationNames */ -function checkFinalDeclaration(declarationNames) { + +function checkFinalDeclarations(declarationNames) { const program = ts.createProgram(declarationNames, { noEmit: true, target: ts.ScriptTarget.ES2019, @@ -522,10 +517,14 @@ function checkFinalDeclaration(declarationNames) { diagnostics.forEach(diagnostic => { if (diagnostic.file) { + if (diagnostic.file.fileName.endsWith("ace-modes.d.ts")) { + return; + } 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}`); } @@ -535,6 +534,83 @@ function checkFinalDeclaration(declarationNames) { }); } +function getChangeKey(change) { + return `${change.start}:${change.end}:${change.newText}`; +} + +function useTsQuickFix(declarationNames) { + const defaultCompilerHost = ts.createCompilerHost({}); + const sourcesToFix = new Map(); + const compilerOptions = { + noEmit: true, + target: ts.ScriptTarget.ES2019, + lib: ["lib.es2019.d.ts", "lib.dom.d.ts"], + noUnusedLocals: true + }; + + const host = { + ...defaultCompilerHost, + getCompilationSettings: () => compilerOptions, + getScriptFileNames: () => declarationNames, + getScriptVersion: () => "1", + getScriptSnapshot: fileName => { + const content = fs.readFileSync(fileName).toString(); + return ts.ScriptSnapshot.fromString(content); + }, + getCurrentDirectory: () => process.cwd(), + getDefaultLibFileName: options => ts.getDefaultLibFilePath(options), + writeFile: (fileName, content) => fs.writeFileSync(fileName, content) + }; + + const languageService = ts.createLanguageService(host); + const diagnostics = languageService.getProgram().getSemanticDiagnostics(); + const suggestionDiagnostics = declarationNames.map((fileName) => { + return languageService.getSuggestionDiagnostics(fileName); + }).flat(); + + const allDiagnostics = [...diagnostics, ...suggestionDiagnostics]; + + allDiagnostics.forEach(diagnostic => { + if (diagnostic.file && diagnostic.start) { + const fixes = languageService.getCodeFixesAtPosition(diagnostic.file.fileName, diagnostic.start, + diagnostic.start + diagnostic.length, [diagnostic.code], defaultFormatCodeSettings, {} + ); + fixes.forEach(fix => { + if ((fix.fixId === "fixMissingImport" || fix.fixName === "unusedIdentifier") && fix.changes.length > 0) { + const fileName = fix.changes[0].fileName; + const changeMap = sourcesToFix.get(fileName) || new Map(); + + fix.changes[0].textChanges.forEach(change => { + const changeObj = { + newText: change.newText, + start: change.span.start, + end: change.span.start + change.span.length + }; + const key = getChangeKey(changeObj); + changeMap.set(key, changeObj); + }); + + sourcesToFix.set(fileName, changeMap); + } + }); + + } + }); + + sourcesToFix.forEach((changeMap, key) => { + let content = fs.readFileSync(key).toString(); + const changes = [...changeMap.values()].sort((a, b) => b.end - a.end); + + changes.forEach(change => { + content = content.slice(0, change.start) + + change.newText + + content.slice(change.end); + }); + + fs.writeFileSync(key, content); + }); +} + /** * Collect statements (interfaces and function declarations) from the ace-internal. * @param {string} aceNamespacePath @@ -572,7 +648,8 @@ function collectStatements(aceNamespacePath) { if (typeName.includes("EventEmitter<")) { typeName = typeName + "T extends { [K in keyof T]: (...args: any[]) => any }>"; rightSide = rightSide + "T>"; - } else if (typeName.includes("<")) { + } + else if (typeName.includes("<")) { typeName = rightSide = rightSide + "T>"; } importAlias += "type " + typeName + " = import(\"" + packageName + "\").Ace." + rightSide @@ -585,7 +662,7 @@ function collectStatements(aceNamespacePath) { 'temp.d.ts', concatenatedInterfaceStrings, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS); nodes = newSourceFile.statements; } - result[node.name.text.replace("./", packageName + "/")] = nodes; + result[node.name.text.replace("./", "") + ".d.ts"] = nodes; } ts.forEachChild(node, visit); } @@ -597,10 +674,10 @@ function collectStatements(aceNamespacePath) { /** * @param {string} aceNamespacePath + * @param {boolean} [withModeReference] * @return {string} */ -function cloneAceNamespace(aceNamespacePath) { - +function cloneAceNamespace(aceNamespacePath, withModeReference) { const program = ts.createProgram([aceNamespacePath], { noEmit: true }); @@ -613,8 +690,11 @@ function cloneAceNamespace(aceNamespacePath) { 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'; + if (withModeReference) { + aceModule = MODE_REFERENCE + '\n\n' + aceModule + '\n'; + } else { + aceModule = aceModule + '\n'; + } return aceModule; } } @@ -624,25 +704,16 @@ function cloneAceNamespace(aceNamespacePath) { * @param {string} [aceNamespacePath] */ function generateDeclaration(aceNamespacePath) { + cleanDeclarationFiles(); + if (!aceNamespacePath) { aceNamespacePath = __dirname + "/../ace-internal.d.ts"; } 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/"); + let data = generateInitialDeclarations(excludeDir); - 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); + fixDeclarations(data, aceNamespacePath); } /** @@ -662,6 +733,71 @@ function updateDeclarationModuleNames(content) { return output; } +function bundleDtsFiles(buildPath) { + const aceNamespacePath = __dirname + "/../ace-internal.d.ts"; + if (!buildPath) { + buildPath = __dirname + '/../'; + } + + const directoryPath = path.resolve(buildPath, 'src'); + const files = getAllFiles(directoryPath); + const dtsFiles = files.filter(file => file.endsWith('.d.ts')); + dtsFiles.push(path.join(buildPath, '/interfaces.d.ts')); + + let combinedDefinitions = ""; + dtsFiles.forEach((filePath) => { + let content = fs.readFileSync(filePath, 'utf8'); + const moduleParts = filePath.replace(/\\/g,"/").replace(/\.d\.ts/, "").split("src"); + + let moduleName; + if (moduleParts.length > 1) { + moduleName = "src" + moduleParts[1]; + if (moduleName == "src/ace") { + content = cloneAceNamespace(aceNamespacePath) + content; + } + + const partOfPath = moduleParts[1].split("/").slice(0, -1).join("/"); + content = content.replace(/(['"])((?:\.\.?\/)+)([^'"]+)/g, (match, quote, relPath, importedFile) => { + const upLevels = (relPath.match(/\.\.\//g) || []).length; + importedFile = importedFile.replace("src/", ""); + + if (moduleName == "src/ext/menu_tools/get_editor_keyboard_shortcuts") { + console.log(moduleName) + } + + let dirs = partOfPath ? partOfPath.split('/') : []; + + if (upLevels > 0) { + dirs = dirs.slice(0, dirs.length - upLevels); + } + + const newPath = dirs.length > 0 ? dirs.join('/') + '/' + importedFile : importedFile; + return `${quote}ace-code/src/${newPath}`.replace(/\/+/g, "/"); + }); + } + else { + moduleName = 'interfaces'; + content = content.replace(/"\.\/src/g, "\"ace-code/src"); + } + + content = content.replace(/declare\s+/g, ""); + + combinedDefinitions += `declare module "ace-code/${moduleName}" {\n ${content}\n}\n`; + + }); + + combinedDefinitions = updateDeclarationModuleNames(combinedDefinitions); + const regex = new RegExp(AUTO_GENERATED_HEADER.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'); + combinedDefinitions = combinedDefinitions.replace(regex, ""); + combinedDefinitions = combinedDefinitions.replace(/ace\-builds\-internal\/ace/g, "ace-builds"); + + combinedDefinitions = formatDts("test.d.ts", combinedDefinitions); + + combinedDefinitions = AUTO_GENERATED_HEADER + MODE_REFERENCE + "\n" + combinedDefinitions; + + return combinedDefinitions; +} + if (!module.parent) { require("./modes-declaration-generator"); @@ -670,5 +806,5 @@ if (!module.parent) { else { exports.generateDeclaration = generateDeclaration; exports.updateDeclarationModuleNames = updateDeclarationModuleNames; - exports.SEPARATE_MODULES = SEPARATE_MODULES; + exports.bundleDtsFiles = bundleDtsFiles; } diff --git a/tool/fs_utilities.js b/tool/fs_utilities.js new file mode 100644 index 00000000000..7401d188ae5 --- /dev/null +++ b/tool/fs_utilities.js @@ -0,0 +1,35 @@ +const fs = require("fs"); +const path = require("path"); + +function getAllFiles(dirPath) { + let files = []; + const entries = fs.readdirSync(dirPath); + + entries.sort().forEach(entry => { + const fullPath = path.join(dirPath, entry); + const stat = fs.statSync(fullPath); + + if (stat.isDirectory()) { + files = files.concat(getAllFiles(fullPath)); + } + else if (stat.isFile()) { + files.push(fullPath); + } + }); + + return files; +} + +function cleanDeclarationFiles() { + const baseDir = path.resolve(__dirname, '../src'); + const files = getAllFiles(baseDir); + + files.forEach(file => { + if (file.endsWith('.d.ts')) { + fs.unlinkSync(file); + } + }); +} + +exports.getAllFiles = getAllFiles; +exports.cleanDeclarationFiles = cleanDeclarationFiles; \ No newline at end of file diff --git a/tool/modes-declaration-generator.js b/tool/modes-declaration-generator.js index 8a326a9c1bb..d55e0dd767a 100644 --- a/tool/modes-declaration-generator.js +++ b/tool/modes-declaration-generator.js @@ -1,6 +1,7 @@ var ts = require("typescript"); var fs = require("fs"); var path = require("path"); +var {getAllFiles} = require("./fs_utilities"); const modeDirPath = __dirname + "/../src/mode"; const outputFilePath = __dirname + "/../ace-modes.d.ts"; @@ -125,26 +126,6 @@ function generateModuleDeclarations(dirPath) { }); } -function getAllFiles(dirPath) { - let files = []; - - const entries = fs.readdirSync(dirPath); - - entries.sort().forEach(entry => { - const fullPath = path.join(dirPath, entry); - const stat = fs.statSync(fullPath); - - if (stat.isDirectory()) { - files = files.concat(getAllFiles(fullPath)); - } - else if (stat.isFile()) { - files.push(fullPath); - } - }); - - return files; -} - function createProgram(dirPath) { const fileNames = getAllFiles(dirPath).filter(file => /\.js$/.test(file) && !/test\.js$/.test(file)); diff --git a/tsconfig.json b/tsconfig.json index bc3b37018c2..4a16b7dcb5b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,13 +2,12 @@ "compilerOptions": { "strict": false, "noImplicitAny": false, - "skipDefaultLibCheck": true, "module": "commonjs", "target": "es2019", "allowJs": true, "checkJs": true, "declaration": true, - "noEmit": true, + "noEmit": true }, "exclude": [ "node_modules", @@ -19,13 +18,13 @@ "src/keyboard/sublime.js", "src/keyboard/vscode.js", "src/mode", - "./ace-internal.d.ts", "./ace-modes.d.ts", - "src/**/* *" + "src/**/* *", + "./src/**/*.d.ts" ], "include": [ - "./src/**/*", - "./ace.d.ts", - "./types/ace_*.d.ts" + "./src/**/*.js", + "./interfaces.d.ts", + "./ace-internal.d.ts" ] } diff --git a/types/ace-ext.d.ts b/types/ace-ext.d.ts deleted file mode 100644 index 8393fb89b1f..00000000000 --- a/types/ace-ext.d.ts +++ /dev/null @@ -1,625 +0,0 @@ -/* 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. - * - * 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 { - 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. - * - */ - 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. - * - */ - 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. - * - */ - 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 } from "ace-code/src/tooltip"; - export var TOOLTIP_CLASS_NAME: string; - export var BUTTON_CLASS_NAME: string; - namespace Ace { - type EventEmitter any; - }> = 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"); - export var keyWordCompleter: 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 { - constructor(editor: Editor); - editor: Editor; - keyboardHandler: HashHandler; - blurListener(e: any): void; - changeListener(e: any): void; - changeTimer: { - (timeout?: number): void; - delay(timeout?: number): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - getInlineRenderer(): AceInline; - inlineRenderer: AceInline; - getInlineTooltip(): CommandBarTooltip; - inlineTooltip: CommandBarTooltip; - /** - * This function is the entry point to the class. This triggers the gathering of the autocompletion and displaying the results; - */ - show(options: import("ace-code").Ace.CompletionOptions): void; - activated: boolean; - insertMatch(): boolean; - goTo(where: import("ace-code").Ace.InlineAutocompleteAction): void; - getLength(): any; - getData(index?: number): import("ace-code").Ace.Completion | undefined; - getIndex(): number; - isOpen(): boolean; - setIndex(value: number): void; - getCompletionProvider(initialPosition: any): CompletionProvider; - completionProvider: CompletionProvider; - updateCompletions(options?: import("ace-code").Ace.CompletionOptions): void; - base: import("ace-code/src/anchor").Anchor; - completions: FilteredList; - detach(): void; - destroy(): void; - updateDocTooltip(): void; - 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 } 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; - 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 { - constructor(editor: Editor, range?: never, showReplaceForm?: never); - activeInput: any; - element: any; - setSession(e: any): void; - setEditor(editor: Editor): void; - editor: Editor; - searchRange: any; - searchBox: HTMLElement; - replaceBox: HTMLElement; - searchOption: HTMLInputElement; - replaceOption: HTMLInputElement; - regExpOption: HTMLInputElement; - caseSensitiveOption: HTMLInputElement; - wholeWordOption: HTMLInputElement; - searchInput: HTMLInputElement; - replaceInput: HTMLInputElement; - searchCounter: HTMLElement; - /** - * - * @external - */ - $onChange: { - schedule: (timeout?: number) => void; - }; - setSearchRange(range: any): void; - searchRangeMarker: number; - /** - * @external - */ - $syncOptions(preventScroll?: boolean): void; - highlight(re?: RegExp): void; - 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; - show(value: string, isReplace?: boolean): void; - isFocused(): boolean; - } - import { HashHandler } from "ace-code/src/keyboard/hash_handler"; -} -declare module "ace-code/src/ext/elastic_tabstops_lite" { - export class ElasticTabstopsLite { - constructor(editor: Editor); - onAfterExec: () => void; - onExec: () => void; - onChange: (delta: any) => void; - processRows(rows: number[]): void; - } - 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; -} -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: 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 & { - }; - import { Editor } from "ace-code/src/editor"; -} -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 } from "ace-code/src/keyboard/hash_handler"; - import { Editor } from "ace-code/src/editor"; - /** - * Implementation of {@link IEmmetEditor} interface for Ace - */ - export class AceEmmetEditor { - 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 - * @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 - * @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 - * @example - * var range = editor.getCurrentLineRange(); - * alert(range.start + ', ' + range.end); - */ - getCurrentLineRange(): any; - /** - * Returns current caret position - */ - getCaretPos(): number | null; - /** - * Set new caret position - * @param {Number} index Caret position - */ - setCaretPos(index: number): void; - /** - * Returns content of current line - */ - 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 - */ - getContent(): string; - /** - * Returns current editor's syntax mode - */ - getSyntax(): string; - /** - * Returns current output profile name (@see emmet#setupProfile) - */ - 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 - * @since 0.65 - */ - getSelection(): string; - /** - * Returns current editor's file path - * @since 0.65 - */ - getFilePath(): string; - } -} -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 } from "ace-code/src/editor"; -} -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 } from "ace-code/src/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: Mode[]; - export var modesByName: Record; - class Mode { - constructor(name: string, caption: string, extensions: string); - name: string; - caption: string; - mode: string; - extensions: string; - extRe: RegExp; - supportsFile(filename: string): RegExpMatchArray; - } -} -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" { - export class OptionPanel { - 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[]; - renderOptionControl(key: string, option: any): any; - renderOption(key: any, option: any): (string | any[] | { - class: string; - })[]; - setOption(option: string | number | any, value: string | number | boolean): void; - getOption(option: any): any; - } - export type Editor = import("ace-code/src/editor").Editor; - namespace Ace { - type EventEmitter any; - }> = 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 highlighted. - */ - selection: [ - number, - 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; - /** - * @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. - * @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 { - function gotoLine(editor: Editor, callback?: Function): void; - function commands(editor: Editor, callback?: Function): void; - function modes(editor: Editor, callback?: Function): void; - } -} -declare module "ace-code/src/ext/rtl" { -} -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" { - function highlight(el: HTMLElement, opts: import("ace-code").Ace.StaticHighlightOptions, callback?: any): boolean; - export namespace 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 | 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} 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 | 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 {SyntaxMode | string} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @returns {object} An object containing: html, css - */ - 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; - /** simple statusbar **/ - export class StatusBar { - constructor(editor: Editor, parentNode: HTMLElement); - element: HTMLDivElement; - updateStatus(editor: Editor): void; - } -} -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/types/ace-lib.d.ts b/types/ace-lib.d.ts deleted file mode 100644 index b66680fd833..00000000000 --- a/types/ace-lib.d.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* This file is generated using `npm run update-types` */ - -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: 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; - 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: string, id?: string, 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): 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; -} -declare module "ace-code/src/lib/lang" { - export function last(a: 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; - export function copyObject(obj: T): T; - 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?: number): { - (timeout?: number): void; - delay(timeout?: number): 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: 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; - 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 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; -} -declare module "ace-code/src/lib/event_emitter" { - 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; - "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" { - export class AppConfig { - 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: typeof warn; - reportError: (msg: any, data: any) => void; - } - function warn(message: any, ...args: any[]): void; - namespace Ace { - type EventEmitter any; - }> = 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" { -} diff --git a/types/ace-modules.d.ts b/types/ace-modules.d.ts deleted file mode 100644 index 609480cbb99..00000000000 --- a/types/ace-modules.d.ts +++ /dev/null @@ -1,4772 +0,0 @@ -/* This file is generated using `npm run update-types` */ - -declare module "ace-code/src/layer/font_metrics" { - export class FontMetrics { - constructor(parentEl: HTMLElement); - el: HTMLDivElement; - checkForSizeChanges(size: any): void; - charSizes: any; - allowBoldFonts: boolean; - setPolling(val: boolean): void; - getCharacterWidth(ch: any): any; - destroy(): void; - els: any[] | HTMLElement | Text; - transformCoordinates(clientPos: any, elPos: any): any[]; - } - namespace Ace { - type EventEmitter any; - }> = 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" { - /** - * 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. - **/ - 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 - **/ - 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`] - **/ - setNewLineMode(newLineMode: NewLineMode): void; - /** - * 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 - **/ - 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 - **/ - 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 - **/ - getLines(firstRow: number, lastRow: number): string[]; - /** - * Returns all lines in the document as string array. - **/ - getAllLines(): string[]; - /** - * Returns the number of rows in the document. - **/ - getLength(): number; - /** - * Returns all the text within `range` as a single string. - * @param {IRange} range The range to work with. - * - **/ - getTextRange(range: IRange): string; - /** - * Returns all the text within `range` as an array of lines. - * @param {IRange} range The range to work with. - * - **/ - getLinesForRange(range: IRange): string[]; - /** - * @deprecated - */ - insertLines(row: any, lines: any): void; - /** - * @deprecated - */ - removeLines(firstRow: any, lastRow: any): string[]; - /** - * @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; - clippedPos(row: number, column: number): Point; - clonePos(pos: Point): 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 {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) - **/ - 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 } from "ace-code/src/anchor"; - import { Range } from "ace-code/src/range"; - namespace Ace { - type EventEmitter any; - }> = import("ace-code").Ace.EventEmitter; - type DocumentEvents = import("ace-code").Ace.DocumentEvents; - } - export interface Document extends Ace.EventEmitter { - } -} -declare module "ace-code/src/anchor" { - /** - * 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. - **/ - getPosition(): import("ace-code").Ace.Point; - /** - * - * Returns the current document. - **/ - getDocument(): Document; - /** - * 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; - document: Document; - markerId?: number; - } - export type Document = import("ace-code/src/document").Document; - namespace Ace { - type EventEmitter any; - }> = 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/config" { - const _exports: { - 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; - /** - * @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]; - set: (key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void; - all: () => import("ace-code").Ace.ConfigOptions; - /** - * module loading - */ - moduleUrl: (name: string, component?: string) => 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; - loadModule: (moduleId: string | [ - string, - string - ], onLoad: (module: any) => void) => void; - setModuleLoader: (moduleName: any, onLoad: any) => void; - version: "1.36.5"; - }; - export = _exports; -} -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 { - constructor(element: HTMLElement, canvasHeight?: number); - element: HTMLElement; - canvasHeight: number; - cells: any[]; - cellCache: any[]; - moveContainer(config: LayerConfig): void; - pageChanged(oldConfig: LayerConfig, newConfig: LayerConfig): boolean; - computeLineTop(row: number, config: Partial, session: EditSession): number; - computeLineHeight(row: number, config: LayerConfig, session: EditSession): number; - getLength(): number; - 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" { - export class Gutter { - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - gutterWidth: number; - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - addGutterDecoration(row: number, className: string): void; - removeGutterDecoration(row: number, className: string): void; - setAnnotations(annotations: any[]): void; - update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; - oldLastRow: number; - updateLineHighlight(): void; - scrollLines(config: LayerConfig): void; - setHighlightGutterLine(highlightGutterLine: boolean): void; - setShowLineNumbers(show: boolean): void; - getShowLineNumbers(): boolean; - setShowFoldWidgets(show?: boolean): void; - getShowFoldWidgets(): boolean; - 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 } from "ace-code/src/layer/lines"; - namespace Ace { - type EventEmitter any; - }> = 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 { - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - setPadding(padding: number): void; - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - setMarkers(markers: { - [x: number]: import("ace-code").Ace.MarkerLike; - }): void; - markers: { - [x: number]: import("ace-code").Ace.MarkerLike; - }; - elt(className: string, css: string): void; - i: number; - update(config: LayerConfig): void; - config: import("ace-code").Ace.LayerConfig; - drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial, extraStyle?: string): void; - drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; - drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength?: number, extraStyle?: string): void; - drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial, extraLength: number, extraStyle: string): void; - 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 } from "ace-code/src/range"; -} -declare module "ace-code/src/layer/text_util" { - export function isTextToken(tokenType: any): boolean; -} -declare module "ace-code/src/layer/text" { - export class Text { - constructor(parentEl: HTMLElement); - dom: typeof dom; - element: HTMLDivElement; - EOL_CHAR: any; - setPadding(padding: number): void; - getLineHeight(): number; - getCharacterWidth(): number; - checkForSizeChanges(): void; - setSession(session: EditSession): void; - session: EditSession; - setShowInvisibles(showInvisibles: string): boolean; - showInvisibles: any; - showSpaces: boolean; - showTabs: boolean; - showEOL: boolean; - setDisplayIndentGuides(display: boolean): boolean; - displayIndentGuides: any; - setHighlightIndentGuides(highlight: boolean): boolean; - tabSize: number; - updateLines(config: LayerConfig, firstRow: number, lastRow: number): void; - config: import("ace-code").Ace.LayerConfig; - scrollLines(config: LayerConfig): void; - 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 } from "ace-code/src/layer/lines"; - namespace Ace { - type EventEmitter any; - }> = 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 { - constructor(parentEl: HTMLElement); - element: HTMLDivElement; - isVisible: boolean; - isBlinking: boolean; - blinkInterval: number; - smoothBlinking: boolean; - cursors: any[]; - cursor: HTMLDivElement; - setPadding(padding: number): void; - setSession(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - setBlinking(blinking: boolean): void; - setBlinkInterval(blinkInterval: number): void; - setSmoothBlinking(smoothBlinking: boolean): void; - addCursor(): HTMLDivElement; - removeCursor(): any; - hideCursor(): void; - showCursor(): void; - restartTimer(): void; - intervalId: number; - 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; - /** - * Returns the width of the scroll bar. - **/ - 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; - /** - * Returns the height of the scroll bar. - **/ - 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 - **/ - 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 any; - }> = 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; - getHeight(): number; - /** - * Returns new top for scroll thumb - **/ - scrollTopFromThumbTop(thumbTop: number): number; - /** - * Returns the width of the scroll bar. - **/ - 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; - /** - * Returns the height of the scroll bar. - **/ - getHeight(): number; - /** - * Returns new left for scroll thumb - **/ - 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 - **/ - 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 any; - }> = 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" { - /** - * 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; - scroller: 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; - /** - * 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 - **/ - updateLines(firstRow: number, lastRow: number, force?: boolean): 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; - resizing: number; - 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. - **/ - 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. - **/ - getShowInvisibles(): boolean; - getDisplayIndentGuides(): boolean; - setDisplayIndentGuides(display: boolean): void; - getHighlightIndentGuides(): boolean; - 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. - **/ - 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. - **/ - getPrintMarginColumn(): number; - /** - * Returns `true` if the gutter is being shown. - **/ - 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; - getFadeFoldWidgets(): boolean; - setFadeFoldWidgets(show: boolean): void; - setHighlightGutterLine(shouldHighlight: boolean): void; - getHighlightGutterLine(): boolean; - /** - * - * Returns the root element containing this renderer. - **/ - getContainerElement(): HTMLElement; - /** - * - * Returns the element that the mouse events are attached to - **/ - getMouseEventTarget(): HTMLElement; - /** - * - * Returns the element to which the hidden text area is added. - **/ - getTextAreaContainer(): HTMLElement; - /** - * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} - **/ - 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. - **/ - 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. - **/ - getLastFullyVisibleRow(): number; - /** - * - * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} - **/ - getLastVisibleRow(): number; - /** - * Sets the padding for all the layers. - * @param {Number} padding A new padding value (in pixels) - **/ - setPadding(padding: number): void; - setScrollMargin(top?: number, bottom?: number, left?: number, right?: number): void; - setMargin(top?: number, bottom?: number, left?: number, right?: number): void; - /** - * Returns whether the horizontal scrollbar is set to be always visible. - **/ - 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. - **/ - 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. - */ - 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; - scrollSelectionIntoView(anchor: Point, lead: Point, offset?: number): void; - /** - * - * Scrolls the cursor into the first visibile area of the editor - */ - scrollCursorIntoView(cursor?: Point, offset?: number, $viewMargin?: { - top?: any; - bottom?: any; - }): void; - /** - * {:EditSession.getScrollTop} - * @related EditSession.getScrollTop - **/ - getScrollTop(): number; - /** - * {:EditSession.getScrollLeft} - * @related EditSession.getScrollLeft - **/ - getScrollLeft(): number; - /** - * Returns the first visible row, regardless of whether it's fully visible or not. - **/ - getScrollTopRow(): number; - /** - * Returns the last visible row, regardless of whether it's fully visible or not. - **/ - 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; - 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; - 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 - * - **/ - isScrollableBy(deltaX: number, deltaY: number): boolean; - pixelToScreenCoordinates(x: number, y: number): import("ace-code").Ace.ScreenCoordinates; - 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 - * - **/ - textToScreenCoordinates(row: number, column: number): { - pageX: number; - pageY: number; - }; - /** - * - * Focuses the current container. - **/ - visualizeFocus(): void; - /** - * - * Blurs the current container. - **/ - visualizeBlur(): void; - 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; - setGhostText(text: string, position?: Point): void; - removeGhostText(): void; - 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} - * @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} - **/ - getTheme(): string; - /** - * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} - * @param {String} style A class name - **/ - 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; - 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; - 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; - export type Theme = import("ace-code").Ace.Theme; - 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 any; - }> = 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; - showInvisibles?: boolean; - theme?: any; - destroyed?: boolean; - session: Ace.EditSession; - keyboardFocusClassName?: string; - } -} -declare module "ace-code/src/selection" { - export class Selection { - /** - * Creates a new `Selection` object. - * @param {EditSession} session The session to use - * @constructor - **/ - constructor(session: EditSession); - session: EditSession; - doc: import("ace-code/src/document").Document; - cursor: Anchor; - lead: Anchor; - anchor: Anchor; - /** - * Returns `true` if the selection is empty. - **/ - isEmpty(): boolean; - /** - * Returns `true` if the selection is a multi-line. - **/ - isMultiLine(): boolean; - /** - * Returns an object containing the `row` and `column` current position of the cursor. - **/ - 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. - * - * @related Anchor.getPosition - **/ - getAnchor(): Point; - /** - * Returns an object containing the `row` and `column` of the calling selection lead. - **/ - getSelectionLead(): any; - /** - * Returns `true` if the selection is going backwards in the document. - **/ - isBackwards(): boolean; - /** - * [Returns the [[Range]] for the selected text.]{: #Selection.getRange} - **/ - 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 - **/ - 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 - **/ - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; - detach(): void; - fromOrientedRange(range: Range & { - desiredColumn?: number; - }): void; - 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 - **/ - getRangeOfMovements(func: Function): Range; - toJSON(): Range | Range[]; - fromJSON(data: any): void; - 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 } from "ace-code/src/range"; - namespace Ace { - type EventEmitter any; - }> = import("ace-code").Ace.EventEmitter; - type MultiSelectionEvents = import("ace-code").Ace.MultiSelectionEvents; - 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); - speed: number; - wheelX: 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 { - constructor(mouseHandler: MouseHandler); - onMouseDown(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - mousedownEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - startSelect(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, pos?: import("ace-code").Ace.Position, waitForClickSelection?: boolean): void; - select(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - extendSelectionBy(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, unitName: string | number): void; - selectByLinesEnd(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - focusWait(this: import("ace-code/src/mouse/mouse_handler").MouseHandler): void; - onDoubleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - onTripleClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - onQuadClick(this: import("ace-code/src/mouse/mouse_handler").MouseHandler, ev: MouseEvent): void; - 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/tooltip" { - export class HoverTooltip extends Tooltip { - constructor(parentNode?: HTMLElement); - timeout: number; - lastT: number; - idleTime: number; - lastEvent: import("ace-code/src/mouse/mouse_event").MouseEvent; - waitForHover(): void; - addToEditor(editor: Editor): void; - removeFromEditor(editor: Editor): void; - isOutsideOfText(e: MouseEvent): boolean; - setDataProvider(value: (event: MouseEvent, editor: Editor) => void): void; - showForRange(editor: Editor, range: Range, domNode: HTMLElement, startingEvent: MouseEvent): void; - range: Range; - 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 { - constructor(parentNode: Element); - isOpen: boolean; - getElement(): HTMLElement; - setText(text: string): void; - setHtml(html: string): void; - setPosition(x: number, y: number): void; - setClassName(className: string): void; - setTheme(theme: import("ace-code").Ace.Theme): void; - show(text?: string, x?: number, y?: number): void; - hide(e: any): void; - getHeight(): number; - getWidth(): number; - destroy(): void; - } - import { Range } from "ace-code/src/range"; - class PopupManager { - popups: Tooltip[]; - addPopup(popup: Tooltip): void; - removePopup(popup: Tooltip): void; - updatePopups(): void; - doPopupsOverlap(popupA: Tooltip, popupB: Tooltip): boolean; - } - export interface HoverTooltip { - row: number; - } -} -declare module "ace-code/src/mouse/default_gutter_handler" { - 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; - }; - security: { - singular: any; - plural: any; - }; - warning: { - singular: any; - plural: any; - }; - info: { - singular: any; - plural: any; - }; - hint: { - 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 } from "ace-code/src/tooltip"; - export interface GutterHandler { - } -} -declare module "ace-code/src/mouse/dragdrop_handler" { - export type MouseHandler = import("ace-code/src/mouse/mouse_handler").MouseHandler; - export function DragdropHandler(mouseHandler: MouseHandler): void; - export class DragdropHandler { - constructor(mouseHandler: MouseHandler); - onDragStart: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - onDragEnd: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - onDragEnter: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - onDragOver: (this: import("ace-code/src/mouse/mouse_handler").MouseHandler, e: any) => any; - onDragLeave: (e: any) => void; - 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 { - constructor(editor: Editor); - mouseEvent: MouseEvent; - editor: import("ace-code/src/editor").Editor; - onMouseEvent(name: any, e: any): void; - onMouseMove(name: any, e: any): void; - onMouseWheel(name: any, 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?: import("ace-code").Ace.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 } from "ace-code/src/mouse/mouse_event"; - 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 { - constructor(editor: Editor); - setDefaultHandler(kb: KeyboardHandler): void; - setKeyboardHandler(kb: KeyboardHandler): void; - addKeyboardHandler(kb?: KeyboardHandler & { - attach?: (editor: any) => void; - detach?: (editor: any) => void; - }, pos?: number): void; - removeKeyboardHandler(kb: KeyboardHandler & { - attach?: (editor: any) => void; - detach?: (editor: any) => void; - }): boolean; - getKeyboardHandler(): KeyboardHandler; - getStatusText(): string; - } -} -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 - * @chainable - **/ - set(options: Partial): Search; - /** - * [Returns an object containing all the search options.]{: #Search.getOptions} - **/ - getOptions(): Partial; - /** - * Sets the search options via the `options` parameter. - * @param {Partial} options object containing all the search propertie - * @related Search.set - **/ - 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 - **/ - 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 - **/ - 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`. - * - * - **/ - replace(input: string, replacement: any): string; - } - import { Range } from "ace-code/src/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 { - constructor(config?: Record | Command[], platform?: string); - platform: string; - commands: Record; - commandKeyBinding: {}; - addCommand(command: Command): void; - removeCommand(command: Command | string, keepCommand?: boolean): void; - bindKey(key: string | { - win?: string; - mac?: string; - position?: number; - }, command: CommandLike | string, position?: number): void; - addCommands(commands?: Record | Command[]): void; - removeCommands(commands: Record): void; - bindKeys(keyList: Record): void; - /** - * Accepts keys in the form ctrl+Enter or ctrl-Enter - * keys without modifiers or shift only - */ - parseKeys(keys: string): { - key: string; - hashId: number; - } | false; - findKeyCommand(hashId: number, keyString: string): Command; - handleKeyboard(data: any, hashId: number, keyString: string, keyCode: number): { - command: string; - } | void; - 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; - exec(command: string | string[] | import("ace-code").Ace.Command, editor: Editor, args: any): boolean; - canExecute(command: string | import("ace-code").Ace.Command, editor: Editor): boolean; - toggleRecording(editor: Editor): boolean; - macro: any; - recording: boolean; - oldMacro: any; - replay(editor: Editor): boolean; - trimMacro(m: any): any; - } - export type Editor = import("ace-code/src/editor").Editor; - import { MultiHashHandler } from "ace-code/src/keyboard/hash_handler"; - namespace Ace { - type EventEmitter any; - }> = 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. - **/ - stepBackward(): import("ace-code").Ace.Token | null; - /** - * Moves iterator position to the start of next token. - **/ - stepForward(): import("ace-code").Ace.Token | null; - /** - * - * Returns current token. - **/ - getCurrentToken(): import("ace-code").Ace.Token; - /** - * - * Returns the current row. - **/ - getCurrentTokenRow(): number; - /** - * - * Returns the current column. - **/ - getCurrentTokenColumn(): number; - /** - * Return the current token position. - */ - getCurrentTokenPosition(): import("ace-code").Ace.Point; - /** - * Return the current token range. - */ - getCurrentTokenRange(): Range; - } - import { Range } from "ace-code/src/range"; -} -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 } from "ace-code/src/mouse/default_gutter_handler"; -} -declare module "ace-code/src/editor" { - /** - * 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); - session: EditSession; - container: HTMLElement & { - env?: any; - value?: any; - }; - renderer: VirtualRenderer; - id: string; - commands: CommandManager; - textInput: any; - keyBinding: KeyBinding; - startOperation(commandEvent: any): void; - /** - * @arg e - */ - endOperation(e: any): void; - onStartOperation(commandEvent: any): void; - curOp: {}; - prevOp: {}; - previousCommand: any; - /** - * @arg e - */ - onEndOperation(e: any): void; - 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 - **/ - setKeyboardHandler(keyboardHandler: string | import("ace-code").Ace.KeyboardHandler | null, cb?: () => void): void; - /** - * Returns the keyboard handler, such as "vim" or "windows". - **/ - 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. - **/ - 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. - * - * @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 - */ - unsetStyle(style: string): void; - /** - * Gets the current font size of the editor text. - */ - getFontSize(): string | number; - /** - * Set a new font size (in pixels) for the editor text. - * @param {String | number} size A font size ( _e.g._ "12px") - **/ - setFontSize(size: string | number): void; - /** - * - * Brings the current `textInput` into focus. - **/ - focus(): void; - /** - * Returns `true` if the current `textInput` is in focus. - **/ - isFocused(): boolean; - /** - * - * Blurs the current `textInput`. - **/ - blur(): void; - /** - * Returns the string of text currently highlighted. - **/ - getCopyText(): string; - execCommand(command: string | string[], args?: any): boolean; - /** - * Inserts `text` into wherever the cursor is pointing. - * @param {String} text The new text to add - **/ - insert(text: string, pasted?: boolean): void; - autoIndent(): void; - 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. - * @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. - * @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). - **/ - 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. - **/ - 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. - **/ - 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. - **/ - getHighlightActiveLine(): boolean; - setHighlightGutterLine(shouldHighlight: boolean): void; - 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. - **/ - getHighlightSelectedWord(): boolean; - setAnimatedScroll(shouldAnimate: boolean): void; - 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. - **/ - getShowInvisibles(): boolean; - setDisplayIndentGuides(display: boolean): void; - getDisplayIndentGuides(): boolean; - setHighlightIndentGuides(highlight: boolean): void; - 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. - **/ - 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. - **/ - 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. - **/ - 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} - **/ - 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. - **/ - 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. - **/ - getShowFoldWidgets(): boolean; - setFadeFoldWidgets(fade: boolean): void; - 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. - **/ - 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} - **/ - findLinkAt(row: any, column: any): string; - /** - * Open valid url under cursor in another tab - **/ - 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 - * - * @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; - /** - * {:VirtualRenderer.getFirstVisibleRow} - * - * @related VirtualRenderer.getFirstVisibleRow - **/ - getFirstVisibleRow(): number; - /** - * {:VirtualRenderer.getLastVisibleRow} - * - * @related VirtualRenderer.getLastVisibleRow - **/ - getLastVisibleRow(): number; - /** - * Indicates if the row is currently visible on the screen. - * @param {Number} row The row to check - * - **/ - isRowVisible(row: number): boolean; - /** - * Indicates if the entire row is currently visible on the screen. - * @param {Number} row The row to check - * - * - **/ - 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 - */ - 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. - * @related EditSession.documentToScreenPosition - **/ - getCursorPositionScreen(): Point; - /** - * {:Selection.getRange} - * @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. - */ - 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 - **/ - 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 - **/ - replaceAll(replacement?: string, options?: Partial): number; - /** - * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. - * @related Search.getOptions - **/ - 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; - 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?: 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").Ace.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 } 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; - type OptionsProvider = import("ace-code").Ace.OptionsProvider; - type EditorOptions = import("ace-code").Ace.EditorOptions; - type EventEmitter any; - }> = 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; - /** - * This object maintains the undo stack for an [[EditSession `EditSession`]]. - **/ - 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: - * - * - `args[0]` is an array of deltas - * - `args[1]` is the document to associate with - * - **/ - add(delta: import("ace-code").Ace.Delta, allowMerge: boolean, session?: EditSession): void; - lastDeltas: any[]; - addSelection(selection: any, rev?: number): void; - startNewGroup(): any; - markIgnored(from: number, to?: number): void; - getSelection(rev: number, after?: boolean): { - value: string; - rev: number; - }; - getRevision(): number; - getDeltas(from: number, to?: number): import("ace-code").Ace.Delta[]; - getChangedRanges(from: number, to?: number): void; - getChangedLines(from: number, to?: number): void; - /** - * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} - **/ - undo(session: EditSession, dontSelect?: boolean): void; - /** - * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} - * - **/ - 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. - **/ - canUndo(): boolean; - /** - * Returns `true` if there are redo operations left to perform. - **/ - canRedo(): boolean; - /** - * Marks the current status clean - */ - bookmark(rev?: number): void; - /** - * Returns if the current status is clean - **/ - isAtBookmark(): boolean; - /** - * Returns an object which can be safely stringified into JSON - */ - 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. - */ - 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); - splitRegex: RegExp; - states: any; - regExps: {}; - matchMappings: {}; - removeCapturingGroups(src: string): string; - createSplitterRegexp(src: string, flag: string): RegExp; - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - */ - 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" { - /** - * 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. - */ - 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").Ace.Completion[]; - setData: (data: import("ace-code").Ace.Completion[], filterText?: string) => void; - getData: (row: number) => import("ace-code").Ace.Completion; - hide: () => void; - anchor: "top" | "bottom"; - anchorPosition: import("ace-code").Ace.Point; - 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; - anchorPos: any; - isMouseOver?: boolean; - selectedNode?: HTMLElement; - } - export function $singleLineEditor(el?: HTMLElement): Editor; - export function getAriaId(index: any): string; - import { Editor } from "ace-code/src/editor"; - 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[]; - pointIndex(pos: Point, excludeEdges?: boolean, startIndex?: number): number; - add(range: Range): any[]; - addList(list: Range[]): any[]; - substractPoint(pos: Point): any[]; - merge(): any[]; - contains(row: number, column: number): boolean; - containsPoint(pos: Point): boolean; - rangeAtPoint(pos: Point): any; - clipRows(startRow: number, endRow: number): any[]; - removeAll(): any[]; - attach(session: EditSession): void; - session: import("ace-code/src/edit_session").EditSession; - onChange: any; - detach(): void; - comparePoints: (p1: import("ace-code/src/range").Point, p2: import("ace-code/src/range").Point) => number; - } - import { Range } from "ace-code/src/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; - }; - 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; - findMatchingSnippet(snippetList: Snippet[], before: string, after: string): Snippet; - register(snippets: any[], scope: string): void; - unregister(snippets: any, scope: any): void; - parseSnippetFile(str: any): Snippet[]; - getSnippetByName(name: any, editor: any): undefined; - } - import { Tokenizer } from "ace-code/src/tokenizer"; - namespace Ace { - type EventEmitter any; - }> = 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. - */ - 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 - */ - 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 - * @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 } from "ace-code/src/autocomplete/inline_screenreader"; -} -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; - }[]; - static for(editor: Editor): Autocomplete; - autoInsert: boolean; - autoSelect: boolean; - autoShown: boolean; - exactMatch: boolean; - inlineEnabled: boolean; - keyboardHandler: HashHandler; - parentNode: any; - setSelectOnHover: boolean; - /** - * @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; - changeTimer: { - (timeout?: number): void; - delay(timeout?: number): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - tooltipTimer: { - (timeout?: number): void; - delay(timeout?: number): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - popupTimer: { - (timeout?: number): void; - delay(timeout?: number): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - stickySelectionTimer: { - (timeout?: number): void; - delay(timeout?: number): void; - schedule: any; - call(): void; - cancel(): void; - isPending(): any; - }; - popup: AcePopup; - inlineRenderer: AceInline; - getPopup(): AcePopup; - stickySelection: boolean; - observeLayoutChanges(): void; - unObserveLayoutChanges(): void; - 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; - insertMatch(data: Completion, options?: undefined): boolean | void; - /** - * This is the entry point for the autocompletion class, triggers the actions which collect and display suggestions - */ - showPopup(editor: Editor, options?: CompletionOptions): void; - editor: import("ace-code/src/editor").Editor; - 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. - * @deprecated - */ - gatherCompletions(editor: any, callback: any): boolean; - updateCompletions(keepPopupPosition: boolean, options?: CompletionOptions): void; - cancelContextMenu(): void; - updateDocTooltip(): void; - showDocTooltip(item: any): void; - tooltipNode: HTMLDivElement; - hideDocTooltip(): 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 { - constructor(initialPosition?: { - pos: Position; - prefix: string; - }); - initialPosition: { - pos: Position; - prefix: string; - }; - active: boolean; - insertByIndex(editor: Editor, index: number, options?: CompletionProviderOptions): boolean; - insertMatch(editor: Editor, data: Completion, options?: CompletionProviderOptions): boolean; - 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 - */ - provideCompletions(editor: Editor, options: CompletionProviderOptions, callback: (err: Error | undefined, completions: FilteredList | [ - ], finished: boolean) => void): void; - detach(): void; - completions: import("ace-code").Ace.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 Position = import("ace-code").Ace.Position; - 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?: any; - /** - * - 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; - 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 } 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?: string); - all: any; - filtered: any; - filterText: string; - 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; - } - 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/line_widgets" { - export class LineWidgets { - constructor(session: EditSession); - session: import("ace-code/src/edit_session").EditSession; - updateOnChange(delta: import("ace-code").Ace.Delta): void; - renderWidgets(e: any, renderer: VirtualRenderer): void; - measureWidgets(e: any, renderer: VirtualRenderer): void; - getRowLength(row: number): number; - attach(editor: Editor): void; - editor: Editor; - detach(e: any): void; - updateOnFold(e: any, session: EditSession): void; - addLineWidget(w: LineWidget): LineWidget; - removeLineWidget(w: LineWidget): void; - 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; - export class SearchHighlight { - constructor(regExp: any, clazz: string, type?: string); - clazz: string; - type: string; - setRegexp(regExp: any): void; - regExp: any; - cache: any[]; - 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 {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 {Object} options options.translatePosition - * @return {Boolean} Whether occur deactivation was successful - * - **/ - exit(editor: Editor, options: any): boolean; - highlight(sess: EditSession, regexp: RegExp): void; - displayOccurContent(editor: Editor, options: Partial): void; - 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 - **/ - occurToOriginalPosition(session: EditSession, pos: Point): Point; - matchingLines(session: EditSession, options: Partial): any[]; - } - 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; - export type MarkerGroupItem = { - 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; - export class MarkerGroup { - /** - * @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: import("ace-code").Ace.MarkerGroupItem[]; - session: EditSession; - /** - * Finds the first marker containing pos - */ - 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 - * - * @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; - 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 { - 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; - subFolds: Fold[]; - setFoldLine(foldLine: FoldLine): void; - clone(): Fold; - addSubFold(fold: Fold): any; - 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 } from "ace-code/src/range_list"; - 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. - */ - constructor(foldData: FoldLine[], folds: Fold[] | Fold); - foldData: FoldLine[]; - folds: Fold[]; - range: Range; - start: import("ace-code").Ace.Point; - end: import("ace-code").Ace.Point; - /** - * Note: This doesn't update wrapData! - */ - 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): { - fold: Fold; - kind: string; - } | null; - addRemoveChars(row: number, column: number, len: number): void; - split(row: number, column: number): FoldLine | null; - merge(foldLineNext: FoldLine): void; - toString(): string; - idxToPosition(idx: number): import("ace-code").Ace.Point; - } - import { Range } from "ace-code/src/range"; -} -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; - 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" { - /** - * 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); - running: false | number; - lines: any[]; - states: string[] | string[][]; - 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 - **/ - 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 - **/ - getState(row: number): string | 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; - namespace Ace { - type EventEmitter any; - }> = 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; - 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 - **/ - 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 - **/ - getFoldsInRange: (range: import("ace-code").Ace.Range | import("ace-code").Ace.Delta) => import("ace-code").Ace.Fold[]; - getFoldsInRangeList: (ranges: import("ace-code").Ace.Range[] | import("ace-code").Ace.Range) => import("ace-code").Ace.Fold[]; - /** - * Returns all folds in the document - */ - getAllFolds: () => import("ace-code").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?: import("ace-code").Ace.FoldLine) => string | null; - getFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; - /** - * Returns the fold which starts after or contains docRow - */ - getNextFoldLine: (docRow: number, startFoldLine?: import("ace-code").Ace.FoldLine) => null | import("ace-code").Ace.FoldLine; - getFoldedRowCount: (first: number, last: number) => number; - /** - * Adds a new fold. - * - * The new created Fold object or an existing fold object in case the - * passed in range fits an existing fold exactly. - */ - addFold: (placeholder: import("ace-code").Ace.Fold | string, range?: import("ace-code").Ace.Range) => import("ace-code").Ace.Fold; - addFolds: (folds: import("ace-code").Ace.Fold[]) => void; - removeFold: (fold: import("ace-code").Ace.Fold) => void; - removeFolds: (folds: import("ace-code").Ace.Fold[]) => void; - expandFold: (fold: import("ace-code").Ace.Fold) => void; - expandFolds: (folds: import("ace-code").Ace.Fold[]) => void; - 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. - **/ - isRowFolded: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => boolean; - getRowFoldEnd: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; - getRowFoldStart: (docRow: number, startFoldRow?: import("ace-code").Ace.FoldLine) => number; - getFoldDisplayLine: (foldLine: import("ace-code").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) => import("ace-code").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; - getParentFoldRangeData: (row: number, ignoreCurrent?: boolean) => { - range?: import("ace-code").Ace.Range; - firstRange?: import("ace-code").Ace.Range; - }; - onFoldWidgetClick: (row: number, e: any) => void; - toggleFoldWidget: (toggleParent?: boolean) => void; - updateFoldWidgets: (delta: import("ace-code").Ace.Delta) => void; - tokenizerUpdateFoldWidgets: (e: any) => void; - } -} -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 { - findMatchingBracket: (this: import("ace-code/src/edit_session").EditSession, position: Point, chr?: string) => import("ace-code").Ace.Point; - 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 - * - */ - 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 - */ - getMatchingTags: (this: import("ace-code/src/edit_session").EditSession, pos: Point) => { - closeTag: Range; - closeTagName: Range; - openTag: Range; - openTagName: Range; - } | undefined; - } - import { Range } from "ace-code/src/range"; -} -declare module "ace-code/src/edit_session" { - /** - * 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. - */ - static fromJSON(session: string | object): EditSession; - /** - * Sets up a new `EditSession` and associates it with the given `Document` and `Mode`. - **/ - constructor(text?: Document | string, mode?: SyntaxMode); - doc: Document; - prevOp: {}; - id: string; - bgTokenizer: BackgroundTokenizer; - selection: Selection; - destroyed: boolean; - curOp: import("ace-code").Ace.Operation | null; - /** - * 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. - */ - endOperation(e?: any): void; - /** - * 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. - **/ - getDocument(): Document; - /** - * Set "widgetManager" in EditSession - * - */ - set widgetManager(value: LineWidgets); - /** - * Get "widgetManager" from EditSession - * - */ - get widgetManager(): LineWidgets; - resetCaches(): void; - mergeUndoDeltas: boolean; - onSelectionChange(): void; - /** - * Sets the session text. - * @param {String} text The new text to place - **/ - setValue(text: string): void; - /** - * Returns the current edit session. - * @method toJSON - */ - toJSON(): any; - /** - * Returns selection object. - **/ - getSelection(): Selection; - /** - * {:BackgroundTokenizer.getState} - * @param {Number} row The row to start at - * @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 - **/ - 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 - * - **/ - 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. - **/ - 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'`. - **/ - 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. - **/ - 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. - **/ - 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. - **/ - 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. - **/ - 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 - * - **/ - getMarkers(inFront?: boolean): { - [id: number]: import("ace-code").Ace.MarkerLike; - }; - highlight(re: RegExp): void; - /** - * experimental - */ - 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`. - **/ - 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 - * - **/ - 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 - * - **/ - getAWordRange(row: number, column: number): Range; - /** - * {:Document.setNewLineMode.desc} - * - * - * @related Document.setNewLineMode - **/ - setNewLineMode(newLineMode: import("ace-code").Ace.NewLineMode): void; - /** - * - * Returns the current new line mode. - * @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; - /** - * 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; - tokenRe: 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} - **/ - getScrollTop(): number; - /** - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - */ - 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} - **/ - getScrollLeft(): number; - /** - * Returns the width of the screen. - **/ - getScreenWidth(): 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 - **/ - 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 - * - * - **/ - getLines(firstRow: number, lastRow: number): string[]; - /** - * Returns the number of rows in the document. - **/ - getLength(): number; - /** - * {:Document.getTextRange.desc} - * @param {IRange} [range] The range to work with - * - **/ - 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 - **/ - undoChanges(deltas: Delta[], dontSelect?: boolean): void; - /** - * Re-implements a previously undone change to your document. - * @param {Delta[]} deltas An array of previous changes - **/ - 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 - * @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. - **/ - 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 - **/ - 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 } - * - **/ - getWrapLimitRange(): { - min: number; - max: number; - }; - /** - * Returns number of screenrows in a wrapped line. - * @param {Number} row The row number to check - **/ - getRowLength(row: number): number; - getRowLineCount(row: number): 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 - * - * @related EditSession.documentToScreenColumn - **/ - getScreenLastRowColumn(screenRow: number): number; - /** - * For the given document row and column, this returns the column position of the last screen row. - **/ - getDocumentLastRowColumn(docRow: number, docColumn: number): number; - /** - * For the given document row and column, this returns the document position of the last row. - **/ - getDocumentLastRowColumnPosition(docRow: number, docColumn: number): Point; - /** - * For the given row, this returns the split data. - */ - 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 - * - **/ - getScreenTabSize(screenColumn: number): number; - screenToDocumentRow(screenRow: number, screenColumn: number): 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. - **/ - documentToScreenColumn(row: number | Point, docColumn?: number): number; - /** - * For the given document row and column, returns the screen row. - **/ - documentToScreenRow(docRow: number | Point, docColumn?: number): number; - /** - * Returns the length of the screen. - **/ - 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 - * @alias EditSession.toString - **/ - getValue: () => string; - lineWidgets: null | import("ace-code").Ace.LineWidget[]; - isFullWidth: typeof isFullWidth; - lineWidgetsWidth?: number; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; - getSelectionMarkers(): 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 LineWidget = import("ace-code").Ace.LineWidget; - export type TextMode = SyntaxMode; - 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 { - type EventEmitter any; - }> = 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; - type Operation = import("ace-code").Ace.Operation; - } - export interface EditSession extends Ace.EventEmitter, Ace.OptionsProvider, Ace.Folding, Ace. - BracketMatch { - doc: Ace.Document; - lineWidgetsWidth?: number; - gutterRenderer?: any; - selectionMarkerCount?: number; - multiSelect?: any; - curOp: Ace.Operation | null; - getSelectionMarkers(): any[]; - } -} -declare module "ace-code/src/range" { - /** - * 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); - start: 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 - **/ - 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] - * ``` - **/ - 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 - * @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]] - **/ - 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 - * @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 - **/ - 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 - **/ - 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 - **/ - 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 - * @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 - * @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 - * @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 - **/ - 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]]). - **/ - isEmpty(): boolean; - /** - * Returns `true` if the range spans across multiple lines. - **/ - isMultiLine(): boolean; - /** - * Returns a duplicate of the calling range. - **/ - clone(): Range; - /** - * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`. - **/ - 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 - **/ - toScreenRange(session: EditSession): Range; - /** - * Shift the calling range by `row` and `column` values. - * @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 - **/ - function fromPoints(start: Point, end: Point): Range; - /** - * Compares `p1` and `p2` [[Point]]'s, useful for sorting - */ - function comparePoints(p1: Point, p2: Point): number; - 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" { - export class PlaceHolder { - 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; - updateAnchors(delta: import("ace-code").Ace.Delta): void; - updateMarkers(): void; - /** - * PlaceHolder.detach() - * - * TODO - * - **/ - detach(): void; - /** - * PlaceHolder.cancel() - * - * TODO - * - **/ - cancel(): void; - } - export type EditSession = import("ace-code/src/edit_session").EditSession; - import { Range } from "ace-code/src/range"; - namespace Ace { - type EventEmitter any; - }> = 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 } from "ace-code/src/keyboard/hash_handler"; -} -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; - export function MultiSelect(editor: Editor): void; - import { Editor } from "ace-code/src/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 { - activate(editor: any, backwards: boolean): void; - deactivate(reset?: boolean): void; - selectionFix(editor: Editor): void; - highlight(regexp: RegExp): void; - cancelSearch(reset?: boolean): Range; - highlightAndFindWithNeedle(moveToNext: boolean, needleUpdateFunc: Function): false | Range; - addString(s: string): false | Range; - removeChar(c: any): false | Range; - next(options: any): false | Range; - convertNeedleToRegExp(): false | Range; - convertNeedleToString(): false | Range; - statusMessage(found: any): void; - message(msg: any): void; - } - import { Search } from "ace-code/src/search"; - import iSearchCommandModule = require("ace-code/src/commands/incremental_search_commands"); - 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 & { - [key: string]: any; - }; - 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. - **/ - getLineTokens(line: any, startState: any): any; - } - 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 } from "ace-code/src/keyboard/hash_handler"; -} diff --git a/types/ace-snippets.d.ts b/types/ace-snippets.d.ts deleted file mode 100644 index a3a14cb8cbe..00000000000 --- a/types/ace-snippets.d.ts +++ /dev/null @@ -1,402 +0,0 @@ -/* This file is generated using `npm run update-types` */ - -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/types/ace-theme.d.ts b/types/ace-theme.d.ts deleted file mode 100644 index 363dd69b787..00000000000 --- a/types/ace-theme.d.ts +++ /dev/null @@ -1,437 +0,0 @@ -/* This file is generated using `npm run update-types` */ - -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; - export const $id: "ace/theme/textmate"; -} -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; - export const $selectionColorConflict: true; -} -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/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; -} -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; - export const $selectionColorConflict: true; -} -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; -}