latest type definition for deno deploy
How do I get the latest type definition for deno deploy?
The type definitions at https://deno.land/x/[email protected]/types/deploy.window.d.ts are out of date (no URLPattern API) and the repository is archived.
I know I can use the type definition for the deno CLI instead, but it would be nice if I could find out by type checking that I'm using an API that exists in the CLI but not in deploy.
related https://github.com/denoland/deployctl/issues/24, https://github.com/denoland/deployctl/issues/53
I would also like to see this fixed/explained.
For anyone looking for a fix, I couldn't get the types working via a deno settings file as recommended by jsejcksn here: https://github.com/denoland/deployctl/issues/24#issuecomment-879208689 I could only get this to work with the tripple slash method.
- pipe the types from deployctl to a local file with the command
deployctl types > deploy.d.ts - reference/import the types where you want to use them:
/// <reference path="./deploy.d.ts" />
I have created https://deno.land/x/deploy_type_checker to typecheck a deno deploy project.
We can run type checking with command deno run --allow-read --allow-run https://deno.land/x/[email protected]/type_check.ts ./your_code.ts.
We can use this until we get the official type check command.