syscall-napi 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # node-syscall-napi
2
- Node.js module to perform promise-based asynchronous syscalls
2
+ Node.js module to perform synchronous syscalls
3
3
 
4
4
 
5
5
  ## About
@@ -1,4 +1,8 @@
1
- declare const syscallNumbers: Partial<{
2
- [x: string]: any;
3
- }>;
1
+ import { syscallNumbers as syscallNumbersX86_64 } from "./x64.js";
2
+ import { syscallNumbers as syscallNumbersArm64 } from "./arm64.js";
3
+ import { syscallNumbers as syscallNumbersArm } from "./arm.js";
4
+ type Common<T, U> = Pick<T, Extract<keyof T, keyof U>>;
5
+ type TCommonSyscallConstants = Common<Common<typeof syscallNumbersX86_64, typeof syscallNumbersArm64>, typeof syscallNumbersArm>;
6
+ type TSyscallConstants = TCommonSyscallConstants & (Partial<typeof syscallNumbersX86_64> & Partial<typeof syscallNumbersArm64> & Partial<typeof syscallNumbersArm>);
7
+ declare const syscallNumbers: TSyscallConstants;
4
8
  export { syscallNumbers };
@@ -25,7 +25,7 @@ if (syscallNumbersOfArch === undefined) {
25
25
  throw Error(`unsupported architecture: ${nodeProcess.arch}`);
26
26
  }
27
27
 
28
- const syscallNumbers = syscallNumbersOfArch/*!*/;
28
+ const syscallNumbers/*: TSyscallConstants*/ = syscallNumbersOfArch;
29
29
 
30
30
  export {
31
31
  syscallNumbers
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.4",
2
+ "version": "0.1.6",
3
3
  "name": "syscall-napi",
4
4
  "type": "module",
5
5
  "description": "Node.js module to perform synchronous syscalls",