From 2f5b4f77af2b94ea0f5780faf7edc1d14bd91c83 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Wed, 25 Sep 2024 12:41:28 +0100 Subject: [PATCH] update cloudflare context ts-docs comments as suggested --- .../src/api/get-cloudflare-context.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/cloudflare/src/api/get-cloudflare-context.ts b/packages/cloudflare/src/api/get-cloudflare-context.ts index eef72ff0..fd5dca4b 100644 --- a/packages/cloudflare/src/api/get-cloudflare-context.ts +++ b/packages/cloudflare/src/api/get-cloudflare-context.ts @@ -9,23 +9,24 @@ export type CloudflareContext< CfProperties extends Record = IncomingRequestCfProperties, Context = ExecutionContext, > = { + /** + * object containing the worker's bindings ([docs](https://developers.cloudflare.com/workers/runtime-apis/bindings/)) + */ env: CloudflareEnv; + /** + * object containing information regarding the current request ([docs](https://developers.cloudflare.com/workers/runtime-apis/request/#the-cf-property-requestinitcfproperties)) + */ cf: CfProperties; + /** + * the current execution context object ([docs](https://developers.cloudflare.com/workers/runtime-apis/context)) + */ ctx: Context; }; const cloudflareContextSymbol = Symbol.for("__cloudflare-context__"); /** - * Utility to get the current Cloudflare context. - * - * Such context contains three values: - * - `env`: object containing the worker's bindings - * (https://developers.cloudflare.com/workers/runtime-apis/bindings/) - * - `ctx`: the current execution context object - * (https://developers.cloudflare.com/workers/runtime-apis/context) - * - `cf`: object containing information regarding the current request - * (https://developers.cloudflare.com/workers/runtime-apis/request/#the-cf-property-requestinitcfproperties) + * Utility to get the current Cloudflare context * * @returns the cloudflare context */