import { type PathSpec } from '../../types.ts'; import type { S3Accessor } from '../../accessor/s3.ts'; import type { IndexCacheStore } from '../../cache/index/store.ts'; export declare function stream(accessor: S3Accessor, path: PathSpec): AsyncIterable; /** * A byte window, taken the cheapest way the configured client allows. * * The SDK path asks for one ranged GET, which is the whole point on an object * store. The browser path cannot: `createBrowserS3Client` fetches a presigned * URL, and a presigned GET carries no `Range` — adding the header would make * the request non-simple and trip a CORS preflight that presigned deployments * generally do not allow. Its shim therefore refuses a `Range` input outright, * so asking for one there would fail rather than quietly return the whole * object as if it were the window. * * Streaming is the honest substitute: `bodyFromResponse` hands back a reader * over the live body, so stopping at `offset + size` cancels the download * instead of buffering the rest of the object and throwing it away. * * @param accessor the S3 accessor * @param path the object path * @param index the index cache store, forwarded to the SDK read * @param offset first byte to read * @param size how many bytes, or null for the rest of the object */ export declare function readRange(accessor: S3Accessor, path: PathSpec, index: IndexCacheStore | undefined, offset: number, size: number | null): Promise; /** * The resource-level `range_read(path, start, end)`, end exclusive. * * Every other backend's `rangeRead` and all of python's spell the window this * way; s3 read its fourth argument as a length, so `range_read(p, 10, 20)` * returned twenty bytes from offset ten where python returned ten. * * @param accessor the S3 accessor * @param path the object path * @param start first byte to read * @param end one past the last byte to read */ export declare function rangeRead(accessor: S3Accessor, path: PathSpec, start: number, end: number): Promise; //# sourceMappingURL=stream.d.ts.map