feat: stabilize Deno.uid() and Deno.gid() (#16424)

Closes https://github.com/denoland/deno_std/issues/2791
This commit is contained in:
Colin Ihrig 2022-11-09 09:46:50 -05:00 committed by GitHub
parent 0500aa1f71
commit c36496b3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 38 deletions

View file

@ -4950,4 +4950,32 @@ declare namespace Deno {
* @category Timers
*/
export function unrefTimer(id: number): void;
/**
* Returns the user id of the process on POSIX platforms. Returns null on Windows.
*
* ```ts
* console.log(Deno.uid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function uid(): number | null;
/**
* Returns the group id of the process on POSIX platforms. Returns null on windows.
*
* ```ts
* console.log(Deno.gid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function gid(): number | null;
}

View file

@ -269,38 +269,6 @@ declare namespace Deno {
*/
export function umask(mask?: number): number;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Returns the user id of the Deno process on POSIX platforms. Returns `null`
* on Windows.
*
* ```ts
* console.log(Deno.uid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function uid(): number | null;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Returns the group id of the process on POSIX platforms. Returns `null` on
* Windows.
*
* ```ts
* console.log(Deno.gid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function gid(): number | null;
/** **UNSTABLE**: New API, yet to be vetted.
*
* All plain number types for interfacing with foreign functions.