Skip to content

Commit

Permalink
fix(typescript): Update to typescript 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Jun 29, 2017
1 parent b88e51c commit ce1669b
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 212 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"awesome-typescript-loader": "3.0.0-beta.10",
"conventional-changelog": "^1.1.0",
"conventional-changelog-cli": "^1.1.1",
"conventional-changelog-ui-router-core": "^1.3.0",
"conventional-changelog-ui-router-core": "^1.4.1",
"core-js": "^2.4.1",
"dts-downlevel": "^0.3.0",
"jasmine-core": "^2.4.1",
Expand All @@ -88,7 +88,7 @@
"shelljs": "^0.7.0",
"shx": "^0.1.4",
"tslint": "^4.5.1",
"typescript": "^2.1.4",
"typescript": "~2.4.0",
"webpack": "^1.13.3"
}
}
2 changes: 1 addition & 1 deletion src/common/coreservices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface $QLikeDeferred {
}

export interface $QLike {
when<T>(val?: T): Promise<T>;
when<T>(value?: T | PromiseLike<T>): Promise<T>;
reject<T>(reason: any): Promise<T>;
defer(): $QLikeDeferred;
all(promises: { [key: string]: Promise<any> }): Promise<any>;
Expand Down
7 changes: 4 additions & 3 deletions src/resolve/resolvable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {isFunction, isObject} from "../common/predicates";
import {Transition} from "../transition/transition";
import {StateObject} from "../state/stateObject";
import {PathNode} from "../path/pathNode";
import { isNullOrUndefined } from '../common';


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

this.token = arg1;
Expand All @@ -90,13 +91,13 @@ export class Resolvable implements ResolvableLiteral {
}
}

getPolicy(state:StateObject): ResolvePolicy {
getPolicy(state: StateObject): ResolvePolicy {
let thisPolicy = this.policy || {};
let statePolicy = state && state.resolvePolicy || {};
return {
when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,
async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,
}
};
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/state/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,6 @@ export interface StateDeclaration {
* If your state has a `lazyLoad` function, it should return a promise.
* If promise resolves to an object matching this interface, then the `states` array
* of [[StateDeclaration]] objects will be automatically registered.
*
* @internalapi
*/
export interface LazyLoadResult {
states?: StateDeclaration[];
Expand Down
4 changes: 2 additions & 2 deletions src/state/stateObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module state
*/
/** for typedoc */
import { StateDeclaration, _ViewDeclaration, _StateDeclaration } from "./interface";
import { StateDeclaration, _ViewDeclaration, _StateDeclaration, LazyLoadResult } from "./interface";
import { defaults, values, find, inherit } from "../common/common";
import { propEq } from "../common/hof";
import { Param } from "../params/param";
Expand Down Expand Up @@ -91,7 +91,7 @@ export class StateObject {
public onEnter: TransitionStateHookFn;

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

/** Prototypally inherits from [[StateDeclaration.redirectTo]] */
redirectTo: (
Expand Down
Loading

0 comments on commit ce1669b

Please sign in to comment.