import { type Action, type Service } from '@atproto/lex'; import type { AtUriString, DatetimeString, DidString } from '@atproto/syntax'; import { type BskyAppProgressGuide, type MutedWord, type Nux, type PostInteractionSettingsPref, type Preferences, type SavedFeed, type VerificationPrefs } from '../lexicons/app/bsky/actor/defs.defs.js'; import type { LabelPreference } from '../moderation/index.js'; import type { BskyFeedViewPreference, BskyPreferences, BskyThreadViewPreference } from './types.js'; /** * Preference reads/writes target the user's account host by default (like * the client's own record helpers), regardless of the client's `service` * default — preferences live on the PDS, not behind the AppView proxy. * Pass `service` to override. * * @remarks Why not default to proxying to the Bluesky API? The Bluesky API * does not implement these endpoints — the reference PDS special-cases them, * intercepting the proxy header and serving them locally, but that intercept * is distro-dependent (it can be compiled/configured out, e.g. Tranquil PDS) * and other AppViews don't get the same treatment. Targeting the account * host directly is the honest description of where preferences live today. * See the discussion on bluesky-social/bsky#1 for the full picture. */ export interface PrefsServiceOptions { service?: Service | null; } type UpdatePreferencesInput = ((prefs: Preferences) => Preferences | false) | ({ update: (prefs: Preferences) => Preferences | false; } & PrefsServiceOptions); /** * Low-level helper to update the raw preferences array on the server. * * Concurrent calls on the same Client are automatically serialized: each * read-modify-write cycle waits for the previous one to complete before * starting, matching the old Agent's per-instance AwaitLock behavior. */ export declare const updatePreferences: Action; /** * Fetches and interprets the current user's preferences into a structured BskyPreferences object. * Migrates v1 savedFeeds to v2 on first read. */ export declare const getPreferences: Action; export declare const setAdultContentEnabled: Action; export declare const setContentLabelPref: Action<{ key: string; value: LabelPreference; labelerDid?: DidString; }, void>; export declare const addSavedFeeds: Action[], SavedFeed[]>; export declare const removeSavedFeeds: Action; export declare const updateSavedFeeds: Action; export declare const overwriteSavedFeeds: Action; /** * @deprecated use updateSavedFeeds or removeSavedFeeds * (old agent.ts:856-862 addPinnedFeed) */ export declare const addPinnedFeed: Action; /** * @deprecated use updateSavedFeeds or removeSavedFeeds * (old agent.ts:864-870 removePinnedFeed) */ export declare const removePinnedFeed: Action; export declare const setFeedViewPrefs: Action<{ feed: string; } & Partial, void>; export declare const setThreadViewPrefs: Action, void>; export declare const setPersonalDetails: Action<{ birthDate: Date | DatetimeString | undefined; }, void>; export declare const setInterestsPref: Action<{ tags: string[]; }, void>; /** * Add a single muted word. (old agent.ts:1070-1112) */ export declare const addMutedWord: Action, void>; /** * Convenience method to add multiple muted words. (old agent.ts:1117-1119) */ export declare const addMutedWords: Action; /** * @deprecated use addMutedWords or addMutedWord instead (old agent.ts:1124-1131) */ export declare const upsertMutedWords: Action[], void>; /** * Update a muted word in user preferences. (old agent.ts:1136-1176) */ export declare const updateMutedWord: Action; /** * Remove a single muted word (old agent.ts:1182-1209) */ export declare const removeMutedWord: Action; /** * Convenience method to remove multiple muted words. (old agent.ts:1214-1216) */ export declare const removeMutedWords: Action; export declare const hidePost: Action; export declare const unhidePost: Action; export declare const addLabeler: Action; export declare const removeLabeler: Action; export declare const queueNudges: Action; export declare const dismissNudges: Action; /** * Set the flag for participating in the beta features program. * (upstream agent.ts setIsBetaUser, atproto#5178) */ export declare const setIsBetaUser: Action; export declare const setActiveProgressGuide: Action; export declare const upsertNux: Action; export declare const removeNuxs: Action; export declare const setVerificationPrefs: Action; export declare const setPostInteractionSettings: Action; /** * Update live event preferences. (old agent.ts:1380-1413) */ export declare const updateLiveEventPreferences: Action<{ type: 'hideFeed'; id: string; } | { type: 'unhideFeed'; id: string; } | { type: 'toggleHideAllFeeds'; }, void>; export {}; //# sourceMappingURL=preferences.d.ts.map