56 lines
1.9 KiB
TypeScript
56 lines
1.9 KiB
TypeScript
|
import { ApplicationRef } from '@angular/core';
|
||
|
import { StaticProvider } from '@angular/core';
|
||
|
import { Type } from '@angular/core';
|
||
|
|
||
|
/**
|
||
|
* A common engine to use to server render an application.
|
||
|
*/
|
||
|
export declare class CommonEngine {
|
||
|
private options?;
|
||
|
private readonly templateCache;
|
||
|
private readonly inlineCriticalCssProcessor;
|
||
|
private readonly pageIsSSG;
|
||
|
constructor(options?: CommonEngineOptions | undefined);
|
||
|
/**
|
||
|
* Render an HTML document for a specific URL with specified
|
||
|
* render options
|
||
|
*/
|
||
|
render(opts: CommonEngineRenderOptions): Promise<string>;
|
||
|
private inlineCriticalCss;
|
||
|
private retrieveSSGPage;
|
||
|
private renderApplication;
|
||
|
/** Retrieve the document from the cache or the filesystem */
|
||
|
private getDocument;
|
||
|
}
|
||
|
|
||
|
export declare interface CommonEngineOptions {
|
||
|
/** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
|
||
|
bootstrap?: Type<{}> | (() => Promise<ApplicationRef>);
|
||
|
/** A set of platform level providers for all requests. */
|
||
|
providers?: StaticProvider[];
|
||
|
/** Enable request performance profiling data collection and printing the results in the server console. */
|
||
|
enablePerformanceProfiler?: boolean;
|
||
|
}
|
||
|
|
||
|
export declare interface CommonEngineRenderOptions {
|
||
|
/** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
|
||
|
bootstrap?: Type<{}> | (() => Promise<ApplicationRef>);
|
||
|
/** A set of platform level providers for the current request. */
|
||
|
providers?: StaticProvider[];
|
||
|
url?: string;
|
||
|
document?: string;
|
||
|
documentFilePath?: string;
|
||
|
/**
|
||
|
* Reduce render blocking requests by inlining critical CSS.
|
||
|
* Defaults to true.
|
||
|
*/
|
||
|
inlineCriticalCss?: boolean;
|
||
|
/**
|
||
|
* Base path location of index file.
|
||
|
* Defaults to the 'documentFilePath' dirname when not provided.
|
||
|
*/
|
||
|
publicPath?: string;
|
||
|
}
|
||
|
|
||
|
export { }
|