1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Observable } from 'rxjs/Observable';
|
9 | import { ErrorHandler } from '../src/error_handler';
|
10 | import { ApplicationInitStatus } from './application_init';
|
11 | import { Console } from './console';
|
12 | import { InjectionToken, Injector, Provider } from './di';
|
13 | import { CompilerOptions } from './linker/compiler';
|
14 | import { ComponentFactory, ComponentRef } from './linker/component_factory';
|
15 | import { ComponentFactoryResolver } from './linker/component_factory_resolver';
|
16 | import { NgModuleFactory, NgModuleRef } from './linker/ng_module_factory';
|
17 | import { ViewRef } from './linker/view_ref';
|
18 | import { Type } from './type';
|
19 | import { NgZone } from './zone/ng_zone';
|
20 | export declare const ALLOW_MULTIPLE_PLATFORMS: InjectionToken<boolean>;
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare function enableProdMode(): void;
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare function isDevMode(): boolean;
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | export declare class NgProbeToken {
|
47 | name: string;
|
48 | token: any;
|
49 | constructor(name: string, token: any);
|
50 | }
|
51 | /**
|
52 | * Creates a platform.
|
53 | * Platforms have to be eagerly created via this function.
|
54 | *
|
55 | * @experimental APIs related to application bootstrap are currently under review.
|
56 | */
|
57 | export declare function createPlatform(injector: Injector): PlatformRef;
|
58 | /**
|
59 | * Creates a factory for a platform
|
60 | *
|
61 | * @experimental APIs related to application bootstrap are currently under review.
|
62 | */
|
63 | export declare function createPlatformFactory(parentPlatformFactory: ((extraProviders?: Provider[]) => PlatformRef) | null, name: string, providers?: Provider[]): (extraProviders?: Provider[]) => PlatformRef;
|
64 | /**
|
65 | * Checks that there currently is a platform which contains the given token as a provider.
|
66 | *
|
67 | * @experimental APIs related to application bootstrap are currently under review.
|
68 | */
|
69 | export declare function assertPlatform(requiredToken: any): PlatformRef;
|
70 | /**
|
71 | * Destroy the existing platform.
|
72 | *
|
73 | * @experimental APIs related to application bootstrap are currently under review.
|
74 | */
|
75 | export declare function destroyPlatform(): void;
|
76 | /**
|
77 | * Returns the current platform.
|
78 | *
|
79 | * @experimental APIs related to application bootstrap are currently under review.
|
80 | */
|
81 | export declare function getPlatform(): PlatformRef | null;
|
82 | /**
|
83 | * The Angular platform is the entry point for Angular on a web page. Each page
|
84 | * has exactly one platform, and services (such as reflection) which are common
|
85 | * to every Angular application running on the page are bound in its scope.
|
86 | *
|
87 | * A page's platform is initialized implicitly when a platform is created via a platform factory
|
88 | * (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.
|
89 | *
|
90 | * @stable
|
91 | */
|
92 | export declare abstract class PlatformRef {
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | abstract bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
|
117 | |
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | abstract bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
|
133 | |
134 |
|
135 |
|
136 | abstract onDestroy(callback: () => void): void;
|
137 | |
138 |
|
139 |
|
140 |
|
141 | readonly abstract injector: Injector;
|
142 | |
143 |
|
144 |
|
145 | abstract destroy(): void;
|
146 | readonly abstract destroyed: boolean;
|
147 | }
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | export declare class PlatformRef_ extends PlatformRef {
|
153 | private _injector;
|
154 | private _modules;
|
155 | private _destroyListeners;
|
156 | private _destroyed;
|
157 | constructor(_injector: Injector);
|
158 | onDestroy(callback: () => void): void;
|
159 | readonly injector: Injector;
|
160 | readonly destroyed: boolean;
|
161 | destroy(): void;
|
162 | bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
|
163 | private _bootstrapModuleFactoryWithZone<M>(moduleFactory, ngZone?);
|
164 | bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
|
165 | private _bootstrapModuleWithZone<M>(moduleType, compilerOptions?, ngZone?);
|
166 | private _moduleDoBootstrap(moduleRef);
|
167 | }
|
168 | /**
|
169 | * A reference to an Angular application running on a page.
|
170 | *
|
171 | * @stable
|
172 | */
|
173 | export declare abstract class ApplicationRef {
|
174 | |
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
|
187 | |
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | abstract tick(): void;
|
198 | |
199 |
|
200 |
|
201 |
|
202 | readonly abstract componentTypes: Type<any>[];
|
203 | |
204 |
|
205 |
|
206 | readonly abstract components: ComponentRef<any>[];
|
207 | |
208 |
|
209 |
|
210 |
|
211 |
|
212 | abstract attachView(view: ViewRef): void;
|
213 | |
214 |
|
215 |
|
216 | abstract detachView(view: ViewRef): void;
|
217 | |
218 |
|
219 |
|
220 | readonly abstract viewCount: number;
|
221 | |
222 |
|
223 |
|
224 | readonly abstract isStable: Observable<boolean>;
|
225 | }
|
226 |
|
227 |
|
228 |
|
229 |
|
230 | export declare class ApplicationRef_ extends ApplicationRef {
|
231 | private _zone;
|
232 | private _console;
|
233 | private _injector;
|
234 | private _exceptionHandler;
|
235 | private _componentFactoryResolver;
|
236 | private _initStatus;
|
237 | private _bootstrapListeners;
|
238 | private _rootComponents;
|
239 | private _rootComponentTypes;
|
240 | private _views;
|
241 | private _runningTick;
|
242 | private _enforceNoNewChanges;
|
243 | private _isStable;
|
244 | private _stable;
|
245 | constructor(_zone: NgZone, _console: Console, _injector: Injector, _exceptionHandler: ErrorHandler, _componentFactoryResolver: ComponentFactoryResolver, _initStatus: ApplicationInitStatus);
|
246 | attachView(viewRef: ViewRef): void;
|
247 | detachView(viewRef: ViewRef): void;
|
248 | bootstrap<C>(componentOrFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
|
249 | private _loadComponent(componentRef);
|
250 | private _unloadComponent(componentRef);
|
251 | tick(): void;
|
252 | ngOnDestroy(): void;
|
253 | readonly viewCount: number;
|
254 | readonly componentTypes: Type<any>[];
|
255 | readonly components: ComponentRef<any>[];
|
256 | readonly isStable: Observable<boolean>;
|
257 | }
|