chore: Refactor client plugin management (#7053)

* Update clientside plugin management to work as server

* docs

* tsc

* Rebase main
This commit is contained in:
Tom Moor
2024-06-16 11:11:26 -04:00
committed by GitHub
parent a9f1086422
commit 3d0160463c
17 changed files with 331 additions and 108 deletions

View File

@@ -58,10 +58,15 @@ export type Plugin<T extends Hook> = {
priority?: number;
};
/**
* Server plugin manager.
*/
export class PluginManager {
private static plugins = new Map<Hook, Plugin<Hook>[]>();
/**
* Add plugins
* Add plugins to the manager.
*
* @param plugins
*/
public static add(plugins: Array<Plugin<Hook>> | Plugin<Hook>) {