mirror of
https://github.com/denoland/deno.git
synced 2025-01-10 16:11:13 -05:00
docs(cli/dts): fix Deno.permissions.query
example (#10572)
This commit is contained in:
parent
576f14baeb
commit
62562f3fd1
1 changed files with 2 additions and 3 deletions
5
cli/dts/lib.deno.ns.d.ts
vendored
5
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -2263,9 +2263,7 @@ declare namespace Deno {
|
|||
*
|
||||
* ```ts
|
||||
* const status = await Deno.permissions.query({ name: "read", path: "/etc" });
|
||||
* if (status.state === "granted") {
|
||||
* data = await Deno.readFile("/etc/passwd");
|
||||
* }
|
||||
* console.log(status.state);
|
||||
* ```
|
||||
*/
|
||||
query(desc: PermissionDescriptor): Promise<PermissionStatus>;
|
||||
|
@ -2274,6 +2272,7 @@ declare namespace Deno {
|
|||
*
|
||||
* ```ts
|
||||
* import { assert } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* const status = await Deno.permissions.revoke({ name: "run" });
|
||||
* assert(status.state !== "granted")
|
||||
* ```
|
||||
|
|
Loading…
Reference in a new issue