UNPKG

presta

Version:

Hyper minimal framework for the modern web.

12 lines (11 loc) 538 B
import { Hooks } from './createEmitter'; import { Config } from './config'; export declare type PluginInterface = { cleanup?(): void; }; export declare type Plugin = (config: Config, hooks: Hooks) => Promise<PluginInterface | void> | PluginInterface | void; export declare type PluginInit = (...props: any) => Plugin; export declare function createPlugin(init: PluginInit): PluginInit; export declare function initPlugins(plugins: Plugin[], instance: Config, hooks: Hooks): Promise<{ cleanup(): Promise<(void | undefined)[]>; }>;