Skip to content

Commit

Permalink
feat(type declarations): improve type of RouterConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
fkleuver committed Feb 27, 2018
1 parent 1e9bfa2 commit c1775e5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/router-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ import {RouteConfig} from './interfaces';
* @constructor
*/
export class RouterConfiguration {
instructions = [];
options: any = {};
pipelineSteps: Array<Function|PipelineStep> = [];
instructions: Array<(router: Router) => void> = [];
options: {
[key: string]: any;
compareQueryParams?: boolean;
root?: string;
pushState?: boolean;
hashChange?: boolean;
silent?: boolean;
} = {};
pipelineSteps: Array<{name: string, step: Function|PipelineStep}> = [];
title: string;
unknownRouteConfig: any;
viewPortDefaults: any;
unknownRouteConfig: string|RouteConfig|((instruction: NavigationInstruction) => string|RouteConfig|Promise<string|RouteConfig>);
viewPortDefaults: {[name: string]: {moduleId: string; [key: string]: any}};

/**
* Adds a step to be run during the [[Router]]'s navigation pipeline.
Expand Down Expand Up @@ -98,7 +105,7 @@ export class RouterConfiguration {
* default, of the form { viewPortName: { moduleId } }.
* @chainable
*/
useViewPortDefaults(viewPortConfig: any) {
useViewPortDefaults(viewPortConfig: {[name: string]: {moduleId: string; [key: string]: any}}): RouterConfiguration {
this.viewPortDefaults = viewPortConfig;
return this;
}
Expand Down

0 comments on commit c1775e5

Please sign in to comment.