mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Historyjs: added missed methods, arguments and fields (#14899)
* Historyjs: changed: * pushState: added queue arg (optional) * replaceState: added queue arg (optional) * getState: added friendly, create args (optional) added: * method getStateId * method getStateById * method setTitle * method clearQueue * method clearAllIntervals * method getRootUrl * field emulated HistroyState: added: * field hashedUrl * field cleanUrl * history.js: added missed return types
This commit is contained in:
committed by
Mohamed Hegazy
parent
ff4dd92b0e
commit
1f7df95edb
Vendored
+23
-5
@@ -20,9 +20,11 @@ interface Historyjs {
|
||||
|
||||
enabled: boolean;
|
||||
|
||||
pushState(data: any, title: string, url: string): void;
|
||||
replaceState(data: any, title: string, url: string): void;
|
||||
getState(): HistoryState;
|
||||
pushState(data: any, title: string, url: string, queue?: boolean): boolean;
|
||||
replaceState(data: any, title: string, url: string, queue?: boolean): boolean;
|
||||
getState(friendly?: boolean, create?: boolean): HistoryState;
|
||||
getStateId (passedState: HistoryState): string;
|
||||
getStateById (id: string): HistoryState;
|
||||
getStateByIndex(index: number): HistoryState;
|
||||
getCurrentIndex(): number;
|
||||
getHash(): string;
|
||||
@@ -37,12 +39,30 @@ interface Historyjs {
|
||||
debug(...messages: any[]): void;
|
||||
|
||||
options: HistoryOptions;
|
||||
|
||||
/**
|
||||
* History.setTitle(title)
|
||||
* Applies the title to the document
|
||||
* @param {HistoryState} newState
|
||||
* @return {Boolean}
|
||||
*/
|
||||
setTitle (newState: HistoryState): boolean
|
||||
clearQueue(): Historyjs;
|
||||
clearAllIntervals(): void;
|
||||
getRootUrl(): string;
|
||||
|
||||
emulated: {
|
||||
hashChange?: any;
|
||||
pushState?: any;
|
||||
}
|
||||
}
|
||||
|
||||
interface HistoryState {
|
||||
data?: any;
|
||||
title?: string;
|
||||
url: string;
|
||||
hashedUrl?: string;
|
||||
cleanUrl?: string;
|
||||
}
|
||||
|
||||
interface HistoryOptions {
|
||||
@@ -56,6 +76,4 @@ interface HistoryOptions {
|
||||
initialTitle?: string;
|
||||
html4Mode?: boolean;
|
||||
delayInit?: number;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user