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 <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
targos committed Oct 10, 2021
1 parent 70a5b86 commit 9467cba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 9467cba

Please sign in to comment.