0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/typings/internalBinding/os.d.ts
Yagiz Nizipli da7962fd4d
lib: fix internalBinding typings
PR-URL: https://github.com/nodejs/node/pull/49742
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-09-23 10:48:34 +00:00

26 lines
1009 B
TypeScript

declare namespace InternalOSBinding {
type OSContext = {};
}
export interface OSBinding {
getHostname(ctx: InternalOSBinding.OSContext): string | undefined;
getLoadAvg(array: Float64Array): void;
getUptime(): number;
getTotalMem(): number;
getFreeMem(): number;
getCPUs(): Array<string | number>;
getInterfaceAddresses(ctx: InternalOSBinding.OSContext): Array<string | number | boolean> | undefined;
getHomeDirectory(ctx: InternalOSBinding.OSContext): string | undefined;
getUserInfo(options: { encoding?: string } | undefined, ctx: InternalOSBinding.OSContext): {
uid: number;
gid: number;
username: string;
homedir: string;
shell: string | null;
} | undefined;
setPriority(pid: number, priority: number, ctx: InternalOSBinding.OSContext): number;
getPriority(pid: number, ctx: InternalOSBinding.OSContext): number | undefined;
getOSInformation(ctx: InternalOSBinding.OSContext): [sysname: string, version: string, release: string];
isBigEndian: boolean;
}