import { CID } from 'multiformats/cid' import { AtUri } from '@atproto/syntax' import { Headers } from '@atproto/xrpc' import { Record as ProfileRecord } from '../lexicon/types/app/bsky/actor/profile' import { Record as PostRecord } from '../lexicon/types/app/bsky/feed/post' import { LocalViewer } from './viewer' export type LocalRecords = { count: number profile: RecordDescript | null posts: RecordDescript[] } export type RecordDescript = { uri: AtUri cid: CID indexedAt: string record: T } export type ApiRes = { headers: Headers data: T } export type MungeFn = ( localViewer: LocalViewer, original: T, local: LocalRecords, requester: string, ) => Promise export type HandlerResponse = { encoding: 'application/json' body: T headers?: Record }