/** * Utility Functions * * Internal utilities for the Edubridge client. */ import type { AggregatedMetrics, DailyActivityMap } from './types'; /** * Scoped logger for the Edubridge client. * Only logs debug/info when DEBUG=1 or DEBUG=true. */ export declare const log: import("@timeback/internal-logger").Logger; /** * Normalize a User object from the API. * * Applies all necessary field normalizations to ensure consistent types. * Currently normalizes: * - `enabledUser`: string → boolean * * @param user - Raw user from the API * @returns User with normalized fields */ export declare function normalizeUser(user: T): T; /** * Normalize a date string for use as a startDate query parameter. * * - Full ISO timestamps (containing `T`) pass through unchanged. * - Bare dates (`YYYY-MM-DD`) are expanded to the start of that day. * When `timezone` is provided, "start of day" is computed in that * timezone and converted to UTC. Otherwise UTC midnight is used. * * @param date - Date string (bare or full ISO) * @param timezone - Optional IANA timezone name * @param fieldName - Field name for error reporting (defaults to "startDate") * @returns Full ISO 8601 datetime string in UTC */ export declare function normalizeStartDate(date: string, timezone?: string, fieldName?: string): string; /** * Normalize a date string for use as an endDate query parameter. * * - Full ISO timestamps (containing `T`) pass through unchanged. * - Bare dates (`YYYY-MM-DD`) are expanded to the end of that day * (23:59:59.999). When `timezone` is provided, "end of day" is * computed in that timezone and converted to UTC. * * @param date - Date string (bare or full ISO) * @param timezone - Optional IANA timezone name * @param fieldName - Field name for error reporting (defaults to "endDate") * @returns Full ISO 8601 datetime string in UTC */ export declare function normalizeEndDate(date: string, timezone?: string, fieldName?: string): string; /** * Aggregate activity metrics from a DailyActivityMap. * * Sums up all metrics across dates and subjects into a single totals object. * * @param data - Activity data grouped by date and subject * @returns Aggregated totals * * @example * ```typescript * const activity = await client.analytics.getActivity({ ... }) * const totals = aggregateActivityMetrics(activity.facts) * console.log(`Total XP: ${totals.totalXp}`) * ``` */ export declare function aggregateActivityMetrics(data: DailyActivityMap): AggregatedMetrics; //# sourceMappingURL=utils.d.ts.map