@benpsnyder/analogjs-esm-router
Version:
Filesystem-based routing for Angular
29 lines (23 loc) • 1.22 kB
TypeScript
import { StaticProvider, ApplicationConfig, Type, Provider } from '@angular/core';
import { ServerRequest, ServerResponse, ServerContext } from '@benpsnyder/analogjs-esm-router/tokens';
declare function provideServerContext({ req, res, }: {
req: ServerRequest;
res: ServerResponse;
}): StaticProvider[];
declare function injectStaticProps(): Record<string, any>;
declare function injectStaticOutputs<T>(): {
set(data: T): void;
};
declare function serverComponentRequest(serverContext: ServerContext): string | undefined;
declare function renderServerComponent(url: string, serverContext: ServerContext, config?: ApplicationConfig): Promise<Response>;
/**
* Returns a function that accepts the navigation URL,
* the root HTML, and server context.
*
* @param rootComponent
* @param config
* @param platformProviders
* @returns Promise<string | Reponse>
*/
declare function render(rootComponent: Type<unknown>, config: ApplicationConfig, platformProviders?: Provider[]): (url: string, document: string, serverContext: ServerContext) => Promise<string | Response>;
export { injectStaticOutputs, injectStaticProps, provideServerContext, render, renderServerComponent, serverComponentRequest };