Compare commits
No commits in common. "0d6219837a743543f97eaf391895a6608e0fb7d5" and "f1da2249ac8d21e76e729d019c75cf15f01bb6a0" have entirely different histories.
0d6219837a
...
f1da2249ac
|
@ -3,7 +3,7 @@ import { RPCMethod, RPCServer } from "./rpc.js";
|
||||||
import { Logger } from "pino";
|
import { Logger } from "pino";
|
||||||
import SSLManager from "./ssl.js";
|
import SSLManager from "./ssl.js";
|
||||||
import type { HDKey } from "micro-ed25519-hdkey";
|
import type { HDKey } from "micro-ed25519-hdkey";
|
||||||
import type Config from "@lumeweb/cfg";
|
import Config from "./config.js";
|
||||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||||
export interface Plugin {
|
export interface Plugin {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -12,6 +12,7 @@ export interface Plugin {
|
||||||
default?: Plugin;
|
default?: Plugin;
|
||||||
}
|
}
|
||||||
export declare class PluginAPI extends EventEmitter2 {
|
export declare class PluginAPI extends EventEmitter2 {
|
||||||
|
private _server;
|
||||||
constructor({
|
constructor({
|
||||||
config,
|
config,
|
||||||
logger,
|
logger,
|
||||||
|
@ -23,9 +24,11 @@ export declare class PluginAPI extends EventEmitter2 {
|
||||||
server: RPCServer;
|
server: RPCServer;
|
||||||
swarm: any;
|
swarm: any;
|
||||||
});
|
});
|
||||||
|
private _swarm;
|
||||||
get swarm(): any;
|
get swarm(): any;
|
||||||
|
private _config;
|
||||||
get config(): Config;
|
get config(): Config;
|
||||||
get pluginConfig(): Config;
|
private _logger;
|
||||||
get logger(): Logger;
|
get logger(): Logger;
|
||||||
get rpcServer(): RPCServer;
|
get rpcServer(): RPCServer;
|
||||||
get seed(): Uint8Array;
|
get seed(): Uint8Array;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eA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AG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;IACvE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;CAC5D"}
|
|
@ -4,7 +4,6 @@
|
||||||
"main": "dist",
|
"main": "dist",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lumeweb/cfg": "https://git.lumeweb.com/LumeWeb/cfg.git",
|
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.17",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
import type arg from "arg";
|
||||||
|
declare class Config {
|
||||||
|
private module;
|
||||||
|
private data;
|
||||||
|
constructor(module: string);
|
||||||
|
inject(options: object): void;
|
||||||
|
load(): void;
|
||||||
|
openDir(dir: string): void;
|
||||||
|
open(file: string): void;
|
||||||
|
save(file: string, data: object): void;
|
||||||
|
set(key: string, value: any): void;
|
||||||
|
has(key: string): any;
|
||||||
|
private normalize;
|
||||||
|
get(key: string, fallback?: any): any;
|
||||||
|
typeOf(
|
||||||
|
key: string
|
||||||
|
):
|
||||||
|
| "string"
|
||||||
|
| "number"
|
||||||
|
| "bigint"
|
||||||
|
| "boolean"
|
||||||
|
| "symbol"
|
||||||
|
| "undefined"
|
||||||
|
| "object"
|
||||||
|
| "function"
|
||||||
|
| "null";
|
||||||
|
str(key: string, fallback?: any): any;
|
||||||
|
int(key: any, fallback?: any): any;
|
||||||
|
uint(key: any, fallback?: any): any;
|
||||||
|
float(key: any, fallback?: any): any;
|
||||||
|
ufloat(key: any, fallback?: any): any;
|
||||||
|
fixed(key: any, exp: any, fallback?: any): any;
|
||||||
|
ufixed(key: any, exp: any, fallback?: any): any;
|
||||||
|
bool(key: any, fallback?: any): any;
|
||||||
|
buf(key: string, fallback?: any, enc?: BufferEncoding): any;
|
||||||
|
array(key: string, fallback?: any): any;
|
||||||
|
obj(key: string, fallback?: any): any;
|
||||||
|
func(key: string, fallback?: any): any;
|
||||||
|
mb(key: string, fallback?: any): any;
|
||||||
|
parseArg(args: arg.Result<any>): void;
|
||||||
|
parseEnv(env?: object): void;
|
||||||
|
}
|
||||||
|
export default Config;
|
|
@ -3,7 +3,7 @@ import { RPCMethod, RPCServer } from "./rpc.js";
|
||||||
import { Logger } from "pino";
|
import { Logger } from "pino";
|
||||||
import SSLManager from "./ssl.js";
|
import SSLManager from "./ssl.js";
|
||||||
import type { HDKey } from "micro-ed25519-hdkey";
|
import type { HDKey } from "micro-ed25519-hdkey";
|
||||||
import type Config from "@lumeweb/cfg";
|
import Config from "./config.js";
|
||||||
|
|
||||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ export interface Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare class PluginAPI extends EventEmitter2 {
|
export declare class PluginAPI extends EventEmitter2 {
|
||||||
|
private _server;
|
||||||
constructor({
|
constructor({
|
||||||
config,
|
config,
|
||||||
logger,
|
logger,
|
||||||
|
@ -26,9 +27,11 @@ export declare class PluginAPI extends EventEmitter2 {
|
||||||
server: RPCServer;
|
server: RPCServer;
|
||||||
swarm: any;
|
swarm: any;
|
||||||
});
|
});
|
||||||
|
private _swarm;
|
||||||
get swarm(): any;
|
get swarm(): any;
|
||||||
|
private _config;
|
||||||
get config(): Config;
|
get config(): Config;
|
||||||
get pluginConfig(): Config;
|
private _logger;
|
||||||
get logger(): Logger;
|
get logger(): Logger;
|
||||||
get rpcServer(): RPCServer;
|
get rpcServer(): RPCServer;
|
||||||
get seed(): Uint8Array;
|
get seed(): Uint8Array;
|
||||||
|
|
Loading…
Reference in New Issue