import type { KyHeadersInit, Options } from '../types/options.js'; import type { Hooks, NormalizedHooks } from '../types/hooks.js'; /** Wraps a value so that `ky.extend()` will replace the parent value instead of merging with it. Works with hooks, headers, search parameters, context, and any other deep-merged option. Inside the `json` option, which holds your own data, use it only where it replaces an inherited value. Ky does not look for it anywhere else there. The `context` option is merged shallowly, so only a wrapper around the whole `context` is supported. By default, `.extend()` deep-merges options with the parent instance: hooks get appended, headers get merged, and search parameters get accumulated. Use `replaceOption` when you want to fully replace a merged property instead. @example ``` import ky, {replaceOption} from 'ky'; const base = ky.create({ hooks: {beforeRequest: [addAuth, addTracking]}, }); // Replaces instead of appending const extended = base.extend({ hooks: replaceOption({beforeRequest: [onlyThis]}), }); // hooks.beforeRequest is now [onlyThis], not [addAuth, addTracking, onlyThis] ``` */ export declare const replaceOption: (value: T) => T; export declare const validateAndMerge: (...sources: Array | undefined>) => Partial; export declare const mergeHeaders: (source1?: KyHeadersInit, source2?: KyHeadersInit) => Headers; export declare const cloneShallow: (value: T) => T; export declare const cloneSearchParameters: (value: T) => T; export declare const cloneDeep: (value: T, seen?: WeakMap | unknown[], unknown>) => T; export declare const mergeHeaderContainers: (source1: KyHeadersInit, source2: KyHeadersInit) => Record; export declare const mergeHooks: (original?: Hooks, incoming?: Hooks) => NormalizedHooks; export declare const deletedParametersSymbol: unique symbol; export type MarkedSearchParameters = URLSearchParams & { [deletedParametersSymbol]?: Set; }; export declare const deepMerge: (...sources: Array | undefined>) => T;