Skip to content

Commit

Permalink
refactor(router): update imports, internal restruct
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 24, 2020
1 parent 8548a80 commit bb2d60e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 1 addition & 7 deletions packages/router/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { Fn, IID, IObjectOf } from "@thi.ng/api";

/**
* ID of event being triggered by `router.match()`
*/
export const EVENT_ROUTE_CHANGED = "route-changed";
export const EVENT_ROUTE_FAILED = "route-failed";
import type { Fn, IID, IObjectOf } from "@thi.ng/api";

/**
* A validation function to for authenticated routes. If this function
Expand Down
15 changes: 7 additions & 8 deletions packages/router/src/basic.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import {
assert,
import { assert, INotifyMixin } from "@thi.ng/api";
import { isString } from "@thi.ng/checks";
import { equiv } from "@thi.ng/equiv";
import { illegalArgs, illegalArity } from "@thi.ng/errors";
import { EVENT_ROUTE_CHANGED } from "./constants";
import type {
Event,
INotify,
INotifyMixin,
IObjectOf,
Listener
} from "@thi.ng/api";
import { isString } from "@thi.ng/checks";
import { equiv } from "@thi.ng/equiv";
import { illegalArgs, illegalArity } from "@thi.ng/errors";
import {
EVENT_ROUTE_CHANGED,
import type {
Route,
RouteMatch,
RouteParamValidator,
Expand Down
6 changes: 6 additions & 0 deletions packages/router/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* ID of success event being triggered by `router.match()`
*/
export const EVENT_ROUTE_CHANGED = "route-changed";

export const EVENT_ROUTE_FAILED = "route-failed";
4 changes: 2 additions & 2 deletions packages/router/src/history.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Fn } from "@thi.ng/api";
import { isString } from "@thi.ng/checks";
import { equiv } from "@thi.ng/equiv";
import { illegalArity } from "@thi.ng/errors";
import { HTMLRouterConfig, RouteMatch, RouterConfig } from "./api";
import { BasicRouter } from "./basic";
import type { Fn } from "@thi.ng/api";
import type { HTMLRouterConfig, RouteMatch, RouterConfig } from "./api";

export class HTMLRouter extends BasicRouter {
protected currentPath!: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/router/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./api";
export type * from "./api";
export * from "./constants";
export * from "./basic";
export * from "./history";

0 comments on commit bb2d60e

Please sign in to comment.