mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[ember] - Add missing Ember.Route#intermediateTransitionTo method (#27031)
* Ember.Route#intermediateTransitionTo * add self as contributor
This commit is contained in:
parent
dae079e5be
commit
2cf2ef209d
14
types/ember/index.d.ts
vendored
14
types/ember/index.d.ts
vendored
@ -7,6 +7,7 @@
|
||||
// Theron Cross <https://github.com/theroncross>
|
||||
// Martin Feckie <https://github.com/mfeckie>
|
||||
// Alex LaFroscia <https://github.com/alexlafroscia>
|
||||
// Mike North <https://github.com/mike-north>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@ -1990,6 +1991,19 @@ declare module 'ember' {
|
||||
*/
|
||||
transitionTo(name: string, ...object: any[]): Transition;
|
||||
|
||||
// https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo
|
||||
/**
|
||||
* Perform a synchronous transition into another route without attempting to resolve promises,
|
||||
* update the URL, or abort any currently active asynchronous transitions
|
||||
* (i.e. regular transitions caused by transitionTo or URL changes).
|
||||
*
|
||||
* @param name the name of the route or a URL
|
||||
* @param object the model(s) or identifier(s) to be used while
|
||||
* transitioning to the route.
|
||||
* @returns the Transition object associated with this attempted transition
|
||||
*/
|
||||
intermediateTransitionTo(name: string, ...object: any[]): Transition;
|
||||
|
||||
// properties
|
||||
/**
|
||||
* The controller associated with this route.
|
||||
|
||||
@ -92,4 +92,13 @@ class RouteUsingClass extends Route.extend({
|
||||
beforeModel(this: RouteUsingClass) {
|
||||
return 'beforeModel can return anything, not just promises';
|
||||
}
|
||||
intermediateTransitionWithoutModel() {
|
||||
this.intermediateTransitionTo('some-route');
|
||||
}
|
||||
intermediateTransitionWithModel() {
|
||||
this.intermediateTransitionTo('some.other.route', { });
|
||||
}
|
||||
intermediateTransitionWithMultiModel() {
|
||||
this.intermediateTransitionTo('some.other.route', 1, 2, { });
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,11 @@ const RouterServiceConsumer = Ember.Service.extend({
|
||||
Ember.get(this, 'router')
|
||||
.transitionTo('some.other.route', model);
|
||||
},
|
||||
transitionWithMultiModel() {
|
||||
const model = Ember.Object.create();
|
||||
Ember.get(this, 'router')
|
||||
.transitionTo('some.other.route', model, model);
|
||||
},
|
||||
transitionWithModelAndOptions() {
|
||||
const model = Ember.Object.create();
|
||||
Ember.get(this, 'router')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user