mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Ember.Application and Ember.EngineInstance.boot are public (#27504)
This commit is contained in:
Vendored
+11
@@ -480,6 +480,11 @@ declare module 'ember' {
|
||||
**/
|
||||
Router: Router;
|
||||
registry: Registry;
|
||||
/**
|
||||
* Initialize the application and return a promise that resolves with the `Application`
|
||||
* object when the boot process is complete.
|
||||
*/
|
||||
boot(): Promise<Application>;
|
||||
}
|
||||
/**
|
||||
The `ApplicationInstance` encapsulates all of the stateful aspects of a
|
||||
@@ -1111,6 +1116,12 @@ declare module 'ember' {
|
||||
* Unregister a factory.
|
||||
*/
|
||||
unregister(fullName: string): any;
|
||||
|
||||
/**
|
||||
* Initialize the `EngineInstance` and return a promise that resolves
|
||||
* with the instance itself when the boot process is complete.
|
||||
*/
|
||||
boot(): Promise<EngineInstance>;
|
||||
}
|
||||
/**
|
||||
* This mixin defines the common interface implemented by enumerable objects
|
||||
|
||||
@@ -18,3 +18,9 @@ appInstance.register('some:injection', class Foo {}, {
|
||||
|
||||
appInstance.factoryFor('router:main');
|
||||
appInstance.lookup('route:basic');
|
||||
|
||||
appInstance.boot();
|
||||
|
||||
(async function() {
|
||||
await appInstance.boot();
|
||||
}());
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import EngineInstance from '@ember/engine/instance';
|
||||
|
||||
const engineInstance = EngineInstance.create();
|
||||
engineInstance.register('some:injection', class Foo {});
|
||||
|
||||
engineInstance.register('some:injection', class Foo {}, {
|
||||
singleton: true,
|
||||
});
|
||||
|
||||
engineInstance.register('some:injection', class Foo {}, {
|
||||
instantiate: false,
|
||||
});
|
||||
|
||||
engineInstance.register('some:injection', class Foo {}, {
|
||||
singleton: false,
|
||||
instantiate: true,
|
||||
});
|
||||
|
||||
engineInstance.factoryFor('router:main');
|
||||
engineInstance.lookup('route:basic');
|
||||
|
||||
engineInstance.boot();
|
||||
|
||||
(async function() {
|
||||
await engineInstance.boot();
|
||||
}());
|
||||
@@ -23,6 +23,7 @@
|
||||
"test/lib/assert.ts",
|
||||
"test/application.ts",
|
||||
"test/application-instance.ts",
|
||||
"test/engine-instance.ts",
|
||||
"test/ember-tests.ts",
|
||||
"test/error.ts",
|
||||
"test/event.ts",
|
||||
|
||||
Reference in New Issue
Block a user