import type { Node } from 'vue-eslint-parser/ast/nodes'; import type { Token } from 'vue-eslint-parser/ast/tokens'; /** * The following function is adapted from https://github.com/eslint/eslint/blob/master/lib/linter/rule-fixer.js * MIT License https://github.com/eslint/eslint/blob/master/LICENSE */ export declare type Operation = { range: number[]; text: string; }; /** * Creates a fix command that inserts text at the specified index in the source text. * @param {int} index The 0-based index at which to insert the new text. * @param {string} text The text to insert. * @returns {Operation} The fix command. * @private */ export declare function insertTextAt(index: number, text: string): Operation; /** * Creates a fix command that inserts text after the given node or token. * The fix is not applied until applyFixes() is called. * @param {Node|Token} nodeOrToken The node or token to insert after. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function insertTextAfter(nodeOrToken: Node | Token, text: string): Operation; /** * Creates a fix command that inserts text after the specified range in the source text. * The fix is not applied until applyFixes() is called. * @param {int[]} range The range to replace, first item is start of range, second * is end of range. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function insertTextAfterRange(range: number[], text: string): Operation; /** * Creates a fix command that inserts text before the given node or token. * The fix is not applied until applyFixes() is called. * @param {Node|Token} nodeOrToken The node or token to insert before. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function insertTextBefore(nodeOrToken: Node | Token, text: string): Operation; /** * Creates a fix command that inserts text before the specified range in the source text. * The fix is not applied until applyFixes() is called. * @param {int[]} range The range to replace, first item is start of range, second * is end of range. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function insertTextBeforeRange(range: number[], text: string): Operation; /** * Creates a fix command that replaces text at the node or token. * The fix is not applied until applyFixes() is called. * @param {Node|Token} nodeOrToken The node or token to remove. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function replaceText(nodeOrToken: Node | Token, text: string): Operation; /** * Creates a fix command that replaces text at the specified range in the source text. * The fix is not applied until applyFixes() is called. * @param {int[]} range The range to replace, first item is start of range, second * is end of range. * @param {string} text The text to insert. * @returns {Operation} The fix command. */ export declare function replaceTextRange(range: number[], text: string): Operation; /** * Creates a fix command that removes the node or token from the source. * The fix is not applied until applyFixes() is called. * @param {Node|Token} nodeOrToken The node or token to remove. * @returns {Operation} The fix command. */ export declare function remove(nodeOrToken: Node | Token): Operation; /** * Creates a fix command that removes the specified range of text from the source. * The fix is not applied until applyFixes() is called. * @param {int[]} range The range to remove, first item is start of range, second * is end of range. * @returns {Operation} The fix command. */ export declare function removeRange(range: number[]): Operation; /** * Get text of Node * @param {Node} node The node to get text * @param {string} source The full text of the source code * @returns {Operation} The text of the node */ export declare function getText(node: Node, source: string): string;