import { Stream } from 'xstream'; export declare type FantasyObserver = { next(x: T): void; error(err: any): void; complete(c?: any): void; }; export declare type FantasySubscription = { unsubscribe(): void; }; export declare type FantasyObservable = { subscribe(observer: FantasyObserver): FantasySubscription; }; export declare type DevToolEnabledSource = { _isCycleSource: string; }; export declare type SinkProxies = { [P in keyof Si]: Stream; }; export declare type Driver = Si extends void ? (() => So) : ((stream: Si) => So); export declare type DisposeFunction = () => void; export declare type Drivers = { [name: string]: Driver, any | void>; }; export declare type Main = (...args: Array) => any; export declare type Sources = { [k in keyof D]: ReturnType; }; export declare type Sinks = ReturnType; export declare type MatchingMain = (Main & { (so: Sources): Sinks; }) | (Main & { (): Sinks; }); /** * For whatever reason, this does not work with RxJS observables, * this for this reason, `MatchingDrivers` has to be redefined * in @cycle/rxjs-run- */ export declare type ToStream = S extends FantasyObservable ? Stream : S; export declare type WidenStream = S extends Stream ? (T extends U ? U : never) : any; export declare type GetValidInputs> = D extends Driver ? (S extends Stream ? T : never) : never; export declare type MatchingDrivers = Drivers & { [k in string & keyof Sinks]: (() => Sources[k]) | ((si: Stream[k]>, GetValidInputs>>) => Sources[k]); }; export interface CycleProgram, M extends MatchingMain> { sources: Sources; sinks: Sinks; run(): DisposeFunction; } export interface Engine { sources: Sources; run>(sinks: Sinks): DisposeFunction; dispose(): void; }