//#region src/experimental/durable-endpoints/client.d.ts
/**
 * Entrypoint file for client-side Durable Endpoint utilities.
 */
interface FetchDurableEndpointOptions {
  /** Fetch function. */
  fetch?: typeof globalThis.fetch;
  /** Options passed to the fetch function. */
  fetchOpts?: RequestInit;
  /** Called when run metadata is received (e.g. run ID). */
  onMetadata?: (args: {
    runId: string;
  }) => void;
  /**
   * Called for each streamed chunk. Should be considered uncommitted until a
   * commit or rollback event is received.
   */
  onData?: (args: {
    data: unknown;
    hashedStepId: string | null;
  }) => void;
  /**
   * Called when uncommitted stream data should be rolled back, since a retry
   * will happen.
   */
  onRollback?: (args: {
    hashedStepId: string | null;
  }) => void;
  /**
   * Called when uncommitted stream data should be committed, since it can no longer be
   * rolled back.
   */
  onCommit?: (args: {
    hashedStepId: string | null;
  }) => void;
}
/**
 * Fetch a durable endpoint URL and consume its SSE stream, dispatching
 * lifecycle callbacks (metadata, data, commit, rollback) as
 * events arrive. Returns the final `Response` reconstructed from the
 * terminal `inngest.response` SSE event.
 *
 * If the server does not respond with `text/event-stream`, the raw
 * `Response` is returned as-is (non-streaming path).
 */
declare function fetchWithStream(url: string, opts?: FetchDurableEndpointOptions): Promise<Response>;
//#endregion
export { fetchWithStream };
//# sourceMappingURL=client.d.cts.map