Skip to content
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

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion cli/tsc/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4042,6 +4042,18 @@ declare namespace Deno {
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
* access to sensitive host system information, which malicious code might
* attempt to exploit. The option `kind` allows scoping the permission to a
Expand Down Expand Up @@ -4096,7 +4108,8 @@ declare namespace Deno {
| NetPermissionDescriptor
| EnvPermissionDescriptor
| SysPermissionDescriptor
| FfiPermissionDescriptor;
| FfiPermissionDescriptor
| ImportPermissionDescriptor;

/** The interface which defines what event types are supported by
* {@linkcode PermissionStatus} instances.
Expand Down
3 changes: 2 additions & 1 deletion runtime/js/10_permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey");
* @property {boolean} partial
*/

/** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "ffi">} */
/** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "ffi" | "import">} */
const permissionNames = [
"read",
"write",
Expand All @@ -46,6 +46,7 @@ const permissionNames = [
"sys",
"run",
"ffi",
"import",
];

/**
Expand Down
Loading