export declare const EMPTY_VALUE: unique symbol; type QValue = string | number | boolean | typeof EMPTY_VALUE; export type QueryList = readonly (readonly [key: string, value: QValue])[]; export type QueryObject = Record; export type Query = QueryList | QueryObject; type Options = { method?: "GET" | "POST"; }; /** * Fetches a URL and returns the response * @param path Path to resource, e.g. "clan_basement.php" * @param query Query parameters, * either as an object, e.g. { action: "cleansewer" }, * or as a list of [key, value] pairs, e.g. [["action", "cleansewer"]] * @param options Additional options * @param options.method HTTP method to use, either "GET" or "POST", defaults to "POST" * @returns the response from visiting the URL */ export declare function fetchUrl(path: string, query?: Query, options?: Options): string; /** * Builds a URL from a path and query * @param path Path to resource, e.g. "clan_basement.php" * @param query Query parameters, * either as an object, e.g. { action: "cleansewer" }, * or as a list of [key, value] pairs, e.g. [["action", "cleansewer"]] * @returns the constructed URL, e.g. "clan_basement.php?action=cleansewer" */ export declare function buildUrl(path: string, query?: Query): string; /** * Combines a list of queries into a single query * @param queries a list of query objects and/or arrays, can be mixed * @returns a single query */ export declare function combineQuery(...queries: Query[]): Query; export {};