## API Report File for "@microsoft/fast-router"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { AddViewBehaviorFactory } from '@microsoft/fast-element';
import { ComposableStyles } from '@microsoft/fast-element';
import { Constructable } from '@microsoft/fast-element';
import { ExecutionContext } from '@microsoft/fast-element';
import { FASTElement } from '@microsoft/fast-element';
import { ViewBehavior } from '@microsoft/fast-element';
import { ViewBehaviorFactory } from '@microsoft/fast-element';
import { ViewController } from '@microsoft/fast-element';
import { ViewTemplate } from '@microsoft/fast-element';

// Warning: (ae-internal-missing-underscore) The name "childRouteParameter" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export const childRouteParameter = "fast-child-route";

// @beta (undocumented)
export type CommandFallbackRouteDefinition<TSettings = any> = HasCommand & SupportsSettings<TSettings> & HasTitle;

// @beta (undocumented)
export type CommandRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & HasCommand & HasTitle;

// @beta (undocumented)
export class ConfigurableRoute implements Route {
    constructor(path: string, name: string, caseSensitive: boolean);
    // (undocumented)
    readonly caseSensitive: boolean;
    // (undocumented)
    readonly name: string;
    // (undocumented)
    readonly path: string;
}

// @beta (undocumented)
export type ContributorOptions = {
    lifecycle?: boolean;
    parameters?: boolean;
};

// @beta (undocumented)
export class DefaultLinkHandler implements LinkHandler {
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
}

// @beta (undocumented)
export class DefaultNavigationProcess<TSettings> {
    // Warning: (ae-forgotten-export) The symbol "NavigationPhaseImpl" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    commit(phase: NavigationPhaseImpl): void;
    // (undocumented)
    run(router: Router, message: NavigationMessage): Promise<void>;
}

// @beta (undocumented)
export class DefaultNavigationQueue implements NavigationQueue, NavigationHandler {
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
    // (undocumented)
    enqueue(msg: NavigationMessage): void;
    // (undocumented)
    handleEvent(event: PopStateEvent): void;
    // (undocumented)
    receive(): Promise<NavigationMessage>;
}

// @beta (undocumented)
export class DefaultRouter implements Router {
    constructor(host: HTMLElement);
    // (undocumented)
    addContributor(contributor: NavigationContributor): void;
    // (undocumented)
    beginRender(route: RecognizedRoute, command: RenderCommand): Promise<{
        commit: any;
        rollback: any;
    }>;
    // (undocumented)
    get config(): RouterConfiguration | null;
    set config(value: RouterConfiguration | null);
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
    // (undocumented)
    readonly host: HTMLElement;
    // (undocumented)
    get level(): number;
    // (undocumented)
    get parent(): Router<any> | null;
    // (undocumented)
    removeContributor(contributor: NavigationContributor): void;
    // (undocumented)
    route: RecognizedRoute | null;
    // (undocumented)
    shouldRender(route: RecognizedRoute): boolean;
}

// @beta (undocumented)
export class DefaultRouteRecognizer<TSettings> implements RouteRecognizer<TSettings> {
    // (undocumented)
    add(routeOrRoutes: Route | readonly Route[], settings?: TSettings): void;
    generateFromName(name: string, params: object): string | null;
    generateFromPath(path: string, params: object): string | null;
    // (undocumented)
    recognize(path: string, converters?: Readonly<Record<string, RouteParameterConverter>>): Promise<RecognizedRoute<TSettings> | null>;
}

// @beta (undocumented)
export type DefinitionCallback = () => Promise<FallbackRouteDefinition> | FallbackRouteDefinition;

// @beta (undocumented)
export type ElementFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasElement & SupportsSettings<TSettings> & HasTitle;

// @beta (undocumented)
export type ElementRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasElement;

// @beta (undocumented)
export class Endpoint<TSettings = any> {
    constructor(route: ConfigurableRoute, paramNames: readonly string[], paramTypes: readonly string[], settings: TSettings | null);
    // (undocumented)
    readonly paramNames: readonly string[];
    // (undocumented)
    readonly paramTypes: readonly string[];
    // (undocumented)
    get path(): string;
    // (undocumented)
    readonly route: ConfigurableRoute;
    // (undocumented)
    readonly settings: TSettings | null;
}

