Skip to content

Commit

Permalink
typings: define types for os binding
Browse files Browse the repository at this point in the history
PR-URL: #40222
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
targos committed Oct 13, 2021
1 parent ca9a854 commit 7733b5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -6,6 +6,7 @@
"./typings/internalBinding/http_parser.d.ts",
"./typings/internalBinding/messaging.d.ts",
"./typings/internalBinding/options.d.ts",
"./typings/internalBinding/os.d.ts",
"./typings/internalBinding/serdes.d.ts",
"./typings/internalBinding/timers.d.ts",
"./typings/internalBinding/util.d.ts",
Expand Down
21 changes: 21 additions & 0 deletions typings/internalBinding/os.d.ts
@@ -0,0 +1,21 @@
declare function InternalBinding(binding: 'os'): {
getHostname(ctx: {}): string | undefined;
getLoadAvg(array: Float64Array): void;
getUptime(): number;
getTotalMem(): number;
getFreeMem(): number;
getCPUs(): Array<string | number>;
getInterfaceAddresses(ctx: {}): Array<string | number | boolean> | undefined;
getHomeDirectory(ctx: {}): string | undefined;
getUserInfo(options: { encoding?: string } | undefined, ctx: {}): {
uid: number;
gid: number;
username: string;
homedir: string;
shell: string | null;
} | undefined;
setPriority(pid: number, priority: number, ctx: {}): number;
getPriority(pid: number, ctx: {}): number | undefined;
getOSInformation(ctx: {}): [sysname: string, version: string, release: string];
isBigEndian: boolean;
};

0 comments on commit 7733b5e

Please sign in to comment.