import { Querier } from '@platform-modules/db';
import { ChannelAdapter } from './index.js';
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';

declare const notifications: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "notifications";
    schema: undefined;
    columns: {
        seq: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: drizzle_orm_pg_core.PgTableWithColumns<{
        name: "notifications";
        schema: undefined;
        columns: {
            seq: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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;

/**
 * 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();
}

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;

export { type InboxRecipient, InboxValidationError, InvalidCursorError, type NotificationListQuery, type NotificationPage, type NotificationPutInput, type NotificationRecord, type NotificationStore, type NotificationsSchema, createDbNotificationStore, createInboxChannel, notifications, notificationsSchema, notificationsTableSql };
