*Update dist
This commit is contained in:
parent
a4c4920839
commit
6da33f1352
|
@ -1,4 +1,3 @@
|
|||
export * from "./rpc.js";
|
||||
export * from "./plugin.js";
|
||||
export * from "./files.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@ -1,62 +1,41 @@
|
|||
/// <reference types="node" />
|
||||
import Config from "@lumeweb/cfg";
|
||||
import tls from "tls";
|
||||
import { Logger } from "loglevel";
|
||||
import type { EventEmitter2 } from "eventemitter2";
|
||||
import { RPCMethod, RPCServer } from "./rpc.js";
|
||||
import { IndependentFileSmall, SavedSslData, SslData } from "./files.js";
|
||||
import type { express } from "express";
|
||||
import type { Err } from "libskynet";
|
||||
import { Logger } from "pino";
|
||||
import SSLManager from "./ssl.js";
|
||||
import type { HDKey } from "micro-ed25519-hdkey";
|
||||
import Config from "./config.js";
|
||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
export type DnsProvider = (ipAddress: string, domain: string) => Promise<void>;
|
||||
export type OverwriteDataFn = (newData: Uint8Array) => Promise<Err>;
|
||||
export type ReadDataFn = () => Promise<[Uint8Array, Err]>;
|
||||
export interface Plugin {
|
||||
name: string;
|
||||
plugin: PluginFunction;
|
||||
exports?: any;
|
||||
default?: Plugin;
|
||||
}
|
||||
export interface PluginAPI {
|
||||
config: Config;
|
||||
registerMethod: (methodName: string, method: RPCMethod) => void;
|
||||
loadPlugin: (moduleName: string) => Promise<Plugin>;
|
||||
getRpcServer: () => RPCServer;
|
||||
ssl: {
|
||||
setContext: (context: tls.SecureContext) => void;
|
||||
getContext: () => tls.SecureContext;
|
||||
getSaved: (retry: boolean) => Promise<boolean | SavedSslData>;
|
||||
set: (
|
||||
cert: IndependentFileSmall | Uint8Array,
|
||||
key: IndependentFileSmall | Uint8Array
|
||||
) => void;
|
||||
get: () => SslData;
|
||||
save: () => Promise<void>;
|
||||
setCheck(checker: () => Promise<void>): void;
|
||||
};
|
||||
appRouter: {
|
||||
get: () => express.Router;
|
||||
set: (newRouter: express.Router) => void;
|
||||
reset: () => void;
|
||||
};
|
||||
files: {
|
||||
createIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string,
|
||||
fileData: Uint8Array
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
openIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
overwriteIndependentFileSmall(
|
||||
file: IndependentFileSmall,
|
||||
newData: Uint8Array
|
||||
): Promise<Err>;
|
||||
};
|
||||
dns: {
|
||||
setProvider(provider: DnsProvider): void;
|
||||
};
|
||||
logger: Logger;
|
||||
getSeed: () => Uint8Array;
|
||||
declare class PluginAPI extends EventEmitter2 {
|
||||
private _server;
|
||||
constructor({
|
||||
config,
|
||||
logger,
|
||||
server,
|
||||
swarm,
|
||||
}: {
|
||||
config: Config;
|
||||
logger: Logger;
|
||||
server: RPCServer;
|
||||
swarm: any;
|
||||
});
|
||||
private _swarm;
|
||||
get swarm(): any;
|
||||
private _config;
|
||||
get config(): Config;
|
||||
private _logger;
|
||||
get logger(): Logger;
|
||||
get rpcServer(): RPCServer;
|
||||
get seed(): Uint8Array;
|
||||
get identity(): HDKey;
|
||||
get ssl(): SSLManager;
|
||||
loadPlugin(moduleName: string): (moduleName: string) => Promise<Plugin>;
|
||||
registerMethod(methodName: string, method: RPCMethod): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=plugin.d.ts.map
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"plugin.d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