// @beta (undocumented)
export type FallbackRouteDefinition<TSettings = any> = ElementFallbackRouteDefinition<TSettings> | TemplateFallbackRouteDefinition<TSettings> | Pick<RedirectRouteDefinition<TSettings>, "redirect"> | CommandFallbackRouteDefinition<TSettings>;

// @beta (undocumented)
export type FASTElementConstructor = new () => FASTElement;

// @beta (undocumented)
export class FASTElementLayout implements Layout {
    constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
    // (undocumented)
    afterCommit(routerElement: HTMLElement): Promise<void>;
    // (undocumented)
    beforeCommit(routerElement: HTMLElement): Promise<void>;
}

// Warning: (ae-forgotten-export) The symbol "FASTRouter_base" needs to be exported by the entry point index.d.ts
//
// @beta (undocumented)
export class FASTRouter extends FASTRouter_base {
}

// @beta (undocumented)
export type HasCommand = {
    command: NavigationCommand;
};

// @beta (undocumented)
export type HasElement = {
    element: string | FASTElementConstructor | HTMLElement | (() => Promise<string | FASTElementConstructor | HTMLElement>);
};

// @beta (undocumented)
export type HasTemplate = {
    template: ViewTemplate | (() => Promise<ViewTemplate>);
};

// @beta (undocumented)
export type HasTitle = {
    title?: string;
};

// @beta (undocumented)
export type IgnorableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings>;

// @beta (undocumented)
export class Ignore implements NavigationCommand {
    // (undocumented)
    createContributor(): Promise<{
        navigate(phase: NavigationPhase): Promise<void>;
    }>;
}

// @beta (undocumented)
export function isFASTElementHost(host: HTMLElement): host is HTMLElement & FASTElement;

// @beta (undocumented)
export function isNavigationPhaseContributor<T extends NavigationPhaseName>(object: any, phase: T): object is Record<T, NavigationPhaseHook>;

// @beta (undocumented)
export interface Layout {
    // (undocumented)
    afterCommit(routerElement: HTMLElement): Promise<void>;
    // (undocumented)
    beforeCommit(routerElement: HTMLElement): Promise<void>;
}

// @beta (undocumented)
export const Layout: Readonly<{
    default: Readonly<Layout>;
}>;

// @beta (undocumented)
export type LayoutAndTransitionRouteDefinition = {
    layout?: Layout | ViewTemplate;
    transition?: Transition;
};

// @beta (undocumented)
export interface LinkHandler {
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
}

// @beta (undocumented)
export type MappableRouteDefinition<TSettings = any> = RenderableRouteDefinition<TSettings> | RedirectRouteDefinition<TSettings> | CommandRouteDefinition<TSettings> | ParentRouteDefinition<TSettings>;

// @beta (undocumented)
export type NavigableRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & HasTitle & {
    childRouters?: boolean;
};

// @beta (undocumented)
export interface NavigationCommand {
    // (undocumented)
    createContributor(router: Router, route: RecognizedRoute): Promise<NavigationContributor>;
}

// @beta (undocumented)
export interface NavigationCommitPhase<TSettings = any> extends Omit<NavigationPhase<TSettings>, "cancel" | "canceled" | "onCancel"> {
    // (undocumented)
    setTitle(title: string): void;
}

// @beta (undocumented)
export type NavigationCommitPhaseHook<TSettings = any> = (phase: NavigationCommitPhase<TSettings>) => Promise<any> | any;

// @beta (undocumented)
export type NavigationContributor<TSettings = any> = Partial<Record<Exclude<NavigationPhaseName, "commit">, NavigationPhaseHook<TSettings>>> & {
    commit?: NavigationCommitPhaseHook<TSettings>;
};

// Warning: (ae-forgotten-export) The symbol "NavigationContributorDirective" needs to be exported by the entry point index.d.ts
//
// @beta (undocumented)
export function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;

// @beta (undocumented)
export interface NavigationHandler {
    // (undocumented)
    enqueue(msg: NavigationMessage): void;
}

// @beta (undocumented)
export const NavigationHandler: Readonly<{
    register(handler: NavigationHandler): void;
    unregister(handler: NavigationHandler): void;
}>;

