/** * The identity-bearing subset of an `openapi-fetch` request init, canonicalized * so that two structurally equivalent requests produce one cache entry. * * Only path params, query params, and the request body identify a resource. * Per-call transport concerns (`signal`, `fetch`, serializers, `headers`, * `baseUrl`, `parseAs`) are deliberately excluded: they are either * non-serializable, or — in the case of headers — carry credentials that have * no business being visible in a cache key or in devtools. */ export type SanitizedQueryInit = { path?: Record; query?: Record; body?: unknown; }; /** * The derived key shape: `[method, path, sanitized(init)]`. The first two * elements are the operation itself, so react-query's default prefix matching * invalidates every cached variant of an endpoint via `[method, path]`. */ export type QueryApiKey = readonly [ method: TMethod, path: TPath, init: SanitizedQueryInit ]; /** * Recursively rewrites plain objects with their keys in sorted order and their * `undefined`-valued properties removed. Arrays keep their order (query-array * order is significant on the wire) and every other value is passed through by * reference. * * react-query's own `hashKey` already sorts object keys before hashing, so this * is not what makes two orderings hit the same cache entry. What it buys is * everything that compares keys *structurally* rather than by hash: partial * `invalidateQueries` matching (`partialDeepEqual` is order- and * `undefined`-sensitive), `exact` filters, and reading a key in devtools. */ export declare function canonicalizeQueryKeyValue(value: unknown): unknown; /** * Reduces an `openapi-fetch` init to its canonical, identity-bearing form. * * Empty and all-`undefined` param records collapse to absent, so * `undefined`, `{}`, and `{ params: { query: { after: undefined } } }` all * sanitize to the same value and therefore share a cache entry. */ export declare function sanitizeQueryInit(init: unknown): SanitizedQueryInit; /** Builds the untyped `[method, path, sanitized(init)]` key. */ export declare function buildQueryApiKey(method: TMethod, path: TPath, init?: unknown): QueryApiKey; /** The `${method} ${path}` token an endpoint is registered and matched under. */ export declare function operationToken(method: string, path: string): string;