@typed/effects
Version:
Generator-powered Effect management
23 lines • 670 B
TypeScript
import { LazyDisposable } from '@typed/disposable';
import { FailEnv } from '../failures';
export interface Fiber<A> extends LazyDisposable {
info: FiberInfo<A>;
}
export declare const FiberFailure: unique symbol;
export declare type FiberFailure = FailEnv<typeof FiberFailure, Error>;
export declare const enum FiberState {
Running = 0,
Returned = 1,
Error = 2
}
export declare type FiberInfo<B> = {
readonly state: FiberState.Running;
readonly promise: Promise<B>;
} | {
readonly state: FiberState.Error;
readonly error: Error;
} | {
readonly state: FiberState.Returned;
readonly value: B;
};
//# sourceMappingURL=Fiber.d.ts.map