// @beta (undocumented)
export class NavigationMessage {
    constructor(path: string);
    // (undocumented)
    path: string;
}

// @beta (undocumented)
export interface NavigationPhase<TSettings = any> {
    // (undocumented)
    cancel(callback?: NavigationPhaseFollowupAction): void;
    // (undocumented)
    readonly canceled: boolean;
    // (undocumented)
    evaluateContributor(contributor: any, route?: RecognizedRoute<TSettings>, router?: Router<TSettings>): Promise<void>;
    // (undocumented)
    readonly name: NavigationPhaseName;
    // (undocumented)
    onCancel(callback: NavigationPhaseFollowupAction): void;
    // (undocumented)
    onCommit(callback: NavigationPhaseFollowupAction): void;
    // (undocumented)
    readonly route: RecognizedRoute<TSettings>;
    // (undocumented)
    readonly router: Router<TSettings>;
}

// @beta (undocumented)
export type NavigationPhaseFollowupAction = () => Promise<any> | any;

// @beta (undocumented)
export type NavigationPhaseHook<TSettings = any> = (phase: NavigationPhase<TSettings>) => Promise<any> | any;

// @beta (undocumented)
export type NavigationPhaseName = "navigate" | "leave" | "construct" | "enter" | "commit";

// @beta (undocumented)
export interface NavigationProcess {
    // (undocumented)
    run(router: Router, message: NavigationMessage): Promise<void>;
}

// @beta (undocumented)
export interface NavigationQueue {
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
    // (undocumented)
    receive(): Promise<NavigationMessage>;
}

// @beta (undocumented)
export type ParameterConverter = RouteParameterConverter | RouteParameterConverterObject | Constructable<RouteParameterConverterObject>;

// @beta (undocumented)
export type ParentRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & LayoutAndTransitionRouteDefinition & {
    children: MappableRouteDefinition<TSettings>[];
};

// @beta (undocumented)
export type PathedRouteDefinition<TSettings = any> = SupportsSettings<TSettings> & Route;

// @beta (undocumented)
export const QueryString: Readonly<{
    readonly current: string;
    build(params: Record<string, string>, traditional?: boolean): string;
    separate(path: string): Readonly<{
        path: string;
        queryString: string;
    }>;
    parse(queryString: string): Readonly<Record<string, string>>;
}>;

// @beta (undocumented)
export class RecognizedRoute<TSettings = any> {
    constructor(endpoint: Endpoint<TSettings>, params: Readonly<Record<string, string | undefined>>, typedParams: Readonly<Record<string, any>>, queryParams: Readonly<Record<string, string>>);
    // (undocumented)
    readonly allParams: Readonly<Record<string, string | undefined>>;
    // (undocumented)
    readonly allTypedParams: Readonly<Record<string, any>>;
    // (undocumented)
    readonly endpoint: Endpoint<TSettings>;
    // (undocumented)
    readonly params: Readonly<Record<string, string | undefined>>;
    // (undocumented)
    readonly queryParams: Readonly<Record<string, string>>;
    // (undocumented)
    get settings(): TSettings | null;
    // (undocumented)
    readonly typedParams: Readonly<Record<string, any>>;
}

// @beta (undocumented)
export class Redirect implements NavigationCommand {
    constructor(redirect: string);
    // (undocumented)
    createContributor(): Promise<{
        navigate(phase: NavigationPhase): Promise<void>;
    }>;
}

// @beta (undocumented)
export type RedirectRouteDefinition<TSettings = any> = PathedRouteDefinition<TSettings> & {
    redirect: string;
};

// @beta (undocumented)
export class Render implements RenderCommand {
    constructor(owner: RouterConfiguration, createView: () => Promise<RouteView>);
    // Warning: (ae-forgotten-export) The symbol "RenderContributor" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    createContributor(router: Router, route: RecognizedRoute): Promise<RenderContributor>;
    // (undocumented)
    createView: () => Promise<RouteView>;
    // (undocumented)
    static fromDefinition(owner: RouterConfiguration, definition: ElementRouteDefinition | TemplateRouteDefinition | ElementFallbackRouteDefinition | TemplateFallbackRouteDefinition): Render;
    // (undocumented)
    get layout(): Layout;
    set layout(value: Layout);
    // (undocumented)
    title: string;
    // (undocumented)
    get transition(): Transition;
    set transition(value: Transition);
}

