The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as Binding from "alchemy/Binding"; |
| 2 | import type { RuntimeContext } from "alchemy/RuntimeContext"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import * as Stream from "effect/Stream"; |
| 5 | import type { Bucket } from "./Bucket.ts"; |
| 6 | import type { |
| 7 | Conditional, |
| 8 | R2Error, |
| 9 | MultipartOptions, |
| 10 | MultipartUpload, |
| 11 | R2Object, |
| 12 | PutOptions, |
| 13 | } from "./BucketTypes.ts"; |
| 14 | |
| 15 | /** |
| 16 | * @binding |
| 17 | * @product R2 |
| 18 | * @category Storage & Databases |
| 19 | */ |
| 20 | export interface WriteBucket extends Binding.Service< |
| 21 | WriteBucket, |
| 22 | "Cloudflare.R2.WriteBucket", |
| 23 | (bucket: Bucket) => Effect.Effect<WriteBucketClient> |
| 24 | > {} |
| 25 | |
| 26 | export const WriteBucket = Binding.Service<WriteBucket>("Cloudflare.R2.WriteBucket"); |
| 27 | |
| 28 | export interface WriteBucketClient { |
| 29 | put<Err = never>( |
| 30 | key: string, |
| 31 | value: |
| 32 | | ReadableStream |
| 33 | | ArrayBuffer |
| 34 | | ArrayBufferView |
| 35 | | string |
| 36 | | null |
| 37 | | Blob |
| 38 | | Stream.Stream<Uint8Array, Err>, |
| 39 | options?: PutOptions & { |
| 40 | onlyIf: Conditional | Headers; |
| 41 | contentLength?: number; |
| 42 | }, |
| 43 | ): Effect.Effect<R2Object | null, R2Error | Err, RuntimeContext>; |
| 44 | put<Err = never>( |
| 45 | key: string, |
| 46 | value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob, |
| 47 | options?: PutOptions, |
| 48 | ): Effect.Effect<R2Object, R2Error | Err, RuntimeContext>; |
| 49 | put<Err = never>( |
| 50 | key: string, |
| 51 | value: |
| 52 | | ReadableStream |
| 53 | | ArrayBuffer |
| 54 | | ArrayBufferView |
| 55 | | string |
| 56 | | null |
| 57 | | Blob |
| 58 | | Stream.Stream<Uint8Array, Err>, |
| 59 | options: PutOptions & { |
| 60 | contentLength: number; |
| 61 | }, |
| 62 | ): Effect.Effect<R2Object, R2Error | Err, RuntimeContext>; |
| 63 | delete(keys: string | string[]): Effect.Effect<void, R2Error, RuntimeContext>; |
| 64 | createMultipartUpload( |
| 65 | key: string, |
| 66 | options?: MultipartOptions, |
| 67 | ): Effect.Effect<MultipartUpload, R2Error, RuntimeContext>; |
| 68 | resumeMultipartUpload( |
| 69 | key: string, |
| 70 | uploadId: string, |
| 71 | ): Effect.Effect<MultipartUpload, R2Error, RuntimeContext>; |
| 72 | } |