import { Annotation } from "../internal"; import { type DecoratorAnnotation } from "./decoratorannotation"; 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; }; interface Flow extends Annotation, ClassMethodDecorator { (generator: (...args: Args) => Generator | AsyncGenerator, context?: never): (...args: Args) => CancellablePromise; } export declare const flow: Flow; export declare const flowBound: DecoratorAnnotation; export declare function flowResult(result: T): T extends Generator ? CancellablePromise : T extends CancellablePromise ? T : never; export declare function isFlow(fn: any): boolean; export {};