mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
Changed Promise to IPromise
The current TypeDefinition with Promise was not working any more, can't find the Promise its needed to be renamed to IPromise.
This commit is contained in:
38
angularjs/angular-component-router.d.ts
vendored
38
angularjs/angular-component-router.d.ts
vendored
@@ -45,7 +45,7 @@ declare namespace angular {
|
||||
|
||||
specificity(): number;
|
||||
|
||||
resolveComponent(): Promise<ComponentInstruction>;
|
||||
resolveComponent(): IPromise<ComponentInstruction>;
|
||||
|
||||
/**
|
||||
* converts the instruction into a URL string
|
||||
@@ -87,20 +87,20 @@ declare namespace angular {
|
||||
* Called by the Router to instantiate a new component during the commit phase of a navigation.
|
||||
* This method in turn is responsible for calling the `routerOnActivate` hook of its child.
|
||||
*/
|
||||
activate(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
activate(nextInstruction: ComponentInstruction): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during the commit phase of a navigation when an outlet
|
||||
* reuses a component between different routes.
|
||||
* This method in turn is responsible for calling the `routerOnReuse` hook of its child.
|
||||
*/
|
||||
reuse(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
reuse(nextInstruction: ComponentInstruction): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} when an outlet disposes of a component's contents.
|
||||
* This method in turn is responsible for calling the `routerOnDeactivate` hook of its child.
|
||||
*/
|
||||
deactivate(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
deactivate(nextInstruction: ComponentInstruction): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during recognition phase of a navigation.
|
||||
@@ -110,7 +110,7 @@ declare namespace angular {
|
||||
* This method delegates to the child component's `routerCanDeactivate` hook if it exists,
|
||||
* and otherwise resolves to true.
|
||||
*/
|
||||
routerCanDeactivate(nextInstruction: ComponentInstruction): Promise<boolean>;
|
||||
routerCanDeactivate(nextInstruction: ComponentInstruction): IPromise<boolean>;
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during recognition phase of a navigation.
|
||||
@@ -122,7 +122,7 @@ declare namespace angular {
|
||||
* Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists,
|
||||
* or resolves to true if the hook is not present.
|
||||
*/
|
||||
routerCanReuse(nextInstruction: ComponentInstruction): Promise<boolean>;
|
||||
routerCanReuse(nextInstruction: ComponentInstruction): IPromise<boolean>;
|
||||
}
|
||||
|
||||
interface RouteRegistry {
|
||||
@@ -140,7 +140,7 @@ declare namespace angular {
|
||||
* Given a URL and a parent component, return the most specific instruction for navigating
|
||||
* the application into the state specified by the url
|
||||
*/
|
||||
recognize(url: string, ancestorInstructions: Instruction[]): Promise<Instruction>;
|
||||
recognize(url: string, ancestorInstructions: Instruction[]): IPromise<Instruction>;
|
||||
|
||||
/**
|
||||
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
|
||||
@@ -197,14 +197,14 @@ declare namespace angular {
|
||||
*
|
||||
* You probably don't need to use this unless you're writing a reusable component.
|
||||
*/
|
||||
registerPrimaryOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
registerPrimaryOutlet(outlet: RouterOutlet): IPromise<boolean>;
|
||||
|
||||
/**
|
||||
* Register an outlet to notified of auxiliary route changes.
|
||||
*
|
||||
* You probably don't need to use this unless you're writing a reusable component.
|
||||
*/
|
||||
registerAuxOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
registerAuxOutlet(outlet: RouterOutlet): IPromise<boolean>;
|
||||
|
||||
/**
|
||||
* Given an instruction, returns `true` if the instruction is currently active,
|
||||
@@ -224,7 +224,7 @@ declare namespace angular {
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(definitions: RouteDefinition[]): Promise<any>;
|
||||
config(definitions: RouteDefinition[]): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Navigate based on the provided Route Link DSL. It's preferred to navigate with this method
|
||||
@@ -238,7 +238,7 @@ declare namespace angular {
|
||||
* ```
|
||||
* See the {@link RouterLink} directive for more.
|
||||
*/
|
||||
navigate(linkParams: any[]): Promise<any>;
|
||||
navigate(linkParams: any[]): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
|
||||
@@ -247,19 +247,19 @@ declare namespace angular {
|
||||
* If the given URL begins with a `/`, router will navigate absolutely.
|
||||
* If the given URL does not begin with `/`, the router will navigate relative to this component.
|
||||
*/
|
||||
navigateByUrl(url: string, _skipLocationChange?: boolean): Promise<any>;
|
||||
navigateByUrl(url: string, _skipLocationChange?: boolean): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
|
||||
* complete.
|
||||
*/
|
||||
navigateByInstruction(instruction: Instruction,
|
||||
_skipLocationChange?: boolean): Promise<any>;
|
||||
_skipLocationChange?: boolean): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
@@ -269,18 +269,18 @@ declare namespace angular {
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): Promise<any>;
|
||||
deactivate(instruction: Instruction): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Given a URL, returns an instruction representing the component graph
|
||||
*/
|
||||
recognize(url: string): Promise<Instruction>;
|
||||
recognize(url: string): IPromise<Instruction>;
|
||||
|
||||
/**
|
||||
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
|
||||
* router has yet to successfully navigate.
|
||||
*/
|
||||
renavigate(): Promise<any>;
|
||||
renavigate(): IPromise<any>;
|
||||
|
||||
/**
|
||||
* Generate an `Instruction` based on the provided Route Link DSL.
|
||||
@@ -364,7 +364,7 @@ declare namespace angular {
|
||||
* {@example router/ts/can_deactivate/can_deactivate_example.ts region='routerCanDeactivate'}
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
$routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | Promise<boolean>;
|
||||
$routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | IPromise<boolean>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -407,7 +407,7 @@ declare namespace angular {
|
||||
* {@example router/ts/reuse/reuse_example.ts region='reuseCmp'}
|
||||
*/
|
||||
interface CanReuse {
|
||||
$routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | Promise<boolean>;
|
||||
$routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | IPromise<boolean>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user