import { type AtUriString, type DidString } from '@atproto/syntax'; import type { DataPlaneClient } from '../data-plane/client/index.js'; import type { FeatureGatesClient, ScopedFeatureGatesClient } from '../feature-gates/index.js'; import { app } from '../lexicons/index.js'; import type { BookmarkInfo, Notification } from '../proto/bsky_pb.js'; import type { ParsedLabelers } from '../util.js'; import { type ActivitySubscriptionStates, ActorHydrator, type Actors, type KnownFollowersStates, type ProfileAggs, type ProfileViewerStates } from './actor.js'; import { ExternalHydrator, type SiteStandardDocuments, type SiteStandardPublications } from './external.js'; import { type FeedGenAggs, type FeedGenViewerStates, type FeedGens, FeedHydrator, type FeedItem, type GetPostsHydrationOptions, type Likes, type Post, type PostAggs, type PostViewerStates, type Postgates, type Posts, type Reposts, type ThreadContexts, type Threadgates } from './feed.js'; import { type Follows, GraphHydrator, type ListAggs, type ListItems, type ListMembershipStates, type ListViewerStates, type Lists, type StarterPackAggs, type StarterPacks, type Verifications } from './graph.js'; import { LabelHydrator, type LabelerAggs, type LabelerViewerStates, type Labelers, Labels } from './label.js'; import { HydrationMap, type ItemRef, type RecordInfo } from './util.js'; export declare class HydrateCtx { private vals; labelers: ParsedLabelers; viewer: `did:${string}:${string}` | null; includeTakedowns: boolean | undefined; overrideIncludeTakedownsForActor: boolean | undefined; include3pBlocks: boolean | undefined; skipViewerBlocks: boolean | undefined; includeDebugField: boolean | undefined; features: ScopedFeatureGatesClient; constructor(vals: HydrateCtxVals); get skipCacheForViewer(): `did:${string}:${string}`[] | undefined; copy>(vals?: V): HydrateCtx & V; } export type HydrateCtxWithViewer = HydrateCtx & { viewer: string; }; export type HydrateCtxVals = { labelers: ParsedLabelers; viewer: DidString | null; includeTakedowns?: boolean; overrideIncludeTakedownsForActor?: boolean; include3pBlocks?: boolean; skipViewerBlocks?: boolean; includeDebugField?: boolean; features: ScopedFeatureGatesClient; }; export type HydrationState = { ctx?: HydrateCtx; actors?: Actors; profileViewers?: ProfileViewerStates; profileAggs?: ProfileAggs; posts?: Posts; postAggs?: PostAggs; postViewers?: PostViewerStates; threadContexts?: ThreadContexts; postBlocks?: PostBlocks; reposts?: Reposts; follows?: Follows; followBlocks?: FollowBlocks; threadgates?: Threadgates; postgates?: Postgates; lists?: Lists; listAggs?: ListAggs; listMemberships?: ListMembershipStates; listViewers?: ListViewerStates; listItems?: ListItems; likes?: Likes; likeBlocks?: LikeBlocks; labels?: Labels; feedgens?: FeedGens; feedgenViewers?: FeedGenViewerStates; feedgenAggs?: FeedGenAggs; starterPacks?: StarterPacks; starterPackAggs?: StarterPackAggs; labelers?: Labelers; labelerViewers?: LabelerViewerStates; labelerAggs?: LabelerAggs; knownFollowers?: KnownFollowersStates; activitySubscriptions?: ActivitySubscriptionStates; bidirectionalBlocks?: BidirectionalBlocks; verifications?: Verifications; bookmarks?: Bookmarks; siteStandardDocuments?: SiteStandardDocuments; siteStandardPublications?: SiteStandardPublications; }; export type PostBlock = { embed: boolean; parent: boolean; root: boolean; }; export type PostBlocks = HydrationMap; export type LikeBlock = boolean; export type LikeBlocks = HydrationMap; export type FollowBlock = boolean; export type FollowBlocks = HydrationMap; export type BidirectionalBlocks = HydrationMap>; export type Bookmark = { ref?: { key: string; }; subjectUri: string; subjectCid: string; indexedAt?: Date; }; export type Bookmarks = HydrationMap>; /** * Additional config passed from `ServerConfig` to the `Hydrator` instance. * Values within this config object may be passed to other sub-hydrators. */ export type HydratorConfig = { debugFieldAllowedDids: Set; featureGatesClient: FeatureGatesClient; }; export declare class Hydrator { dataplane: DataPlaneClient; actor: ActorHydrator; external: ExternalHydrator; feed: FeedHydrator; graph: GraphHydrator; label: LabelHydrator; serviceLabelers: Set; config: HydratorConfig; constructor(dataplane: DataPlaneClient, serviceLabelers: readonly DidString[] | undefined, config: HydratorConfig); hydrateProfileViewers(dids: DidString[], ctx: HydrateCtx): Promise; hydrateProfiles(dids: DidString[], ctx: HydrateCtx): Promise; hydrateProfilesBasic(dids: DidString[], ctx: HydrateCtx): Promise; hydrateProfilesDetailed(dids: DidString[], ctx: HydrateCtx, opts?: { knownFollowersDids?: DidString[]; }): Promise; hydrateLists(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateListsBasic(uris: AtUriString[], ctx: HydrateCtx, opts?: { skipAuthors: boolean; }): Promise; hydrateListItems(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateListsMembership(uris: AtUriString[], did: DidString, ctx: HydrateCtx): Promise; hydratePosts(refs: { uri: AtUriString; }[], ctx: HydrateCtx, state?: HydrationState, options?: Pick): Promise; private hydratePostBlocks; hydrateFeedItems(items: FeedItem[], ctx: HydrateCtx): Promise; /** * Hydrate the state needed to build an `app.bsky.embed.external#view` for * a set of `site.standard.*` AT-URIs at compose-time. Filters input URIs to * SS collections, fetches latest indexed versions plus labels, and gates * taken-down records. */ hydrateEmbedExternalViewFromUris(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateThreadPosts(refs: ItemRef[], ctx: HydrateCtx): Promise; hydrateFeedGens(uris: AtUriString[], // @TODO any way to get refs here? ctx: HydrateCtx): Promise; hydrateStarterPacksBasic(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateStarterPacks(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateLikes(authorDid: DidString, uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateReposts(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateNotifications(notifs: Notification[], ctx: HydrateCtx): Promise; hydrateBookmarks(bookmarkInfos: BookmarkInfo[], ctx: HydrateCtx): Promise; hydrateFollows(uris: AtUriString[], ctx: HydrateCtx): Promise; hydrateBidirectionalBlocks(didMap: Map, // DID -> DID[] ctx: HydrateCtx): Promise; hydrateLabelers(dids: DidString[], ctx: HydrateCtx): Promise; getRecord(uri: AtUriString, includeTakedowns?: boolean): Promise | import("./feed.js").Repost | import("./graph.js").StarterPack | import("./actor.js").Status | import("./feed.js").Threadgate | Post | undefined>; createContext & { features?: ScopedFeatureGatesClient; }>(vals: V): Promise; resolveUri(uriStr: AtUriString): Promise; } export declare const mergeStates: (stateA: HydrationState, stateB: HydrationState) => HydrationState; export declare const mergeManyStates: (...states: HydrationState[]) => HydrationState; //# sourceMappingURL=hydrator.d.ts.map