UNPKG

r3bl-ts-utils

Version:

The `r3bl-ts-utils` package is a set of useful TypeScript functions and classes that can be used in Node.js and browser environments. They are inspired by Kotlin stdlib, and Rust to write code as expressions rather than statements, colorized text, powerfu

20 lines (19 loc) 696 B
import { ListItem, OperateOnOneItemFn } from "./types"; /** @immutable */ export declare class SelectionModel { private selected; private readonly singleSelectionMode; /** @immutable */ constructor(initialSelected: ListItem[], singleSelectionMode: boolean); /** @immutable */ clearAllSelections: () => SelectionModel; /** @immutable */ toggleSelectionFor: (selectedItem: ListItem, onSelect: OperateOnOneItemFn, onUnselect: OperateOnOneItemFn) => SelectionModel; /** * @immutable * https://stackoverflow.com/a/20070691/2085356 */ getSelection: () => ListItem[]; isItemSelected: (query: ListItem) => boolean; toString: () => string; }