mirror of
https://github.com/denoland/deno.git
synced 2025-02-01 20:25:12 -05:00
feat: Stabilize Deno.osRelease() API (#15973)
Closes https://github.com/denoland/deno/issues/15928
This commit is contained in:
parent
851db03a6e
commit
046ab7dc8a
3 changed files with 16 additions and 18 deletions
16
cli/dts/lib.deno.ns.d.ts
vendored
16
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -344,6 +344,22 @@ declare namespace Deno {
|
||||||
*/
|
*/
|
||||||
export const noColor: boolean;
|
export const noColor: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the release version of the Operating System.
|
||||||
|
*
|
||||||
|
* ```ts
|
||||||
|
* console.log(Deno.osRelease());
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* Requires `allow-env` permission.
|
||||||
|
* Under consideration to possibly move to Deno.build or Deno.versions and if
|
||||||
|
* it should depend sys-info, which may not be desirable.
|
||||||
|
*
|
||||||
|
* @tags allow-env
|
||||||
|
* @category Runtime Environment
|
||||||
|
*/
|
||||||
|
export function osRelease(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options which define the permissions within a test or worker context.
|
* Options which define the permissions within a test or worker context.
|
||||||
*
|
*
|
||||||
|
|
17
cli/dts/lib.deno.unstable.d.ts
vendored
17
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -226,23 +226,6 @@ declare namespace Deno {
|
||||||
*/
|
*/
|
||||||
export function umask(mask?: number): number;
|
export function umask(mask?: number): number;
|
||||||
|
|
||||||
/** **UNSTABLE**: New API, yet to be vetted.
|
|
||||||
*
|
|
||||||
* Returns the release version of the Operating System.
|
|
||||||
*
|
|
||||||
* ```ts
|
|
||||||
* console.log(Deno.osRelease());
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Requires `allow-sys` permission.
|
|
||||||
* Under consideration to possibly move to Deno.build or Deno.versions and if
|
|
||||||
* it should depend sys-info, which may not be desirable.
|
|
||||||
*
|
|
||||||
* @tags allow-sys
|
|
||||||
* @category Runtime Environment
|
|
||||||
*/
|
|
||||||
export function osRelease(): string;
|
|
||||||
|
|
||||||
/** **UNSTABLE**: New API, yet to be vetted.
|
/** **UNSTABLE**: New API, yet to be vetted.
|
||||||
*
|
*
|
||||||
* Displays the total amount of free and used physical and swap memory in the
|
* Displays the total amount of free and used physical and swap memory in the
|
||||||
|
|
|
@ -182,7 +182,6 @@ fn op_hostname(state: &mut OpState) -> Result<String, AnyError> {
|
||||||
|
|
||||||
#[op]
|
#[op]
|
||||||
fn op_os_release(state: &mut OpState) -> Result<String, AnyError> {
|
fn op_os_release(state: &mut OpState) -> Result<String, AnyError> {
|
||||||
super::check_unstable(state, "Deno.osRelease");
|
|
||||||
state
|
state
|
||||||
.borrow_mut::<Permissions>()
|
.borrow_mut::<Permissions>()
|
||||||
.sys
|
.sys
|
||||||
|
|
Loading…
Add table
Reference in a new issue