@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 39 lines 1.19 KB
Raw
1 import type * as runtime from "@cloudflare/workers-types";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import * as Effect from "effect/Effect";
5 import type { Bucket } from "./Bucket.ts";
6 import type {
7 R2Error,
8 GetOptions,
9 ListOptions,
10 R2Object,
11 ObjectBody,
12 Objects,
13 } from "./BucketTypes.ts";
14
15 /**
16 * @binding
17 * @product R2
18 * @category Storage & Databases
19 */
20 export interface ReadBucket extends Binding.Service<
21 ReadBucket,
22 "Cloudflare.R2.ReadBucket",
23 (bucket: Bucket) => Effect.Effect<ReadBucketClient>
24 > {}
25
26 export const ReadBucket = Binding.Service<ReadBucket>("Cloudflare.R2.ReadBucket");
27
28 export interface ReadBucketClient {
29 raw: Effect.Effect<runtime.R2Bucket, never, RuntimeContext>;
30 head(key: string): Effect.Effect<R2Object | null, R2Error, RuntimeContext>;
31 get(
32 key: string,
33 options: GetOptions & {
34 onlyIf: runtime.R2Conditional | Headers;
35 },
36 ): Effect.Effect<ObjectBody | R2Object | null, R2Error, RuntimeContext>;
37 get(key: string, options?: GetOptions): Effect.Effect<ObjectBody | null, R2Error, RuntimeContext>;
38 list(options?: ListOptions): Effect.Effect<Objects, R2Error, RuntimeContext>;
39 }