import { IsNever, WhenNever } from './Basics'; import Either from './Either'; import * as Scheduler from './Scheduler'; export declare class Router { private readonly process; private readonly dispatch; constructor(process: Scheduler.Process>, dispatch: (msg: AppMsg) => void); sendToApp(msg: AppMsg): Task; sendToSelf(msg: SelfMsg): Task; } export interface Manager { init: Task; onEffects(router: Router, commands: Array>, subscriptions: Array>, state: State): Task; onSelfMsg(router: Router, msg: SelfMsg, state: State): Task; } interface Effects { commands: Array>; subscriptions: Array>; } declare abstract class Bag { static gather(sequence: Array, effectDict: WeakMap>, bag: Bag): void; abstract map(fn: (effect: T) => R): Bag; protected abstract gather(sequence: Array, effectDict: WeakMap>): void; } export declare abstract class Cmd extends Bag { static readonly none: Cmd; static batch(cmds: Array>): Cmd; protected abstract readonly manager: Manager; abstract map(fn: (effect: T) => R): Cmd; protected gather(sequence: Array, effectDict: WeakMap>): void; } export declare abstract class Sub extends Bag { static readonly none: Sub; static batch(cmds: Array>): Sub; protected abstract readonly manager: Manager; abstract map(fn: (effect: T) => R): Sub; protected gather(sequence: Array, effectDict: WeakMap>): void; } declare abstract class IM { abstract step(manager: Manager, router: Router, state: State): Task; } export declare class Worker { private readonly update; private readonly subscriptions; private model; private readonly runtime; private readonly subscribers; constructor([initialModel, initialCmd]: [Model, Cmd], update: (msg: Msg, model: Model) => [Model, Cmd], subscriptions: (model: Model) => Sub); getModel(): Model; dispatch(msg: Msg): void; subscribe(subscriber: () => void): () => void; } export declare class Program { private readonly init_; private readonly update; private readonly subscriptions; static worker(config: { init(flags: Flags): [Model, Cmd]; update(msg: Msg, model: Model): [Model, Cmd]; subscriptions(model: Model): Sub; }): Program; private constructor(); init(flags: Flags): Worker; } export declare class Task { protected internal: Scheduler.Task; static succeed(value: T): Task; static fail(error: E): Task; static sequence(tasks: Array>): Task>; static binding(callback: (done: (task: Task) => void) => void | (() => void)): Task; constructor(internal: Scheduler.Task); map(fn: (value: T) => R): Task; chain(fn: (value: T) => Task, R>): Task, R>; mapError(fn: (error: E) => S): Task; onError(fn: (error: E) => Task>): Task>; perform(tagger: IsNever Msg, never>): Cmd; attempt(tagger: (either: Either) => Msg): Cmd; spawn(): Task; execute(): Scheduler.Task; } export declare class Process { protected readonly internal: Scheduler.Process; static sleep(time: number): Task; constructor(internal: Scheduler.Process); kill(): Task; execute(): Scheduler.Process; } export {};