mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
napcat native
This commit is contained in:
BIN
src/native/external/MoeHoo.win32.node
vendored
Normal file
BIN
src/native/external/MoeHoo.win32.node
vendored
Normal file
Binary file not shown.
15
src/native/index.ts
Normal file
15
src/native/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { constants } from "node:os";
|
||||
import path from "path";
|
||||
import { dlopen } from "process";
|
||||
export class Native {
|
||||
platform: string;
|
||||
supportedPlatforms = ['win32'];
|
||||
MoeHooExport: any = { exports: {} };
|
||||
constructor(nodePath: string, platform: string = process.platform) {
|
||||
this.platform = platform;
|
||||
if (!this.supportedPlatforms.includes(this.platform)) {
|
||||
throw new Error(`Platform ${this.platform} is not supported`);
|
||||
}
|
||||
dlopen(this.MoeHooExport, path.join(nodePath, './native/MoeHoo.win32.node'), constants.dlopen.RTLD_LAZY);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user