mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 16:49:18 -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;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
|
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;
|
||||
|
||||
/** **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.
|
||||
*
|
||||
* 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]
|
||||
fn op_os_release(state: &mut OpState) -> Result<String, AnyError> {
|
||||
super::check_unstable(state, "Deno.osRelease");
|
||||
state
|
||||
.borrow_mut::<Permissions>()
|
||||
.sys
|
||||
|
|
Loading…
Reference in a new issue