import type { IotasLogger } from '../logger.js'; import type { IotasTokens } from '../types.js'; export interface IotasSessionOptions { log: IotasLogger; email: string; authenticate: () => Promise<{ username: string; password: string; }>; onTokensChanged?: (tokens: IotasTokens) => void; initialTokens?: IotasTokens; baseUrl?: string; authRetryDelaysMs?: number[]; /** Injected fetch function for testing. Default: globalThis.fetch */ fetch?: typeof fetch; /** Injected delay function for testing. Default: setTimeout-based sleep */ delay?: (ms: number) => Promise; } /** * Manages authentication and token lifecycle for the IOTAS API. * * Handles initial auth, token refresh, JWT expiry checks, * retry with backoff, and request deduplication. */ export declare class IotasSession { private token; private refreshToken; private authenticateRequest; private readonly log; private readonly email; private readonly authenticateFn; private readonly onTokensChanged?; private readonly baseUrl; private readonly authRetryDelaysMs; private readonly fetch; private readonly delay; constructor(options: IotasSessionOptions); getToken(): Promise; invalidateToken(): void; private authenticate; private authenticateWithRetry; private refreshAccessToken; }