persona-community-5/.pnpm-store/v3/files/c7/63e703f0c50724a160d81ba5540b1651c3ff00997bb66906c176d15b3c6d8f0ae032afe549481f2efe510cfce5086fceba3245522f9d4e097efa0aca83748a
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

36 lines
786 B
Plaintext

export type Options = {
/**
Whether to use 1-based or 0-based indexing for the result.
@default false
*/
readonly oneBased?: boolean;
/**
Whether to use 1-based or 0-based line indexing for the result.
@default false
*/
readonly oneBasedLine?: boolean;
/**
Whether to use 1-based or 0-based column indexing for the result.
@default false
*/
readonly oneBasedColumn?: boolean;
};
/**
Convert a string index to its line and column position.
@param text - The text in which to find the line and column position.
@param index - The index in the string for which to find the line and column position.
@returns The line and column position.
*/
export default function indexToPosition(
text: string,
index: number,
options?: Options
): {line: number; column: number};