Skip to main content

Class: BaseRouter

Hierarchy

Implements

Constructors

constructor

new BaseRouter()

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:26

Properties

history

history: Location[]

Implementation of

Router.history

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:22


i18n

i18n: I18n = {}

Implementation of

Router.i18n

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:21


params

params: AnonymousObject<any> = {}

Implementation of

Router.params

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:23


route

Optional route: string

Implementation of

Router.route

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:24


settings

settings: AppSettings = {}

Implementation of

Router.settings

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:20

Accessors

hash

get hash(): undefined | null | ParsedQuery<string>

Returns

undefined | null | ParsedQuery<string>

Implementation of

Router.hash

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:38


href

get href(): undefined | null | string

Returns

undefined | null | string

Implementation of

Router.href

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:46


location

get location(): Location

Returns

Location

Implementation of

Router.location

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:30


pathname

get pathname(): null | string

Returns

null | string

Implementation of

Router.pathname

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:50


previousLocation

get previousLocation(): Location

Returns

Location

Implementation of

Router.previousLocation

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:34


query

get query(): undefined | null | ParsedQuery<string>

Returns

undefined | null | ParsedQuery<string>

Implementation of

Router.query

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:42


state

get state(): undefined | null | AnonymousObject<any>

Returns

undefined | null | AnonymousObject<any>

Implementation of

Router.state

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:54

Methods

_pushLocation

_pushLocation(location, replace?): void

Parameters

NameTypeDefault value
locationLocationundefined
replacebooleanfalse

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:130


back

Abstract back(delta?): void

Parameters

NameType
delta?number

Returns

void

Implementation of

Router.back

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:58


deleteOrigin

deleteOrigin(): void

Returns

void

Implementation of

Router.deleteOrigin

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:60


forward

Abstract forward(delta?): void

Parameters

NameType
delta?number

Returns

void

Implementation of

Router.forward

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:64


getLinkComponent

Abstract getLinkComponent(props, ref): Element

Parameters

NameType
propsLinkProps
refnull | MutableRefObject<null | HTMLAnchorElement> | (instance: null | HTMLAnchorElement) => void

Returns

Element

Implementation of

Router.getLinkComponent

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:66


getOrigin

getOrigin(): Object

Returns

Object

NameType
fromstring

Implementation of

Router.getOrigin

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:75


getReactContext

getReactContext(): Context<any>

Returns

Context<any>

Implementation of

Router.getReactContext

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:71


init

init(settings): void

Parameters

NameType
settingsAppSettings

Returns

void

Implementation of

Router.init

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:80


listen

Abstract listen(callback): UnregisterCallback

callback(url) where url is: { url: string, // example: /users/1?test=1&test2#h=3&h2 route: string, // example: /users/[id] pathname: string, // example: /users/1 query: obj, // example: {test:1,test2:null} hash: obj // example: {h:3, h2:null} state: obj // example: {key1: 'value1'} }

Parameters

NameType
callbackLocationChangeCallback

Returns

UnregisterCallback

Implementation of

Router.listen

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:95


push

Abstract push(urlOrLocation, options?): void

url can be a string or a location. If location, the format is the following { url: string, // example: /users/1?test=1&test2#h=3&h2 route: string, // example: /users/[id] pathname: string, // example: /users/1 query: obj, // example: {test:1,test2:null} hash: obj // example: {h:3, h2:null} state: obj // example: {key1: 'value1'} }

Parameters

NameType
urlOrLocationstring | Location
options?RouterPushOptions

Returns

void

Implementation of

Router.push

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:109


replace

Abstract replace(urlOrLocation, options?): void

Parameters

NameType
urlOrLocationstring | Location
options?RouterPushOptions

Returns

void

Implementation of

Router.replace

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:111


saveOrigin

saveOrigin(force?): void

Parameters

NameTypeDefault value
forcebooleantrue

Returns

void

Implementation of

Router.saveOrigin

Defined in

onekijs/packages/onekijs-framework/src/router/Router.ts:113