Compare commits

...

3 Commits

Author SHA1 Message Date
Derrick Hammer 0d6219837a
*Update dist 2022-12-21 15:19:10 -05:00
Derrick Hammer c476a94b0e
*Don't bundle cfg types 2022-12-21 15:18:48 -05:00
Derrick Hammer b5b1a8bbb9
*Remove private property references 2022-12-21 15:01:15 -05:00
5 changed files with 6 additions and 54 deletions

7
dist/plugin.d.ts vendored
View File

@ -3,7 +3,7 @@ import { RPCMethod, RPCServer } from "./rpc.js";
import { Logger } from "pino";
import SSLManager from "./ssl.js";
import type { HDKey } from "micro-ed25519-hdkey";
import Config from "./config.js";
import type Config from "@lumeweb/cfg";
export type PluginFunction = (api: PluginAPI) => Promise<void>;
export interface Plugin {
name: string;
@ -12,7 +12,6 @@ export interface Plugin {
default?: Plugin;
}
export declare class PluginAPI extends EventEmitter2 {
private _server;
constructor({
config,
logger,
@ -24,11 +23,9 @@ export declare class PluginAPI extends EventEmitter2 {
server: RPCServer;
swarm: any;
});
private _swarm;
get swarm(): any;
private _config;
get config(): Config;
private _logger;
get pluginConfig(): Config;
get logger(): Logger;
get rpcServer(): RPCServer;
get seed(): Uint8Array;

View File

@ -1 +1 @@
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAA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AAEvC,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;gBACtC,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,SAAS,CAAC;QAClB,KAAK,EAAE,GAAG,CAAC;KACZ;IACD,IAAI,KAAK,IAAI,GAAG,CAAC;IACjB,IAAI,MAAM,IAAI,MAAM,CAAC;IACrB,IAAI,YAAY,IAAI,MAAM,CAAC;IAC3B,IAAI,MAAM,IAAI,MAAM,CAAC;IACrB,IAAI,SAAS,IAAI,SAAS,CAAC;IAC3B,IAAI,IAAI,IAAI,UAAU,CAAC;IACvB,IAAI,QAAQ,IAAI,KAAK,CAAC;IACtB,IAAI,GAAG,IAAI,UAAU,CAAC;IACtB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;IACvE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;CAC5D"}

View File

@ -4,6 +4,7 @@
"main": "dist",
"type": "module",
"devDependencies": {
"@lumeweb/cfg": "https://git.lumeweb.com/LumeWeb/cfg.git",
"@types/node": "^18.11.17",
"express": "^4.18.1",
"node-cache": "^5.1.2",

View File

@ -1,43 +0,0 @@
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;

View File

@ -3,7 +3,7 @@ import { RPCMethod, RPCServer } from "./rpc.js";
import { Logger } from "pino";
import SSLManager from "./ssl.js";
import type { HDKey } from "micro-ed25519-hdkey";
import Config from "./config.js";
import type Config from "@lumeweb/cfg";
export type PluginFunction = (api: PluginAPI) => Promise<void>;
@ -15,7 +15,6 @@ export interface Plugin {
}
export declare class PluginAPI extends EventEmitter2 {
private _server;
constructor({
config,
logger,
@ -27,11 +26,9 @@ export declare class PluginAPI extends EventEmitter2 {
server: RPCServer;
swarm: any;
});
private _swarm;
get swarm(): any;
private _config;
get config(): Config;
private _logger;
get pluginConfig(): Config;
get logger(): Logger;
get rpcServer(): RPCServer;
get seed(): Uint8Array;