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<(() => void | Promise<void>)[]>;
|
28 |
|
29 | /**
|
30 | * The DI token for setting the initial config for the platform.
|
31 | *
|
32 | * @publicApi
|
33 | */
|
34 | export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
|
35 |
|
36 | /**
|
37 | * Config object passed to initialize the platform.
|
38 | *
|
39 | * @publicApi
|
40 | */
|
41 | export declare interface PlatformConfig {
|
42 | /**
|
43 | * The initial DOM to use to bootstrap the server application.
|
44 | * @default create a new DOM using Domino
|
45 | */
|
46 | document?: string;
|
47 | /**
|
48 | * The URL for the current application state. This is used for initializing
|
49 | * the platform's location. `protocol`, `hostname`, and `port` will be
|
50 | * overridden if `baseUrl` is set.
|
51 | * @default none
|
52 | */
|
53 | url?: string;
|
54 | /**
|
55 | * Note: this option has no effect and can be removed from the config.
|
56 | *
|
57 | * Whether to append the absolute URL to any relative HTTP requests. If set to
|
58 | * true, this logic executes prior to any HTTP interceptors that may run later
|
59 | * on in the request. `baseUrl` must be supplied if this flag is enabled.
|
60 | *
|
61 | * @deprecated This option is a noop.
|
62 | * @default false
|
63 | */
|
64 | useAbsoluteUrl?: boolean;
|
65 | /**
|
66 | * Note: this option has no effect and can be removed from the config.
|
67 | *
|
68 | * The base URL for resolving absolute URL for HTTP requests. It must be set
|
69 | * if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
|
70 | * and optional port. This option has no effect if `useAbsoluteUrl` is not
|
71 | * enabled.
|
72 | *
|
73 | * @deprecated This option is a noop.
|
74 | */
|
75 | baseUrl?: string;
|
76 | }
|
77 |
|
78 | /**
|
79 | * The server platform that supports the runtime compiler.
|
80 | *
|
81 | * @see `platformServer`
|
82 | * @deprecated add an `import @angular/compiler` and replace the usage with `platformServer`
|
83 | * instead.
|
84 | * @publicApi
|
85 | */
|
86 | export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | export declare class PlatformState {
|
99 | private _doc;
|
100 | constructor(_doc: any);
|
101 | /**
|
102 | * Renders the current state of the platform to string.
|
103 | */
|
104 | renderToString(): string;
|
105 | /**
|
106 | * Returns the current DOM state.
|
107 | */
|
108 | getDocument(): any;
|
109 | static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
|
110 | static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
|
111 | }
|
112 |
|
113 | /**
|
114 | * Sets up providers necessary to enable server rendering functionality for the application.
|
115 | *
|
116 | * @usageNotes
|
117 | *
|
118 | * Basic example of how you can add server support to your application:
|
119 | * ```ts
|
120 | * bootstrapApplication(AppComponent, {
|
121 | * providers: [provideServerRendering()]
|
122 | * });
|
123 | * ```
|
124 | *
|
125 | * @publicApi
|
126 | * @returns A set of providers to setup the server.
|
127 | */
|
128 | export declare function provideServerRendering(): EnvironmentProviders;
|
129 |
|
130 | /**
|
131 | * Bootstraps an instance of an Angular application and renders it to a string.
|
132 |
|
133 | * ```typescript
|
134 | * const bootstrap = () => bootstrapApplication(RootComponent, appConfig);
|
135 | * const output: string = await renderApplication(bootstrap);
|
136 | * ```
|
137 | *
|
138 | * @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`
|
139 | * instance once resolved.
|
140 | * @param options Additional configuration for the render operation:
|
141 | * - `document` - the document of the page to render, either as an HTML string or
|
142 | * as a reference to the `document` instance.
|
143 | * - `url` - the URL for the current render request.
|
144 | * - `platformProviders` - the platform level providers for the current render request.
|
145 | *
|
146 | * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
|
147 | *
|
148 | * @publicApi
|
149 | * @developerPreview
|
150 | */
|
151 | export declare function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: {
|
152 | document?: string | Document;
|
153 | url?: string;
|
154 | platformProviders?: Provider[];
|
155 | }): Promise<string>;
|
156 |
|
157 | /**
|
158 | * Bootstraps an application using provided NgModule and serializes the page content to string.
|
159 | *
|
160 | * @param moduleType A reference to an NgModule that should be used for bootstrap.
|
161 | * @param options Additional configuration for the render operation:
|
162 | * - `document` - the document of the page to render, either as an HTML string or
|
163 | * as a reference to the `document` instance.
|
164 | * - `url` - the URL for the current render request.
|
165 | * - `extraProviders` - set of platform level providers for the current render request.
|
166 | *
|
167 | * @publicApi
|
168 | */
|
169 | export declare function renderModule<T>(moduleType: Type<T>, options: {
|
170 | document?: string | Document;
|
171 | url?: string;
|
172 | extraProviders?: StaticProvider[];
|
173 | }): Promise<string>;
|
174 |
|
175 | /**
|
176 | * The ng module for the server.
|
177 | *
|
178 | * @publicApi
|
179 | */
|
180 | export declare class ServerModule {
|
181 | static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
|
182 | static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.HttpClientModule, typeof i2.NoopAnimationsModule], [typeof i3.BrowserModule]>;
|
183 | static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
|
184 | }
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | export declare class ServerTransferStateModule {
|
198 | static ɵfac: i0.ɵɵFactoryDeclaration<ServerTransferStateModule, never>;
|
199 | static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTransferStateModule, never, never, never>;
|
200 | static ɵinj: i0.ɵɵInjectorDeclaration<ServerTransferStateModule>;
|
201 | }
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | export declare const VERSION: Version;
|
207 |
|
208 | export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 | export declare const ɵSERVER_CONTEXT: InjectionToken<string>;
|
216 |
|
217 | export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
|
218 |
|
219 | export declare function ɵsetDomTypes(): void;
|
220 |
|
221 | export { }
|