import {Scope, Reducer, MakeScopesFn} from './lib/types'; import {Stream} from 'most'; export interface StateSource { state$: Stream; select(scope: Scope): StateSource; toCollection(this: StateSource>, itemComp: (so: any) => Si): Collection; isolateSource(source: StateSource, scope: Scope): StateSource; isolateSink(innerReducer$: Stream>, scope: Scope): Stream>; } export interface Collection { uniqueBy(getKey: (state: S) => string): UniqueCollection; isolateEach(makeScopes: MakeScopesFn): Collection; build(sources: any): Instances; } export interface UniqueCollection extends Collection { isolateEach(makeScopes: (key: string) => string | object): UniqueCollection; } export interface Instances { pickMerge(selector: string): Stream; pickCombine(selector: string): Stream>; }