evanesce
Version:
Evanesce disappears your web application framework for desired routes by managing AOT page builds on dependency change.
30 lines (29 loc) • 912 B
TypeScript
import { Application, Router } from 'express';
import { SignalKey, SignalsOrFunctions } from './core';
export declare type ExpressRender = (template: string, data: {
[key: string]: any;
}) => Promise<string>;
export interface Response {
render: ExpressRender;
}
export interface Request {
params: {
[key: string]: any;
};
}
export declare const evanesceExpress: ({ app, router, signalKeys, onRouteRebuild }: {
app: Application;
router: Router;
signalKeys: Array<SignalKey>;
onRouteRebuild: ({ route, html }: {
route: string;
html: string;
}) => void;
}) => {
signals: import("./core").Signals;
evanesceRouter: {
get: (_route: string, controller: (request: Request, response: Response) => Promise<string>, rebuildOnSignals: SignalsOrFunctions, paramsList?: {
[key: string]: any;
}[] | undefined) => Router;
};
};