import { Obj } from '@mathigon/core'; declare global { interface Window { csrfToken: string; } } type PostData = Obj; /** Converts a JSON object to an HTML query string. */ export declare function toQueryString(data: PostData): string; /** Converts an HTML query string to JSON object. */ export declare function fromQueryString(str: string): Obj; /** * Asynchronously loads a resource using a POST request. This utility function * automatically form-encodes JSON data and adds a CSRF header. */ export declare function post(url: string, data?: FormData | PostData): Promise; /** Asynchronously loads and executes a JS script. */ export declare function loadScript(src: string): Promise; /** Asynchronously loads an Image. */ export declare function loadImage(url: string, credentials?: boolean): Promise; export declare const loadImageDataURI: (url: string) => Promise; /** * Utility function to throttle repeated POST requests. A request to the same * URL will be made at most every 5s, and the corresponding data objects will * be deep-merged. */ export declare function deferredPost(url: string, data: PostData): void; export {};