import { c as MarketingContact, i as MarketingAdapter, n as CampaignStats, t as Campaign, u as MarketingList, w as ComplianceStore } from "./index-Ot3FsdgL.js";
import { MailMessage } from "@platform-modules/mail";
//#region src/self-managed.d.ts
type SelfManagedMail = {
  send(msg: MailMessage): Promise<{
    id: string;
    provider: string;
  }>;
};
type SelfManagedStore = {
  upsertContact(contact: MarketingContact, listId?: string): Promise<void>;
  removeContact(email: string, listId?: string): Promise<void>;
  tagContact(email: string, tag: string): Promise<void>;
  createList(name: string): Promise<MarketingList>;
  lists(): Promise<MarketingList[]>;
  saveCampaign(campaign: Campaign): Promise<void>;
  getCampaign(id: string): Promise<Campaign | null>;
  getListRecipients(listIds: string[]): Promise<string[]>;
  recordOpen(campaignId: string, email: string): Promise<void>;
  recordClick(campaignId: string, email: string, url: string): Promise<void>;
  getStats(campaignId: string): Promise<CampaignStats>;
  createSegment(def: {
    name: string;
    listId: string;
    filter: SegmentFilter;
  }): Promise<Segment>;
  listSegments(listId?: string): Promise<Segment[]>;
  scheduleCampaign(campaignId: string, scheduledAt: string): Promise<void>;
};
type SegmentFilter = {
  tag?: string;
  attributeKey?: string;
  attributeValue?: string;
};
type Segment = {
  id: string;
  name: string;
  listId: string;
  filter: SegmentFilter;
};
type SelfManagedCreds = {
  from: string;
  mail: SelfManagedMail;
  store: SelfManagedStore;
  complianceStore: ComplianceStore;
  replyTo?: string;
};
declare function makeSelfManagedAdapter(creds: SelfManagedCreds): MarketingAdapter & {
  createSegment: SelfManagedStore['createSegment'];
  listSegments: SelfManagedStore['listSegments'];
  scheduleCampaign: SelfManagedStore['scheduleCampaign'];
  recordOpen: SelfManagedStore['recordOpen'];
  recordClick: SelfManagedStore['recordClick'];
};
//#endregion
export { Segment, SegmentFilter, SelfManagedCreds, SelfManagedMail, SelfManagedStore, makeSelfManagedAdapter };