import { A as ChannelPollResult } from "./types.core-B4TEcHvN.js";
import { b as OutboundDeliveryResult, n as ChannelOutboundAdapter } from "./outbound.types-zeWA9XuZ.js";
//#region src/plugin-sdk/channel-send-result.d.ts
/** Legacy raw send result shape accepted from channel SDK adapters. */
type ChannelSendRawResult = {
  ok: boolean;
  messageId?: string | null;
  error?: string | null;
};
/** Attaches the channel id to a single outbound send result. */
declare function attachChannelToResult<T extends object>(channel: string, result: T): {
  channel: string;
} & T;
/** Attaches the channel id to each outbound send result in order. */
declare function attachChannelToResults<T extends object>(channel: string, results: readonly T[]): ({
  channel: string;
} & T)[];
/** Creates an empty outbound delivery result for send paths that produced no platform id. */
declare function createEmptyChannelResult(channel: string, result?: Partial<Omit<OutboundDeliveryResult, "channel" | "messageId">> & {
  messageId?: string;
}): OutboundDeliveryResult;
type MaybePromise<T> = T | Promise<T>;
type SendTextParams = Parameters<NonNullable<ChannelOutboundAdapter["sendText"]>>[0];
type SendMediaParams = Parameters<NonNullable<ChannelOutboundAdapter["sendMedia"]>>[0];
type SendPollParams = Parameters<NonNullable<ChannelOutboundAdapter["sendPoll"]>>[0];
/** Wraps outbound send methods that already return delivery-shaped results without channel ids. */
declare function createAttachedChannelResultAdapter(params: {
  channel: string;
  sendText?: (ctx: SendTextParams) => MaybePromise<Omit<OutboundDeliveryResult, "channel">>;
  sendMedia?: (ctx: SendMediaParams) => MaybePromise<Omit<OutboundDeliveryResult, "channel">>;
  sendPoll?: (ctx: SendPollParams) => MaybePromise<Omit<ChannelPollResult, "channel">>;
}): Pick<ChannelOutboundAdapter, "sendText" | "sendMedia" | "sendPoll">;
/** Wraps legacy raw text/media send methods and normalizes their results. */
declare function createRawChannelSendResultAdapter(params: {
  channel: string;
  sendText?: (ctx: SendTextParams) => MaybePromise<ChannelSendRawResult>;
  sendMedia?: (ctx: SendMediaParams) => MaybePromise<ChannelSendRawResult>;
}): Pick<ChannelOutboundAdapter, "sendText" | "sendMedia">;
/** Normalize raw channel send results into the shape shared outbound callers expect. */
declare function buildChannelSendResult(channel: string, result: ChannelSendRawResult): {
  channel: string;
  ok: boolean;
  messageId: string;
  error: Error | undefined;
};
//#endregion
export { type ChannelOutboundAdapter, ChannelSendRawResult, type OutboundDeliveryResult, attachChannelToResult, attachChannelToResults, buildChannelSendResult, createAttachedChannelResultAdapter, createEmptyChannelResult, createRawChannelSendResultAdapter };