/** * A `SessionToken` object is a unique identifier that groups together `suggest` / `retrieve` calls as part of the * [Mapbox Search Box API](https://docs.mapbox.com/api/search/search-box/#retrieve-a-suggested-feature). * * Session tokens are used for [billing](https://docs.mapbox.com/api/search/search-box/#search-box-api-pricing) and * customer-accessible analytics. * * A [UUIDv4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) value is recommended, * and is generated if an `id` is not provided. * * Note that any method that accepts a `SessionToken` object as an argument or option * can also accept a unique `string` and will perform an implicit conversion. * This flexible type is documented as {@link SessionTokenLike}. * * @name SessionToken * @example * ```typescript * const token = new SessionToken(); * console.log(token.id); // = I am a UUIDv4 value! * ``` */ export declare class SessionToken { /** * The session token in string format. */ readonly id: string; constructor(id?: string); /** * Returns the session token in string format. * * This is the same as calling `token.id`, and is okay to be used for serialization. */ toString(): string; /** * Converts a string to a `SessionToken` object. * * If a `SessionToken` object is passed in, the function returns a copy. */ static convert(token: SessionToken | string): SessionToken; } /** * A {@link SessionToken} object or string representing a Mapbox Search Box API session token. * * It's recommended this value is a [UUIDv4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) value. * * @typedef SessionTokenLike * @type {SessionToken | string} * @example * const v1 = new SessionToken(); * const v2 = new SessionToken('f06e7531-6373-4d5a-8614-b6f313488050'); * const v3 = 'f06e7531-6373-4d5a-8614-b6f313488050'; */ export declare type SessionTokenLike = string | SessionToken;