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 - URL source to normalize; may already be a string or carry query parameters to append. * @returns Fully resolved request URL ready to pass to `fetch`. */ 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;