import type { ComponentOpts, WorkflowOpts } from "./types.js";
import { ExecutionNode, STREAMING_PLACEHOLDER } from "./checkpoint-types.js";
import { InputRequest } from "./workflow-context.js";
import { WorkflowMessageListener } from "./workflow-state.js";
export { STREAMING_PLACEHOLDER };
export declare function Component
(name: string, target: (props: P) => R, componentOpts?: ComponentOpts): (props?: P, runtimeOpts?: ComponentOpts) => R;
type WorkflowRuntimeOpts = WorkflowOpts & {
workflowExecutionId?: string;
messageListener?: WorkflowMessageListener;
checkpoint?: ExecutionNode;
printUrl?: boolean;
executionScope?: Record;
onRequestInput?: (request: InputRequest) => Promise;
onRestoreCheckpoint?: (node: ExecutionNode, feedback: unknown) => Promise;
/**
* Optional reference to capture the pending updates promise, that ensures that all traces are sent to the server after completion.
* If provided, the workflow will set this reference to the promise
* that resolves when all checkpoint updates are complete.
* If not provided, the workflow will wait for pending updates before returning.
*
* @example
* ```typescript
* const pendingUpdatesRef = { value: undefined };
* const result = await workflow(props, { pendingUpdatesRef });
* // result is available immediately
* await pendingUpdatesRef.value; // wait for checkpoint updates
* ```
*/
pendingUpdatesRef?: {
value?: Promise;
};
};
export declare function Workflow(name: string, target: (props: P) => R, workflowOpts?: WorkflowOpts): (props?: P, runtimeOpts?: WorkflowRuntimeOpts) => Promise>;
export declare const isReadableStream: (x: unknown) => x is ReadableStream;
export declare const isAsyncIterable: (x: unknown) => x is AsyncIterable;
//# sourceMappingURL=component.d.ts.map