1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import { EventManager } from '@angular/platform-browser';
|
8 | import { HttpBackend } from '@angular/common/http';
|
9 | import { HttpEvent } from '@angular/common/http';
|
10 | import { HttpRequest } from '@angular/common/http';
|
11 | import { InjectionToken } from '@angular/core';
|
12 | import { Injector } from '@angular/core';
|
13 | import { NgModuleFactory } from '@angular/core';
|
14 | import { NgZone } from '@angular/core';
|
15 | import { Observable } from 'rxjs';
|
16 | import { PlatformLocation } from '@angular/common';
|
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 { TransferState } from '@angular/platform-browser';
|
24 | import { Type } from '@angular/core';
|
25 | import { Version } from '@angular/core';
|
26 | import { XhrFactory } from '@angular/common';
|
27 | import { ɵAnimationEngine } from '@angular/animations/browser';
|
28 | import { ɵAnimationRendererFactory } from '@angular/platform-browser/animations';
|
29 | import { ɵSharedStylesHost } from '@angular/platform-browser';
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise<void>)[]>;
|
38 |
|
39 | /**
|
40 | * The DI token for setting the initial config for the platform.
|
41 | *
|
42 | * @publicApi
|
43 | */
|
44 | export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
|
45 |
|
46 | /**
|
47 | * Config object passed to initialize the platform.
|
48 | *
|
49 | * @publicApi
|
50 | */
|
51 | export declare interface PlatformConfig {
|
52 | /**
|
53 | * The initial DOM to use to bootstrap the server application.
|
54 | * @default create a new DOM using Domino
|
55 | */
|
56 | document?: string;
|
57 | /**
|
58 | * The URL for the current application state. This is used for initializing
|
59 | * the platform's location. `protocol`, `hostname`, and `port` will be
|
60 | * overridden if `baseUrl` is set.
|
61 | * @default none
|
62 | */
|
63 | url?: string;
|
64 | /**
|
65 | * Whether to append the absolute URL to any relative HTTP requests. If set to
|
66 | * true, this logic executes prior to any HTTP interceptors that may run later
|
67 | * on in the request. `baseUrl` must be supplied if this flag is enabled.
|
68 | * @default false
|
69 | */
|
70 | useAbsoluteUrl?: boolean;
|
71 | /**
|
72 | * The base URL for resolving absolute URL for HTTP requests. It must be set
|
73 | * if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
|
74 | * and optional port. This option has no effect if `useAbsoluteUrl` is not
|
75 | * enabled.
|
76 | */
|
77 | baseUrl?: string;
|
78 | }
|
79 |
|
80 | /**
|
81 | * The server platform that supports the runtime compiler.
|
82 | *
|
83 | * @publicApi
|
84 | */
|
85 | export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
|
91 |
|
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 | }
|
110 |
|
111 | /**
|
112 | * Renders a Module to string.
|
113 | *
|
114 | * `document` is the full document HTML of the page to render, as a string.
|
115 | * `url` is the URL for the current render request.
|
116 | * `extraProviders` are the platform level providers for the current render request.
|
117 | *
|
118 | * If compiling with the ViewEngine renderer, do not use this in a production server environment.
|
119 | * Use pre-compiled {@link NgModuleFactory} with {@link renderModuleFactory} instead. If
|
120 | * compiling with the Ivy renderer, this method is the recommended rendering method for
|
121 | * platform-server.
|
122 | *
|
123 | * @publicApi
|
124 | */
|
125 | export declare function renderModule<T>(module: Type<T>, options: {
|
126 | document?: string;
|
127 | url?: string;
|
128 | extraProviders?: StaticProvider[];
|
129 | }): Promise<string>;
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 | export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
|
141 | document?: string;
|
142 | url?: string;
|
143 | extraProviders?: StaticProvider[];
|
144 | }): Promise<string>;
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 | export declare class ServerModule {
|
152 | }
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 | export declare class ServerTransferStateModule {
|
161 | }
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | export declare const VERSION: Version;
|
167 |
|
168 | declare class ZoneClientBackend extends ZoneMacroTaskWrapper<HttpRequest<any>, HttpEvent<any>> implements HttpBackend {
|
169 | private backend;
|
170 | private platformLocation;
|
171 | private config;
|
172 | constructor(backend: HttpBackend, platformLocation: PlatformLocation, config: PlatformConfig);
|
173 | handle(request: HttpRequest<any>): Observable<HttpEvent<any>>;
|
174 | protected delegate(request: HttpRequest<any>): Observable<HttpEvent<any>>;
|
175 | }
|
176 |
|
177 | declare abstract class ZoneMacroTaskWrapper<S, R> {
|
178 | wrap(request: S): Observable<R>;
|
179 | protected abstract delegate(request: S): Observable<R>;
|
180 | }
|
181 |
|
182 | export declare function ɵangular_packages_platform_server_platform_server_a(renderer: RendererFactory2, engine: ɵAnimationEngine, zone: NgZone): ɵAnimationRendererFactory;
|
183 |
|
184 | export declare function ɵangular_packages_platform_server_platform_server_b(doc: Document, appId: string, transferStore: TransferState): () => void;
|
185 |
|
186 | export declare class ɵangular_packages_platform_server_platform_server_c extends ɵSharedStylesHost {
|
187 | private doc;
|
188 | private transitionId;
|
189 | private head;
|
190 | private _styleNodes;
|
191 | constructor(doc: any, transitionId: string);
|
192 | private _addStyle;
|
193 | onStylesAdded(additions: Set<string>): void;
|
194 | ngOnDestroy(): void;
|
195 | }
|
196 |
|
197 |
|
198 | export declare class ɵangular_packages_platform_server_platform_server_d {
|
199 | private doc;
|
200 | constructor(doc: any);
|
201 | supports(eventName: string): boolean;
|
202 | addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
|
203 | /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
|
204 | addGlobalEventListener(element: string, eventName: string, handler: Function): Function;
|
205 | }
|
206 |
|
207 | export declare class ɵangular_packages_platform_server_platform_server_e implements XhrFactory {
|
208 | build(): XMLHttpRequest;
|
209 | }
|
210 |
|
211 | export declare function ɵangular_packages_platform_server_platform_server_f(backend: HttpBackend, injector: Injector, platformLocation: PlatformLocation, config: PlatformConfig): ZoneClientBackend;
|
212 |
|
213 | export declare const ɵangular_packages_platform_server_platform_server_g: Provider[];
|
214 |
|
215 | export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
|
216 |
|
217 | export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
|
218 |
|
219 | export declare class ɵServerRendererFactory2 implements RendererFactory2 {
|
220 | private eventManager;
|
221 | private ngZone;
|
222 | private document;
|
223 | private sharedStylesHost;
|
224 | private rendererByCompId;
|
225 | private defaultRenderer;
|
226 | private schema;
|
227 | constructor(eventManager: EventManager, ngZone: NgZone, document: any, sharedStylesHost: ɵSharedStylesHost);
|
228 | createRenderer(element: any, type: RendererType2 | null): Renderer2;
|
229 | begin(): void;
|
230 | end(): void;
|
231 | }
|
232 |
|
233 | export { }
|