/** * Module representing the `TokensData` class, which manages a dictionary of tokens and allows * adding, removing, and retrieving tokens, as well as setting a default token. * * @module tokens-data */ import { TokensData as ITokensData } from '../types/transport.types'; /** * Class representing a dictionary of tokens with a default token ID. */ export declare class TokensData implements ITokensData { private tokens; private defaultId; constructor(tokens?: { [key: string]: string; }, defaultId?: string); /** * Adds a new token to the tokens dictionary. * * @param {string} tokenId - The unique identifier of the token. * @param {string} token - The token value. * @return {boolean} True if the token was added successfully, false if the token already exists. */ addToken(tokenId: string, token: string): boolean; /** * Removes a token from the tokens dictionary and updates the default token if necessary. * * @param {string} tokenId - The unique identifier of the token to remove. * @param {string} [defaultId] - The new default token ID. If not provided, the first remaining token will be used. * @return {boolean} True if the token was removed successfully, false if the token does not exist or the default ID is invalid. */ removeToken(tokenId: string, defaultId?: string): boolean; /** * Retrieves a token from the tokens dictionary by its unique identifier. * * @param {string} tokenId - The unique identifier of the token to retrieve. * @return {string | undefined} The token value if found, or undefined if not found. */ getToken(tokenId: string): string | undefined; /** * Sets the default token ID. * * @param {string} tokenId - The ID of the token to set as default. * @return {boolean} True if the default token was set successfully, false if the token does not exist. */ setDefaultToken(tokenId: string): boolean; /** * Retrieves the default token from the tokens dictionary. * * @return {string | undefined} The default token value if found, or undefined if not found. */ getDefaultToken(): string | undefined; }