import { Stream } from 'xstream'; import { MainFn, Reducer } from './types'; import { StateSource } from './StateSource'; /** * While we are waiting for keyof subtraction to land in TypeScript, * https://github.com/Microsoft/TypeScript/issues/12215, * we must use `any` as the type of sources or sinks in the mainOnionified. * This is because the correct type is *not* * * Main * * *neither* * * Main, Partial> * * The former will signal to Cycle.run that a driver for 'onion' is needed, * while the latter will make valid channels like 'DOM' become optional. * The correct type should be * * Main, Omit> */ export declare type Omit = any; export declare type OSo = { onion: StateSource; }; export declare type OSi = { onion: Stream>; }; export declare type MainOnionified, Si extends OSi> = MainFn, Omit>; export declare function onionify, Si extends OSi>(main: MainFn, name?: string): MainOnionified;