import type { AtUriString, DatetimeString, DidString } from '@atproto/lex-schema'; import type { NotificationsV2Algorithm } from '../../../../../config.js'; import type { Notification, NotificationFeed } from '../../../../../proto/bsky_pb.js'; import { type AppviewNotificationReason, type DataplaneNotificationReason, NOTIFICATION_REASON } from '../constants.js'; type DataplaneNotificationReasonWithSubject = typeof NOTIFICATION_REASON.LIKE | typeof NOTIFICATION_REASON.REPOST | typeof NOTIFICATION_REASON.LIKE_VIA_REPOST | typeof NOTIFICATION_REASON.REPOST_VIA_REPOST | typeof NOTIFICATION_REASON.REPLY | typeof NOTIFICATION_REASON.QUOTE | typeof NOTIFICATION_REASON.STARTERPACK_JOINED; export type RawNotification = { recipientDid: DidString; uri: AtUriString; indexedAt: DatetimeString; } & ({ reason: DataplaneNotificationReasonWithSubject; reasonSubject: AtUriString; } | { reason: typeof NOTIFICATION_REASON.FOLLOW | typeof NOTIFICATION_REASON.FOLLOW_BACK; reasonSubject: AtUriString | undefined; } | { reason: Exclude; reasonSubject: undefined; }); export type NotificationItem = { raw: RawNotification; id: string; groupingKey: string; actorDid: DidString; indexedTime: number; }; export declare const buildNotificationItem: (raw: RawNotification, id: string, groupingKey: string, actorDid: DidString) => NotificationItem; export type NotificationGroup = { id: string; kind: AppviewNotificationReason; groupingKey: string; actorDids: DidString[]; itemCount: number; indexedAt: DatetimeString; firstIndexedAt: DatetimeString; isRead: boolean; items: NotificationItem[]; }; export type GroupingResult = { groups: NotificationGroup[]; cursor?: string; }; export type GroupBuilder = (items: NotificationItem[]) => GroupingResult; export type GroupBuilderFactory = (limit: number, now: number, seenAt?: number, feed?: NotificationFeed) => GroupBuilder; export type BurstSplitter = (items: NotificationItem[], now: number, timeSpanMultiplier: number) => NotificationItem[][]; type GroupingAlgorithm = { createGroupBuilder: GroupBuilderFactory; splitBursts: BurstSplitter; }; export declare function parseRawNotification(notification: Notification): RawNotification | undefined; /** Select matching implementations for ordinary grouping and spotlight bursts. */ export declare const getGroupingAlgorithm: (algorithm: NotificationsV2Algorithm) => GroupingAlgorithm; export {}; //# sourceMappingURL=grouping.d.ts.map