import { AtUriString, DidString } from '@atproto/syntax'; import { DataPlaneClient } from '../data-plane/client/index.js'; import { FeatureGatesClient, ScopedFeatureGatesClient } from '../feature-gates/index.js'; import { app } from '../lexicons/index.js'; import { BookmarkInfo, Notification } from '../proto/bsky_pb.js'; import { ParsedLabelers } from '../util.js'; import { ActivitySubscriptionStates, ActorHydrator, Actors, KnownFollowersStates, ProfileAggs, ProfileViewerStates } from './actor.js'; import { ExternalHydrator, SiteStandardDocuments, SiteStandardPublications } from './external.js'; import { FeedGenAggs, FeedGenViewerStates, FeedGens, FeedHydrator, FeedItem, type GetPostsHydrationOptions, Likes, Post, PostAggs, PostViewerStates, Postgates, Posts, Reposts, ThreadContexts, Threadgates } from './feed.js'; import { Follows, GraphHydrator, ListAggs, ListItems, ListMembershipStates, ListViewerStates, Lists, StarterPackAggs, StarterPacks, Verifications } from './graph.js'; import { LabelHydrator, LabelerAggs, LabelerViewerStates, Labelers, Labels } from './label.js'; import { HydrationMap, ItemRef, 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): 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 | 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