import type { AppBskyFeedDefs } from "@atcute/bluesky"; import type { Did, ResourceUri } from "@atcute/lexicons"; import type { ToolsOzoneModerationDefs } from "@atcute/ozone"; import type { Bot } from "../bot/Bot.js"; import { Facet } from "./post/Facet.js"; import { Post } from "./post/Post.js"; import { Profile } from "./Profile.js"; /** * Data used to construct a FeedGenerator class. * @see FeedGenerator */ export interface FeedGeneratorData { displayName: string; uri: string; cid: string; did: string; creator: Profile; description?: string | undefined; descriptionFacets?: Array | undefined; avatar?: string | undefined; isOnline?: boolean; likeUri?: string; indexedAt: Date; } /** * A feed generator that can be followed to receive posts. */ export declare class FeedGenerator { protected bot: Bot; /** The feed generator's name. */ displayName: string; /** The feed generator's AT URI. */ uri: ResourceUri; /** The feed generator's CID. */ cid: string; /** The feed generator's DID. */ did: Did; /** The feed generator's creator. */ creator: Profile; /** The feed generator's description. */ description?: string; /** Any facets associated with the feed generator's description. */ descriptionFacets?: Array; /** The feed generator's avatar. */ avatar?: string; /** Whether the feed generator is currently online. */ isOnline?: boolean; /** The URI of the feed generator's like record, if the viewer has liked the feed generator. */ likeUri?: ResourceUri; /** The time the feed generator was indexed by the AppView. */ indexedAt: Date; /** * @param data Feed generator data. * @param bot The active Bot instance. */ constructor({ displayName, uri, cid, did, creator, description, descriptionFacets, avatar, isOnline, likeUri, indexedAt }: FeedGeneratorData, bot: Bot); /** * Like the feed generator. * @returns The like record's AT URI. */ like(): Promise; /** * Unlike the feed generator. */ unlike(): Promise; /** * Get a feed of posts from the feed generator. * @param options Options for fetching the feed. * @returns The posts and a cursor for pagination. */ getPosts({ limit, cursor }?: FeedGeneratorGetPostsOptions): Promise<{ cursor?: string; posts: Array; }>; /** * Iterate over posts from this feed generator. * @param options Options for fetching the feed. */ iteratePosts(options?: FeedGeneratorGetPostsOptions): AsyncIterableIterator; /** * Apply labels to the feed geenrator. * @param labels The labels to apply. * @param comment An optional comment. */ label(labels: Array, comment?: string): Promise; /** * Negate labels previously applied to the feed geenrator. * @param labels The labels to negate. * @param comment An optional comment. */ negateLabels(labels: Array, comment?: string): Promise; /** * Constructs an instance from a GeneratorView. * @param view The GeneratorView to construct from. * @param bot The active Bot instance. */ static fromView(view: AppBskyFeedDefs.GeneratorView, bot: Bot): FeedGenerator; } /** * Options for the {@link FeedGenerator#getPosts} method. */ export interface FeedGeneratorGetPostsOptions { /** The maximum number of posts to return (1-100, default 100). */ limit?: number; /** The cursor for pagination. */ cursor?: string; }