import type * as runtime from "@cloudflare/workers-types"; import * as Effect from "effect/Effect"; import * as Binding from "../../Binding.ts"; import type { RuntimeContext } from "../../RuntimeContext.ts"; import type { Bucket } from "./Bucket.ts"; import type { R2Error, GetOptions, ListOptions, R2Object, ObjectBody, Objects, } from "./BucketTypes.ts"; /** * @binding * @product R2 * @category Storage & Databases */ export interface ReadBucket extends Binding.Service< ReadBucket, "Cloudflare.R2.ReadBucket", (bucket: Bucket) => Effect.Effect > {} export const ReadBucket = Binding.Service( "Cloudflare.R2.ReadBucket", ); export interface ReadBucketClient { raw: Effect.Effect; head(key: string): Effect.Effect; get( key: string, options: GetOptions & { onlyIf: runtime.R2Conditional | Headers; }, ): Effect.Effect; get( key: string, options?: GetOptions, ): Effect.Effect; list(options?: ListOptions): Effect.Effect; }