import { type ArrayOrValue, type Maybe } from '@dereekb/util'; export type SimpleFetchURLInput = URL | string; export interface FetchURLConfiguration { /** * Base URL to use */ url: SimpleFetchURLInput; /** * Query parameters to append to the url. */ queryParams?: FetchURLQueryParamsInput; } export type FetchURLInput = SimpleFetchURLInput | FetchURLConfiguration; /** * Resolves a FetchURLInput to a URL string. Handles plain strings, URL objects, and * FetchURLConfiguration objects by appending query parameters when provided. * * @param input - a string, URL, or FetchURLConfiguration to resolve * @returns the resolved URL as a string */ export declare function fetchURL(input: FetchURLInput): string; /** * Type guard that checks whether the given value is a URL instance. * * @param input - the value to test * @returns true if the input is a URL instance */ export declare function isURL(input: unknown): input is URL; /** * Type guard that checks whether the given value is a URLSearchParams instance. * * @param input - the value to test * @returns true if the input is a URLSearchParams instance */ export declare function isURLSearchParams(input: unknown): input is URLSearchParams; export type FetchURLQueryParamsInput = URLSearchParams | FetchURLSearchParamsObject | Iterable | Iterable | string; export type FetchURLQueryKeyValueStringTuple = [string, string]; /** * Converts the input * * @param input * @returns */ export declare function fetchURLQueryKeyValueStringTuples(input: Iterable): FetchURLQueryKeyValueStringTuple[]; export type FetchURLQueryKeyValueTuple = [Maybe, Maybe>>]; export type FetchURLQueryKeyValueTupleKey = string | number; export type FetchURLQueryKeyValueTupleKeyValue = string | number | boolean; /** * Converts a FetchURLQueryParamsInput value (URLSearchParams, string, iterable of tuples, or * params object) into a URLSearchParams instance. * * @param input - the query parameters input to convert * @returns a URLSearchParams instance representing the input */ export declare function queryParamsToSearchParams(input: FetchURLQueryParamsInput): URLSearchParams; export type FetchURLSearchTupleValueKey = string | number; export type FetchURLSearchTupleValue = string | number; export type FetchURLSearchParamsObject = Partial>>>; /** * Converts a FetchURLSearchParamsObject (a plain key-value record) into a URLSearchParams instance, * expanding array values into multiple entries for the same key and filtering out null/undefined values. * * @param input - the params object to convert * @returns a URLSearchParams instance representing the input object */ export declare function fetchURLSearchParamsObjectToURLSearchParams(input: FetchURLSearchParamsObject): URLSearchParams;