import { JSDOM } from 'jsdom'; import { HandledRoute } from '../routerPlugins/handledRoute.interface'; import { AlternateExtensionsForFilePlugin, configValidator, routeProcessPriority, priority } from './pluginRepository'; export declare type ScullySystem = `scullySystem`; export declare type ErrorString = string; export declare type ConfigValidator = (RouteConfig: any) => ErrorString[] | Promise; export declare type RoutePlugin = { (route?: string, config?: any): Promise; [configValidator]?: ConfigValidator | undefined; }; export declare type PluginFunction = (...args: any[]) => any; export declare type postProcessByDomPlugin = (dom?: JSDOM, route?: HandledRoute) => Promise; export declare type postProcessByHtmlPlugin = (html?: string, route?: HandledRoute) => Promise; export declare type RouteProcess = { (routes?: HandledRoute[]): Promise; [routeProcessPriority]?: number; }; export declare type RouteDiscoveryPlugin = (routes?: HandledRoute[]) => Promise; export declare type AllDonePlugin = (routes?: HandledRoute[]) => Promise; export declare type BeforeAllPlugin = { (): Promise; [priority]?: number; }; export declare type FilePlugin = { (html: string, route?: HandledRoute): Promise; [AlternateExtensionsForFilePlugin]?: string[]; }; export declare type ScullySystemPlugin = PluginFunction; export declare type EnterprisePlugin = PluginFunction; export interface Plugins { beforeAll: { [name: string]: BeforeAllPlugin; }; allDone: { [name: string]: AllDonePlugin; }; enterprise: { [name: string]: EnterprisePlugin; }; fileHandler: { [fileExtension: string]: FilePlugin; }; postProcessByDom: { [name: string]: postProcessByDomPlugin; }; postProcessByHtml: { [name: string]: postProcessByHtmlPlugin; }; render: { [name: string]: postProcessByHtmlPlugin; }; routeDiscoveryDone: { [name: string]: RouteDiscoveryPlugin; }; routeProcess: { [name: string]: RouteProcess; }; router: { [name: string]: RoutePlugin; }; scullySystem: { [name: string]: ScullySystemPlugin; }; } export interface PluginFuncs { beforeAll: BeforeAllPlugin; allDone: AllDonePlugin; enterprise: EnterprisePlugin; fileHandler: FilePlugin; postProcessByDom: postProcessByDomPlugin; postProcessByHtml: postProcessByHtmlPlugin; render: postProcessByHtmlPlugin; routeDiscoveryDone: RouteDiscoveryPlugin; routeProcess: RouteProcess; router: RoutePlugin; scullySystem: ScullySystemPlugin; } export declare type PluginTypes = keyof Plugins; export interface RegisterOptions { replaceExistingPlugin?: boolean; }