@hyper-fetch/react
Version:
React hooks and utils for the hyper-fetch
11 lines • 582 B
TypeScript
import { RequestInstance } from '@hyper-fetch/core';
import { UseStreamOptionsType, UseStreamReturnType } from './use-stream.types';
/**
* Hook for consuming streaming responses chunk-by-chunk.
* Works with any request that uses the fetch adapter's `streaming: true` option.
*
* Provides both accumulated `text` (for LLM/SSE use cases) and raw `chunks`
* (for binary streaming / file downloads).
*/
export declare const useStream: <T extends RequestInstance>(request: T, options?: UseStreamOptionsType) => UseStreamReturnType<T>;
//# sourceMappingURL=use-stream.hooks.d.ts.map