/** * All valid formats `fetchData` supports. */ export declare enum Formats { JSON = "json", TEXT = "text" } /** * The default timeout for `fetchData` when run on the server. * No timeout is used on the client. */ export declare const DEFAULT_SERVER_TIMEOUT = 1500; /** * Fetch data from a given `url` with `headers` and then parse the response * assuming it is of type `format`. On the server wait a max of `timeout` and * throw if the response does not succeed. If it succeeds return the parsed * data. * * @param url The URL to fetch data from. * @param headers Headers to send to the server with the request (default: none). * @param format The expected content type of the data (default: JSON). * @param timeout Maximum wait time for response (server only) (default: `DEFAULT_SERVER_TIMEOUT`). */ export declare function fetchData(url: string, headers?: { [key: string]: string; }, format?: Formats, timeout?: number): Promise; //# sourceMappingURL=index.d.ts.map