Sha256: 0e1dedea27ffa6fd9c72f5fe738b122f8e0b24fd13388958f37601ce0aa380c0
Contents?: true
Size: 1.04 KB
Versions: 84
Compression:
Stored size: 1.04 KB
Contents
import { type Prettify } from '@inquirer/type'; /** Represents an item that's part of a layout, about to be rendered */ export type Layout<T> = { item: T; index: number; isActive: boolean; }; /** * Renders a page of items as lines that fit within the given width ensuring * that the number of lines is not greater than the page size, and the active * item renders at the provided position, while prioritizing that as many lines * of the active item get rendered as possible. */ export declare function lines<T>({ items, width, renderItem, active, position: requested, pageSize, }: { items: ReadonlyArray<T>; /** The width of a rendered line in characters. */ width: number; /** Renders an item as part of a page. */ renderItem: (layout: Prettify<Layout<T>>) => string; /** The index of the active item in the list of items. */ active: number; /** The position on the page at which to render the active item. */ position: number; /** The number of lines to render per page. */ pageSize: number; }): string[];
Version data entries
84 entries across 29 versions & 2 rubygems