Skip to content

Commit

Permalink
fix(enums): Workaround angular compiler export issue angular/angular#…
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed May 8, 2018
1 parent 5ab0ebb commit 38d25fa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/common/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ const consoletable = isFunction(console.table) ? console.table.bind(console) : c
*
* `trace.enable(1)`
*/
export enum Category {
enum Category {
RESOLVE,
TRANSITION,
HOOK,
UIVIEW,
VIEWCONFIG,
}

export { Category };

/** @hidden */
const _tid = parse('$id');

Expand Down
9 changes: 7 additions & 2 deletions src/params/param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ const isShorthand = (cfg: ParamDeclaration) =>
['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;

/** @internalapi */
export enum DefType {
enum DefType {
PATH,
SEARCH,
CONFIG,
}
export { DefType };

/** @hidden */
function unwrapShorthand(cfg: ParamDeclaration): ParamDeclaration {
Expand All @@ -49,7 +50,11 @@ function getType(cfg: ParamDeclaration, urlType: ParamType, location: DefType, i
const type =
location === DefType.CONFIG
? 'any'
: location === DefType.PATH ? 'path' : location === DefType.SEARCH ? 'query' : 'string';
: location === DefType.PATH
? 'path'
: location === DefType.SEARCH
? 'query'
: 'string';
return paramTypes.type(type);
}
return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type as string);
Expand Down
6 changes: 4 additions & 2 deletions src/transition/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -836,14 +836,16 @@ export interface PathType {
*/
export type HookMatchCriterion = string | IStateMatch | boolean;

export enum TransitionHookPhase {
enum TransitionHookPhase {
CREATE,
BEFORE,
RUN,
SUCCESS,
ERROR,
}
export enum TransitionHookScope {
enum TransitionHookScope {
TRANSITION,
STATE,
}

export { TransitionHookPhase, TransitionHookScope };
4 changes: 3 additions & 1 deletion src/transition/rejectFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { extend, silentRejection } from '../common/common';
import { stringify } from '../common/strings';
import { is } from '../common/hof';

export enum RejectType {
enum RejectType {
/**
* A new transition superseded this one.
*
Expand Down Expand Up @@ -50,6 +50,8 @@ export enum RejectType {
ERROR = 6,
}

export { RejectType };

/** @hidden */
let id = 0;

Expand Down

0 comments on commit 38d25fa

Please sign in to comment.