import { k as ChannelPollResult } from "./types.core-CuC3Nb15.js"; import { b as OutboundDeliveryResult, n as ChannelOutboundAdapter } from "./outbound.types-CfSE45o1.js"; //#region src/plugin-sdk/channel-send-result.d.ts /** Legacy raw send result shape accepted from channel SDK adapters. */ type ChannelSendRawResult = { /** Whether the channel send operation succeeded. */ok: boolean; /** Platform message id; null/undefined normalizes to the empty-id sentinel. */ messageId?: string | null; /** Legacy error text converted to an Error for outbound callers. */ error?: string | null; }; /** Attaches the channel id to a single outbound send result. */ declare function attachChannelToResult(/** Channel id to stamp onto the returned delivery result. */ channel: string, /** Delivery-shaped result without channel metadata. */ result: T): { channel: string; } & T; /** Attaches the channel id to each outbound send result in order. */ declare function attachChannelToResults(/** Channel id to stamp onto every returned delivery result. */ channel: string, /** Ordered delivery-shaped results without channel metadata. */ results: readonly T[]): ({ channel: string; } & T)[]; /** Creates an empty outbound delivery result for send paths that produced no platform id. */ declare function createEmptyChannelResult(/** Channel id attached to the synthetic empty result. */ channel: string, /** Additional delivery metadata to preserve alongside the empty message id. */ result?: Partial> & { messageId?: string; }): OutboundDeliveryResult; type MaybePromise = T | Promise; type SendTextParams = Parameters>[0]; type SendMediaParams = Parameters>[0]; type SendPollParams = Parameters>[0]; /** Wraps outbound send methods that already return delivery-shaped results without channel ids. */ declare function createAttachedChannelResultAdapter(params: { /** Channel id attached to every wrapped send result. */channel: string; /** Text sender that returns an outbound result without channel metadata. */ sendText?: (ctx: SendTextParams) => MaybePromise>; /** Media sender that returns an outbound result without channel metadata. */ sendMedia?: (ctx: SendMediaParams) => MaybePromise>; /** Poll sender that returns a poll result without channel metadata. */ sendPoll?: (ctx: SendPollParams) => MaybePromise>; }): Pick; /** Wraps legacy raw text/media send methods and normalizes their results. */ declare function createRawChannelSendResultAdapter(params: { /** Channel id attached to every normalized legacy send result. */channel: string; /** Legacy text sender that returns ok/messageId/error fields. */ sendText?: (ctx: SendTextParams) => MaybePromise; /** Legacy media sender that returns ok/messageId/error fields. */ sendMedia?: (ctx: SendMediaParams) => MaybePromise; }): Pick; /** Normalize raw channel send results into the shape shared outbound callers expect. */ declare function buildChannelSendResult(/** Channel id attached to the normalized delivery result. */ channel: string, /** Legacy raw channel result to normalize. */ result: ChannelSendRawResult): { channel: string; ok: boolean; messageId: string; error: Error | undefined; }; //#endregion export { type ChannelOutboundAdapter, ChannelSendRawResult, type OutboundDeliveryResult, attachChannelToResult, attachChannelToResults, buildChannelSendResult, createAttachedChannelResultAdapter, createEmptyChannelResult, createRawChannelSendResultAdapter };