UNPKG

@atproto/api

Version:

Client library for atproto and Bluesky

62 lines (61 loc) 1.97 kB
import { LabelPreference } from './moderation/types'; export declare type AtpSessionEvent = 'create' | 'create-failed' | 'update' | 'expired'; export interface AtpSessionData { refreshJwt: string; accessJwt: string; handle: string; did: string; email?: string; emailConfirmed?: boolean; } export declare type AtpPersistSessionHandler = (evt: AtpSessionEvent, session: AtpSessionData | undefined) => void | Promise<void>; export interface AtpAgentOpts { service: string | URL; persistSession?: AtpPersistSessionHandler; } export interface AtpAgentCreateAccountOpts { email: string; password: string; handle: string; inviteCode?: string; } export interface AtpAgentLoginOpts { identifier: string; password: string; } declare type AtpAgentFetchHeaders = Record<string, string>; export interface AtpAgentFetchHandlerResponse { status: number; headers: Record<string, string>; body: any; } export declare type AtpAgentFetchHandler = (httpUri: string, httpMethod: string, httpHeaders: AtpAgentFetchHeaders, httpReqBody: any) => Promise<AtpAgentFetchHandlerResponse>; export interface AtpAgentGlobalOpts { fetch: AtpAgentFetchHandler; } export declare type BskyLabelPreference = LabelPreference | 'show'; export interface BskyFeedViewPreference { hideReplies: boolean; hideRepliesByUnfollowed: boolean; hideRepliesByLikeCount: number; hideReposts: boolean; hideQuotePosts: boolean; [key: string]: any; } export interface BskyThreadViewPreference { sort: string; prioritizeFollowedUsers: boolean; [key: string]: any; } export interface BskyPreferences { feeds: { saved?: string[]; pinned?: string[]; }; feedViewPrefs: Record<string, BskyFeedViewPreference>; threadViewPrefs: BskyThreadViewPreference; adultContentEnabled: boolean; contentLabels: Record<string, BskyLabelPreference>; birthDate: Date | undefined; } export {};