import type { Client } from './generated/client'; export interface LoginResponse { token: string; refreshToken: string; } export type AuthConfig = { mode: 'bearer'; token: string; } | { mode: 'apiKey'; key: string; } | { mode: 'dynamic'; resolve: () => string | Promise; }; /** * Installs a request interceptor that sets the `X-Authorization` header. * * - **No config** — reads `options.auth` and sets `Bearer ${token}` (backward compat with `login()`). * - **`bearer`** — static `Bearer ${token}` header. * - **`apiKey`** — static `ApiKey ${key}` header. * - **`dynamic`** — calls `resolve()` per-request for the full header value. * * Safe to call multiple times — duplicate interceptors are prevented via a WeakMap guard. * Calling again with a different config updates the stored config without adding a new interceptor. */ export declare function setupAuth(client: Client, config?: AuthConfig): void; /** * Authenticates with ThingsBoard and sets the auth token on the client. * * The `/api/auth/login` endpoint is not part of the ThingsBoard OpenAPI spec, * so this helper is provided manually. */ export declare function login(username: string, password: string, options?: { client?: Client; }): Promise; /** * Clears the auth token from the client. */ export declare function logout(options?: { client?: Client; }): void; //# sourceMappingURL=auth.d.ts.map