mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-27 22:14:40 +01:00
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
export declare global {
|
|
interface Document {
|
|
addEventListener<K extends keyof CustomEventMap>(
|
|
type: K,
|
|
listener: (this: Document, ev: CustomEventMap[K]) => void,
|
|
): void
|
|
removeEventListener<K extends keyof CustomEventMap>(
|
|
type: K,
|
|
listener: (this: Document, ev: CustomEventMap[K]) => void,
|
|
): void
|
|
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K] | UIEvent): void
|
|
}
|
|
/** A page fetched ahead by prefetch.inline.ts (`url` is where it came from, after redirects). */
|
|
interface PrefetchedPage {
|
|
url: string
|
|
contentType: string
|
|
/** The HTML; missing when the link turned out not to be a page. */
|
|
text?: string
|
|
}
|
|
interface Window {
|
|
spaNavigate(url: URL, isBack: boolean = false)
|
|
addCleanup(fn: (...args: any[]) => void)
|
|
/**
|
|
* Set when prefetching is on: the page at `url` from the prefetch cache, or fetched now and
|
|
* kept (undefined if it could not be fetched).
|
|
*/
|
|
quartzPrefetch?: {
|
|
load(url: URL): Promise<PrefetchedPage | undefined>
|
|
}
|
|
/** Absolute URL of the site's static/ folder (renderPage.tsx) */
|
|
quartzStaticUrl?: string
|
|
/** Prefetch settings, written by componentResources.ts ahead of prefetch.inline.ts */
|
|
__quartzPrefetchMode?: "viewport" | "hover"
|
|
__quartzSpa?: boolean
|
|
}
|
|
}
|