@playlive/fundraiser-data
    Preparing search index...

    Interface DemoProvider

    Shape of an injected demo fixture provider. Matches @playlive/realtime-pipeline/demo 1-for-1 so consumers can pass the whole namespace import directly.

    Every method is optional — fetchers fall back to a benign default (null / []) when a method isn't supplied.

    interface DemoProvider {
        getDemoCampaign?: (
            isTeam: boolean,
        ) => TiltifyCampaign | TiltifyTeamCampaign | null;
        getDemoCause?: () => TiltifyCause | null;
        getDemoDonations?: () => TiltifyDonation[];
        getDemoDonorSpotlight?: (
            params: { campaignId: string; isTeam: boolean },
        ) => DonorSpotlightSnapshot | null;
        getDemoFundraisingEvent?: (id?: string) => TiltifyFundraisingEvent | null;
        getDemoLifetimeRaised?: (
            params: { isTeam: boolean; username: string },
        ) => number | null;
        getDemoMilestones?: () => TiltifyMilestone[];
        getDemoPolls?: () => TiltifyPoll[];
        getDemoPreviousYearTotals?: (
            params: { isTeam: boolean; slug: string },
        ) => { amount: string; id: string; name: string; year: string }[] | null;
        getDemoRewards?: () => TiltifyReward[];
        getDemoSchedule?: (
            params: { epoch?: number; intervalMs?: number; now?: number },
        ) => TiltifySchedule[];
        getDemoScheduleBlockRaised?: (
            params: { end?: string | null; start?: string | null },
        ) => number;
        getDemoTargets?: () => TiltifyTarget[];
        getDemoTeam?: () => TiltifyTeam | null;
        getDemoUser?: () => TiltifyUser | null;
    }
    Index
    getDemoCampaign?: (
        isTeam: boolean,
    ) => TiltifyCampaign | TiltifyTeamCampaign | null
    getDemoCause?: () => TiltifyCause | null
    getDemoDonations?: () => TiltifyDonation[]
    getDemoDonorSpotlight?: (
        params: { campaignId: string; isTeam: boolean },
    ) => DonorSpotlightSnapshot | null

    Return the demo donor spotlight snapshot for a demo campaign, or null for "no spotlight yet" (still short-circuits the network). Return undefined — the default for providers that don't implement this method — to fall through to the real fetch.

    Consulted by fetchDonorSpotlight when the incoming params.campaignId matches one of the demo campaign UUIDs (DEMO_CAMPAIGN_ID / DEMO_TEAM_CAMPAIGN_ID).

    getDemoFundraisingEvent?: (id?: string) => TiltifyFundraisingEvent | null

    Return the demo fundraising event.

    The optional id param lets fetchers that key off import("../demo/index.ts").DEMO_FUNDRAISING_EVENT_ID pass through to the provider so consumers can differentiate multiple fixture events if they wish; providers that only ship a single event may ignore the arg.

    getDemoLifetimeRaised?: (
        params: { isTeam: boolean; username: string },
    ) => number | null

    Return the demo lifetime-raised total for a user or team, or null to fall through to the network fetch. Consulted by fetchLifetimeRaised when a provider is registered.

    getDemoMilestones?: () => TiltifyMilestone[]
    getDemoPolls?: () => TiltifyPoll[]
    getDemoPreviousYearTotals?: (
        params: { isTeam: boolean; slug: string },
    ) => { amount: string; id: string; name: string; year: string }[] | null

    Return the demo previous-year totals for a user or team, an empty array to indicate "no historical data" (still short- circuits the network), or null to fall through to the real fetch below — same tri-state pattern as DemoProvider.getDemoLifetimeRaised. Consulted by fetchPreviousYearTotals when a provider is registered.

    The row shape matches PreviousYearTotalItem from @playlive/fundraiser-data/playlive.

    getDemoRewards?: () => TiltifyReward[]
    getDemoSchedule?: (
        params: { epoch?: number; intervalMs?: number; now?: number },
    ) => TiltifySchedule[]

    Return a synthesized demo schedule for a rotating fixture. The fusion useLiveSchedule hook calls this when demo mode is enabled so consumers see a live-rotating block-list without a real Tiltify campaign. Providers typically forward directly to buildDemoSchedule from @playlive/realtime-pipeline/demo.

    getDemoScheduleBlockRaised?: (
        params: { end?: string | null; start?: string | null },
    ) => number

    Return the demo raised total for a synthesized schedule block. The fusion useCurrentBlockRaised hook calls this when demo mode is enabled instead of hitting the schedule-service REST baseline. Providers typically forward directly to getDemoBlockRaised from @playlive/realtime-pipeline/demo, which hashes the ISO start string so adjacent slots produce distinct amounts.

    getDemoTargets?: () => TiltifyTarget[]
    getDemoTeam?: () => TiltifyTeam | null
    getDemoUser?: () => TiltifyUser | null