import type { EditorState, Line } from '@codemirror/state'; export interface IndentEntry { line: Line; col: number; level: number; empty: boolean; active?: number; } /** * Indentation map for a set of lines. * * This map will contain the indentation for lines that are not a part of the given set, * but this is because calculating the indentation for those lines was necessary to * calculate the indentation for the lines provided to the constructor. * * @see {@link IndentEntry} */ export declare class IndentationMap { /** The {@link EditorState} indentation is derived from. */ protected state: EditorState; /** The set of lines that are used as an entrypoint. */ protected lines: Set; /** The internal mapping of line numbers to {@link IndentEntry} objects. */ protected map: Map; /** The width of the editor's indent unit. */ protected unitWidth: number; /** The type of indentation to use (terminate at end of scope vs last non-empty line in scope) */ protected markerType: 'fullScope' | 'codeOnly'; /** * @param lines - The set of lines to get the indentation map for. * @param state - The {@link EditorState} to derive the indentation map from. * @param unitWidth - The width of the editor's indent unit. * @param markerType - The type of indentation to use (terminate at end of scope vs last line of code in scope) */ constructor(lines: Set, state: EditorState, unitWidth: number, markerType: 'fullScope' | 'codeOnly'); /** * Checks if the indentation map has an entry for the given line. * * @param line - The {@link Line} or line number to check for. */ has(line: Line | number): boolean; /** * Returns the {@link IndentEntry} for the given line. * * Note that this function will throw an error if the line does not exist in the map. * * @param line - The {@link Line} or line number to get the entry for. */ get(line: Line | number): IndentEntry; /** * Sets the {@link IndentEntry} for the given line. * * @param line - The {@link Line} to set the entry for. * @param col - The visual beginning whitespace width of the line. * @param level - The indentation level of the line. */ protected set(line: Line, col: number, level: number): IndentEntry; /** * Adds a line to the indentation map. * * @param line - The {@link Line} to add to the map. */ protected add(line: Line): IndentEntry; /** * Finds the closest non-empty line, starting from the given line. * * @param from - The {@link Line} to start from. * @param dir - The direction to search in. Either `1` or `-1`. */ protected closestNonEmpty(from: Line, dir: -1 | 1): IndentEntry; /** * Finds the state's active block (via the current selection) and sets all * the active indent level for the lines in the block. */ protected findAndSetActiveLines(): void; } //# sourceMappingURL=map.d.ts.map