import { Annotation } from "../internal"; import type { ClassMethodDecorator } from "../types/decorator_fills"; export declare const FLOW = "flow"; export declare function FlowCancellationError(): void; export declare namespace FlowCancellationError { var prototype: any; } export declare function isFlowCancellationError(error: Error): boolean; export type CancellablePromise = Promise & { cancel(): void; }; interface Flow extends Annotation, PropertyDecorator, ClassMethodDecorator { (generator: (...args: Args) => Generator | AsyncGenerator): (...args: Args) => CancellablePromise; bound: Annotation & PropertyDecorator & ClassMethodDecorator; } export declare const flow: Flow; export declare function flowResult(result: T): T extends Generator ? CancellablePromise : T extends CancellablePromise ? T : never; export declare function isFlow(fn: any): boolean; export {};