The R2 bucket binding
Optionaloptions: R2StorageOptions
Key prefix
Deletes an object.
Object path/key
true if an object was deleted
Reports whether an object exists.
Object path/key
true if present
Always refuses — R2 bindings cannot presign.
The refusal is a REJECTION, never a synchronous throw: see the class doc.
The unused _options is kept, not deleted. Dropping it would narrow the
exported class below IStorage, so a consumer holding an
R2Storage directly could no longer pass SignedUrlOptions —
the interface still declares it. An underscore is the sanctioned way to
mark a parameter a contract requires and an implementation cannot use.
The object path, named in the error
Required by the contract; no counterpart on the binding
A rejected promise
Writes an object, translating PutObjectOptions into R2's own
spelling: the content type lives under httpMetadata, user metadata under
customMetadata. Without this every object was served as
application/octet-stream (X8-6).
The object path
The object bytes
Optionaloptions: PutObjectOptions
Object attributes to record with the bytes
Object storage backed by Cloudflare R2.
getStreamis implemented, so a download can be piped straight to the response throughIResponse.stream()without buffering the object.getSignedUrlrejects: the R2 Workers binding exposes no presigned-URL capability at all. Serving an object through a Worker route, or fronting the bucket with a custom domain, are the available alternatives, and the error says so. The refusal is a rejection rather than a synchronous throw, because the method is typedPromise<string>and a throw escaping before the promise exists is invisible to a caller using.catch().Since
0.2.0