Setu-TS
    Preparing search index...

    Object storage backed by Cloudflare R2.

    getStream is implemented, so a download can be piped straight to the response through IResponse.stream() without buffering the object.

    getSignedUrl rejects: 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 typed Promise<string> and a throw escaping before the promise exists is invisible to a caller using .catch().

    0.2.0

    Implements

    Index
    • 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.

      Parameters

      • path: string

        The object path, named in the error

      • _options: SignedUrlOptions

        Required by the contract; no counterpart on the binding

      Returns Promise<string>

      A rejected promise

      Always, as a rejection

    • Streams an object without buffering it.

      Parameters

      • path: string

        The object path

      Returns Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

      The object body as a stream

      When the object does not exist

    • 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).

      Parameters

      • path: string

        The object path

      • data: Uint8Array

        The object bytes

      • Optionaloptions: PutObjectOptions

        Object attributes to record with the bytes

      Returns Promise<void>