import type { GlucoseReading } from "./glucose-engine.js"; export interface LibreLinkUpAuth { /** JWT bearer token issued by /llu/auth/login. */ token: string; /** Numeric account id; its SHA-256 hex digest goes in the `account-id` header. */ accountId: string; /** Unix-epoch (seconds) expiry of the JWT, when supplied by the API. */ expires?: number; } export interface LibreLinkUpConnection { /** patientId — pass to getGraph / getCurrent. */ patientId: string; firstName?: string; lastName?: string; /** Sensor serial / device label, when present. */ sensor?: string; /** Latest glucose measurement embedded in the connection record, if any. */ latest?: GlucoseReading; } export interface LibreLinkUpClientOptions { email?: string; password?: string; region?: string; token?: string; accountId?: string; patientId?: string; fetchImpl?: typeof fetch; } export declare class LibreLinkUpClient { readonly email?: string; readonly password?: string; /** Active LibreLink Up region shard. May be updated once if login redirects. */ region: string; readonly fixedPatientId?: string; private token?; private accountId?; private readonly fetchImpl; constructor(opts?: LibreLinkUpClientOptions); /** True when we have enough to authenticate: either email+password or an existing token. */ hasAuth(): boolean; /** True once we hold a live bearer token. */ isLoggedIn(): boolean; private base; private headers; /** * Authenticate against LibreLink Up. Stores the bearer token + account id on * the client and returns them. Follows one regional redirect if the API asks. */ login(): Promise; /** List the patients (sensors) this account follows. The account's own sensor is one of them. */ getConnections(): Promise; /** Resolve the patientId to query: explicit override, else the first connection. */ resolvePatientId(): Promise; /** * Fetch the recent glucose graph for a patient (~12h of historical points plus * the current measurement). Returns chronologically-sorted GlucoseReadings. */ getGraph(patientId?: string): Promise; /** Return the single most-recent reading for a patient (last point of the graph). */ getCurrent(patientId?: string): Promise; }