UNPKG

@atproto/api

Version:

Client library for atproto and Bluesky

88 lines (87 loc) 4 kB
import { AtpAgent } from './agent'; import { AppBskyFeedPost, AppBskyActorProfile } from './client'; import { BskyPreferences, BskyLabelPreference, BskyFeedViewPreference, BskyThreadViewPreference } from './types'; declare global { interface Array<T> { findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T; } } export declare class BskyAgent extends AtpAgent { get app(): import("./client").AppNS; getTimeline: typeof this.api.app.bsky.feed.getTimeline; getAuthorFeed: typeof this.api.app.bsky.feed.getAuthorFeed; getActorLikes: typeof this.api.app.bsky.feed.getActorLikes; getPostThread: typeof this.api.app.bsky.feed.getPostThread; getPost: typeof this.api.app.bsky.feed.post.get; getPosts: typeof this.api.app.bsky.feed.getPosts; getLikes: typeof this.api.app.bsky.feed.getLikes; getRepostedBy: typeof this.api.app.bsky.feed.getRepostedBy; getFollows: typeof this.api.app.bsky.graph.getFollows; getFollowers: typeof this.api.app.bsky.graph.getFollowers; getProfile: typeof this.api.app.bsky.actor.getProfile; getProfiles: typeof this.api.app.bsky.actor.getProfiles; getSuggestions: typeof this.api.app.bsky.actor.getSuggestions; searchActors: typeof this.api.app.bsky.actor.searchActors; searchActorsTypeahead: typeof this.api.app.bsky.actor.searchActorsTypeahead; listNotifications: typeof this.api.app.bsky.notification.listNotifications; countUnreadNotifications: typeof this.api.app.bsky.notification.getUnreadCount; post(record: Partial<AppBskyFeedPost.Record> & Omit<AppBskyFeedPost.Record, 'createdAt'>): Promise<{ uri: string; cid: string; }>; deletePost(postUri: string): Promise<void>; like(uri: string, cid: string): Promise<{ uri: string; cid: string; }>; deleteLike(likeUri: string): Promise<void>; repost(uri: string, cid: string): Promise<{ uri: string; cid: string; }>; deleteRepost(repostUri: string): Promise<void>; follow(subjectDid: string): Promise<{ uri: string; cid: string; }>; deleteFollow(followUri: string): Promise<void>; upsertProfile(updateFn: (existing: AppBskyActorProfile.Record | undefined) => AppBskyActorProfile.Record | Promise<AppBskyActorProfile.Record>): Promise<void>; mute(actor: string): Promise<import("./client/types/app/bsky/graph/muteActor").Response>; unmute(actor: string): Promise<import("./client/types/app/bsky/graph/unmuteActor").Response>; muteModList(uri: string): Promise<import("./client/types/app/bsky/graph/muteActorList").Response>; unmuteModList(uri: string): Promise<import("./client/types/app/bsky/graph/unmuteActorList").Response>; blockModList(uri: string): Promise<{ uri: string; cid: string; }>; unblockModList(uri: string): Promise<void>; updateSeenNotifications(seenAt?: string): Promise<import("./client/types/app/bsky/notification/updateSeen").Response>; getPreferences(): Promise<BskyPreferences>; setSavedFeeds(saved: string[], pinned: string[]): Promise<{ saved: string[]; pinned: string[]; }>; addSavedFeed(v: string): Promise<{ saved: string[]; pinned: string[]; }>; removeSavedFeed(v: string): Promise<{ saved: string[]; pinned: string[]; }>; addPinnedFeed(v: string): Promise<{ saved: string[]; pinned: string[]; }>; removePinnedFeed(v: string): Promise<{ saved: string[]; pinned: string[]; }>; setAdultContentEnabled(v: boolean): Promise<void>; setContentLabelPref(key: string, value: BskyLabelPreference): Promise<void>; setPersonalDetails({ birthDate, }: { birthDate: string | Date | undefined; }): Promise<void>; setFeedViewPrefs(feed: string, pref: Partial<BskyFeedViewPreference>): Promise<void>; setThreadViewPrefs(pref: Partial<BskyThreadViewPreference>): Promise<void>; }