type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'QUERY'; type ResponseType = 'auto' | 'json' | 'text' | 'html' | 'xml' | 'dom' | 'blob' | 'arrayBuffer' | 'response' | 'stream'; type StormFetchAdapterName = 'auto' | 'fetch' | 'xhr' | 'http' | 'http2'; type RequestPriority = 'low' | 'normal' | 'high'; interface QueryObject { [key: string]: QueryValue; } type QueryValue = string | number | boolean | null | undefined | Date | QueryObject | Array; type QueryParams = Record; type PathParams = Record; type HeadersInput = HeadersInit | Record; /** File descriptor accepted by React Native's FormData implementation. */ interface ReactNativeFile { uri: string; name: string; type: string; } interface StormFetchProgressEvent { loaded: number; total?: number; progress?: number; bytes: number; rate?: number; estimated?: number; lengthComputable: boolean; upload: boolean; download: boolean; event?: unknown; } interface BasicAuthConfig { username: string; password: string; } interface ProxyConfig { protocol?: 'http' | 'https'; host: string; port: number; auth?: BasicAuthConfig; noProxy?: string | string[]; } interface StormFetchTlsOptions { ca?: string | string[] | BufferSource; cert?: string | string[] | BufferSource; key?: string | string[] | BufferSource; servername?: string; rejectUnauthorized?: boolean; certificatePins?: string[]; } interface StormFetchBeforeRedirectContext { from: URL; to: URL; status: number; headers: Headers; config: ResolvedFastApiRequestConfig; requestOptions: Record; } interface ParamsSerializerOptions { indexes?: boolean | null; dots?: boolean; maxDepth?: number; strict?: boolean; encode?: (value: string) => string; serialize?: (params: QueryParams) => string; } type StormFetchJsonReviver = (key: string, value: unknown, context?: { source?: string; }) => unknown; type StormFetchFormDataHeaderPolicy = 'none' | 'content-only' | 'all'; interface StormFetchFormSerializerOptions { format?: 'auto' | 'json' | 'urlencoded' | 'multipart'; /** Maximum nested object/array depth. Defaults to 32; Infinity disables the cap. */ maxDepth?: number; /** Uses dot notation for nested keys instead of brackets. */ dots?: boolean; /** Array key style: true = [0], false = [], null = repeated key. */ indexes?: boolean | null; } type StormFetchFormSerializer = 'auto' | 'json' | 'urlencoded' | 'multipart' | StormFetchFormSerializerOptions | ((data: unknown, config: ResolvedFastApiRequestConfig) => unknown); type StormFetchResponseEncoding = 'utf8' | 'utf16le' | 'latin1' | 'ascii' | 'base64' | 'hex'; type StormFetchMaxRate = number | [number | undefined, number | undefined]; interface StormFetchFetchEnv { fetch?: typeof fetch; Request?: typeof Request; Response?: typeof Response; Headers?: typeof Headers; FormData?: typeof FormData; Blob?: typeof Blob; } type StormFetchTransport = (config: ResolvedFastApiRequestConfig) => Promise>; interface RetryOptions { retry?: number; retryDelay?: number; retryUnsafe?: boolean; retryPolicy?: RetryPolicy; } interface CacheOptions { cache?: boolean; cacheTTL?: number; cacheStorage?: CacheStorageType | StormFetchCacheStorage | AsyncStormFetchCacheStorage; cacheTags?: string[]; invalidateTags?: string[]; staleTime?: number; staleWhileRevalidate?: boolean; } interface FastApiRequestConfig extends RetryOptions, CacheOptions { url?: string; method?: HttpMethod; baseURL?: string; headers?: HeadersInput; query?: QueryParams; params?: QueryParams; pathParams?: PathParams; body?: TBody; data?: TBody; timeout?: number; credentials?: RequestCredentials; signal?: AbortSignal; responseType?: ResponseType; cacheMode?: RequestCache; mode?: RequestMode; redirect?: RequestRedirect; referrerPolicy?: ReferrerPolicy; dedupe?: boolean; silent?: boolean; requestId?: string; meta?: Record; transformRequest?: RequestTransformer[]; transformResponse?: ResponseTransformer[]; adapter?: StormFetchAdapter; auth?: BasicAuthConfig; proxy?: ProxyConfig | false; trustProxyEnv?: boolean; httpAgent?: unknown; httpsAgent?: unknown; transport?: StormFetchTransport; socketPath?: string; allowedSocketPaths?: string[]; tls?: StormFetchTlsOptions; paramsSerializer?: ParamsSerializerOptions | ((params: QueryParams) => string); validateStatus?: ((status: number) => boolean) | null; onUploadProgress?: (event: StormFetchProgressEvent) => void; onDownloadProgress?: (event: StormFetchProgressEvent) => void; xsrfCookieName?: string; xsrfHeaderName?: string; withXSRFToken?: boolean; maxRedirects?: number; beforeRedirect?: (context: StormFetchBeforeRedirectContext) => void | false | Partial | Promise>; maxBodyLength?: number; maxContentLength?: number; maxDecompressionRatio?: number; maxJsonDepth?: number; maxJsonKeys?: number; maxFormDepth?: number; maxResponseJsonDepth?: number; maxResponseJsonKeys?: number; parseReviver?: StormFetchJsonReviver; formDataHeaderPolicy?: StormFetchFormDataHeaderPolicy; formSerializer?: StormFetchFormSerializer; decompress?: boolean; maxRate?: StormFetchMaxRate; responseEncoding?: StormFetchResponseEncoding; strictConfig?: boolean; timeoutErrorMessage?: string; transitional?: { clarifyTimeoutError?: boolean; silentJSONParsing?: boolean; forcedJSONParsing?: boolean; }; env?: StormFetchFetchEnv; fetchOptions?: Record; family?: 0 | 4 | 6; lookup?: unknown; insecureHTTPParser?: boolean; httpVersion?: '1.1' | '2'; http2Options?: Record; localAddress?: string; offlineQueue?: boolean; offlineDependencies?: string[]; offlinePriority?: number; offlineExpiresAt?: number; offlineGroup?: string; normalizeError?: ErrorNormalizer | false; priority?: RequestPriority; idempotencyKey?: string; requestSchema?: SchemaValidator; responseSchema?: SchemaValidator; traceId?: string; } interface ResolvedFastApiRequestConfig extends Omit, 'headers' | 'method'> { url: string; method: HttpMethod; headers: Record; } interface FastApiResponse { data: TData; status: number; statusText: string; headers: Headers; config: ResolvedFastApiRequestConfig; requestId: string; duration: number; request?: unknown; } interface FastApiError extends Error { status?: number; data?: TData; code?: string; fieldErrors?: Record; traceId?: string; raw?: unknown; request?: unknown; response?: FastApiResponse; config: ResolvedFastApiRequestConfig; requestId: string; duration: number; isNetworkError: boolean; isTimeoutError: boolean; isAbortError: boolean; isStormFetchError: true; toJSON(): Record; } type RequestTransformer = (config: ResolvedFastApiRequestConfig) => ResolvedFastApiRequestConfig | Promise; type ResponseTransformer = (response: FastApiResponse) => FastApiResponse | Promise>; type RequestInterceptor = RequestTransformer; type ResponseInterceptor = ResponseTransformer; type ErrorInterceptor = (error: FastApiError) => unknown; type RetryPolicy = 'network-only' | 'safe' | 'aggressive'; type CacheStorageType = 'memory' | 'localStorage' | 'sessionStorage'; interface StormFetchCacheStorage { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; key?(index: number): string | null; readonly length?: number; } /** Promise-based storage supported by AsyncStorage, MMKV wrappers, and custom stores. */ interface AsyncStormFetchCacheStorage { getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; getAllKeys?(): Promise; } type SchemaValidator = ((value: unknown) => T) | { parse(value: unknown): T; } | { safeParse(value: unknown): { success: boolean; data?: T; error?: unknown; }; }; type StormFetchAdapter = StormFetchAdapterName | ((config: ResolvedFastApiRequestConfig) => Promise>); interface CircuitBreakerOptions { failureThreshold?: number; resetTimeout?: number; successThreshold?: number; fallback?: (config: ResolvedFastApiRequestConfig, error?: FastApiError) => unknown | Promise; } type StormFetchPolicyMatcher = string | RegExp | ((config: FastApiRequestConfig & { url: string; }) => boolean); interface StormFetchPolicy { match: StormFetchPolicyMatcher; config: FastApiRequestConfig; } interface StormFetchHistoryEntry { id: string; url: string; method: HttpMethod; startedAt: number; endedAt?: number; duration?: number; status?: number; ok: boolean; request: ResolvedFastApiRequestConfig; response?: FastApiResponse; error?: NormalizedErrorShape; } interface StormFetchHarLog { log: { version: '1.2'; creator: { name: 'StormFetch'; version: string; }; entries: Array>; }; } type StormFetchHostMatcher = string | RegExp | ((host: string, url: URL) => boolean); type StormFetchMethodMatcher = HttpMethod | '*'; type StormFetchCredentialForwardPolicy = 'always' | 'same-origin' | 'same-host' | 'never' | StormFetchHostMatcher[]; type StormFetchIpResolver = (hostname: string) => string[] | Promise; interface StormFetchSecurityOptions { allowedHosts?: StormFetchHostMatcher[]; blockedHosts?: StormFetchHostMatcher[]; allowedCidrs?: string[]; blockedCidrs?: string[]; allowedMethods?: StormFetchMethodMatcher[]; allowedProtocols?: Array<'http:' | 'https:'>; allowAbsoluteUrls?: boolean; allowPathTraversal?: boolean; allowHttp?: boolean; allowPrivateNetwork?: boolean; blockCloudMetadata?: boolean; validateDns?: boolean; resolveHost?: StormFetchIpResolver; maxUrlLength?: number; maxQueryDepth?: number; maxJsonDepth?: number; maxJsonKeys?: number; sensitiveHeaders?: string[]; sensitiveDataPatterns?: RegExp[]; redactSensitiveHeaders?: boolean; redactSensitiveData?: boolean; requireSameOriginXSRF?: boolean; credentialPolicy?: Record; cookiePolicy?: StormFetchCredentialForwardPolicy; allowedRedirectHosts?: StormFetchHostMatcher[]; blockedRedirectHosts?: StormFetchHostMatcher[]; maxRedirectHosts?: number; blockRedirectToPrivateNetwork?: boolean; blockQuerySecrets?: boolean | string[]; signRequest?: (config: ResolvedFastApiRequestConfig) => ResolvedFastApiRequestConfig | void | Promise; guard?: (config: ResolvedFastApiRequestConfig) => void | Promise; } type StormFetchEventType = 'request:start' | 'request:success' | 'request:error' | 'request:retry' | 'cache:hit' | 'cache:stale' | 'cache:invalidate' | 'offline:queued' | 'offline:flush' | 'offline:dead-letter' | 'transfer:start' | 'transfer:progress' | 'transfer:complete' | 'transfer:error' | 'circuit:open' | 'security:block' | 'security:redact' | 'security:credential-strip'; interface StormFetchEvent { type: StormFetchEventType; timestamp: number; requestId?: string; method?: HttpMethod; url?: string; duration?: number; status?: number; attempt?: number; data?: unknown; } interface StormFetchHmacSigningOptions { secret: string | (() => string | Promise); algorithm?: 'SHA-256' | 'SHA-384' | 'SHA-512'; headerName?: string; timestampHeaderName?: string; nonceHeaderName?: string; createNonce?: () => string; now?: () => number; includeBody?: boolean; } interface StormFetchSecureLoggerOptions { logger?: Pick; level?: 'debug' | 'error' | 'warn'; } interface StormFetchSpan { setAttribute?(name: string, value: string | number | boolean): void; recordException?(error: unknown): void; end(): void; } interface StormFetchObservabilityOptions { onEvent?: (event: StormFetchEvent) => void; startSpan?: (name: string, config: ResolvedFastApiRequestConfig) => StormFetchSpan | undefined; traceHeaderName?: string; createTraceId?: () => string; } interface OfflineQueueRecord { id: string; config: FastApiRequestConfig & { url: string; method: HttpMethod; }; createdAt: number; attempts: number; nextAttemptAt?: number; lastError?: NormalizedErrorShape; dependencies?: string[]; priority?: number; expiresAt?: number; group?: string; } interface OfflineQueueStorage { load(): Promise; save(records: OfflineQueueRecord[]): Promise; loadDeadLetters?(): Promise; saveDeadLetters?(records: OfflineDeadLetter[]): Promise; } interface OfflineQueueCryptoProvider { encrypt(plainText: string): string | Promise; decrypt(cipherText: string): string | Promise; } interface OfflineQueueMigration { from: number; to: number; migrate(records: OfflineQueueRecord[]): OfflineQueueRecord[] | Promise; } interface OfflineDeadLetter extends OfflineQueueRecord { failedAt: number; reason: NormalizedErrorShape; } interface OfflineQueueSnapshot { pending: OfflineQueueRecord[]; deadLetters: OfflineDeadLetter[]; } type OfflineConflictResolution = 'retry' | 'discard' | { config: FastApiRequestConfig & { url: string; method: HttpMethod; }; }; interface NativeTransferResult { uri?: string; status?: number; headers?: Record; data?: unknown; } interface NativeTransferOptions { url: string; fileUri?: string; destinationUri?: string; method?: HttpMethod; headers?: Record; body?: Record; onProgress?: (event: StormFetchProgressEvent) => void; signal?: AbortSignal; background?: boolean; } interface NativeTransferAdapter { upload(options: NativeTransferOptions): Promise; download(options: NativeTransferOptions): Promise; startUpload?(options: NativeTransferOptions): NativeTransferTask; startDownload?(options: NativeTransferOptions): NativeTransferTask; } interface NativeTransferTask { readonly id: string; readonly result: Promise; pause(): void | Promise; resume(): void | Promise; cancel(reason?: unknown): void | Promise; } interface NormalizedErrorShape { message?: string; code?: string; fieldErrors?: Record; traceId?: string; raw?: unknown; } type ErrorNormalizer = (error: FastApiError) => NormalizedErrorShape | void; type StormFetchPluginCapability = 'adapter' | 'auth' | 'cache' | 'observability' | 'serializer' | 'security' | 'transport'; interface StormFetchPlugin { name?: string; version?: string; apiVersion?: string; capabilities?: StormFetchPluginCapability[]; setup(client: FastApiClient): void | (() => void) | Promise void)>; dispose?(): void | Promise; } interface StormFetchInstalledPlugin { name: string; version: string; apiVersion: string; capabilities: StormFetchPluginCapability[]; } interface InterceptorManager { use(handler: THandler, options?: InterceptorOptions): () => void; eject(handler: THandler): void; clear(): void; handlers(context?: unknown): THandler[]; } interface InterceptorOptions { /** Runs this interceptor only when the predicate accepts the current config/response/error. */ runWhen?: (context: unknown) => boolean; /** Automatically ejects the interceptor after its first matching execution. */ once?: boolean; /** Runs before existing interceptors instead of after them. */ prepend?: boolean; } interface FastApiClientOptions extends Omit { baseURL?: string; headers?: HeadersInput; timeout?: number; debug?: boolean; rateLimit?: number; token?: () => string | null | Promise; refreshToken?: (error: FastApiError) => Promise; onUnauthorized?: (error: FastApiError) => void; onSuccess?: (response: FastApiResponse) => void; onError?: (error: FastApiError) => void; language?: () => string | null; plugins?: StormFetchPlugin[]; /** Supplies network state in runtimes such as React Native (for example, from NetInfo). */ isOnline?: () => boolean | Promise; /** Saves data returned by download(). Required for auto-save outside a browser. */ fileSaver?: StormFetchFileSaver; maxConcurrent?: number; maxConcurrentPerHost?: number; circuitBreaker?: CircuitBreakerOptions | false; security?: StormFetchSecurityOptions; observability?: StormFetchObservabilityOptions; offlineStorage?: OfflineQueueStorage; offlineMaxAttempts?: number; offlineRetryDelay?: number | ((attempt: number, record: OfflineQueueRecord) => number); offlineIdempotencyHeader?: string | false; resolveOfflineConflict?: (record: OfflineQueueRecord, error: unknown) => OfflineConflictResolution | Promise; onOfflineDeadLetter?: (entry: OfflineDeadLetter) => void | Promise; nativeTransfer?: NativeTransferAdapter; domParser?: StormFetchDomParser; graphqlEndpoint?: string; historyLimit?: number; policies?: StormFetchPolicy[]; } interface DownloadOptions extends Omit { fileName?: string; /** Override the client-level file saver for this download. */ fileSaver?: StormFetchFileSaver; /** Set false to return the downloaded Blob without attempting to save it. */ autoSave?: boolean; } type StormFetchFileSaver = (data: Blob, fileName: string, response: FastApiResponse) => void | Promise; interface FastApiClient { defaults: FastApiClientOptions; interceptors: { request: InterceptorManager; response: InterceptorManager; error: InterceptorManager; }; request(config: FastApiRequestConfig & { url: string; method?: HttpMethod; }): Promise>; fetch(url: string, config?: FastApiRequestConfig): Promise>; get(url: string, config?: FastApiRequestConfig): Promise>; post(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; put(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; patch(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; delete(url: string, config?: FastApiRequestConfig): Promise>; head(url: string, config?: FastApiRequestConfig): Promise>; options(url: string, config?: FastApiRequestConfig): Promise>; query(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; GET(url: string, config?: FastApiRequestConfig): Promise>; POST(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; PUT(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; PATCH(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; DELETE(url: string, config?: FastApiRequestConfig): Promise>; HEAD(url: string, config?: FastApiRequestConfig): Promise>; OPTIONS(url: string, config?: FastApiRequestConfig): Promise>; QUERY(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; postJson(url: string, data?: TBody, config?: FastApiRequestConfig): Promise>; postForm(url: string, data: Record | URLSearchParams, config?: FastApiRequestConfig): Promise>; postMultipart(url: string, data: Record | FormData, config?: FastApiRequestConfig): Promise>; graphql>(query: string, variables?: TVariables, config?: FastApiRequestConfig): Promise>; batch(requests: readonly StormFetchBatchRequest[]): Promise<{ [K in keyof TResponses]: FastApiResponse; }>; poll(url: string, intervalOrOptions?: number | StormFetchPollOptions, config?: FastApiRequestConfig): StormFetchPollController; getHtml(url: string, config?: FastApiRequestConfig): Promise>; getXml(url: string, config?: FastApiRequestConfig): Promise>; getDom(url: string, config?: FastApiRequestConfig & { mimeType?: StormFetchDomMimeType; }): Promise>; parseDom(html: string, mimeType?: StormFetchDomMimeType): StormFetchDomDocument; scrape(url: string, schema: TShape, config?: FastApiRequestConfig): Promise>>; resource, TUpdate = Partial>(basePath: string): StormFetchResource; download(url: string, fileName?: string, config?: DownloadOptions): Promise>; clearCache(key?: string): void; clearCacheAsync(key?: string): Promise; invalidateTags(tags: string[]): Promise; cacheManager: StormFetchCacheManager; prefetch(url: string, config?: FastApiRequestConfig): Promise>; dehydrateCache(): Promise; hydrateCache(snapshot: StormFetchCacheSnapshot): Promise; cacheKeys(): string[]; history(): StormFetchHistoryEntry[]; clearHistory(): void; replay(requestId: string): Promise>; toCurl(requestIdOrConfig: string | ResolvedFastApiRequestConfig): string; toHAR(): StormFetchHarLog; policy(match: StormFetchPolicyMatcher, config: FastApiRequestConfig): () => void; streamText(url: string, config?: FastApiRequestConfig): AsyncIterable; streamJson(url: string, config?: FastApiRequestConfig): Promise; streamNdjson(url: string, config?: FastApiRequestConfig): AsyncIterable; sse(url: string, options?: StormFetchSseOptions): StormFetchSseController; contract(definition: TContract): StormFetchContract; createFormData(data: Record): FormData; flushOfflineQueue?(): Promise; offlineQueueSnapshot?(): Promise; retryOfflineRequest?(id: string): Promise; discardOfflineRequest?(id: string): Promise; retryOfflineBatch?(ids?: string[]): Promise; reconcileOfflineRequest?(id: string, config: FastApiRequestConfig & { url: string; method: HttpMethod; }): Promise; subscribe?(listener: (event: StormFetchEvent) => void): () => void; nativeUpload?(options: NativeTransferOptions): Promise; nativeDownload?(options: NativeTransferOptions): Promise; startNativeUpload?(options: NativeTransferOptions): NativeTransferTask; startNativeDownload?(options: NativeTransferOptions): NativeTransferTask; usePlugin?(plugin: StormFetchPlugin): Promise<() => Promise>; removePlugin?(name: string): Promise; installedPlugins?(): StormFetchInstalledPlugin[]; dispose?(): Promise; } interface ReactLike { useCallback unknown>(callback: T, deps: unknown[]): T; useEffect(effect: () => void | (() => void), deps?: unknown[]): void; useState(initial: T | (() => T)): [T, (next: T | ((current: T) => T)) => void]; } interface StormQueryOptions { enabled?: boolean; initialData?: TData; onSuccess?: (data: TData) => void; onError?: (error: FastApiError) => void; refetchOnFocus?: boolean; refetchOnReconnect?: boolean; config?: FastApiRequestConfig; } type StormFetchRuntime = 'browser' | 'react-native' | 'node' | 'deno' | 'bun' | 'unknown'; interface StormFetchRuntimeInfo { runtime: StormFetchRuntime; isBrowser: boolean; isReactNative: boolean; isNode: boolean; isDeno: boolean; isBun: boolean; hasFetch: boolean; hasXHR: boolean; hasFormData: boolean; hasBlob: boolean; } interface StormQueryState { data?: TData; error?: FastApiError; loading: boolean; refetch: () => Promise; reset: () => void; } interface StormMutationState { data?: TData; error?: FastApiError; loading: boolean; mutate: (body?: TBody, config?: FastApiRequestConfig) => Promise>; reset: () => void; } interface StormMutationOptions { invalidateTags?: string[]; optimisticData?: (current: TData | undefined, body?: TBody) => TData; onMutate?: (body?: TBody) => TContext | Promise; onSuccess?: (data: TData, body?: TBody, context?: TContext) => void; onError?: (error: FastApiError, body?: TBody, context?: TContext) => void; } interface StormInfiniteQueryState { pages: TData[]; error?: FastApiError; loading: boolean; fetchingNextPage: boolean; hasNextPage: boolean; fetchNextPage: () => Promise; refetch: () => Promise; reset: () => void; pageParams: TPageParam[]; } interface StormInfiniteQueryOptions { enabled?: boolean; initialPageParam: TPageParam; getNextPageParam: (lastPage: TData, pages: TData[], pageParams: TPageParam[]) => TPageParam | undefined; createConfig: (pageParam: TPageParam, pages: TData[]) => FastApiRequestConfig; onSuccess?: (pages: TData[]) => void; onError?: (error: FastApiError) => void; } interface MockRoute { method?: HttpMethod; url: string | RegExp | ((config: ResolvedFastApiRequestConfig) => boolean); status?: number; statusText?: string; headers?: HeadersInput; delay?: number; data: TData | ((config: ResolvedFastApiRequestConfig) => TData | Promise | FastApiResponse | Promise>); } interface MockAdapterOptions { routes?: MockRoute[]; delay?: number; passthrough?: StormFetchAdapter; scenario?: string; scenarios?: Record; } interface StormFetchMockServer { adapter: StormFetchAdapter; setScenario(name: string): void; addRoute(route: MockRoute, scenario?: string): void; requests(): ResolvedFastApiRequestConfig[]; clearRequests(): void; } type StormFetchDomMimeType = 'text/html' | 'application/xml' | 'text/xml' | 'application/xhtml+xml'; interface StormFetchDomParser { parse(html: string, mimeType: StormFetchDomMimeType): StormFetchDomDocument; } interface StormFetchDomDocument { querySelector(selector: string): StormFetchDomElement | null; querySelectorAll(selector: string): Iterable | ArrayLike; } interface StormFetchDomElement { textContent?: string | null; getAttribute(name: string): string | null; } type StormFetchScrapeRule = string | readonly [string] | { selector: string; attr?: string; all?: boolean; trim?: boolean; }; type StormFetchScrapeSchema = Record; type StormFetchScrapeValue = TRule extends readonly [string] ? string[] : TRule extends { all: true; } ? string[] : string | undefined; type StormFetchScrapeResult = { [K in keyof TShape]: StormFetchScrapeValue; }; interface StormFetchBatchRequest extends FastApiRequestConfig { url: string; method?: HttpMethod; data?: TBody; map?: (response: FastApiResponse) => unknown; } interface StormFetchPollOptions { interval?: number; immediate?: boolean; maxAttempts?: number; stopWhen?: (response: FastApiResponse) => boolean; onData?: (response: FastApiResponse) => void; onError?: (error: FastApiError) => void; config?: FastApiRequestConfig; } interface StormFetchPollController { stop(): void; subscribe(listener: (response: FastApiResponse) => void): () => void; readonly stopped: boolean; } interface StormFetchResource, TUpdate = Partial> { list(config?: FastApiRequestConfig): Promise>; detail(id: string | number, config?: FastApiRequestConfig): Promise>; create(data: TCreate, config?: FastApiRequestConfig): Promise>; replace(id: string | number, data: TCreate, config?: FastApiRequestConfig): Promise>; update(id: string | number, data: TUpdate, config?: FastApiRequestConfig): Promise>; remove(id: string | number, config?: FastApiRequestConfig): Promise>; } interface StormFetchCacheSnapshotEntry { key: string; value: unknown; ttl: number; tags: string[]; staleTime?: number; } interface StormFetchCacheSnapshot { version: number; entries: StormFetchCacheSnapshotEntry[]; } interface StormFetchCacheManager { prefetch(url: string, config?: FastApiRequestConfig): Promise>; invalidate(tags: string[]): Promise; clear(key?: string): Promise; keys(): string[]; dehydrate(): Promise; hydrate(snapshot: StormFetchCacheSnapshot): Promise; subscribe(listener: (event: StormFetchEvent) => void): () => void; } interface StormFetchSseMessage { event?: string; data: string; id?: string; retry?: number; } interface StormFetchSseOptions extends FastApiRequestConfig { onMessage?: (message: StormFetchSseMessage) => void; onError?: (error: unknown) => void; } interface StormFetchSseController { close(): void; readonly closed: boolean; } interface StormFetchContractEndpoint { method: HttpMethod; url: string; } type StormFetchContractDefinition = Record; type StormFetchContract = { [K in keyof TContract]: (dataOrConfig?: TBody | FastApiRequestConfig, config?: FastApiRequestConfig) => Promise>; }; interface StormFetchServerClientOptions extends FastApiClientOptions { cookies?: string | Record; headers?: HeadersInput; } interface EndpointDefinition { data: TData; body?: TBody; } type EndpointMap = Record>>; type EndpointResponse = TEndpoints[TUrl][TMethod] extends EndpointDefinition ? TData : unknown; type EndpointBody = TEndpoints[TUrl][TMethod] extends EndpointDefinition ? TBody : unknown; type TypedStormFetchClient = Omit & { get(url: TUrl, config?: FastApiRequestConfig): Promise>>; post(url: TUrl, data?: EndpointBody, config?: FastApiRequestConfig>): Promise, EndpointBody>>; put(url: TUrl, data?: EndpointBody, config?: FastApiRequestConfig>): Promise, EndpointBody>>; patch(url: TUrl, data?: EndpointBody, config?: FastApiRequestConfig>): Promise, EndpointBody>>; delete(url: TUrl, config?: FastApiRequestConfig): Promise>>; }; type StormFetchClient = FastApiClient; type StormFetchClientOptions = FastApiClientOptions; type StormFetchRequestConfig = FastApiRequestConfig; type StormFetchResponse = FastApiResponse; type StormFetchError = FastApiError; export type { HeadersInput as $, StormFetchServerClientOptions as A, EndpointMap as B, FastApiError as C, DownloadOptions as D, ErrorInterceptor as E, FastApiClient as F, PathParams as G, HttpMethod as H, InterceptorManager as I, ReactNativeFile as J, OfflineQueueStorage as K, OfflineQueueRecord as L, StormFetchRuntimeInfo as M, NativeTransferOptions as N, OfflineQueueSnapshot as O, ParamsSerializerOptions as P, QueryParams as Q, RequestTransformer as R, StormFetchBatchRequest as S, TypedStormFetchClient as T, AsyncStormFetchCacheStorage as U, BasicAuthConfig as V, CacheOptions as W, CacheStorageType as X, CircuitBreakerOptions as Y, EndpointDefinition as Z, ErrorNormalizer as _, FastApiClientOptions as a, StormMutationState as a$, InterceptorOptions as a0, MockAdapterOptions as a1, MockRoute as a2, NativeTransferAdapter as a3, NormalizedErrorShape as a4, OfflineConflictResolution as a5, OfflineDeadLetter as a6, OfflineQueueCryptoProvider as a7, OfflineQueueMigration as a8, ProxyConfig as a9, StormFetchFormSerializer as aA, StormFetchFormSerializerOptions as aB, StormFetchHmacSigningOptions as aC, StormFetchHostMatcher as aD, StormFetchIpResolver as aE, StormFetchJsonReviver as aF, StormFetchMaxRate as aG, StormFetchMethodMatcher as aH, StormFetchMockServer as aI, StormFetchObservabilityOptions as aJ, StormFetchPluginCapability as aK, StormFetchPolicy as aL, StormFetchProgressEvent as aM, StormFetchRequestConfig as aN, StormFetchResponse as aO, StormFetchResponseEncoding as aP, StormFetchRuntime as aQ, StormFetchScrapeRule as aR, StormFetchSecureLoggerOptions as aS, StormFetchSecurityOptions as aT, StormFetchSpan as aU, StormFetchSseMessage as aV, StormFetchTlsOptions as aW, StormFetchTransport as aX, StormInfiniteQueryOptions as aY, StormInfiniteQueryState as aZ, StormMutationOptions as a_, QueryObject as aa, QueryValue as ab, ReactLike as ac, RequestInterceptor as ad, RequestPriority as ae, ResponseInterceptor as af, ResponseType as ag, RetryOptions as ah, RetryPolicy as ai, SchemaValidator as aj, StormFetchAdapter as ak, StormFetchAdapterName as al, StormFetchBeforeRedirectContext as am, StormFetchCacheSnapshotEntry as an, StormFetchCacheStorage as ao, StormFetchClient as ap, StormFetchClientOptions as aq, StormFetchContractEndpoint as ar, StormFetchCredentialForwardPolicy as as, StormFetchDomElement as at, StormFetchDomParser as au, StormFetchError as av, StormFetchEventType as aw, StormFetchFetchEnv as ax, StormFetchFileSaver as ay, StormFetchFormDataHeaderPolicy as az, ResponseTransformer as b, StormQueryOptions as b0, StormQueryState as b1, FastApiRequestConfig as c, FastApiResponse as d, StormFetchPollOptions as e, StormFetchPollController as f, StormFetchDomMimeType as g, StormFetchDomDocument as h, StormFetchScrapeSchema as i, StormFetchScrapeResult as j, StormFetchResource as k, StormFetchCacheManager as l, StormFetchCacheSnapshot as m, StormFetchHistoryEntry as n, ResolvedFastApiRequestConfig as o, StormFetchHarLog as p, StormFetchPolicyMatcher as q, StormFetchSseOptions as r, StormFetchSseController as s, StormFetchContractDefinition as t, StormFetchContract as u, NativeTransferResult as v, NativeTransferTask as w, StormFetchPlugin as x, StormFetchInstalledPlugin as y, StormFetchEvent as z };