import { Annotation } from "../internal"; import type { ClassMethodDecorator } from "../types/decorator_fills"; export declare const FLOW = "flow"; export declare class FlowCancellationError extends Error { constructor(); toString(): string; } export declare function isFlowCancellationError(error: Error): error is FlowCancellationError; export type CancellablePromise = Promise & { cancel(): void; }; type FlowGenerator = (...args: any[]) => Generator | AsyncGenerator; interface Flow extends Annotation, PropertyDecorator { (value: Value, context: ClassMethodDecoratorContext): Value | void; (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 {};