@pageworks/pjax
Version:
Turns any website into a SPA using Fetch and link prefetching.
50 lines (42 loc) • 1.37 kB
TypeScript
export {Pjax as default};
export as namespace Pjax;
declare class Pjax {
constructor(options?: Partial<Pjax.IOptions>);
public static load: (url:string)=>void;
}
declare namespace Pjax{
export interface IOptions{
elements?: string;
selectors?: Array<string>;
history?: boolean;
cacheBust?: boolean;
debug?: boolean;
titleSwitch?: boolean;
customTransitions?: boolean;
customPreventionAttributes?: Array<string>;
importScripts?: boolean;
importCSS?: boolean;
scriptImportLocation?: HTMLElement|HTMLHeadElement;
requireCssBeforeComplete?: boolean;
}
export interface IScrollPosition{
x: number;
y: number;
}
export interface ICacheObject{
status: number;
document: Document;
url: string;
}
export interface IEventOptions{
triggerElement: Element;
}
export interface ISwitchObject{
new: Element;
current: Element;
}
export interface ICachedSwitchOptions{
queue: Array<ISwitchObject>;
title?: string;
}
}