import { Dict } from 'spica/dict'; export default Pjax; export class Pjax { static assign(url: string, config: Config): boolean; static replace(url: string, config: Config): boolean; static sync(isPjaxPage?: boolean): void; static pushURL(url: string, title: string, state?: any): void; static replaceURL(url: string, title: string, state?: any): void; constructor(config: Config); assign(url: string): boolean; replace(url: string): boolean; } export interface Config { readonly areas?: string[]; readonly link?: string; readonly filter?: (el: HTMLAnchorElement | HTMLAreaElement) => boolean; readonly form?: string; readonly replace?: string; readonly memory?: Dict; readonly fetch?: { readonly rewrite?: (url: string, method: string, headers: Headers, timeout: number, body: FormData | null, memory?: Document) => XMLHttpRequest | undefined; readonly headers?: Headers; readonly timeout?: number; readonly wait?: number; }; readonly update?: { readonly rewrite?: (url: string, document: Document, area: string, memory?: Document) => void; readonly head?: string; readonly css?: boolean; readonly script?: boolean; readonly ignore?: string; readonly reload?: string; readonly log?: string; }; readonly fallback?: (target: HTMLAnchorElement | HTMLAreaElement | HTMLFormElement | Window, reason: unknown) => void; readonly sequence?: Sequence; readonly scope?: Record; readonly isolation?: boolean; } export interface Sequence { readonly fetch: (result: void, request: { path: string; method: string; headers: Headers; body: FormData | null; }) => PromiseLike; readonly unload: (result: a, response: { url: string; header: (name: string) => string | null; document: Document; }) => PromiseLike; readonly content: (result: b, areas: HTMLElement[]) => PromiseLike; readonly ready: (result: c) => PromiseLike; readonly load: (result: d, events: Event[]) => PromiseLike; } declare global { interface WindowEventMap { 'pjax:fetch': Event; 'pjax:unload': Event; 'pjax:load': Event; } interface DocumentEventMap { 'pjax:content': Event; 'pjax:ready': Event; } } export class FakeXMLHttpRequest extends XMLHttpRequest { public static create(url: string, response: Document | PromiseLike): FakeXMLHttpRequest; }