UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

42 lines (41 loc) 1.95 kB
import type { ReplykeState } from "../replykeReducers"; export interface AccountSummary { id: string; name: string | null; email: string | null; avatar: string | null; } export interface AccountEntry { refreshToken: string; tokenExpiresAt: number; user: AccountSummary; } export interface AccountMap { activeAccountId: string | null; accounts: Record<string, AccountEntry>; } export interface AccountsState { accounts: Record<string, AccountEntry>; activeAccountId: string | null; isReady: boolean; accountManagerRegistered: boolean; } export declare const MAX_ACCOUNTS = 5; export declare const setAccountMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountMap, "accounts/setAccountMap">, upsertAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{ userId: string; entry: AccountEntry; }, "accounts/upsertAccount">, removeAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "accounts/removeAccount">, setActiveAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "accounts/setActiveAccount">, clearAllAccounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"accounts/clearAllAccounts">, setAccountsReady: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "accounts/setAccountsReady">, registerAccountManager: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"accounts/registerAccountManager">; export declare const selectAccounts: (state: { replyke: ReplykeState; }) => Record<string, AccountEntry>; export declare const selectActiveAccountId: (state: { replyke: ReplykeState; }) => string | null; export declare const selectAccountsReady: (state: { replyke: ReplykeState; }) => boolean; export declare const selectAccountManagerRegistered: (state: { replyke: ReplykeState; }) => boolean; declare const _default: import("@reduxjs/toolkit").Reducer<AccountsState>; export default _default;