import type { WeftEventMap } from '../core/events.ts'; import type { QueryDefinition, ScheduleSpec, ScheduleSummary, ScheduleUpdateOptions, SearchAttributeValue, SignalDefinition, SignalDeliveryOptions, UpdateDefinition } from '../core/types.ts'; import type { WorkflowEventTail } from './event-tail.ts'; import type { ClientHandle, ClientScheduleHandle, StartOrSignalOutcome } from './interface.ts'; export interface WorkflowHandleDelegationClient { cancel(id: string): Promise; suspend(id: string): Promise; resume(id: string): Promise; tail(id: string): WorkflowEventTail; signal(id: string, name: string, payload?: unknown, options?: SignalDeliveryOptions): Promise; update(id: string, name: string, payload?: unknown, options?: { timeout?: number; }): Promise; query(id: string, name: string, input?: unknown): Promise; getAttributes(id: string): Promise | null>; setAttributes(id: string, attributes: Record): Promise; addTags(id: string, ...tags: string[]): Promise; removeTags(id: string, ...tags: string[]): Promise; } export declare abstract class WorkflowHandleDelegation implements ClientHandle { readonly id: string; protected readonly client: TClient; readonly outcome: StartOrSignalOutcome | undefined; constructor(id: string, client: TClient, outcome?: StartOrSignalOutcome); abstract result(): Promise; cancel(): Promise; suspend(): Promise; resume(): Promise; signal(name: SignalDefinition): Promise; signal(name: SignalDefinition, payload: TInput, options?: SignalDeliveryOptions): Promise; signal(name: string, payload?: unknown, options?: SignalDeliveryOptions): Promise; update(name: UpdateDefinition, payload?: void, options?: { timeout?: number; }): Promise; update(name: UpdateDefinition, payload: TInput, options?: { timeout?: number; }): Promise; update(name: string, payload?: unknown, options?: { timeout?: number; }): Promise; query(name: QueryDefinition): Promise; query(name: QueryDefinition, input: TInput): Promise; query(name: string, input?: unknown): Promise; getAttributes(): Promise | null>; setAttributes(attributes: Record): Promise; addTags(...tags: string[]): Promise; removeTags(...tags: string[]): Promise; tail(): WorkflowEventTail; /** * Default readiness: resolved immediately. Transports whose event stream has * connection latency (e.g. the HTTP watch socket) override this to reflect * their own connection state. */ whenConnected(): Promise; abstract addEventListener(type: K, listener: (event: WeftEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; abstract addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; abstract removeEventListener(type: K, listener: (event: WeftEventMap[K]) => void, options?: boolean | EventListenerOptions): void; abstract removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; abstract [Symbol.dispose](): void; } export interface ScheduleHandleDelegationClient { pauseSchedule(id: string): Promise; resumeSchedule(id: string): Promise; cancelSchedule(id: string): Promise; updateSchedule(id: string, newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise; getSchedule(id: string): Promise; } export declare abstract class ScheduleHandleDelegation implements ClientScheduleHandle { readonly id: string; protected readonly client: TClient; constructor(id: string, client: TClient); pause(): Promise; resume(): Promise; cancel(): Promise; update(newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise; describe(): Promise; abstract [Symbol.dispose](): void; }