import type { Writable } from 'svelte/store'; type BodyMethods = 'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text'; type ResponseMapping = { [mimeType: string]: (res: Response) => Promise; }; export type FetchConfig = { options?: () => RequestInit; disabled?: boolean; force?: boolean; as?: 'auto' | BodyMethods | ((response: Response) => Promise) | ResponseMapping; onDataChange?: (newData: TData, data: TData) => any; onResponseChange?: (response: Response, state: FetchState) => any; once?: boolean; /** * Writable store used to track all errors. Useful to handle all errors consistently. Typically passed via initFetchClient */ errors?: Writable; /** * Do not pass errors up to context */ suppressErrors?: boolean; }; export declare function initFetchClient(config: FetchConfig): void; export type FetchState = { loading: boolean | undefined; data: any; error: any; request: { url: string; options: RequestInit; } | undefined; response: any; }; export declare const defaultOptions: RequestInit; export default function fetchStore(): { subscribe: (this: void, run: import("svelte/store").Subscriber, invalidate?: () => void) => import("svelte/store").Unsubscriber; fetch: (url: string, config?: FetchConfig) => { subscribe: (this: void, run: import("svelte/store").Subscriber, invalidate?: () => void) => import("svelte/store").Unsubscriber; } | undefined; refresh(): void; clear(): void; fetchConfig: Writable<{ url: string; config?: FetchConfig; }>; }; export {}; //# sourceMappingURL=fetchStore.d.ts.map