@stencil/router

  • Version 1.0.1
  • Published
  • 1.23 MB
  • 1 dependency
  • MIT license

Install

npm i @stencil/router
yarn add @stencil/router
pnpm add @stencil/router

Overview

Stencil Router

Index

Functions

function injectHistory

injectHistory: (Component: any) => void;

    function matchPath

    matchPath: (pathname: string, options?: MatchOptions) => MatchResults | null;
    • Public API for matching a URL pathname to a path pattern.

    Interfaces

    interface ActiveRouter

    interface ActiveRouter {}

      property dispatch

      dispatch: (
      location: LocationSegments,
      nextListeners: RouteSubscription[]
      ) => void;

        property subscribe

        subscribe: (
        location: LocationSegments,
        nextListeners: RouteSubscription[],
        routeSubscription: RouteSubscription
        ) => Listener;

          interface LocationSegments

          interface LocationSegments {}

            property hash

            hash?: string;

              property key

              key: string;

                property pathname

                pathname: string;

                  property query

                  query: {
                  [key: string]: any;
                  };

                    property scrollPosition

                    scrollPosition?: [number, number];

                      property search

                      search?: string;

                        property state

                        state?: any;

                          interface MatchOptions

                          interface MatchOptions {}

                            property exact

                            exact?: boolean;

                              property path

                              path?: Path;

                                property strict

                                strict?: boolean;

                                  interface MatchResults

                                  interface MatchResults {}

                                    property isExact

                                    isExact: boolean;

                                      property params

                                      params: {
                                      [key: string]: string;
                                      };

                                        property path

                                        path: string;

                                          property url

                                          url: string;

                                            interface RouteRenderProps

                                            interface RouteRenderProps {}

                                              property history

                                              history: RouterHistory;

                                                property match

                                                match: MatchResults;

                                                  index signature

                                                  [key: string]: any;

                                                    interface RouterHistory

                                                    interface RouterHistory {}

                                                      property action

                                                      action: string;

                                                        property block

                                                        block: (prompt?: string | Prompt) => () => void;

                                                          property createHref

                                                          createHref: (location: LocationSegments) => string;

                                                            property go

                                                            go: (n: number) => void;

                                                              property goBack

                                                              goBack: () => void;

                                                                property goForward

                                                                goForward: () => void;

                                                                  property length

                                                                  length: number;

                                                                    property listen

                                                                    listen: (listener: Function) => () => void;

                                                                      property location

                                                                      location: LocationSegments;

                                                                        property push

                                                                        push: (path: string | LocationSegments, state?: any) => void;

                                                                          property replace

                                                                          replace: (path: string | LocationSegments, state?: any) => void;

                                                                            property win

                                                                            win: Window;

                                                                              Type Aliases

                                                                              type Listener

                                                                              type Listener = () => void;

                                                                                Namespaces

                                                                                namespace Components

                                                                                namespace Components {}

                                                                                  interface StencilAsyncContent

                                                                                  interface StencilAsyncContent {}

                                                                                    property 'documentLocation'

                                                                                    documentLocation?: string;

                                                                                      interface StencilRoute

                                                                                      interface StencilRoute {}

                                                                                        property 'component'

                                                                                        component?: string;

                                                                                          property 'componentProps'

                                                                                          componentProps?: { [key: string]: any };

                                                                                            property 'componentUpdated'

                                                                                            componentUpdated?: (options: RouteViewOptions) => void;

                                                                                              property 'exact'

                                                                                              exact: boolean;

                                                                                                property 'group'

                                                                                                group: string | null;

                                                                                                  property 'history'

                                                                                                  history?: RouterHistory;

                                                                                                    property 'historyType'

                                                                                                    historyType?: HistoryType;

                                                                                                      property 'location'

                                                                                                      location?: LocationSegments;

                                                                                                        property 'match'

                                                                                                        match: MatchResults | null;

                                                                                                          property 'routeRender'

                                                                                                          routeRender?: (props: RouteRenderProps) => any;

                                                                                                            property 'routeViewsUpdated'

                                                                                                            routeViewsUpdated?: (options: RouteViewOptions) => void;

                                                                                                              property 'scrollTopOffset'

                                                                                                              scrollTopOffset?: number;

                                                                                                                property 'url'

                                                                                                                url?: string | string[];
                                                                                                                  interface StencilRouteLink {}

                                                                                                                    property 'activeClass'

                                                                                                                    activeClass: string;

                                                                                                                      property 'anchorClass'

                                                                                                                      anchorClass?: string;

                                                                                                                        property 'anchorId'

                                                                                                                        anchorId?: string;

                                                                                                                          property 'anchorRole'

                                                                                                                          anchorRole?: string;

                                                                                                                            property 'anchorTabIndex'

                                                                                                                            anchorTabIndex?: string;

                                                                                                                              property 'anchorTitle'

                                                                                                                              anchorTitle?: string;

                                                                                                                                property 'ariaHaspopup'

                                                                                                                                ariaHaspopup?: string;

                                                                                                                                  property 'ariaLabel'

                                                                                                                                  ariaLabel?: string;

                                                                                                                                    property 'ariaPosinset'

                                                                                                                                    ariaPosinset?: string;

                                                                                                                                      property 'ariaSetsize'

                                                                                                                                      ariaSetsize?: number;

                                                                                                                                        property 'custom'

                                                                                                                                        custom: string;
                                                                                                                                        • Custom tag to use instead of an anchor

                                                                                                                                        property 'exact'

                                                                                                                                        exact: boolean;

                                                                                                                                          property 'history'

                                                                                                                                          history?: RouterHistory;

                                                                                                                                            property 'location'

                                                                                                                                            location?: LocationSegments;

                                                                                                                                              property 'root'

                                                                                                                                              root?: string;

                                                                                                                                                property 'strict'

                                                                                                                                                strict: boolean;

                                                                                                                                                  property 'url'

                                                                                                                                                  url?: string;

                                                                                                                                                    property 'urlMatch'

                                                                                                                                                    urlMatch?: Path;

                                                                                                                                                      interface StencilRouter

                                                                                                                                                      interface StencilRouter {}

                                                                                                                                                        property 'historyType'

                                                                                                                                                        historyType: HistoryType;

                                                                                                                                                          property 'root'

                                                                                                                                                          root: string;

                                                                                                                                                            property 'scrollTopOffset'

                                                                                                                                                            scrollTopOffset?: number;

                                                                                                                                                              property 'titleSuffix'

                                                                                                                                                              titleSuffix: string;

                                                                                                                                                                interface StencilRouterPrompt

                                                                                                                                                                interface StencilRouterPrompt {}

                                                                                                                                                                  property 'history'

                                                                                                                                                                  history?: RouterHistory;

                                                                                                                                                                    property 'message'

                                                                                                                                                                    message: string | Prompt;

                                                                                                                                                                      property 'when'

                                                                                                                                                                      when: boolean;

                                                                                                                                                                        interface StencilRouterRedirect

                                                                                                                                                                        interface StencilRouterRedirect {}

                                                                                                                                                                          property 'history'

                                                                                                                                                                          history?: RouterHistory;

                                                                                                                                                                            property 'root'

                                                                                                                                                                            root?: string;

                                                                                                                                                                              property 'url'

                                                                                                                                                                              url?: string;

                                                                                                                                                                                interface StencilRouteSwitch

                                                                                                                                                                                interface StencilRouteSwitch {}

                                                                                                                                                                                  property 'group'

                                                                                                                                                                                  group: string;

                                                                                                                                                                                    property 'location'

                                                                                                                                                                                    location?: LocationSegments;

                                                                                                                                                                                      property 'routeViewsUpdated'

                                                                                                                                                                                      routeViewsUpdated?: (options: RouteViewOptions) => void;

                                                                                                                                                                                        property 'scrollTopOffset'

                                                                                                                                                                                        scrollTopOffset?: number;

                                                                                                                                                                                          interface StencilRouteTitle

                                                                                                                                                                                          interface StencilRouteTitle {}

                                                                                                                                                                                            property 'pageTitle'

                                                                                                                                                                                            pageTitle: string;

                                                                                                                                                                                              property 'titleSuffix'

                                                                                                                                                                                              titleSuffix: string;

                                                                                                                                                                                                Package Files (5)

                                                                                                                                                                                                Dependencies (1)

                                                                                                                                                                                                Dev Dependencies (1)

                                                                                                                                                                                                Peer Dependencies (0)

                                                                                                                                                                                                No peer dependencies.

                                                                                                                                                                                                Badge

                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@stencil/router.

                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@stencil/router)
                                                                                                                                                                                                • HTML
                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/@stencil/router"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>