0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-08 07:16:56 -05:00

fixes Deno.permissions.query({name:"imports"}) is not supported #27050

This commit is contained in:
张瑞 2024-11-25 23:58:47 +08:00
parent 2a6ed4cde9
commit d3e4150c88
3 changed files with 16 additions and 3 deletions

View file

@ -4042,6 +4042,18 @@ declare namespace Deno {
variable?: string; variable?: string;
} }
/** Specifies if the import permission should be requested or revoked.
* If set to "inherit" the current import permission will be inherited.
* If set to true, the global import permission will be requested.
* If set to false, the global import permission will be revoked.
* If set to Array<string>, the import permissions will be requested with the specified domains.
*
* @category Permissions */
export interface ImportPermissionDescriptor {
name: "import";
variable?: string;
}
/** The permission descriptor for the `allow-sys` and `deny-sys` permissions, which controls /** The permission descriptor for the `allow-sys` and `deny-sys` permissions, which controls
* access to sensitive host system information, which malicious code might * access to sensitive host system information, which malicious code might
* attempt to exploit. The option `kind` allows scoping the permission to a * attempt to exploit. The option `kind` allows scoping the permission to a
@ -4096,7 +4108,8 @@ declare namespace Deno {
| NetPermissionDescriptor | NetPermissionDescriptor
| EnvPermissionDescriptor | EnvPermissionDescriptor
| SysPermissionDescriptor | SysPermissionDescriptor
| FfiPermissionDescriptor; | FfiPermissionDescriptor
| ImportPermissionDescriptor;
/** The interface which defines what event types are supported by /** The interface which defines what event types are supported by
* {@linkcode PermissionStatus} instances. * {@linkcode PermissionStatus} instances.

View file

@ -32,6 +32,5 @@ export const appendFile = fsPromises.appendFile;
export const readFile = fsPromises.readFile; export const readFile = fsPromises.readFile;
export const watch = fsPromises.watch; export const watch = fsPromises.watch;
export const cp = fsPromises.cp; export const cp = fsPromises.cp;
export const sync = fsPromises.sync;
export default fsPromises; export default fsPromises;

View file

@ -37,7 +37,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey");
* @property {boolean} partial * @property {boolean} partial
*/ */
/** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "ffi">} */ /** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "ffi" | "import">} */
const permissionNames = [ const permissionNames = [
"read", "read",
"write", "write",
@ -46,6 +46,7 @@ const permissionNames = [
"sys", "sys",
"run", "run",
"ffi", "ffi",
"import",
]; ];
/** /**