import { UserApi } from '../api'; import { User, UserFeature, UserInsightProfile, UserProfile } from '../types'; import { GlobalStore } from './GlobalStore'; export declare class UserStore { globalStore: GlobalStore; api: UserApi; userFeatures: UserFeature[]; userFeaturesLoaded: boolean; userInsightProfile: UserInsightProfile | null; constructor(globalStore: GlobalStore); get userProfile(): UserProfile; get user(): User; setUserFeatures: (features: UserFeature[]) => void; loadUserFeatures: () => Promise; updateUser: (user: User) => Promise; updateUserProfile: (userProfile: UserProfile) => Promise; /** * Seeds the profile. The host (pulse) loads `user_insight_profile` and pushes it in here; * experiences itself never fetches it. */ setUserInsightProfile: (profile: UserInsightProfile | null) => void; /** * Merges `fields` into the seeded profile and PUTs the whole profile. The endpoint is an * upsert that writes every profile field from the request, so a partial body would null * the fields it omits; the merge is what keeps them. Throws if the host has not seeded the * profile yet, and rethrows API failures, so a caller driving UI state (e.g. an insight * CTA) reports the error instead of silently treating the save as done. */ updateUserInsightProfile: (fields: Partial) => Promise; private captureError; }