*add plugin util types
This commit is contained in:
parent
5a3226e0b9
commit
e6941a34e2
|
@ -5,7 +5,9 @@
|
|||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@lumeweb/cfg": "https://git.lumeweb.com/LumeWeb/cfg.git",
|
||||
"@types/b4a": "^1.6.0",
|
||||
"@types/node": "^18.11.17",
|
||||
"c": "^1.1.1",
|
||||
"express": "^4.18.1",
|
||||
"node-cache": "^5.1.2",
|
||||
"prettier": "^2.8.1",
|
||||
|
|
|
@ -5,6 +5,7 @@ import SSLManager from "./ssl.js";
|
|||
import type { HDKey } from "micro-ed25519-hdkey";
|
||||
import type Config from "@lumeweb/cfg";
|
||||
import type { ProtocolManager } from "./swarm.js";
|
||||
import type { Util } from "./util.js";
|
||||
|
||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
|
||||
|
@ -27,6 +28,7 @@ export declare class PluginAPI extends EventEmitter2 {
|
|||
server: RPCServer;
|
||||
swarm: any;
|
||||
});
|
||||
get util(): Util;
|
||||
get swarm(): any;
|
||||
get config(): Config;
|
||||
get pluginConfig(): Config;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import type b4a from "b4a";
|
||||
import type c from "compact-encoding";
|
||||
export declare class Util {
|
||||
private _crypto;
|
||||
get crypto(): Crypto;
|
||||
get bufferEncoding(): typeof b4a;
|
||||
get binaryEncoding(): typeof c;
|
||||
}
|
||||
|
||||
export declare class Crypto {
|
||||
createHash(data: string): Buffer;
|
||||
}
|
Loading…
Reference in New Issue