/** * @license * @preserve * * Copyright 2026 KeeeX SAS * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ import { type AxiosRequestConfig } from "axios"; import type * as typeAuth from "../types/auth.js"; /** Function to add authentication info in a request */ export type AddAuthFn = (axiosRequestConfig: AxiosRequestConfig) => Promise; /** Manage headers for authentication methods */ export declare class AuthenticationHeaders { #private; constructor(initialValues: typeAuth.AuthMethodHeaders); /** * Set the headers used when `authentication === true`. * * If a property have a `null` value, this header will be forcibly removed when applied. */ setDefaultHeaders: (headers: Record) => void; setHeaders: (authenticationMethod: string, headers: Record) => void; /** * Remove some authentication headers. * * @param nullRemove - If `false` (the default), will completely delete the entry, as if it never existed. * If `true`, will set all known properties to `null` so that they are actively cleaned. */ clearHeaders: (authenticationMethod?: string, nullRemove?: boolean) => void; /** * Apply the requested authentication method, if available. * * @param failOnMissing - If `true`, will throw an error if the requested auth method is not * configured. */ applyHeaders: (authenticationMethod: string | boolean, axiosRequestConfig: AxiosRequestConfig, failOnMissing?: boolean) => void; }