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