1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ErrorHandler } from '../src/error_handler';
|
9 | import { ApplicationInitStatus } from './application_init';
|
10 | import { Console } from './console';
|
11 | import { Injector, Provider } from './di';
|
12 | import { CompilerOptions } from './linker/compiler';
|
13 | import { ComponentFactory, ComponentRef } from './linker/component_factory';
|
14 | import { ComponentFactoryResolver } from './linker/component_factory_resolver';
|
15 | import { NgModuleFactory, NgModuleRef } from './linker/ng_module_factory';
|
16 | import { ViewRef } from './linker/view_ref';
|
17 | import { Testability, TestabilityRegistry } from './testability/testability';
|
18 | import { Type } from './type';
|
19 | import { NgZone } from './zone/ng_zone';
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare function enableProdMode(): void;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export declare function isDevMode(): boolean;
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare class NgProbeToken {
|
46 | name: string;
|
47 | token: any;
|
48 | constructor(name: string, token: any);
|
49 | }
|
50 | /**
|
51 | * Creates a platform.
|
52 | * Platforms have to be eagerly created via this function.
|
53 | *
|
54 | * @experimental APIs related to application bootstrap are currently under review.
|
55 | */
|
56 | export declare function createPlatform(injector: Injector): PlatformRef;
|
57 | /**
|
58 | * Creates a factory for a platform
|
59 | *
|
60 | * @experimental APIs related to application bootstrap are currently under review.
|
61 | */
|
62 | export declare function createPlatformFactory(parentPlatformFactory: (extraProviders?: Provider[]) => PlatformRef, name: string, providers?: Provider[]): (extraProviders?: Provider[]) => PlatformRef;
|
63 | /**
|
64 | * Checks that there currently is a platform
|
65 | * 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;
|
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 {@link bootstrap}() is called, or
|
88 | * explicitly by calling {@link createPlatform}().
|
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 | bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
|
117 | |
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | 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 | injector: Injector;
|
142 | |
143 |
|
144 |
|
145 | abstract destroy(): void;
|
146 | destroyed: boolean;
|
147 | }
|
148 | export declare class PlatformRef_ extends PlatformRef {
|
149 | private _injector;
|
150 | private _modules;
|
151 | private _destroyListeners;
|
152 | private _destroyed;
|
153 | constructor(_injector: Injector);
|
154 | onDestroy(callback: () => void): void;
|
155 | injector: Injector;
|
156 | destroyed: boolean;
|
157 | destroy(): void;
|
158 | bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
|
159 | private _bootstrapModuleFactoryWithZone<M>(moduleFactory, ngZone);
|
160 | bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
|
161 | private _bootstrapModuleWithZone<M>(moduleType, compilerOptions, ngZone, componentFactoryCallback?);
|
162 | private _moduleDoBootstrap(moduleRef);
|
163 | }
|
164 | /**
|
165 | * A reference to an Angular application running on a page.
|
166 | *
|
167 | * For more about Angular applications, see the documentation for {@link bootstrap}.
|
168 | *
|
169 | * @stable
|
170 | */
|
171 | export declare abstract class ApplicationRef {
|
172 | |
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 | abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
|
185 | |
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 | abstract tick(): void;
|
196 | |
197 |
|
198 |
|
199 |
|
200 | componentTypes: Type<any>[];
|
201 | |
202 |
|
203 |
|
204 | components: ComponentRef<any>[];
|
205 | |
206 |
|
207 |
|
208 |
|
209 |
|
210 | attachView(view: ViewRef): void;
|
211 | |
212 |
|
213 |
|
214 | detachView(view: ViewRef): void;
|
215 | |
216 |
|
217 |
|
218 | viewCount: any;
|
219 | }
|
220 | export declare class ApplicationRef_ extends ApplicationRef {
|
221 | private _zone;
|
222 | private _console;
|
223 | private _injector;
|
224 | private _exceptionHandler;
|
225 | private _componentFactoryResolver;
|
226 | private _initStatus;
|
227 | private _testabilityRegistry;
|
228 | private _testability;
|
229 | private _bootstrapListeners;
|
230 | private _rootComponents;
|
231 | private _rootComponentTypes;
|
232 | private _views;
|
233 | private _runningTick;
|
234 | private _enforceNoNewChanges;
|
235 | constructor(_zone: NgZone, _console: Console, _injector: Injector, _exceptionHandler: ErrorHandler, _componentFactoryResolver: ComponentFactoryResolver, _initStatus: ApplicationInitStatus, _testabilityRegistry: TestabilityRegistry, _testability: Testability);
|
236 | attachView(viewRef: ViewRef): void;
|
237 | detachView(viewRef: ViewRef): void;
|
238 | bootstrap<C>(componentOrFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
|
239 | private _loadComponent(componentRef);
|
240 | private _unloadComponent(componentRef);
|
241 | tick(): void;
|
242 | ngOnDestroy(): void;
|
243 | viewCount: number;
|
244 | componentTypes: Type<any>[];
|
245 | components: ComponentRef<any>[];
|
246 | }
|