-
Notifications
You must be signed in to change notification settings - Fork 5.8k
fix(dts): resolve missing types in lib.deno.ns.d.ts #31349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
f401e9f
b9339c2
599e322
6c0a6dc
f699ff6
15a0f43
db10eba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /// <reference path="./cli/tsc/dts/lib.deno.ns.d.ts" /> | ||
|
|
||
| console.log(Deno.version); | ||
|
Check failure on line 3 in check_ns.ts
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "esnext", | ||
| "lib": [ | ||
| "esnext", | ||
| "dom" | ||
| ], | ||
| "types": [], | ||
| "skipLibCheck": false, | ||
| "noEmit": true | ||
| }, | ||
| "files": [ | ||
| "./check_ns.ts" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| try { | ||
| Deno.readTextFileSync("doesnt-exist"); | ||
| } catch (e) { | ||
| if (e instanceof Deno.errors.NotFound) { | ||
| // @ts-ignore: Property 'code' does not exist on type 'NotFound'. | ||
| console.log("Runtime code:", (e as any).code); | ||
|
Check failure on line 6 in repro_issue.ts
|
||
|
|
||
| // This line should fail type checking currently | ||
| console.log((e as Deno.errors.NotFound).code); | ||
|
Check failure on line 9 in repro_issue.ts
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| /// <reference path="./cli/tsc/dts/lib.dom.d.ts" /> | ||
| /// <reference path="./cli/tsc/dts/lib.deno_cache.d.ts" /> | ||
| // Try to use Cache to ensure types are compatible and constructible (as per the fix) | ||
| const c = new Cache(); | ||
|
Check failure on line 4 in verify_fix.js
|
||
| const cs = new CacheStorage(); | ||
|
Check failure on line 5 in verify_fix.js
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /// <reference path="./cli/tsc/dts/lib.dom.d.ts" /> | ||
| /// <reference path="./cli/tsc/dts/lib.deno_cache.d.ts" /> | ||
|
|
||
| // Try to use Cache to ensure types are compatible and constructible (as per the fix) | ||
| const c = new Cache(); | ||
|
Check failure on line 5 in verify_fix.ts
|
||
| const cs = new CacheStorage(); | ||
|
Check failure on line 6 in verify_fix.ts
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are tests in this file changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the read_file_test.ts changes. The PR now only contains type definitions in lib.deno.ns.d.ts and type-level tests in error_test.ts. Thanks for the feedback! Let me know if there is anything I can do.