Skip to content

Commit 69bf457

Browse files
authored
typings: add credentials internal binding types
Add a CredentialsBinding declaration for internalBinding('credentials') and wire it into InternalBindingMap. Signed-off-by: HoonDongKang <d159123@naver.com> PR-URL: #65036 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
1 parent 00f0f8c commit 69bf457

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

typings/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BufferBinding } from './internalBinding/buffer';
55
import { CJSLexerBinding } from './internalBinding/cjs_lexer';
66
import { ConfigBinding } from './internalBinding/config';
77
import { ConstantsBinding } from './internalBinding/constants';
8+
import { CredentialsBinding } from './internalBinding/credentials';
89
import { CryptoBinding } from './internalBinding/crypto';
910
import { DebugBinding } from './internalBinding/debug';
1011
import { EncodingBinding } from './internalBinding/encoding_binding';
@@ -44,6 +45,7 @@ interface InternalBindingMap {
4445
cjs_lexer: CJSLexerBinding;
4546
config: ConfigBinding;
4647
constants: ConstantsBinding;
48+
credentials: CredentialsBinding;
4749
crypto: CryptoBinding;
4850
debug: DebugBinding;
4951
encoding_binding: EncodingBinding;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export interface CredentialsBinding {
2+
implementsPosixCredentials?: true;
3+
safeGetenv(key: string): string | undefined;
4+
getTempDir(): string | undefined;
5+
6+
getuid?(): number;
7+
geteuid?(): number;
8+
getgid?(): number;
9+
getegid?(): number;
10+
getgroups?(): number[];
11+
12+
initgroups?(user: string | number, extraGroup: string | number): 0 | 1 | 2;
13+
setegid?(id: string | number): 0 | 1;
14+
seteuid?(id: string | number): 0 | 1;
15+
setgid?(id: string | number): 0 | 1;
16+
setuid?(id: string | number): 0 | 1;
17+
setgroups?(groups: Array<string | number>): number;
18+
}

0 commit comments

Comments
 (0)