import { DispatchOpts, JobRegistry } from "./index.js";
import { QueueBinding } from "./cf-queues.js";
import { Querier } from "@platform-modules/db";
//#region src/outbox.d.ts
declare const outboxTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "outbox";
  schema: undefined;
  columns: {
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "outbox";
      dataType: "string";
      columnType: "PgUUID";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    aggregateType: import("drizzle-orm/pg-core").PgColumn<{
      name: "aggregate_type";
      tableName: "outbox";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    aggregateId: import("drizzle-orm/pg-core").PgColumn<{
      name: "aggregate_id";
      tableName: "outbox";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    eventType: import("drizzle-orm/pg-core").PgColumn<{
      name: "event_type";
      tableName: "outbox";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    payload: import("drizzle-orm/pg-core").PgColumn<{
      name: "payload";
      tableName: "outbox";
      dataType: "json";
      columnType: "PgJsonb";
      data: unknown;
      driverParam: unknown;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    processedAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "processed_at";
      tableName: "outbox";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    failedAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "failed_at";
      tableName: "outbox";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    retryCount: import("drizzle-orm/pg-core").PgColumn<{
      name: "retry_count";
      tableName: "outbox";
      dataType: "number";
      columnType: "PgInteger";
      data: number;
      driverParam: string | number;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    lastError: import("drizzle-orm/pg-core").PgColumn<{
      name: "last_error";
      tableName: "outbox";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: false;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "outbox";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
type OutboxRow = typeof outboxTable.$inferSelect;
type NewOutboxRow = typeof outboxTable.$inferInsert;
declare const schema: {
  outbox: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "outbox";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "outbox";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      aggregateType: import("drizzle-orm/pg-core").PgColumn<{
        name: "aggregate_type";
        tableName: "outbox";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      aggregateId: import("drizzle-orm/pg-core").PgColumn<{
        name: "aggregate_id";
        tableName: "outbox";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      eventType: import("drizzle-orm/pg-core").PgColumn<{
        name: "event_type";
        tableName: "outbox";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      payload: import("drizzle-orm/pg-core").PgColumn<{
        name: "payload";
        tableName: "outbox";
        dataType: "json";
        columnType: "PgJsonb";
        data: unknown;
        driverParam: unknown;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      processedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "processed_at";
        tableName: "outbox";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      failedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "failed_at";
        tableName: "outbox";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      retryCount: import("drizzle-orm/pg-core").PgColumn<{
        name: "retry_count";
        tableName: "outbox";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      lastError: import("drizzle-orm/pg-core").PgColumn<{
        name: "last_error";
        tableName: "outbox";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "outbox";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
};
type OutboxSchema = typeof schema;
declare function insertOutboxRow<S extends OutboxSchema>(db: Querier<S>, values: NewOutboxRow): Promise<OutboxRow>;
/** Post-commit, fire-and-forget — never throws. Sends `{ outboxId }` only. */
declare function enqueueOutbox(queue: QueueBinding<{
  outboxId: string;
}>, outboxId: string): void;
declare function dispatchOutboxRow<E, S extends OutboxSchema>(registry: JobRegistry<E>, db: Querier<S>, row: OutboxRow, env: E, opts?: DispatchOpts<E>): Promise<'dispatched' | 'skipped'>;
//#endregion
export { NewOutboxRow, OutboxRow, dispatchOutboxRow, enqueueOutbox, insertOutboxRow, schema as outboxSchema, outboxTable };