UNPKG

rvx

Version:

A signal based rendering library

27 lines 894 B
import { Signal, TeardownHook } from "../signals.js"; export type MapArrayFn<I, O> = (input: I, index: () => number) => O; export interface MapArrayStateEntry<I, O> { /** input */ i: I; /** output */ o: O; /** index */ s: Signal<number>; /** dispose */ d: TeardownHook; /** removed */ r: boolean; } export interface MapArrayUpdate<I, O> { /** inclusive start index in new state */ s: number; /** exclusive end index in new state */ e: number; /** previous chunk */ p: MapArrayStateEntry<I, O>[]; /** next chunk */ n: MapArrayStateEntry<I, O>[]; } export declare function createMapArrayState<I, O>(): MapArrayStateEntry<I, O>[]; export declare function mapArrayUpdate<I, O>(state: MapArrayStateEntry<I, O>[], rawInput: Iterable<I>, fn: MapArrayFn<I, O>): MapArrayUpdate<I, O> | null; //# sourceMappingURL=map-array.d.ts.map