1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { EnvironmentProviders } from '@angular/core';
|
9 | import { EventManager } from '@angular/platform-browser';
|
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 { NgModuleFactory } from '@angular/core';
|
16 | import { NgZone } from '@angular/core';
|
17 | import { PlatformRef } from '@angular/core';
|
18 | import { Provider } from '@angular/core';
|
19 | import { Renderer2 } from '@angular/core';
|
20 | import { RendererFactory2 } from '@angular/core';
|
21 | import { RendererType2 } from '@angular/core';
|
22 | import { StaticProvider } from '@angular/core';
|
23 | import { Type } from '@angular/core';
|
24 | import { Version } from '@angular/core';
|
25 | import { ɵSharedStylesHost } from '@angular/platform-browser';
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise<void>)[]>;
|
34 |
|
35 | /**
|
36 | * The DI token for setting the initial config for the platform.
|
37 | *
|
38 | * @publicApi
|
39 | */
|
40 | export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
|
41 |
|
42 | /**
|
43 | * Config object passed to initialize the platform.
|
44 | *
|
45 | * @publicApi
|
46 | */
|
47 | export declare interface PlatformConfig {
|
48 | /**
|
49 | * The initial DOM to use to bootstrap the server application.
|
50 | * @default create a new DOM using Domino
|
51 | */
|
52 | document?: string;
|
53 | /**
|
54 | * The URL for the current application state. This is used for initializing
|
55 | * the platform's location. `protocol`, `hostname`, and `port` will be
|
56 | * overridden if `baseUrl` is set.
|
57 | * @default none
|
58 | */
|
59 | url?: string;
|
60 | /**
|
61 | * Whether to append the absolute URL to any relative HTTP requests. If set to
|
62 | * true, this logic executes prior to any HTTP interceptors that may run later
|
63 | * on in the request. `baseUrl` must be supplied if this flag is enabled.
|
64 | * @default false
|
65 | */
|
66 | useAbsoluteUrl?: boolean;
|
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 | baseUrl?: string;
|
74 | }
|
75 |
|
76 | /**
|
77 | * The server platform that supports the runtime compiler.
|
78 | *
|
79 | * @publicApi
|
80 | */
|
81 | export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | export declare class PlatformState {
|
94 | private _doc;
|
95 | constructor(_doc: any);
|
96 | /**
|
97 | * Renders the current state of the platform to string.
|
98 | */
|
99 | renderToString(): string;
|
100 | /**
|
101 | * Returns the current DOM state.
|
102 | */
|
103 | getDocument(): any;
|
104 | static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
|
105 | static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
|
106 | }
|
107 |
|
108 | /**
|
109 | * Bootstraps an instance of an Angular application and renders it to a string.
|
110 | *
|
111 | * Note: the root component passed into this function *must* be a standalone one (should have the
|
112 | * `standalone: true` flag in the `@Component` decorator config).
|
113 | *
|
114 | * ```typescript
|
115 | * @Component({
|
116 | * standalone: true,
|
117 | * template: 'Hello world!'
|
118 | * })
|
119 | * class RootComponent {}
|
120 | *
|
121 | * const output: string = await renderApplication(RootComponent, {appId: 'server-app'});
|
122 | * ```
|
123 | *
|
124 | * @param rootComponent A reference to a Standalone Component that should be rendered.
|
125 | * @param options Additional configuration for the render operation:
|
126 | * - `appId` - a string identifier of this application. The appId is used to prefix all
|
127 | * server-generated stylings and state keys of the application in TransferState
|
128 | * use-cases.
|
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 | * - `providers` - set of application level providers for the current render request.
|
133 | * - `platformProviders` - the platform level providers for the current render request.
|
134 | *
|
135 | * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
|
136 | *
|
137 | * @publicApi
|
138 | * @developerPreview
|
139 | */
|
140 | export declare function renderApplication<T>(rootComponent: Type<T>, options: {
|
141 | appId: string;
|
142 | document?: string | Document;
|
143 | url?: string;
|
144 | providers?: Array<Provider | EnvironmentProviders>;
|
145 | platformProviders?: Provider[];
|
146 | }): Promise<string>;
|
147 |
|
148 | /**
|
149 | * Bootstraps an application using provided NgModule and serializes the page content to string.
|
150 | *
|
151 | * @param moduleType A reference to an NgModule that should be used for bootstrap.
|
152 | * @param options Additional configuration for the render operation:
|
153 | * - `document` - the document of the page to render, either as an HTML string or
|
154 | * as a reference to the `document` instance.
|
155 | * - `url` - the URL for the current render request.
|
156 | * - `extraProviders` - set of platform level providers for the current render request.
|
157 | *
|
158 | * @publicApi
|
159 | */
|
160 | export declare function renderModule<T>(moduleType: Type<T>, options: {
|
161 | document?: string | Document;
|
162 | url?: string;
|
163 | extraProviders?: StaticProvider[];
|
164 | }): Promise<string>;
|
165 |
|
166 | /**
|
167 | * Bootstraps an application using provided {@link NgModuleFactory} and serializes the page content
|
168 | * to string.
|
169 | *
|
170 | * @param moduleFactory An instance of the {@link NgModuleFactory} that should be used for
|
171 | * bootstrap.
|
172 | * @param options Additional configuration for the render operation:
|
173 | * - `document` - the document of the page to render, either as an HTML string or
|
174 | * as a reference to the `document` instance.
|
175 | * - `url` - the URL for the current render request.
|
176 | * - `extraProviders` - set of platform level providers for the current render request.
|
177 | *
|
178 | * @publicApi
|
179 | *
|
180 | * @deprecated
|
181 | * This symbol is no longer necessary as of Angular v13.
|
182 | * Use {@link renderModule} API instead.
|
183 | */
|
184 | export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
|
185 | document?: string;
|
186 | url?: string;
|
187 | extraProviders?: StaticProvider[];
|
188 | }): Promise<string>;
|
189 |
|
190 | /**
|
191 | * The ng module for the server.
|
192 | *
|
193 | * @publicApi
|
194 | */
|
195 | export declare class ServerModule {
|
196 | static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
|
197 | static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.HttpClientModule, typeof i2.NoopAnimationsModule], [typeof i3.BrowserModule]>;
|
198 | static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
|
199 | }
|
200 |
|
201 | /**
|
202 | * NgModule to install on the server side while using the `TransferState` to transfer state from
|
203 | * server to client.
|
204 | *
|
205 | * Note: this module is not needed if the `renderApplication` function is used.
|
206 | * The `renderApplication` makes all providers from this module available in the application.
|
207 | *
|
208 | * @publicApi
|
209 | * @deprecated no longer needed, you can inject the `TransferState` in an app without providing
|
210 | * this module.
|
211 | */
|
212 | export declare class ServerTransferStateModule {
|
213 | static ɵfac: i0.ɵɵFactoryDeclaration<ServerTransferStateModule, never>;
|
214 | static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTransferStateModule, never, never, never>;
|
215 | static ɵinj: i0.ɵɵInjectorDeclaration<ServerTransferStateModule>;
|
216 | }
|
217 |
|
218 | /**
|
219 | * @publicApi
|
220 | */
|
221 | export declare const VERSION: Version;
|
222 |
|
223 | export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
|
224 |
|
225 | /**
|
226 | * An internal token that allows providing extra information about the server context
|
227 | * (e.g. whether SSR or SSG was used). The value is a string and characters other
|
228 | * than [a-zA-Z0-9\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const.
|
229 | */
|
230 | export declare const ɵSERVER_CONTEXT: InjectionToken<string>;
|
231 |
|
232 | export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
|
233 |
|
234 | export declare class ɵServerRendererFactory2 implements RendererFactory2 {
|
235 | private eventManager;
|
236 | private ngZone;
|
237 | private document;
|
238 | private sharedStylesHost;
|
239 | private rendererByCompId;
|
240 | private defaultRenderer;
|
241 | private schema;
|
242 | constructor(eventManager: EventManager, ngZone: NgZone, document: any, sharedStylesHost: ɵSharedStylesHost);
|
243 | createRenderer(element: any, type: RendererType2 | null): Renderer2;
|
244 | begin(): void;
|
245 | end(): void;
|
246 | static ɵfac: i0.ɵɵFactoryDeclaration<ɵServerRendererFactory2, never>;
|
247 | static ɵprov: i0.ɵɵInjectableDeclaration<ɵServerRendererFactory2>;
|
248 | }
|
249 |
|
250 | export declare function ɵsetDomTypes(): void;
|
251 |
|
252 | export { }
|
253 |
|
\ | No newline at end of file |