import { Cid } from '@atproto/lex-data' import { AtUri, DatetimeString } from '@atproto/syntax' import { app } from '../lexicons/index.js' import { LocalViewer } from './viewer' export type LocalRecords = { count: number profile: RecordDescript | null posts: RecordDescript[] } export type RecordDescript = { uri: AtUri cid: Cid indexedAt: DatetimeString record: T } export type ApiRes = { headers: Record data: T } export type MungeFn = ( localViewer: LocalViewer, original: T, local: LocalRecords, requester: string, ) => Promise export type HandlerResponse = { encoding: 'application/json' body: T headers?: Record }