From 8bad551b2940ef2840fb7f9dbfbb07223e61b62e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Apr 2023 22:56:00 -0400 Subject: [PATCH] *add app getter --- package.json | 1 + src/plugin.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/package.json b/package.json index 2dd35f8..31aa59d 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@types/node": "^18.11.17", "c": "^1.1.1", "express": "^4.18.1", + "fastify": "^4.15.0", "node-cache": "^5.1.2", "prettier": "^2.8.1", "typescript": "^4.9.4" diff --git a/src/plugin.ts b/src/plugin.ts index 6b9efdc..ab76384 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -6,6 +6,7 @@ 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"; +import type { FastifyInstance } from "fastify"; export type PluginFunction = (api: PluginAPI) => Promise; @@ -38,6 +39,7 @@ export declare class PluginAPI extends EventEmitter2 { get identity(): HDKey; get ssl(): SSLManager; get protocols(): ProtocolManager; + get app(): FastifyInstance; loadPlugin(moduleName: string): (moduleName: string) => Promise; registerMethod(methodName: string, method: RPCMethod): void; }