export { MUX_STREAM_ORIGIN, MUX_IMAGE_ORIGIN } from './mux-origins';
/**
* Save-Data detection — the ONE source of truth for "is this a metered
* connection". Consumed by the preload gate below and by `video.tsx`'s
* default `preload` policy. SSR-safe (returns false on the server).
*/
export declare function saveDataEnabled(): boolean;
/**
* Preconnect-only variant — fires the three video-bearing origin
* preconnects (Supabase Storage + Mux stream + Mux image) without
* setting up the IntersectionObserver subscription or the preload
* `` injection.
*
* Use this when the consumer can't attach a `ref` to the video
* container (e.g. release detail page, which delegates the player
* render to a sibling component). Calling the full `useVideoWarmup`
* from there would subscribe to a never-mounted ref and ship dead
* preload machinery in the bundle.
*
* For consumers that own the video container, use `useVideoWarmup`
* (which composes this hook + the IO-gated preload step).
*
* Reads `supabaseStorageOrigin` from `ChatRuntime.endpoints` by
* default — callers in hosts that mount `HubRuntimeProvider` (or
* any equivalent provider that wires the field) get the origin
* automatically. The explicit `supabaseStorageOrigin` argument
* overrides the runtime value when set.
*
* The hub's `app/layout.tsx` also emits STATIC ``
* tags for the same Mux origins (document-parse-time warmup; React
* dedupes against these runtime calls via the matching
* crossOrigin="anonymous"). A change to the origin list here must be
* mirrored there.
*/
export declare function useVideoOriginPreconnect({ supabaseStorageOrigin, }?: {
supabaseStorageOrigin?: string;
}): void;
interface UseVideoWarmupOptions {
/**
* Effective video URL the page renders. Pass null/undefined when
* there's no video yet (the hook still preconnects). Only URLs on
* `supabaseStorageOrigin` are preloaded — Mux HLS and YouTube are
* no-ops on the preload side.
*/
videoUrl?: string | null;
/**
* Supabase storage origin (e.g. `https://xyz.supabase.co`). When
* omitted, falls back to `ChatRuntime.endpoints.supabaseStorageOrigin`
* — hosts that mount `HubRuntimeProvider` (or any equivalent
* provider) get the origin automatically. When neither is set, the
* preload step is skipped (preconnect to Mux still fires).
*/
supabaseStorageOrigin?: string;
/**
* IO root margin gate for the preload step. Default `'1000px'` —
* about one viewport's worth of lookahead on desktop.
*/
nearMargin?: string;
}
export interface UseVideoWarmupResult {
ref: (node: T | null) => void;
isNear: boolean;
}
export declare function useVideoWarmup({ videoUrl, supabaseStorageOrigin, nearMargin, }?: UseVideoWarmupOptions): UseVideoWarmupResult;
//# sourceMappingURL=use-video-warmup.d.ts.map