deploy_feedback icon indicating copy to clipboard operation
deploy_feedback copied to clipboard

latest type definition for deno deploy

Open ayame113 opened this issue 4 years ago • 2 comments

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

ayame113 avatar Oct 29 '21 09:10 ayame113

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.

  1. pipe the types from deployctl to a local file with the command deployctl types > deploy.d.ts
  2. reference/import the types where you want to use them: /// <reference path="./deploy.d.ts" />

MrEmanuel avatar Dec 26 '21 11:12 MrEmanuel

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.

ayame113 avatar Jan 17 '22 18:01 ayame113