import React from 'react'; import type { Fetcher, PreviewFile, RequestHandler, RequestInitFactory, ShouldFetchAsBlob } from '@eternalheart/file-preview-core'; export interface RequestContextValue { fetcher: Fetcher; shouldFetchAsBlob?: ShouldFetchAsBlob; } export interface RequestProviderProps { requestInit?: RequestInitFactory; requestHandler?: RequestHandler; shouldFetchAsBlob?: ShouldFetchAsBlob; children: React.ReactNode; } export declare const RequestProvider: React.FC; export declare function useRequest(): RequestContextValue; export declare function useFetcher(): Fetcher; /** * 解析 file 的可消费 URL: * - 未配置 shouldFetchAsBlob 或返回 false:同步返回 file.url(不入 state,避免切换文件时残留旧值) * - 返回 true:用 fetcher 拉成 blob: URL,组件卸载或 file 变化时 revoke * * 期间返回空字符串(表示 "还没准备好"),调用方应避免空 URL 时挂载到 等。 */ export declare function useResolvedUrl(file: PreviewFile | undefined): string; //# sourceMappingURL=RequestContext.d.ts.map