import * as amplifyAuth from "aws-amplify/auth"; import { AlarmsLogType, DeviceAssociationResponse, DeviceInfoType, EasyTimerStateType, PowerDistributionType, RegenerationDataType, ServiceCountersType, ServiceStatusType, TotalCountersType, UsageAnalyticsType } from "./types"; /** * Generates headers with a JWT token for authenticated requests. * @param {string} jwtToken - The JWT token for authorization. * @returns {object} - The headers object with the Authorization field. */ declare const headers: (jwtToken: string) => { Authorization: string; }; /** * Configures Amplify if not already configured. * Uses a local flag to avoid calling getConfig() which prints a warning. * @param {object} [storage] - Optional custom storage adapter for token persistence */ declare const configureAmplify: (storage?: { setItem: (key: string, value: string) => Promise; getItem: (key: string) => Promise; removeItem: (key: string) => Promise; clear: () => Promise; }) => void; /** * Creates an authentication service with sign-in functionality. * @param {typeof amplifyAuth} auth - The authentication module to use. * @returns {object} - An object containing authentication-related methods. */ declare const createAuthService: (auth: typeof amplifyAuth) => { signIn: (username: string, password: string, legacy?: boolean) => Promise; getSession: (forceRefresh?: boolean, legacy?: boolean) => Promise; }; declare const signIn: (username: string, password: string, legacy?: boolean) => Promise, getSession: (forceRefresh?: boolean, legacy?: boolean) => Promise; /** * Derives the Airkare mode status from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {boolean} - Whether Airkare mode is active. * * @example * const info = await api.deviceInfo(token, mac); * const isAirkareActive = deriveAirkare(info); */ export declare const deriveAirkare: (deviceInfo: DeviceInfoType) => boolean; /** * Derives the Relax mode status from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {boolean} - Whether Relax mode is active. * * @example * const info = await api.deviceInfo(token, mac); * const isRelaxActive = deriveRelax(info); */ export declare const deriveRelax: (deviceInfo: DeviceInfoType) => boolean; /** * Derives the sound (control beep) status from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {boolean} - Whether control beep sounds are enabled. * * @example * const info = await api.deviceInfo(token, mac); * const isSoundActive = deriveSound(info); */ export declare const deriveSound: (deviceInfo: DeviceInfoType) => boolean; /** * Derives the Chrono mode status from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * Note: The API field is spelled "is_crono_active" (typo in original API). * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {boolean} - Whether Chrono mode is active. * * @example * const info = await api.deviceInfo(token, mac); * const isChronoActive = deriveChronoMode(info); */ export declare const deriveChronoMode: (deviceInfo: DeviceInfoType) => boolean; /** * Derives the Easy Timer state from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {EasyTimerStateType} - Object containing active status and timer time. * * @example * const info = await api.deviceInfo(token, mac); * const timer = deriveEasyTimer(info); * console.log(`Timer active: ${timer.active}, Time: ${timer.time} minutes`); */ export declare const deriveEasyTimer: (deviceInfo: DeviceInfoType) => EasyTimerStateType; /** * Converts a day and time to a schedule array index. * * @param {number} day - Day of week (0=Monday, 6=Sunday). * @param {number} hour - Hour of day (0-23). * @param {number} minute - Minute (0-59, will be rounded to nearest 30). * @returns {number} - Index in the 336-element schedule array. * * @example * // Monday 08:00 * timeToIndex(0, 8, 0); // Returns 16 * * @example * // Wednesday 14:30 * timeToIndex(2, 14, 30); // Returns 125 */ export declare const timeToIndex: (day: number, hour: number, minute: number) => number; /** * Converts a schedule array index to day and time. * * @param {number} index - Index in the schedule array (0-335). * @returns {{ day: number; hour: number; minute: 0 | 30 }} - Day, hour, and minute. * * @example * // Index 16 = Monday 08:00 * indexToTime(16); // Returns { day: 0, hour: 8, minute: 0 } * * @example * // Index 125 = Wednesday 14:30 * indexToTime(125); // Returns { day: 2, hour: 14, minute: 30 } */ export declare const indexToTime: (index: number) => { day: number; hour: number; minute: 0 | 30; }; /** * Creates an empty schedule array (all slots set to OFF). * * @returns {number[]} - A 336-element array filled with zeros. * * @example * const schedule = createEmptySchedule(); * // schedule is [0, 0, 0, ...] (336 zeros) */ export declare const createEmptySchedule: () => number[]; /** * Sets a range of time slots in a schedule array. * Modifies the schedule array in place and returns it. * * @param {number[]} schedule - The schedule array to modify. * @param {number} day - Day of week (0=Monday, 6=Sunday). * @param {number} startHour - Starting hour (0-23). * @param {number} endHour - Ending hour (0-24, exclusive). * @param {number} value - Value to set (0=OFF, 1=Economy/Power1, 2=Comfort/Power5). * @returns {number[]} - The modified schedule array. * * @example * // Set Monday 08:00-18:00 to Comfort * const schedule = createEmptySchedule(); * setScheduleRange(schedule, 0, 8, 18, 2); */ export declare const setScheduleRange: (schedule: number[], day: number, startHour: number, endHour: number, value: number) => number[]; /** * Sets the same time range for all weekdays (Monday-Friday). * * @param {number[]} schedule - The schedule array to modify. * @param {number} startHour - Starting hour (0-23). * @param {number} endHour - Ending hour (0-24, exclusive). * @param {number} value - Value to set (0=OFF, 1=Economy/Power1, 2=Comfort/Power5). * @returns {number[]} - The modified schedule array. * * @example * // Set weekdays 08:00-18:00 to Comfort (2) * const schedule = createEmptySchedule(); * setWeekdayRange(schedule, 8, 18, 2); */ export declare const setWeekdayRange: (schedule: number[], startHour: number, endHour: number, value: number) => number[]; /** * Sets the same time range for weekend days (Saturday-Sunday). * * @param {number[]} schedule - The schedule array to modify. * @param {number} startHour - Starting hour (0-23). * @param {number} endHour - Ending hour (0-24, exclusive). * @param {number} value - Value to set (0=OFF, 1=Economy/Power1, 2=Comfort/Power5). * @returns {number[]} - The modified schedule array. * * @example * // Set weekends 09:00-22:00 to Comfort (2) * const schedule = createEmptySchedule(); * setWeekendRange(schedule, 9, 22, 2); */ export declare const setWeekendRange: (schedule: number[], startHour: number, endHour: number, value: number) => number[]; /** * Creates a typical work-week schedule: comfort during weekday mornings/evenings, * economy at night, and comfort all day on weekends. * * @param {Object} options - Schedule configuration options. * @param {number} options.morningStart - Hour to start morning comfort (default: 6). * @param {number} options.morningEnd - Hour to end morning comfort (default: 9). * @param {number} options.eveningStart - Hour to start evening comfort (default: 17). * @param {number} options.eveningEnd - Hour to end evening comfort (default: 22). * @param {number} options.weekendStart - Hour to start weekend comfort (default: 8). * @param {number} options.weekendEnd - Hour to end weekend comfort (default: 23). * @returns {number[]} - A 336-element schedule array. * * @example * // Create default work-week schedule * const schedule = createWorkWeekSchedule(); * * @example * // Custom times * const schedule = createWorkWeekSchedule({ * morningStart: 5, * morningEnd: 8, * eveningStart: 18, * eveningEnd: 23, * }); */ export declare const createWorkWeekSchedule: (options?: { morningStart?: number; morningEnd?: number; eveningStart?: number; eveningEnd?: number; weekendStart?: number; weekendEnd?: number; }) => number[]; /** * Derives the Continue Cochlea Loading (continuous cochlea mode) status * from an existing DeviceInfo response. * This is a pure function that extracts data without API calls. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {boolean} - Whether continuous cochlea mode is active. * * @example * const info = await api.deviceInfo(token, mac); * const isCochleaContinuous = deriveContinueCochleaLoading(info); */ export declare const deriveContinueCochleaLoading: (deviceInfo: DeviceInfoType) => boolean; /** * Derives alarm history from an existing DeviceInfo response. * This is a pure function that extracts alarm data without API calls. * * Use this when you already have a DeviceInfo object (e.g., from a previous deviceInfo() call) * to avoid making an additional API request. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @returns {AlarmsLogType} - Alarm history log. * * @example * const info = await api.deviceInfo(token, mac); * const alarms = deriveAlarmHistory(info); * // No additional API call needed */ export declare const deriveAlarmHistory: (deviceInfo: DeviceInfoType) => AlarmsLogType; /** * Derives usage analytics from an existing DeviceInfo response. * This is a pure function that performs client-side calculations without API calls. * * Use this when you already have a DeviceInfo object (e.g., from a previous deviceInfo() call) * to avoid making an additional API request. * * @param {DeviceInfoType} deviceInfo - The device info response object. * @param {number} [serviceThreshold=2000] - Service threshold in hours. * @returns {UsageAnalyticsType} - Comprehensive usage analytics. * * @example * const info = await api.deviceInfo(token, mac); * const analytics = deriveUsageAnalytics(info); */ export declare const deriveUsageAnalytics: (deviceInfo: DeviceInfoType, serviceThreshold?: number) => UsageAnalyticsType; /** * Get human-readable description of the current device phase. * Combines operational_phase and sub_operational_phase for context. * * @param {number} operationalPhase - The main operational phase. * @param {number} subOperationalPhase - The sub-phase (used during ignition). * @returns {string} - Human-readable phase description. * * @example * const desc = getPhaseDescription(2, 1); * // Returns: "Ignition - Pellet load" */ export declare const getPhaseDescription: (operationalPhase: number, subOperationalPhase: number) => string; /** * Derive phase description from existing DeviceInfo. * Pure function - no API calls required. * * @param {DeviceInfoType} deviceInfo - The device info object. * @returns {string} - Human-readable phase description. * * @example * const info = await api.deviceInfo(token, mac); * const desc = derivePhaseDescription(info); * // Returns: "On" or "Ignition - Warmup" etc. */ export declare const derivePhaseDescription: (deviceInfo: DeviceInfoType) => string; /** * Configures the library for API interactions. * Initializes API methods with a specified base URL. * * @param {string} [baseURL=API_URL] - The base URL for the API. * @returns {object} - An object containing methods for interacting with the API. * * @example * const api = configure(); * const power = await api.getPower(jwtToken, macAddress); */ declare const configure: (baseURL?: string) => { deviceInfo: (jwtToken: string, macAddress: string) => Promise; registerDevice: (jwtToken: string, macAddress: string, serialNumber: string, deviceName?: string, deviceRoom?: string) => Promise; editDevice: (jwtToken: string, macAddress: string, deviceName?: string, deviceRoom?: string) => Promise; setPower: (jwtToken: string, macAddress: string, value: number) => Promise; setPowerOff: (jwtToken: string, macAddress: string) => Promise; setPowerOn: (jwtToken: string, macAddress: string) => Promise; getPower: (jwtToken: string, macAddress: string) => Promise; setPowerLevel: (jwtToken: string, macAddress: string, level: number) => Promise; getPowerLevel: (jwtToken: string, macAddress: string) => Promise; setFanSpeed: (jwtToken: string, macAddress: string, fanIndex: 1 | 2 | 3, speed: number) => Promise; getFanSpeed: (jwtToken: string, macAddress: string, fanIndex: 1 | 2 | 3) => Promise; setFan1Speed: (jwtToken: string, macAddress: string, speed: number) => Promise; setFan2Speed: (jwtToken: string, macAddress: string, speed: number) => Promise; setFan3Speed: (jwtToken: string, macAddress: string, speed: number) => Promise; getFan1Speed: (jwtToken: string, macAddress: string) => Promise; getFan2Speed: (jwtToken: string, macAddress: string) => Promise; getFan3Speed: (jwtToken: string, macAddress: string) => Promise; setAirkare: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getAirkare: (jwtToken: string, macAddress: string) => Promise; setRelax: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getRelax: (jwtToken: string, macAddress: string) => Promise; setSound: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getSound: (jwtToken: string, macAddress: string) => Promise; setStandby: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getStandby: (jwtToken: string, macAddress: string) => Promise; setStandbyTime: (jwtToken: string, macAddress: string, minutes: number) => Promise; getStandbyTime: (jwtToken: string, macAddress: string) => Promise; setAuto: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getAuto: (jwtToken: string, macAddress: string) => Promise; getEnvironmentTemperature: (jwtToken: string, macAddress: string) => Promise; getTargetTemperature: (jwtToken: string, macAddress: string, envIndex: 1 | 2 | 3) => Promise; setTargetTemperature: (jwtToken: string, macAddress: string, envIndex: 1 | 2 | 3, temperature: number) => Promise; setEnvironment1Temperature: (jwtToken: string, macAddress: string, temperature: number) => Promise; getEnvironment1Temperature: (jwtToken: string, macAddress: string) => Promise; setEnvironment2Temperature: (jwtToken: string, macAddress: string, temperature: number) => Promise; getEnvironment2Temperature: (jwtToken: string, macAddress: string) => Promise; setEnvironment3Temperature: (jwtToken: string, macAddress: string, temperature: number) => Promise; getEnvironment3Temperature: (jwtToken: string, macAddress: string) => Promise; setMeasureUnit: (jwtToken: string, macAddress: string, isFahrenheit: boolean) => Promise; getMeasureUnit: (jwtToken: string, macAddress: string) => Promise; setLanguage: (jwtToken: string, macAddress: string, languageCode: number) => Promise; getLanguage: (jwtToken: string, macAddress: string) => Promise; getPelletInReserve: (jwtToken: string, macAddress: string) => Promise; getPelletAutonomyTime: (jwtToken: string, macAddress: string) => Promise; getChronoMode: (jwtToken: string, macAddress: string) => Promise; setChronoMode: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; setChronoComfortTemperature: (jwtToken: string, macAddress: string, temperature: number) => Promise; setChronoEconomyTemperature: (jwtToken: string, macAddress: string, temperature: number) => Promise; setChronoTemperatureRanges: (jwtToken: string, macAddress: string, ranges: number[]) => Promise; setChronoPowerRanges: (jwtToken: string, macAddress: string, ranges: number[]) => Promise; getEasyTimer: (jwtToken: string, macAddress: string) => Promise; setEasyTimer: (jwtToken: string, macAddress: string, minutes: number) => Promise; getContinueCochleaLoading: (jwtToken: string, macAddress: string) => Promise; setContinueCochleaLoading: (jwtToken: string, macAddress: string, enabled: boolean) => Promise; getOperationalPhase: (jwtToken: string, macAddress: string) => Promise; getSubOperationalPhase: (jwtToken: string, macAddress: string) => Promise; getStoveState: (jwtToken: string, macAddress: string) => Promise; getActualPower: (jwtToken: string, macAddress: string) => Promise; getTotalCounters: (jwtToken: string, macAddress: string) => Promise; getServiceCounters: (jwtToken: string, macAddress: string) => Promise; getAlarmHistory: (jwtToken: string, macAddress: string) => Promise; getRegenerationData: (jwtToken: string, macAddress: string) => Promise; getServiceTime: (jwtToken: string, macAddress: string) => Promise; getTotalOperatingHours: (jwtToken: string, macAddress: string) => Promise; getPowerDistribution: (jwtToken: string, macAddress: string) => Promise; getServiceStatus: (jwtToken: string, macAddress: string, thresholdHours?: number) => Promise; getUsageAnalytics: (jwtToken: string, macAddress: string, serviceThreshold?: number) => Promise; }; export { configure, configureAmplify, createAuthService, getSession, headers, signIn, };