react-view-router
Version:
react-view-router
30 lines (29 loc) • 1.36 kB
TypeScript
import { State, History, HashType, To, HistoryOptions } from './types';
/**
* A hash history stores the current location in the fragment identifier portion
* of the URL in a web browser environment.
*
* This is ideal for apps that do not control the server for some reason
* (because the fragment identifier is never sent to the server), including some
* shared hosting environments that do not provide fine-grained controls over
* which pages are served at which URLs.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#hashhistory
*/
export interface HashHistory<S extends State = State> extends History<S> {
readonly hashType: HashType;
}
export interface HashHistoryOptions extends HistoryOptions {
window?: Window;
hashType?: HashType;
}
export declare function createHashHref(to: To, hashType?: HashType, _window?: any): string;
/**
* Hash history stores the location in window.location.hash. This makes it ideal
* for situations where you don't want to send the location to the server for
* some reason, either because you do cannot configure it or the URL space is
* reserved for something else.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#createhashhistory
*/
export declare function createHashHistory(options?: HashHistoryOptions): HashHistory;