import { ExperienceTiming } from '@fanfare-io/fanfare-sdk-core/experiences'; import { Accessor } from 'solid-js'; /** * Result of {@link useExperienceTiming}. * * - `status() === "loading"`: the first read for this experience has not settled; `timing()` is `undefined`. * - `status() === "error"`: the last read was rejected; `timing()` is `undefined` and `refresh()` reads again. * - `status() === "ready"`: `timing()` is the experience's public timing, or `null` when it publishes none. */ export interface UseExperienceTimingResult { status: Accessor<"loading" | "error" | "ready">; timing: Accessor; refresh(): Promise; } /** * Reads an experience's public timing once when it attaches, and again whenever * `experienceId` changes or `refresh()` is called. * * The primitive never polls, retries or schedules work around the timing's * boundaries; a caller that needs fresher timing calls `refresh()`. While a * refresh is in flight the result is unchanged: a `ready` result keeps its last * timing and an `error` result stays `error` until the read settles. Primitives * that read the same experience at the same time on one SDK instance share a * single request. Results from a superseded read, or from one still in flight * after disposal, are dropped. */ export declare function useExperienceTiming(experienceId: Accessor): UseExperienceTimingResult;