import { dotNetTicksToDate } from '../../utils/dotnetTicks'; import { Grid3UserPath } from '../../processors/gridset/helpers'; import { SnapUserInfo } from '../../processors/snap/helpers'; import { AACSemanticCategory, AACSemanticIntent } from '../../core/treeStructure'; import type { CompetenceUtterance } from './competence'; export type HistorySource = 'Grid' | 'Snap' | 'OBL' | string; export interface HistoryOccurrence { timestamp: Date; latitude?: number | null; longitude?: number | null; modeling?: boolean; accessMethod?: number | null; pageId?: string | null; buttonId?: string | null; boardId?: string | null; spoken?: boolean; vocalization?: string; imageUrl?: string; actions?: any[]; type?: 'button' | 'action' | 'utterance' | 'note' | 'other'; intent?: AACSemanticIntent | string; category?: AACSemanticCategory; } export interface HistoryPlatformExtras { label?: string; message?: string; buttonId?: string; contentXml?: string; [key: string]: any; } export interface HistoryEntry { id: string; source: HistorySource; content: string; occurrences: HistoryOccurrence[]; raw?: unknown; platform?: HistoryPlatformExtras; } export { dotNetTicksToDate }; /** * Adapt any `HistoryEntry[]` (Grid 3, Snap, OBF/OBFL logs, ...) into the generic * utterance stream consumed by the linguistic-competence engine * (`analyzeTimeline`). Each occurrence of each phrase becomes one utterance, * timestamped by its occurrence time. This keeps the competence metrics fully * source-agnostic: anything the library can read as history can be analysed. */ export declare function historyEntriesToCompetenceUtterances(entries: HistoryEntry[]): CompetenceUtterance[]; export interface BatonExportMetadata { timestamp: string; latitude?: number | null; longitude?: number | null; } export interface BatonExportSentence { uuid: string; anonymousUUID: string; content: string; metadata: BatonExportMetadata[]; source: HistorySource; } export interface BatonExport { version: string; exportDate: string; encryption: string; sentenceCount: number; sentences: BatonExportSentence[]; } export declare function exportHistoryToBaton(entries: HistoryEntry[], options?: { version?: string; exportDate?: string | Date; encryption?: string; anonymousUUID?: string; }): BatonExport; /** * Read Grid 3 phrase history from a history.sqlite database and tag entries with their source. */ export declare function readGrid3History(historyDbPath: string): Promise; /** * Read Grid 3 history for a specific user/language combination. */ export declare function readGrid3HistoryForUser(userName: string, langCode?: string): Promise; /** * Read every available Grid 3 history database on the machine. */ export declare function readAllGrid3History(): Promise; /** * Read Snap button usage from a pageset database and tag entries with source. */ export declare function readSnapUsage(pagesetPath: string): Promise; /** * Read Snap usage for a specific user across all discovered pagesets. */ export declare function readSnapUsageForUser(userId?: string, packageNamePattern?: string): Promise; export declare function listSnapUsers(): Promise; /** * List Grid 3 users on the current machine. */ export declare function listGrid3Users(): Promise; /** * Convenience helper to gather all available history across Grid 3 and Snap. * Returns an empty array if no history files are present. */ export declare function collectUnifiedHistory(): Promise;