Skip to content

Commit ce1669b

Browse files
fix(typescript): Update to typescript 2.4
1 parent b88e51c commit ce1669b

File tree

6 files changed

+337
-212
lines changed

6 files changed

+337
-212
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"awesome-typescript-loader": "3.0.0-beta.10",
6666
"conventional-changelog": "^1.1.0",
6767
"conventional-changelog-cli": "^1.1.1",
68-
"conventional-changelog-ui-router-core": "^1.3.0",
68+
"conventional-changelog-ui-router-core": "^1.4.1",
6969
"core-js": "^2.4.1",
7070
"dts-downlevel": "^0.3.0",
7171
"jasmine-core": "^2.4.1",
@@ -88,7 +88,7 @@
8888
"shelljs": "^0.7.0",
8989
"shx": "^0.1.4",
9090
"tslint": "^4.5.1",
91-
"typescript": "^2.1.4",
91+
"typescript": "~2.4.0",
9292
"webpack": "^1.13.3"
9393
}
9494
}

src/common/coreservices.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface $QLikeDeferred {
2525
}
2626

2727
export interface $QLike {
28-
when<T>(val?: T): Promise<T>;
28+
when<T>(value?: T | PromiseLike<T>): Promise<T>;
2929
reject<T>(reason: any): Promise<T>;
3030
defer(): $QLikeDeferred;
3131
all(promises: { [key: string]: Promise<any> }): Promise<any>;

src/resolve/resolvable.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {isFunction, isObject} from "../common/predicates";
1313
import {Transition} from "../transition/transition";
1414
import {StateObject} from "../state/stateObject";
1515
import {PathNode} from "../path/pathNode";
16+
import { isNullOrUndefined } from '../common';
1617

1718

1819
// TODO: explicitly make this user configurable
@@ -73,7 +74,7 @@ export class Resolvable implements ResolvableLiteral {
7374
if (arg1 instanceof Resolvable) {
7475
extend(this, arg1);
7576
} else if (isFunction(resolveFn)) {
76-
if (arg1 == null || arg1 == undefined) throw new Error("new Resolvable(): token argument is required");
77+
if (isNullOrUndefined(arg1)) throw new Error("new Resolvable(): token argument is required");
7778
if (!isFunction(resolveFn)) throw new Error("new Resolvable(): resolveFn argument must be a function");
7879

7980
this.token = arg1;
@@ -90,13 +91,13 @@ export class Resolvable implements ResolvableLiteral {
9091
}
9192
}
9293

93-
getPolicy(state:StateObject): ResolvePolicy {
94+
getPolicy(state: StateObject): ResolvePolicy {
9495
let thisPolicy = this.policy || {};
9596
let statePolicy = state && state.resolvePolicy || {};
9697
return {
9798
when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,
9899
async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,
99-
}
100+
};
100101
}
101102

102103
/**

src/state/interface.ts

-2
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,6 @@ export interface StateDeclaration {
709709
* If your state has a `lazyLoad` function, it should return a promise.
710710
* If promise resolves to an object matching this interface, then the `states` array
711711
* of [[StateDeclaration]] objects will be automatically registered.
712-
*
713-
* @internalapi
714712
*/
715713
export interface LazyLoadResult {
716714
states?: StateDeclaration[];

src/state/stateObject.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @module state
44
*/
55
/** for typedoc */
6-
import { StateDeclaration, _ViewDeclaration, _StateDeclaration } from "./interface";
6+
import { StateDeclaration, _ViewDeclaration, _StateDeclaration, LazyLoadResult } from "./interface";
77
import { defaults, values, find, inherit } from "../common/common";
88
import { propEq } from "../common/hof";
99
import { Param } from "../params/param";
@@ -91,7 +91,7 @@ export class StateObject {
9191
public onEnter: TransitionStateHookFn;
9292

9393
/** Prototypally inherits from [[StateDeclaration.lazyLoad]] */
94-
public lazyLoad: (transition: Transition, state: StateDeclaration) => Promise<StateDeclaration[]>;
94+
public lazyLoad: (transition: Transition, state: StateDeclaration) => Promise<LazyLoadResult>;
9595

9696
/** Prototypally inherits from [[StateDeclaration.redirectTo]] */
9797
redirectTo: (

0 commit comments

Comments
 (0)