UNPKG

@launchmenu/core

Version:

An environment for visual keyboard controlled applets

45 lines 1.8 kB
import type { Ace } from "ace-builds"; import { ITextSelection } from "../_types/ITextSelection"; /** * Splits the text into its lines * @param text The text to split * @param includeEndings Whether to include line endings in the lines * @returns The split text */ export declare function getTextLines(text: string, includeEndings?: boolean): string[]; /** * Creates a valid 2 dimensional index in the given text * @param text The text to perform the conversion with * @param index The 1 dimensional index * @returns The 2 dimensional index */ export declare function get2dIndex(text: string, index: number): { row: number; column: number; }; /** * Creates a valid 2 dimensional range from a given 1 dimensional selection * @param text The text to perform the conversion with * @param selection The 1 dimensional selection * @returns The 2 dimensional selection range */ export declare function get2dSelectionRange(text: string, selection: ITextSelection): Ace.Range; /** * Creates a valid 1 dimensional index in the given text * @param text The text to perform the conversion with * @param index The 2 dimensional index * @returns The 1 dimensional index */ export declare function get1dIndex(text: string, index: { row: number; column: number; }): number; /** * Creates a valid 1 dimensional range from a given 2 dimensional selection * @param text The text to perform the conversion with * @param selection The 2 dimensional selection * @param reverse Whether the selection started at the end index * @returns The 1 dimensional selection range */ export declare function get1dSelectionRange(text: string, selection: Ace.Range, reverse?: boolean): ITextSelection; //# sourceMappingURL=rangeConversion.d.ts.map