import { AACTree, AACSemanticCategory, AACSemanticIntent } from '../../core/treeStructure'; import { FileAdapter, ProcessorInput } from '../../utils/io'; import { ZipAdapter } from '../../utils/zip'; /** * Build a map of button IDs to resolved image entry paths for a specific page. * Helpful when rewriting zip entry names or validating images referenced in a grid. */ export declare function getPageTokenImageMap(tree: AACTree, pageId: string): Map; /** * Collect all image entries referenced across every page in a tree. * Returns normalized zip entry paths that should be preserved when pruning images. */ export declare function getAllowedImageEntries(tree: AACTree): Set; /** * Read an image entry from a gridset zip by path. * @param gridsetBuffer Gridset archive contents * @param entryPath Entry name inside the zip * @returns Image data buffer or null if not found */ export declare function openImage(gridsetBuffer: Uint8Array, entryPath: string, password?: string | undefined, fileAdapter?: FileAdapter, zipAdapter?: (input?: ProcessorInput) => Promise): Promise; /** * Generate a random GUID for Grid3 elements * Grid3 uses GUIDs for grid identification * @returns A UUID v4-like string in the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx */ export declare function generateGrid3Guid(): string; /** * Create Grid3 settings XML with start grid and common settings * @param startGrid - Name of the grid to start on * @param options - Optional settings (scan, hover, language, etc.) * @returns XML string for Settings.xml */ export declare function createSettingsXml(startGrid: string, options?: { scanEnabled?: boolean; scanTimeoutMs?: number; hoverEnabled?: boolean; hoverTimeoutMs?: number; mouseclickEnabled?: boolean; language?: string; }): string; /** * Create Grid3 FileMap.xml content * @param grids - Array of grid configurations with name and path * @returns XML string for FileMap.xml */ export declare function createFileMapXml(grids: Array<{ name: string; path: string; dynamicFiles?: string[]; }>): string; /** * Grid3 user data path information */ export interface Grid3UserPath { userName: string; langCode: string; basePath: string; historyDbPath: string; } export interface Grid3VocabularyPath { userName: string; gridsetPath: string; } export interface Grid3HistoryEntry { id: string; content: string; occurrences: Array<{ timestamp: Date; latitude?: number | null; longitude?: number | null; type?: 'button' | 'action' | 'utterance' | 'note' | 'other'; intent?: AACSemanticIntent | string; category?: AACSemanticCategory; }>; rawXml?: string; } /** * Get the Windows Common Documents folder path from registry * Falls back to default path if registry access fails * @returns Path to Common Documents folder */ export declare function getCommonDocumentsPath(): string; /** * Find all Grid3 user data paths * Searches for users and language codes in the Grid3 directory structure * C:\Users\Public\Documents\Smartbox\Grid 3\Users\{UserName}\{langCode}\Phrases\history.sqlite * Grid set/vocabulary archives live alongside users at: * C:\Users\Public\Documents\Smartbox\Grid 3\Users\{UserName}\Grid Sets\ * @returns Array of Grid3 user path information */ export declare function findGrid3UserPaths(fileAdapter?: FileAdapter): Promise; /** * Find all Grid3 history database paths * Convenience method that returns just the database file paths * @returns Array of paths to history.sqlite files */ export declare function findGrid3HistoryDatabases(fileAdapter?: FileAdapter): Promise; /** * Get Grid 3 users (alias of findGrid3UserPaths for clarity) */ export declare function findGrid3Users(): Promise; /** * Find Grid 3 gridset/vocabulary files for each user * @param userName Optional user filter; matches case-insensitively * @returns Array of user/gridset path pairs */ export declare function findGrid3Vocabularies(userName?: string, fileAdapter?: FileAdapter): Promise; /** * Find a specific user's Grid 3 history database * @param userName User name to search for (case-insensitive) * @param langCode Optional language code filter (case-insensitive) * @returns Path to history.sqlite or null if not found */ export declare function findGrid3UserHistory(userName: string, langCode?: string, fileAdapter?: FileAdapter): Promise; /** * Check whether Grid 3 appears to be installed (Windows only) */ export declare function isGrid3Installed(fileAdapter?: FileAdapter): Promise; /** * Read history events from a Grid 3 history.sqlite database. * @param historyDbPath Absolute path to the history database * @returns Parsed history entries grouped by phrase */ export declare function readGrid3History(historyDbPath: string, fileAdapter?: FileAdapter): Promise; /** * Convenience wrapper to load history for a specific Grid 3 user/lang combination. * @param userName Grid 3 user name (case-insensitive) * @param langCode Optional language code to narrow selection (case-insensitive) * @returns History entries for that user/language, or empty array if none */ export declare function readGrid3HistoryForUser(userName: string, langCode?: string): Promise; /** * Load all available Grid 3 histories on the machine. * @returns Combined history entries from every discovered history.sqlite */ export declare function readAllGrid3History(): Promise;