/** * Identity-keyed focus over a list of rendered rows. * * The companion of {@link RowViewport}: that class owns which contiguous rows * are visible, this one owns which row the human is aimed at. Keeping focus on * an IDENTITY rather than an index is what lets a live list insert or remove * rows under the cursor without a keystroke landing on whatever inherited the * old screen position. * @module dshline/focus */ /** A wrapping cursor over the focusable rows of one view. */ export declare class FocusRing { private keys; private aim; private at; /** * Re-align the ring with the rows the newest render produced. * * When the aimed key still exists its new position is adopted, so a row that * appeared above it never drags the cursor. When it vanished, `retarget` * decides what happens: rendering adopts the predictable neighbour as the new * aim, while a human ACTION keeps the dead aim so it can refuse rather than * hit that neighbour. * @param keys - focus identities of the current focusable rows, in row order. * @param retarget - whether a vanished aim may be replaced by its neighbour. */ update(keys: readonly string[], retarget: boolean): void; /** * Move the cursor by whole focusable rows, wrapping at either end. * @param amount - positive moves down; negative moves up. */ move(amount: number): void; /** Aim at the first focusable row. */ first(): void; /** Aim at the last focusable row. */ last(): void; /** * Aim at one exact identity, whether or not it is currently present. * @param key - the identity to aim at, or undefined to aim at nothing. */ aimAt(key: string | undefined): void; /** The aimed identity, which may no longer be present after a removal. */ get current(): string | undefined; /** Position among the focusable rows, or -1 when there are none. */ get position(): number; } //# sourceMappingURL=focus.d.ts.map