/** * Custom fetch selector function. * * This module provides a function to select the appropriate custom fetch * implementation based on configuration. It evaluates various feature flags * and returns the corresponding custom fetch function, or undefined to use * the default fetch implementation. * * @module */ import type { Logger } from '../../logger/index.js'; import type { FetchProgressEvent } from '../types/progress-event.types.js'; /** * Configuration for custom fetch selection. */ export type CustomFetchConfig = { /** * Logger instance for custom fetch implementations. */ readonly logger: Logger; /** * Whether to enable progress logging. */ readonly enableProgressLog: boolean; /** * Base fetch function to wrap with progress tracking. * If not provided, uses global fetch. */ readonly baseFetch?: typeof fetch; /** * Optional callback for progress events. */ readonly onProgressEvent?: (event: FetchProgressEvent) => void; }; /** * Select appropriate custom fetch function based on configuration. * * This function evaluates the provided configuration and returns the appropriate * custom fetch function. If no custom features are needed, it returns undefined * to allow the default fetch implementation to be used. * * @param config - Configuration for custom fetch selection * @returns Custom fetch function or undefined for default behavior * * @example * ```typescript * const customFetch = selectCustomFetch({ * logger: myLogger, * enableProgressLog: true, * }); * * const client = createProtoPediaClient({ * fetch: customFetch, // undefined uses default fetch * }); * ``` */ export declare function selectCustomFetch(config: CustomFetchConfig): typeof fetch | undefined; //# sourceMappingURL=select-custom-fetch.d.ts.map