Skip to content

Commit

Permalink
update cloudflare context ts-docs comments as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Sep 25, 2024
1 parent e5aa81a commit 2f5b4f7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/cloudflare/src/api/get-cloudflare-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ export type CloudflareContext<
CfProperties extends Record<string, unknown> = 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
*/
Expand Down

0 comments on commit 2f5b4f7

Please sign in to comment.