UNPKG

ace-builds

Version:
1,235 lines (1,233 loc) 209 kB
/* This file is generated using `npm run update-types` */ declare module "ace-builds-internal/layer/font_metrics" { export class FontMetrics { constructor(parentEl: HTMLElement); el: HTMLDivElement; checkForSizeChanges(size?: { height: number; width: number; } | null): 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<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type FontMetricsEvents = import("ace-builds").Ace.FontMetricsEvents; } export interface FontMetrics extends Ace.EventEmitter<Ace.FontMetricsEvents> { } } declare module "ace-builds-internal/apply_delta" { export function applyDelta(docLines: string[], delta: import("ace-builds").Ace.Delta, doNotValidate?: any): void; } declare module "ace-builds-internal/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.<br/>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-builds").Ace.Delta; export type Point = import("ace-builds").Ace.Point; export type IRange = import("ace-builds").Ace.IRange; export type NewLineMode = import("ace-builds").Ace.NewLineMode; import { Anchor } from "ace-builds-internal/anchor"; import { Range } from "ace-builds-internal/range"; namespace Ace { type EventEmitter<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type DocumentEvents = import("ace-builds").Ace.DocumentEvents; } export interface Document extends Ace.EventEmitter<Ace.DocumentEvents> { } } declare module "ace-builds-internal/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-builds").Ace.Point} row The starting row position * @param {Number} [column] The starting column position **/ constructor(doc: Document, row: number | import("ace-builds").Ace.Point, column?: number); /** * Returns an object identifying the `row` and `column` position of the current anchor. **/ getPosition(): import("ace-builds").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-builds-internal/document").Document; namespace Ace { type EventEmitter<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type AnchorEvents = import("ace-builds").Ace.AnchorEvents; type Document = import("ace-builds").Ace.Document; } export interface Anchor extends Ace.EventEmitter<Ace.AnchorEvents> { markerId?: number; document: Ace.Document; } } declare module "ace-builds-internal/config" { const _exports: { defineOptions(obj: any, path: string, options: { [key: string]: any; }): import("ace-builds").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<K extends string | number | symbol>(name: K, callback: any): void; setDefaultHandler(name: string, callback: Function): void; removeDefaultHandler(name: string, callback: Function): void; on<K extends string | number | symbol>(name: K, callback: any, capturing?: boolean): any; addEventListener<K extends string | number | symbol>(name: K, callback: any, capturing?: boolean): any; off<K extends string | number | symbol>(name: K, callback: any): void; removeListener<K extends string | number | symbol>(name: K, callback: any): void; removeEventListener<K extends string | number | symbol>(name: K, callback: any): void; removeAllListeners(name?: string): void; /** * @param {K} key - The key of the config option to retrieve. * @returns {import("ace-builds").Ace.ConfigOptions[K]} - The value of the config option. */ get: <K extends keyof import("ace-builds").Ace.ConfigOptions>(key: K) => import("ace-builds").Ace.ConfigOptions[K]; set: <K extends keyof import("ace-builds").Ace.ConfigOptions>(key: K, value: import("ace-builds").Ace.ConfigOptions[K]) => void; all: () => import("ace-builds").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.43.0"; }; export = _exports; } declare module "ace-builds-internal/layer/lines" { export type EditSession = import("ace-builds-internal/edit_session").EditSession; export type LayerConfig = import("ace-builds").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<LayerConfig>, 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-builds-internal/layer/gutter" { export class Gutter { constructor(parentEl: HTMLElement); element: HTMLDivElement; gutterWidth: number; setSession(session: EditSession): void; session: import("ace-builds-internal/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-builds").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-builds-internal/edit_session").EditSession; export type LayerConfig = import("ace-builds").Ace.LayerConfig; import { Lines } from "ace-builds-internal/layer/lines"; namespace Ace { type EventEmitter<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type GutterEvents = import("ace-builds").Ace.GutterEvents; } export interface Gutter extends Ace.EventEmitter<Ace.GutterEvents> { } } declare module "ace-builds-internal/layer/marker" { export type EditSession = import("ace-builds-internal/edit_session").EditSession; export type LayerConfig = import("ace-builds").Ace.LayerConfig; export class Marker { constructor(parentEl: HTMLElement); element: HTMLDivElement; setPadding(padding: number): void; setSession(session: EditSession): void; session: import("ace-builds-internal/edit_session").EditSession; setMarkers(markers: { [x: number]: import("ace-builds").Ace.MarkerLike; }): void; markers: { [x: number]: import("ace-builds").Ace.MarkerLike; }; elt(className: string, css: string): void; i: number; update(config: LayerConfig): void; config: import("ace-builds").Ace.LayerConfig; drawTextMarker(stringBuilder: undefined, range: Range, clazz: string, layerConfig: Partial<LayerConfig>, extraStyle?: string): void; drawMultiLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: LayerConfig, extraStyle?: string): void; drawSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial<LayerConfig>, extraLength?: number, extraStyle?: string): void; drawBidiSingleLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial<LayerConfig>, extraLength: number, extraStyle: string): void; drawFullLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial<LayerConfig>, extraStyle?: undefined): void; drawScreenLineMarker(stringBuilder: undefined, range: Range, clazz: string, config: Partial<LayerConfig>, extraStyle?: undefined): void; } import { Range } from "ace-builds-internal/range"; } declare module "ace-builds-internal/layer/text_util" { export function isTextToken(tokenType: any): boolean; } declare module "ace-builds-internal/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-builds").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-builds").Ace.LayerConfig; export type EditSession = import("ace-builds-internal/edit_session").EditSession; import dom = require("ace-builds-internal/lib/dom"); import { Lines } from "ace-builds-internal/layer/lines"; namespace Ace { type EventEmitter<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type TextEvents = import("ace-builds").Ace.TextEvents; type LayerConfig = import("ace-builds").Ace.LayerConfig; } export interface Text extends Ace.EventEmitter<Ace.TextEvents> { config: Ace.LayerConfig; } } declare module "ace-builds-internal/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-builds-internal/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: ReturnType<typeof setInterval>; getPixelPosition(position?: import("ace-builds").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-builds-internal/edit_session").EditSession; export interface Cursor { timeoutId?: number; } } declare module "ace-builds-internal/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<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type ScrollbarEvents = import("ace-builds").Ace.ScrollbarEvents; } export interface VScrollBar extends Ace.EventEmitter<Ace.ScrollbarEvents> { } export interface HScrollBar extends Ace.EventEmitter<Ace.ScrollbarEvents> { } } declare module "ace-builds-internal/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<T extends { [K in keyof T]: (...args: any[]) => any; }> = import("ace-builds").Ace.EventEmitter<T>; type ScrollbarEvents = import("ace-builds").Ace.ScrollbarEvents; } export interface VScrollBar extends Ace.EventEmitter<Ace.ScrollbarEvents> { } export interface HScrollBar extends Ace.EventEmitter<Ace.ScrollbarEvents> { } } declare module "ace-builds-internal/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-builds-internal/css/editor-css" { const _exports: string; export = _exports; } declare module "ace-builds-internal/layer/decorators" { export class Decorator { constructor(scrollbarV: import("ace-builds").Ace.VScrollbar, renderer: import("ace-builds-internal/virtual_renderer").VirtualRenderer); renderer: import("ace-builds-internal/virtual_renderer").VirtualRenderer; pixelRatio: number; maxHeight: number; lineHeight: number; minDecorationHeight: number; halfMinDecorationHeight: number; colors: {}; canvas: HTMLCanvasElement; setScrollBarV(scrollbarV: any): void; scrollbarV: any; getVerticalOffsetForRow(row: any): number; setDimensions(config: any): void; canvasHeight: any; canvasWidth: any; heightRatio: number; setZoneWidth(): void; oneZoneWidth: any; destroy(): void; } } declare module "ace-builds-internal/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-builds").Ace.VScrollbar; scrollBarH: import("ace-builds").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-builds-internal/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-builds").Ace.Annotation[]} annotations An array containing annotations * **/ setAnnotations(annotations: import("ace-builds").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-builds").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; /**