export interface SetAccountPushEnabledParams { /** Any account in the stored account map — it does not have to be active. */ userId: string; enabled: boolean; } export interface UseAccountPushToggleValues { setAccountPushEnabled: (params: SetAccountPushEnabledParams) => Promise; /** Whether a given stored account currently wants push on this device. */ isAccountPushEnabled: (userId: string) => boolean; isUpdating: boolean; error: string | null; } /** * Per-account, per-device push control — one switch per stored account. * * **Distinct from `useNotificationPreferences`**, and the two are not * alternatives. This decides *whether an account is bound to this device at * all*; notification preferences decide *which event types* a single signed-in * user receives. Silencing an account here removes its binding, so nothing * reaches this device for it regardless of its per-event-type settings. * * Works on accounts the user is not currently signed into — silencing a * non-active account unbinds it server-side without switching to it. That path * spends one rotating token exchange for the target account; it is safe to fail * there because nothing is destroyed: the account stays, the flag is unchanged, * and the user can retry. * * **The flag is written only AFTER the binding change succeeds.** The SDK must * never report an account as push-enabled while nothing is bound. What an app * renders on failure is the integrator's business; reporting the truth about * server state is not. */ export default function useAccountPushToggle(): UseAccountPushToggleValues;