// @beta (undocumented)
export type RenderableRouteDefinition<TSettings = any> = ElementRouteDefinition<TSettings> | TemplateRouteDefinition<TSettings>;

// @beta (undocumented)
export interface RenderCommand extends NavigationCommand {
    // (undocumented)
    createView(): Promise<RouteView>;
    // (undocumented)
    layout: Layout;
    // (undocumented)
    transition: Transition;
}

// @beta (undocumented)
export interface RenderOperation {
    // (undocumented)
    commit(): Promise<void>;
    // (undocumented)
    rollback(): Promise<void>;
}

// @beta (undocumented)
export interface Route {
    // (undocumented)
    readonly caseSensitive?: boolean;
    // (undocumented)
    readonly name?: string;
    // (undocumented)
    readonly path: string;
}

// @beta (undocumented)
export const Route: Readonly<{
    path: Readonly<{
        readonly current: string;
        generateRoute(relativeTo: HTMLElement | Router, path: string, params?: Object): Promise<string | null>;
        push(path: string, trigger?: boolean): void;
        replace(path: string, trigger?: boolean): void;
        trigger(path: string): void;
    }>;
    name: Readonly<{
        generateRoute(relativeTo: HTMLElement | Router, name: string, params?: Object): Promise<string | null>;
        push(relativeTo: HTMLElement | Router, name: string, params?: Object, trigger?: boolean): Promise<void>;
        replace(relativeTo: HTMLElement | Router, name: string, params?: Object, trigger?: boolean): Promise<void>;
        trigger(relativeTo: HTMLElement | Router, name: string, params?: Object): Promise<void>;
    }>;
}>;

// @beta (undocumented)
export class RouteCollection<TSettings = any> {
    constructor(owner: RouterConfiguration);
    // (undocumented)
    converter(name: string, converter: ParameterConverter): void;
    // (undocumented)
    fallback(definitionOrCallback: FallbackRouteDefinition<TSettings> | DefinitionCallback): void;
    generateFromName(name: string, params: object): string | null;
    generateFromPath(path: string, params: object): string | null;
    // (undocumented)
    ignore(definitionOrString: IgnorableRouteDefinition<TSettings> | string): void;
    // (undocumented)
    map(...routes: MappableRouteDefinition<TSettings>[]): void;
    // (undocumented)
    recognize(path: string): Promise<RouteMatch<TSettings> | null>;
}

// @beta (undocumented)
export type RouteMatch<TSettings = any> = {
    route: RecognizedRoute<TSettings>;
    command: NavigationCommand;
};

// @beta (undocumented)
export type RouteParameterConverter = (name: string, value: string | undefined, context: RouteParameterConverterContext) => any | Promise<any>;

// @beta (undocumented)
export interface RouteParameterConverterContext<TSettings = any> {
    // (undocumented)
    readonly endpoint: Endpoint<TSettings>;
    // (undocumented)
    readonly params: Readonly<Record<string, string | undefined>>;
    // (undocumented)
    readonly queryParams: Record<string, string>;
    // (undocumented)
    readonly typedParams: Record<string, any>;
}

// @beta (undocumented)
export type RouteParameterConverterObject = {
    convert: RouteParameterConverter;
};

// @beta (undocumented)
export interface Router<TSettings = any> {
    // (undocumented)
    addContributor(contributor: NavigationContributor): void;
    // (undocumented)
    beginRender(route: RecognizedRoute<TSettings>, command: RenderCommand): Promise<RenderOperation>;
    // (undocumented)
    config: RouterConfiguration | null;
    // (undocumented)
    connect(): void;
    // (undocumented)
    disconnect(): void;
    // (undocumented)
    readonly level: number;
    // (undocumented)
    readonly parent: Router | null;
    // (undocumented)
    removeContributor(contributor: NavigationContributor): void;
    // (undocumented)
    readonly route: RecognizedRoute | null;
    // (undocumented)
    shouldRender(route: RecognizedRoute<TSettings>): boolean;
}

