import { WeavyType } from '../client/weavy'; import { QueryObserverOptions } from '@tanstack/query-core'; /** * Query options for the ids of the users the authenticated user has blocked. * * The viewer's own list, rather than the `is_blocked` flag on each user they are handed. Only the detailed user * representation carries that flag; list routes, message authors and realtime payloads do not, since an event is mapped * once in the sender's request and pushed to every recipient, so anything caller-relative would be answered for the * wrong person. A message arriving over the wire says nothing about whether its author is blocked, and without this it * would render as if they were not. * * One request per session answers it for every message in every conversation, however the message arrived, and whether * or not the app has a member list to look the author up in. Components track it only where Feature.Block is on -- * with blocking unavailable there is nothing to create or reveal, so the list would be an empty answer to a question * nobody asked. * * An array rather than a Set, because the query cache is persisted to sessionStorage as JSON -- a Set survives the * session but comes back from a reload as `{}`, with no type error to show for it. */ export declare function getBlockedUserIdsOptions(weavy: WeavyType): QueryObserverOptions; export type MutateUserBlockProps = { block: boolean; }; export type MutateUserBlockContextType = { block: boolean; } | undefined; /** * Mutation options for blocking and unblocking a user. * * Blocking changes what the blocker sees in a lot of places at once -- conversation lists, member lists, search results * and the profile card -- and the server derives every one of those flags per request. Rather than patch each cache by * hand, the profile is updated optimistically so the card flips immediately, and everything else is invalidated once the * request settles. */ export declare function getUserBlockMutationOptions(weavy: WeavyType, uid: number | string): { mutationKey: (string | number)[]; mutationFn: ({ block }: MutateUserBlockProps) => Promise; onMutate: ({ block }: MutateUserBlockProps) => { block: boolean; }; onSettled: () => Promise; }; //# sourceMappingURL=blocks.d.ts.map