import { DatabasePayload, Id, Notifiable } from "../types.mjs"; import { Channel } from "../contracts/channel.contract.mjs"; import { NotificationContract } from "../contracts/notification.contract.mjs"; import { BaseNotificationsRepository, NotificationModelClass, NotificationsFilter } from "./base-notifications-repository.mjs"; import { TypedRepositoryOptionsWithPages } from "@warlock.js/core"; //#region ../notifications/src/in-app/in-app.d.ts /** * List options for the read methods — the repository's paginated options * (`page` / `limit` / `orderBy` / filter keys). `recipientId` is always forced * from the recipient argument, so passing it here has no effect. */ type NotificationsListOptions = TypedRepositoryOptionsWithPages; /** * Configure options — discriminated so `model` and `repository` are mutually * exclusive at the type level. Future knobs (cache / realtime / naming) slot * in here without breaking the signature. */ type ConfigureOptions = { model: NotificationModelClass; repository?: never; } | { repository: BaseNotificationsRepository; model?: never; }; declare class InApp { private repo?; /** * Bind the in-app store AND return the `database` channel. Called once * from `config/notifications.ts`. Subsequent calls REPLACE the binding. */ configure(options: ConfigureOptions): Channel; private get repository(); /** General list — scoped to recipient; pass `options` for paging + filters. */ list(recipient: Notifiable | Id, options?: NotificationsListOptions): Promise>; /** Unread-only list — common case for badges + dashboards. */ listUnread(recipient: Notifiable | Id, options?: NotificationsListOptions): Promise>; /** * Cached unread count — backs the badge. Auto-invalidated by the repo's * model create/update events (`RepositoryManager.registerEvents`). */ countUnread(recipient: Notifiable | Id): Promise; /** Find one notification for a recipient — for a detail view. */ find(recipient: Notifiable | Id, id: Id): Promise; /** Mark read — `id` omitted = all unread for this recipient. */ markAsRead(recipient: Notifiable | Id, id?: Id): Promise; /** Mark unread — same recipient-scoping. */ markAsUnread(recipient: Notifiable | Id, id?: Id): Promise; /** Delete/dismiss — `id` omitted = clear all for this recipient. */ dismiss(recipient: Notifiable | Id, id?: Id): Promise; } /** Single in-app facade — bound at boot via `inApp.configure(...)`. */ declare const inApp: InApp; //#endregion export { ConfigureOptions, NotificationsListOptions, inApp }; //# sourceMappingURL=in-app.d.mts.map