import { type AppBskyGraphDefs, type AppBskyRichtextFacet } from "@atcute/bluesky"; import type { ToolsOzoneModerationDefs } from "@atcute/ozone"; import type { Bot } from "../bot/Bot.js"; import { Post } from "./post/Post.js"; import { Profile } from "./Profile.js"; /** * The purpose of a list. * @enum */ export declare const ListPurpose: { /** A moderation list. */ ModList: string; /** A user list. */ CurateList: string; }; export type ListPurpose = typeof ListPurpose[keyof typeof ListPurpose]; /** * Data used to construct a List class. */ export interface ListData { /** The list's name. */ name: string; /** The list's AT URI. */ uri: string; /** The list's CID. */ cid: string; /** The list's purpose. */ purpose: ListPurpose; /** The list's creator. */ creator?: Profile | undefined; /** The list's description. */ description?: string | undefined; /** Any facets associated with the list's description. */ descriptionFacets?: Array | undefined; /** The list's avatar. */ avatar?: string | undefined; /** The list's members. */ items?: Array; /** The AT URI of the list block record, if the logged in user has the list blocked. */ blockUri?: string | undefined; /** Whether the logged in user has the list muted. */ muted?: boolean | undefined; /** The time the list was indexed by the AppView. */ indexedAt?: Date | undefined; } /** * A list of users. */ export declare class List { protected bot: Bot; /** The list's name. */ name: string; /** The list's AT URI. */ uri: string; /** The list's CID. */ cid: string; /** The list's purpose. */ purpose: ListPurpose; /** The list's creator. */ creator?: Profile; /** The list's description. */ description?: string; /** Any facets associated with the list's description. */ descriptionFacets?: Array; /** The list's avatar. */ avatar?: string; /** The list's members. */ items?: Array; /** The AT URI of the list block record, if the bot has the list blocked. */ blockUri?: string; /** Whether the bot has the list muted. */ muted?: boolean; /** The time the list was indexed by the AppView. */ indexedAt?: Date; /** Whether the list is a mod list. */ get isModList(): boolean; /** Whether the list is a curation list. */ get isCurateList(): boolean; /** * @param data List data. * @param bot The active Bot instance. */ constructor({ name, uri, cid, creator, purpose, description, descriptionFacets, avatar, items, indexedAt, }: ListData, bot: Bot); /** * Fetch the list's members. * @param options Options for fetching list members. */ fetchItems({ force }?: ListFetchItemsOptions): Promise>; /** * Mute all accounts on the list. */ mute(): Promise; /** * Unmute all accounts on the list. */ unmute(): Promise; /** * Block all accounts on the list. * @returns The AT URI of the list block record. */ block(): Promise; /** * Unblock all accounts on the list. */ unblock(): Promise; /** * Get a feed of recent posts from accounts on the list. * @param options Options for fetching the feed. */ getFeed({ limit, cursor }?: ListGetFeedOptions): Promise<{ cursor?: string; posts: Array; }>; /** * Iterate over recent posts from accounts on the list. * @param options Options for fetching the feed. */ iterateFeed(options?: ListGetFeedOptions): AsyncIterableIterator; /** * Apply labels to the list. * @param labels The labels to apply. * @param comment An optional comment. */ label(labels: Array, comment?: string): Promise; /** * Negate labels previously applied to the list. * @param labels The labels to negate. * @param comment An optional comment. */ negateLabels(labels: Array, comment?: string): Promise; /** * Constructs an instance from a ListView. * @param view The ListView to construct from. * @param bot The active Bot instance. */ static fromView(view: AppBskyGraphDefs.ListView | AppBskyGraphDefs.ListViewBasic, bot: Bot): List; } /** * Options for the {@link List#fetchItems} method. */ export interface ListFetchItemsOptions { /** Whether to fetch items even if they are already cached. */ force?: boolean; } /** * Options for the {@link List#getFeed} method. */ export interface ListGetFeedOptions { /** The maximum number of posts to fetch (1-100, default 100). */ limit?: number; /** The cursor for pagination. */ cursor?: string; }