interface IR2Bucket

Methods

head(key: string): Promise<IR2Object | null>

Reads object metadata without transferring the body.

get(key: string): Promise<IR2ObjectBody | null>

Reads an object.

put(
key: string,
value: ArrayBuffer | ArrayBufferView,
options?: R2PutOptions
): Promise<IR2Object | null>

Writes an object.

delete(key: string): Promise<void>

Removes an object. Succeeds whether or not it existed, and reports nothing about what was removed — which is why R2Storage.delete heads first to honor its committed Promise<boolean>.

Usage

import { type IR2Bucket } from "cloudflare-plugin/src/index.ts";