1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ApplicationRef } from '@angular/core';
|
9 | import { EnvironmentProviders } from '@angular/core';
|
10 | import * as i0 from '@angular/core';
|
11 | import * as i1 from '@angular/platform-browser/animations';
|
12 | import * as i2 from '@angular/platform-browser';
|
13 | import { InjectionToken } from '@angular/core';
|
14 | import { PlatformRef } from '@angular/core';
|
15 | import { Provider } from '@angular/core';
|
16 | import { StaticProvider } from '@angular/core';
|
17 | import { Type } from '@angular/core';
|
18 | import { Version } from '@angular/core';
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare const BEFORE_APP_SERIALIZED: InjectionToken<readonly (() => void | Promise<void>)[]>;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare interface PlatformConfig {
|
41 | |
42 |
|
43 |
|
44 |
|
45 | document?: string;
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | url?: string;
|
53 | }
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export declare function platformServer(extraProviders?: StaticProvider[] | undefined): PlatformRef;
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | export declare class PlatformState {
|
66 | private _doc;
|
67 | constructor(_doc: any);
|
68 | /**
|
69 | * Renders the current state of the platform to string.
|
70 | */
|
71 | renderToString(): string;
|
72 | /**
|
73 | * Returns the current DOM state.
|
74 | */
|
75 | getDocument(): any;
|
76 | static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
|
77 | static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
|
78 | }
|
79 |
|
80 | /**
|
81 | * Sets up providers necessary to enable server rendering functionality for the application.
|
82 | *
|
83 | * @usageNotes
|
84 | *
|
85 | * Basic example of how you can add server support to your application:
|
86 | * ```ts
|
87 | * bootstrapApplication(AppComponent, {
|
88 | * providers: [provideServerRendering()]
|
89 | * });
|
90 | * ```
|
91 | *
|
92 | * @publicApi
|
93 | * @returns A set of providers to setup the server.
|
94 | */
|
95 | export declare function provideServerRendering(): EnvironmentProviders;
|
96 |
|
97 | /**
|
98 | * Bootstraps an instance of an Angular application and renders it to a string.
|
99 |
|
100 | * ```ts
|
101 | * const bootstrap = () => bootstrapApplication(RootComponent, appConfig);
|
102 | * const output: string = await renderApplication(bootstrap);
|
103 | * ```
|
104 | *
|
105 | * @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`
|
106 | * instance once resolved.
|
107 | * @param options Additional configuration for the render operation:
|
108 | * - `document` - the document of the page to render, either as an HTML string or
|
109 | * as a reference to the `document` instance.
|
110 | * - `url` - the URL for the current render request.
|
111 | * - `platformProviders` - the platform level providers for the current render request.
|
112 | *
|
113 | * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
|
114 | *
|
115 | * @publicApi
|
116 | */
|
117 | export declare function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: {
|
118 | document?: string | Document;
|
119 | url?: string;
|
120 | platformProviders?: Provider[];
|
121 | }): Promise<string>;
|
122 |
|
123 | /**
|
124 | * Bootstraps an application using provided NgModule and serializes the page content to string.
|
125 | *
|
126 | * @param moduleType A reference to an NgModule that should be used for bootstrap.
|
127 | * @param options Additional configuration for the render operation:
|
128 | * - `document` - the document of the page to render, either as an HTML string or
|
129 | * as a reference to the `document` instance.
|
130 | * - `url` - the URL for the current render request.
|
131 | * - `extraProviders` - set of platform level providers for the current render request.
|
132 | *
|
133 | * @publicApi
|
134 | */
|
135 | export declare function renderModule<T>(moduleType: Type<T>, options: {
|
136 | document?: string | Document;
|
137 | url?: string;
|
138 | extraProviders?: StaticProvider[];
|
139 | }): Promise<string>;
|
140 |
|
141 | /**
|
142 | * The ng module for the server.
|
143 | *
|
144 | * @publicApi
|
145 | */
|
146 | export declare class ServerModule {
|
147 | static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
|
148 | static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.NoopAnimationsModule], [typeof i2.BrowserModule]>;
|
149 | static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
|
150 | }
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | export declare const VERSION: Version;
|
156 |
|
157 | export declare const ɵENABLE_DOM_EMULATION: InjectionToken<boolean>;
|
158 |
|
159 | export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | export declare const ɵSERVER_CONTEXT: InjectionToken<string>;
|
167 |
|
168 | export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
|
169 |
|
170 | export { }
|