import { Insertable } from 'kysely'; import { Cid, l } from '@atproto/lex'; import { AtUri } from '@atproto/syntax'; import { BackgroundQueue } from '../background.js'; import { DatabaseSchema } from '../db/database-schema.js'; import { Database } from '../db/index.js'; import { Notification } from '../db/tables/notification.js'; type RecordProcessorOptions = { schema: TSchema; insertFn: (db: DatabaseSchema, uri: AtUri, cid: Cid, obj: l.InferInput, timestamp: string) => Promise; findDuplicate: (db: DatabaseSchema, uri: AtUri, obj: l.InferInput) => Promise; deleteFn: (db: DatabaseSchema, uri: AtUri) => Promise; notifsForInsert: (obj: TRow) => Notif[]; notifsForDelete: (prev: TRow, replacedBy: TRow | null) => { notifs: Notif[]; toDelete: string[]; }; updateAggregates?: (db: DatabaseSchema, obj: TRow) => Promise; }; type Notif = Insertable; export declare class RecordProcessor { private appDb; private background; private options; constructor(appDb: Database, background: BackgroundQueue, options: RecordProcessorOptions); get db(): DatabaseSchema; get collection(): TSchema['$type']; matchesSchema(obj: I): obj is I & l.InferInput; assertValidRecord(obj: unknown): asserts obj is l.InferInput; insertRecord(uri: AtUri, cid: Cid, obj: unknown, timestamp: string, opts?: { disableNotifs?: boolean; }): Promise; updateRecord(uri: AtUri, cid: Cid, obj: unknown, timestamp: string, opts?: { disableNotifs?: boolean; }): Promise; deleteRecord(uri: AtUri, cascading?: boolean): Promise; handleNotifs(op: { deleted?: TRow; inserted?: TRow; }): Promise; filterNotifsForThreadMutes(notifs: Notif[]): Promise; isNotifBlockedByThreadMute(notif: Notif): Promise; aggregateOnCommit(indexed: TRow): void; } export default RecordProcessor; //# sourceMappingURL=processor.d.ts.map