import { ChannelAdapter } from "./index.js";
import { Querier } from "@platform-modules/db";
//#region src/inbox-schema.d.ts
declare const notifications: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "notifications";
  schema: undefined;
  columns: {
    seq: import("drizzle-orm/pg-core").PgColumn<{
      name: "seq";
      tableName: "notifications";
      dataType: "number";
      columnType: "PgBigSerial53";
      data: number;
      driverParam: number;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "notifications";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    userId: import("drizzle-orm/pg-core").PgColumn<{
      name: "user_id";
      tableName: "notifications";
      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;
    }, {}, {}>;
    title: import("drizzle-orm/pg-core").PgColumn<{
      name: "title";
      tableName: "notifications";
      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;
    }, {}, {}>;
    body: import("drizzle-orm/pg-core").PgColumn<{
      name: "body";
      tableName: "notifications";
      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;
    }, {}, {}>;
    href: import("drizzle-orm/pg-core").PgColumn<{
      name: "href";
      tableName: "notifications";
      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;
    }, {}, {}>;
    kind: import("drizzle-orm/pg-core").PgColumn<{
      name: "kind";
      tableName: "notifications";
      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;
    }, {}, {}>;
    createdAtMs: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at_ms";
      tableName: "notifications";
      dataType: "number";
      columnType: "PgBigInt53";
      data: number;
      driverParam: string | number;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "notifications";
      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;
    }, {}, {}>;
    readAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "read_at";
      tableName: "notifications";
      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;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
declare const notificationsSchema: {
  notifications: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "notifications";
    schema: undefined;
    columns: {
      seq: import("drizzle-orm/pg-core").PgColumn<{
        name: "seq";
        tableName: "notifications";
        dataType: "number";
        columnType: "PgBigSerial53";
        data: number;
        driverParam: number;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "notifications";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      userId: import("drizzle-orm/pg-core").PgColumn<{
        name: "user_id";
        tableName: "notifications";
        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;
      }, {}, {}>;
      title: import("drizzle-orm/pg-core").PgColumn<{
        name: "title";
        tableName: "notifications";
        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;
      }, {}, {}>;
      body: import("drizzle-orm/pg-core").PgColumn<{
        name: "body";
        tableName: "notifications";
        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;
      }, {}, {}>;
      href: import("drizzle-orm/pg-core").PgColumn<{
        name: "href";
        tableName: "notifications";
        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;
      }, {}, {}>;
      kind: import("drizzle-orm/pg-core").PgColumn<{
        name: "kind";
        tableName: "notifications";
        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;
      }, {}, {}>;
      createdAtMs: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at_ms";
        tableName: "notifications";
        dataType: "number";
        columnType: "PgBigInt53";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "notifications";
        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;
      }, {}, {}>;
      readAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "read_at";
        tableName: "notifications";
        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;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
};
type NotificationsSchema = typeof notificationsSchema;
/** Pure DDL helper — column names/types match the drizzle table above exactly (parity requirement). */
declare function notificationsTableSql(table?: string): string;
//#endregion
//#region src/inbox-cursor.d.ts
/**
 * Keyset cursor over NUMERIC (createdAtMs, seq) — collation-safe across pg dialects.
 * Ported from @platform-modules/comments/src/cursor.ts (spec §5 inbox parity).
 */
declare class InvalidCursorError extends Error {
  readonly name = "InvalidCursorError";
  constructor();
}
//#endregion
//#region src/inbox.d.ts
interface NotificationRecord {
  id: string;
  userId: string;
  title: string;
  body?: string;
  href?: string;
  kind?: string;
  createdAt: string;
  readAt: string | null;
}
interface NotificationPutInput {
  userId: string;
  title: string;
  body?: string;
  href?: string;
  kind?: string;
}
interface NotificationListQuery {
  cursor?: string;
  limit?: number;
  unreadOnly?: boolean;
}
interface NotificationPage {
  items: NotificationRecord[];
  nextCursor: string | null;
}
interface NotificationStore {
  put(input: NotificationPutInput): Promise<NotificationRecord>;
  list(userId: string, query?: NotificationListQuery): Promise<NotificationPage>;
  unreadCount(userId: string): Promise<number>;
  markRead(userId: string, ids: string[] | 'all'): Promise<void>;
}
declare class InboxValidationError extends Error {
  readonly field: string;
  readonly detail: string;
  readonly name = "InboxValidationError";
  constructor(field: string, detail: string);
}
declare function createDbNotificationStore(db: Querier<NotificationsSchema>): NotificationStore;
type InboxRecipient = {
  userId: string;
  href?: string;
  kind?: string;
};
/** Persists to NotificationStore — the inbox delivery channel over the shipped notify() pipeline. */
declare function createInboxChannel(store: NotificationStore): ChannelAdapter;
//#endregion
export { InboxRecipient, InboxValidationError, InvalidCursorError, NotificationListQuery, NotificationPage, NotificationPutInput, NotificationRecord, NotificationStore, type NotificationsSchema, createDbNotificationStore, createInboxChannel, notifications, notificationsSchema, notificationsTableSql };