type ViewerType = 'google' | 'office' | 'mammoth' | 'pdf' | 'url'; type ViewerRenderPhase = 'idle' | 'loading' | 'ready' | 'error'; type ViewerRecoveryMode = 'google-probe' | 'google-final-retry' | 'office-auto-retry'; interface ViewerRecoveryPlan { modes: ViewerRecoveryMode[]; } interface Props { loaded?: () => void; url: string; queryParams?: string; viewerUrl?: string; googleCheckInterval?: number; disableContent?: 'none' | 'all' | 'poput' | 'popout-hide'; googleCheckContentLoaded?: boolean; viewer?: ViewerType; } interface IFrameReloader { subscribe: (iframe: HTMLIFrameElement, interval?: number, maxChecks?: number) => any; unsubscribe: () => void; } declare const defaultProps: Props; declare const fileToArray: (url: string) => Promise; declare const timeout: (ms: number) => Promise; declare const handleFileUpload: (fileInput: any) => Promise; declare const getbaseUrl: () => string; declare const getLocation: (href: string) => { href: string; protocol: string; host: string; hostname: string; port: string; pathname: string; search: string; hash: string; } | null; declare const getDocxToHtml: (url: string) => Promise; declare const googleCheckSubscription: () => IFrameReloader; declare const iframeIsLoaded: (iframe: HTMLIFrameElement) => boolean; declare const getViewerDetails: (url: string, configuredViewer?: ViewerType, queryParams?: string, viewerUrl?: string) => { url: string; externalViewer: boolean; }; declare const getViewerRecoveryPlan: ({ viewer, googleCheckContentLoaded, googleFinalRetryDelay, officeAutoRetry, }: { viewer: ViewerType; googleCheckContentLoaded?: boolean; googleFinalRetryDelay?: number; officeAutoRetry?: boolean; }) => ViewerRecoveryPlan; declare const replaceLocalUrl: (url: string, overrideLocalhost: string) => string; declare const uploadToCloud: (fileUrl: string, api: string) => Promise; declare const isLocalFile: (file: string) => boolean; interface ViewerRecoveryConfig { viewer: ViewerType; googleCheckContentLoaded: boolean; googleCheckInterval: number; googleMaxChecks: number; googleFinalRetryDelay: number; officeAutoRetry: boolean; officeRetryDelay: number; } interface ViewerRecoveryHandlers { /** * Start a fresh load of the current document. Used by the google final-retry * and office auto-retry recovery modes. */ triggerRetry: () => void; /** * The external viewer did not finish loading in time and no retry is pending. * The host should surface the timeout error (guarding on its own load phase). */ reportTimeout: () => void; } /** * Framework-agnostic orchestration for the google/office iframe recovery logic * shared by ngx-doc-viewer and react-documents. Owns the load-timeout, * google-final-retry and office-auto-retry timers plus the per-source retry * bookkeeping. The google-probe iframe reload stays in the host because it is * framework specific (iframe refs, Angular zones). */ declare class ViewerRecoveryController { private config; private readonly handlers; private externalLoadTimeoutId?; private googleFinalRetryTimeoutId?; private officeRetryTimeoutId?; private googleFinalRetriedSourceKey?; private currentGoogleSourceKey?; private officeAutoRetriedSourceKey?; private currentOfficeSourceKey?; constructor(config: ViewerRecoveryConfig, handlers: ViewerRecoveryHandlers); /** Update the active configuration (e.g. after inputs change). */ configure(config: ViewerRecoveryConfig): void; /** * Track the resolved viewer URL as the current source. Resets the per-source * "already retried" flags whenever the source changes so a new document gets * its own recovery budget. */ trackSource(resolvedUrl: string): void; /** * Begin watching an external (iframe/pdf/url) load. Clears any prior timers, * arms the load-timeout and schedules office auto-retry. Returns the recovery * plan so the host can run the framework-specific google-probe if present. */ beginExternalLoad(isActive: () => boolean): ViewerRecoveryPlan; /** The external viewer finished loading; stop all pending recovery timers. */ notifyLoaded(): void; /** Clear every pending recovery timer without tearing down state. */ clearTimers(): void; /** Release all timers; call on destroy. */ dispose(): void; private recoveryPlan; private scheduleGoogleFinalRetry; private scheduleOfficeRetry; private clearExternalLoadTimeout; private clearGoogleFinalRetry; private clearOfficeRetry; } export { type IFrameReloader, type ViewerRecoveryConfig, ViewerRecoveryController, type ViewerRecoveryHandlers, type ViewerRecoveryMode, type ViewerRecoveryPlan, type ViewerRenderPhase, type ViewerType, defaultProps, fileToArray, getDocxToHtml, getLocation, getViewerDetails, getViewerRecoveryPlan, getbaseUrl, googleCheckSubscription, handleFileUpload, iframeIsLoaded, isLocalFile, replaceLocalUrl, timeout, uploadToCloud };