// @beta (undocumented)
export const Router: Readonly<{
    getOrCreateFor(element: HTMLElement): Router<any> | DefaultRouter;
    find(element: HTMLElement): Router | null;
    from<TBase extends {
        new (): HTMLElement;
        prototype: HTMLElement;
    }>(BaseType: TBase): new () => InstanceType<TBase> & RouterElement;
}>;

// @beta (undocumented)
export abstract class RouterConfiguration<TSettings = any> {
    // (undocumented)
    protected cached(ElementType: new () => HTMLElement): () => Promise<HTMLElement>;
    // (undocumented)
    protected abstract configure(): Promise<void> | void;
    // (undocumented)
    construct<T>(Type: Constructable<T>): T;
    // (undocumented)
    readonly contributors: NavigationContributor<TSettings>[];
    // Warning: (ae-forgotten-export) The symbol "RoutingEventSink" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    createEventSink(): RoutingEventSink;
    // (undocumented)
    createLinkHandler(): LinkHandler;
    // (undocumented)
    createNavigationProcess(): NavigationProcess;
    // (undocumented)
    createNavigationQueue(): NavigationQueue;
    // (undocumented)
    createRouteRecognizer(): RouteRecognizer<TSettings>;
    // Warning: (ae-forgotten-export) The symbol "TitleBuilder" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    createTitleBuilder(): TitleBuilder;
    // (undocumented)
    defaultLayout: Layout;
    // (undocumented)
    defaultTransition: Readonly<Transition>;
    // (undocumented)
    findContributors<T extends NavigationPhaseName>(phase: T): Record<T, NavigationPhaseHook<TSettings>>[];
    generateRouteFromName(name: string, params: object): Promise<string | null>;
    generateRouteFromPath(path: string, params: object): Promise<string | null>;
    // (undocumented)
    parent: RouterConfiguration<TSettings> | null;
    // (undocumented)
    recognizeRoute(path: string): Promise<RouteMatch<TSettings> | null>;
    // (undocumented)
    readonly routes: RouteCollection<TSettings>;
    // (undocumented)
    title: string;
}

// @beta (undocumented)
export interface RouteRecognizer<TSettings> {
    // (undocumented)
    add(routeOrRoutes: Route | readonly Route[], settings?: TSettings): void;
    // (undocumented)
    generateFromName(name: string, params: object): string | null;
    // (undocumented)
    generateFromPath(path: string, params: object): string | null;
    // (undocumented)
    recognize(path: string, converters?: Readonly<Record<string, RouteParameterConverter>>): Promise<RecognizedRoute<TSettings> | null>;
}

// @beta (undocumented)
export interface RouterElement extends HTMLElement {
    // Warning: (ae-forgotten-export) The symbol "routerProperty" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    readonly [routerProperty]: Router;
    // (undocumented)
    config: RouterConfiguration | null;
    // (undocumented)
    connectedCallback(): void;
    // (undocumented)
    disconnectedCallback(): void;
}

// @beta (undocumented)
export type RouterExecutionContext = ExecutionContext & {
    router?: Router;
};

// @beta (undocumented)
export interface RouteView {
    // (undocumented)
    appendTo(host: HTMLElement): void;
    // (undocumented)
    bind(allTypedParams: Readonly<Record<string, any>>): void;
    // (undocumented)
    context: RouterExecutionContext;
    // (undocumented)
    dispose(): void;
}

// @beta (undocumented)
export type SupportsSettings<TSettings = any> = {
    settings?: TSettings;
};

// @beta (undocumented)
export type TemplateFallbackRouteDefinition<TSettings = any> = LayoutAndTransitionRouteDefinition & HasTemplate & SupportsSettings<TSettings> & HasTitle;

// @beta (undocumented)
export type TemplateRouteDefinition<TSettings = any> = NavigableRouteDefinition<TSettings> & HasTemplate;

// @beta (undocumented)
export interface Transition {
    // (undocumented)
    begin(host: HTMLElement, prev: RouteView | null, next: RouteView): Promise<void>;
    // (undocumented)
    commit(host: HTMLElement, prev: RouteView | null, next: RouteView): Promise<void>;
    // (undocumented)
    rollback(host: HTMLElement, prev: RouteView | null, next: RouteView): Promise<void>;
}

// @beta (undocumented)
export const Transition: Readonly<{
    default: Readonly<Transition>;
}>;

// (No @packageDocumentation comment for this package)

```
