diff --git a/src/worker-types/globals.d.ts b/src/worker-types/globals.d.ts index bcc3087cf..660c4e7fc 100644 --- a/src/worker-types/globals.d.ts +++ b/src/worker-types/globals.d.ts @@ -13,18 +13,18 @@ import type { PuterContext } from './types/event.d.ts'; declare global { /** The deployer's Puter context, authenticated with the worker's own credentials. */ const me: PuterContext; - /** Alias for {@link me}. */ + /** @deprecated Alias for {@link me}. Will be removed at a future date. */ const my: PuterContext; - /** Alias for {@link me}. */ + /** @deprecated Alias for {@link me}. Will be removed at a future date. */ const myself: PuterContext; /** The router used to register HTTP route handlers. */ const router: Router; - /** The deployer's Puter auth token, provided as a Cloudflare secret binding. */ + /** @deprecated The deployer's Puter auth token, provided as a Cloudflare secret binding. Will be removed at a future date. Use me.puter.authToken */ const puter_auth: string; - /** The Puter API endpoint, provided as a Cloudflare plaintext binding. Defaults to `https://api.puter.com`. */ + /** @deprecated The Puter API endpoint, provided as a Cloudflare plaintext binding. Defaults to `https://api.puter.com`. Will be removed at a future date. use me.puter.APIOrigin */ const puter_endpoint: string; } diff --git a/src/worker-types/types/event.d.ts b/src/worker-types/types/event.d.ts index c93f262f5..d1d278030 100644 --- a/src/worker-types/types/event.d.ts +++ b/src/worker-types/types/event.d.ts @@ -16,7 +16,7 @@ export interface PuterContext { * methods infer it from the path literal so handlers get precisely-typed * `params` automatically. */ -export interface WorkerEvent { +export interface WorkerEvent extends Extendable{ request: Request; params: TParams; @@ -27,8 +27,15 @@ export interface WorkerEvent { */ user?: PuterContext; - /** Alias for {@link WorkerEvent.user}. */ + /** @deprecated Alias for {@link WorkerEvent.user}. May be removed at a future date. */ requestor?: PuterContext; + + /** + * The **`WorkerEvent.waitUntil()`** method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In puter workers, waitUntil() tells the worker that work is ongoing until the promise settles, and it shouldn't terminate the worker if it wants that work to complete. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) + */ + waitUntil(f: Promise): void; } /**