export type MediaTokenRetryOptions = { /** * The token to retry with, read at the moment media fails. When it returns * nothing, the `preview_token` query parameter of the page URL is used. */ getToken?: () => string | null | undefined; /** * The CMS URL, usually `OPTIMIZELY_CMS_URL`. Only media on this host gets the token. * @default the host the CMS communication injector script loads from */ cmsUrl?: string; }; /** * Listens for images and videos that fail to load and retries them with the * preview token, replacing a stale token if the URL already has one. * * Media URLs are rendered without the token so they stay the same across saves; * only media that needs it (unpublished or restricted) fails and is requested again. * Only URLs on the CMS host get the token, and without a known CMS host nothing is * retried. Media that already failed before the call is retried straight away. A * retry that would not change the URL is skipped, so media that fails with the * current token is not requested again until the token changes. * * @returns Stops listening. */ export declare function startMediaTokenRetry({ getToken, cmsUrl }?: MediaTokenRetryOptions): () => void;