@action-land/component
Version:
Basic interface for a component
18 lines (17 loc) • 711 B
TypeScript
import { Option } from 'standard-data-structures';
declare type ListKey = string | number;
export declare class ListComponentState<S> {
private baseInit;
private readonly keys;
private readonly hashMap;
private constructor();
static of<S>(baseInit: () => S): ListComponentState<S>;
set(k: ListKey, value?: S): ListComponentState<S>;
get(k: ListKey): Option<S>;
fold<T>(s: T, fn: (current: S, k: ListKey, acc: T) => T): T;
static fold<T, S>(L: ListComponentState<S>, T: T, fn: (current: S, k: ListKey, acc: T) => T): T;
static toArray<S>(L: ListComponentState<S>): Array<[ListKey, S]>;
has(k: ListKey): boolean;
readonly asArray: Array<[ListKey, S]>;
}
export {};