/** * Attempt to parse json into a POJO. * * @param json - The JSON object to parse. */ export declare function tryParseJSON(json: unknown): T | undefined; /** * Check if the given `value` is JSON or a POJO. * * @param value - The value to check. */ export declare function isObjOrJSON(value: unknown): boolean; /** * If an object return otherwise try to parse it as json. * * @param value */ export declare function objOrParseJSON(value: unknown): T | undefined; /** * Load image avoiding xhr/fetch CORS issues. Server status can't be obtained this way * unfortunately, so this uses "naturalWidth" to determine if the image has been loaded. By * default it checks if it is at least 1px. * * @param src - The URL of where the image resource is located. * @param minWidth - The minimum width for a valid image to be loaded. */ export declare function loadImage(src: string, minWidth?: number): Promise; /** * Loads a script into the DOM. * * @param src The URL of where the script is located. */ export declare function loadScript(src: string): Promise; /** * Tries to parse json and return a object. * * @param data */ export declare function decodeJSON(data: unknown): T | undefined; /** * Attempts to safely decode a URI component, on failure it returns the given fallback. * * @param component * @param fallback * @param isClient */ export declare function tryDecodeURIComponent(component: string, fallback?: string, isClient?: boolean): string; /** * Returns a simple key/value map and duplicate keys are merged into an array. * * @param qs - The query string to parse. * @link https://github.com/ampproject/amphtml/blob/c7c46cec71bac92f5c5da31dcc6366c18577f566/src/url-parse-query-string.js#L31 */ export declare function parseQueryString(qs?: string): T; export declare type Params = Record; /** * Serializes the given params into a query string. * * @param params */ export declare function serializeQueryString(params: Params): string; /** * Notifies the browser to start establishing a connection with the given URL. * * @param url * @param rel * @param isClient */ export declare function preconnect(url: string, rel?: 'preconnect' | 'prefetch' | 'preload', isClient?: boolean): boolean; /** * Safely appends the given query string to the given URL. * * @param url * @param qs */ export declare function appendQueryStringToURL(url: string, qs?: string): string; /** * Serializes the given params into a query string and appends them to the given URL. * * @param url * @param params */ export declare function appendParamsToURL(url: string, params: string | Params): string; /** * Tries to convert a query string into a object. * * @param qs */ export declare function decodeQueryString(qs: string): T | undefined; export declare class ScriptLoader { private static pendingRequests; static load(src: string): Promise; } //# sourceMappingURL=network.d.ts.map