text-manipulation
Version:
A NPM library that assists in text range manipulation
38 lines (37 loc) • 969 B
TypeScript
import { TextPosition } from './text-position';
import { TextRange } from './text-range';
import { TextBuffer } from './text-buffer';
export declare class MutableTextRange implements TextRange {
private textBuffer;
start: TextPosition;
end: TextPosition;
/**
* @param {[TextPosition , TextPosition]} interval
* @param {TextBuffer} textBuffer
*/
constructor(interval: [TextPosition, TextPosition], textBuffer: TextBuffer);
/**
* Change the text of the range
*
* @param {string} text
*/
setText(text: string): void;
/**
* Get the text of the range
* @returns {string}
*/
getText(): string;
/**
* Sort the range ensuring that start is less than or equal to end
* start <= end
*
* @returns {MutableTextRange}
*/
sort(): MutableTextRange;
/**
* The range from start to end exists
*
* @returns {boolean}
*/
exists(): boolean;
}