@types/history

  • Version 4.7.8
  • Published
  • 10.9 kB
  • No dependencies
  • MIT license

Install

npm i @types/history
yarn add @types/history
pnpm add @types/history

Overview

TypeScript definitions for history

Index

Functions

function createBrowserHistory

createBrowserHistory: <S = unknown>(
options?: BrowserHistoryBuildOptions
) => History<S>;

    function createHashHistory

    createHashHistory: <S = unknown>(
    options?: HashHistoryBuildOptions
    ) => History<S>;

      function createLocation

      createLocation: <S = unknown>(
      path: LocationDescriptor<S>,
      state?: S,
      key?: LocationKey,
      currentLocation?: Location<S>
      ) => Location<S>;

        function createMemoryHistory

        createMemoryHistory: <S = unknown>(
        options?: MemoryHistoryBuildOptions
        ) => MemoryHistory<S>;

          function createPath

          createPath: <S>(location: LocationDescriptorObject<S>) => Path;

            function locationsAreEqual

            locationsAreEqual: <S = unknown>(
            lv: LocationDescriptor<S>,
            rv: LocationDescriptor<S>
            ) => boolean;

              function parsePath

              parsePath: (path: Path) => Location;

                Interfaces

                interface BrowserHistoryBuildOptions

                interface BrowserHistoryBuildOptions {}

                  property basename

                  basename?: string;

                    property forceRefresh

                    forceRefresh?: boolean;

                      property getUserConfirmation

                      getUserConfirmation?: typeof getConfirmation;

                        property keyLength

                        keyLength?: number;

                          interface HashHistoryBuildOptions

                          interface HashHistoryBuildOptions {}

                            property basename

                            basename?: string;

                              property getUserConfirmation

                              getUserConfirmation?: typeof getConfirmation;

                                property hashType

                                hashType?: HashType;

                                  interface History

                                  interface History<HistoryLocationState = LocationState> {}

                                    property action

                                    action: Action;

                                      property length

                                      length: number;

                                        property location

                                        location: Location<HistoryLocationState>;

                                          method block

                                          block: (
                                          prompt?: boolean | string | TransitionPromptHook<HistoryLocationState>
                                          ) => UnregisterCallback;

                                            method createHref

                                            createHref: (location: LocationDescriptorObject<HistoryLocationState>) => Href;

                                              method go

                                              go: (n: number) => void;

                                                method goBack

                                                goBack: () => void;

                                                  method goForward

                                                  goForward: () => void;

                                                    method listen

                                                    listen: (listener: LocationListener<HistoryLocationState>) => UnregisterCallback;

                                                      method push

                                                      push: {
                                                      (path: Path, state?: HistoryLocationState): void;
                                                      (location: LocationDescriptor<HistoryLocationState>): void;
                                                      };

                                                        method replace

                                                        replace: {
                                                        (path: Path, state?: HistoryLocationState): void;
                                                        (location: LocationDescriptor<HistoryLocationState>): void;
                                                        };

                                                          interface Location

                                                          interface Location<S = LocationState> {}

                                                            property hash

                                                            hash: Hash;

                                                              property key

                                                              key?: LocationKey;

                                                                property pathname

                                                                pathname: Pathname;

                                                                  property search

                                                                  search: Search;

                                                                    property state

                                                                    state: S;

                                                                      interface LocationDescriptorObject

                                                                      interface LocationDescriptorObject<S = LocationState> {}

                                                                        property hash

                                                                        hash?: Hash;

                                                                          property key

                                                                          key?: LocationKey;

                                                                            property pathname

                                                                            pathname?: Pathname;

                                                                              property search

                                                                              search?: Search;

                                                                                property state

                                                                                state?: S;

                                                                                  interface MemoryHistory

                                                                                  interface MemoryHistory<HistoryLocationState = LocationState>
                                                                                  extends History<HistoryLocationState> {}

                                                                                    property entries

                                                                                    entries: Location<HistoryLocationState>[];

                                                                                      property index

                                                                                      index: number;

                                                                                        method canGo

                                                                                        canGo: (n: number) => boolean;

                                                                                          interface MemoryHistoryBuildOptions

                                                                                          interface MemoryHistoryBuildOptions {}

                                                                                            property getUserConfirmation

                                                                                            getUserConfirmation?: typeof getConfirmation;

                                                                                              property initialEntries

                                                                                              initialEntries?: string[];

                                                                                                property initialIndex

                                                                                                initialIndex?: number;

                                                                                                  property keyLength

                                                                                                  keyLength?: number;

                                                                                                    interface Module

                                                                                                    interface Module {}

                                                                                                      property createBrowserHistory

                                                                                                      createBrowserHistory: typeof createBrowserHistory;

                                                                                                        property createHashHistory

                                                                                                        createHashHistory: typeof createHashHistory;

                                                                                                          property createLocation

                                                                                                          createLocation: typeof createLocation;

                                                                                                            property createMemoryHistory

                                                                                                            createMemoryHistory: typeof createMemoryHistory;

                                                                                                              property createPath

                                                                                                              createPath: typeof createPath;

                                                                                                                property locationsAreEqual

                                                                                                                locationsAreEqual: typeof locationsAreEqual;

                                                                                                                  property parsePath

                                                                                                                  parsePath: typeof parsePath;

                                                                                                                    Type Aliases

                                                                                                                    type Action

                                                                                                                    type Action = 'PUSH' | 'POP' | 'REPLACE';

                                                                                                                      type Hash

                                                                                                                      type Hash = History.Hash;

                                                                                                                        type HashType

                                                                                                                        type HashType = 'hashbang' | 'noslash' | 'slash';

                                                                                                                          type Href

                                                                                                                          type Href = History.Href;

                                                                                                                            type LocationDescriptor

                                                                                                                            type LocationDescriptor<S = LocationState> = History.LocationDescriptor<S>;

                                                                                                                              type LocationKey

                                                                                                                              type LocationKey = History.LocationKey;

                                                                                                                                type LocationListener

                                                                                                                                type LocationListener<S = LocationState> = History.LocationListener<S>;

                                                                                                                                  type LocationState

                                                                                                                                  type LocationState = History.LocationState;

                                                                                                                                    type Path

                                                                                                                                    type Path = History.Path;

                                                                                                                                      type Pathname

                                                                                                                                      type Pathname = History.Pathname;
                                                                                                                                        type Search = History.Search;

                                                                                                                                          type TransitionHook

                                                                                                                                          type TransitionHook<S = LocationState> = History.TransitionHook<S>;

                                                                                                                                            type TransitionPromptHook

                                                                                                                                            type TransitionPromptHook<S = LocationState> = History.TransitionPromptHook<S>;

                                                                                                                                              type UnregisterCallback

                                                                                                                                              type UnregisterCallback = () => void;

                                                                                                                                                Namespaces

                                                                                                                                                namespace History

                                                                                                                                                namespace History {}

                                                                                                                                                  type Hash

                                                                                                                                                  type Hash = string;

                                                                                                                                                    type Href

                                                                                                                                                    type Href = string;

                                                                                                                                                      type LocationDescriptor

                                                                                                                                                      type LocationDescriptor<S = LocationState> = Path | LocationDescriptorObject<S>;

                                                                                                                                                        type LocationKey

                                                                                                                                                        type LocationKey = string;

                                                                                                                                                          type LocationListener

                                                                                                                                                          type LocationListener<S = LocationState> = (
                                                                                                                                                          location: Location<S>,
                                                                                                                                                          action: Action
                                                                                                                                                          ) => void;

                                                                                                                                                            type LocationState

                                                                                                                                                            type LocationState = unknown;

                                                                                                                                                              type Path

                                                                                                                                                              type Path = string;

                                                                                                                                                                type Pathname

                                                                                                                                                                type Pathname = string;

                                                                                                                                                                  type Search

                                                                                                                                                                  type Search = string;

                                                                                                                                                                    type TransitionHook

                                                                                                                                                                    type TransitionHook<S = LocationState> = (
                                                                                                                                                                    location: Location<S>,
                                                                                                                                                                    callback: (result: any) => void
                                                                                                                                                                    ) => any;

                                                                                                                                                                      type TransitionPromptHook

                                                                                                                                                                      type TransitionPromptHook<S = LocationState> = (
                                                                                                                                                                      location: Location<S>,
                                                                                                                                                                      action: Action
                                                                                                                                                                      ) => string | false | void;

                                                                                                                                                                        Package Files (6)

                                                                                                                                                                        Dependencies (0)

                                                                                                                                                                        No dependencies.

                                                                                                                                                                        Dev Dependencies (0)

                                                                                                                                                                        No dev dependencies.

                                                                                                                                                                        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/@types/history.

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