/** * Scanning selection methods for switch access * Determines how the scanning advances through items */ export declare enum ScanningSelectionMethod { /** Automatically advance through items at timed intervals (1 Switch) */ AutoScan = "AutoScan", /** Automatic scanning with overscan (two-stage scanning) */ AutoScanWithOverscan = "AutoScanWithOverscan", /** Hold switch to advance, release to select */ HoldToAdvance = "HoldToAdvance", /** Hold to advance with overscan */ HoldToAdvanceWithOverscan = "HoldToAdvanceWithOverscan", /** Tap switch to advance, tap again to select (Automatic) */ TapToAdvance = "TapToAdvance", /** Tap switch to advance, another switch to select (2 Switch Step Scan) */ StepScan2Switch = "StepScan2Switch", /** Tap switch 1 to advance, tap switch 1 again to select (1 Switch Step Scan) */ StepScan1Switch = "StepScan1Switch" } /** * Cell scanning order patterns * Determines the sequence in which cells are highlighted */ export declare enum CellScanningOrder { /** Simple linear scan across rows (left-to-right, top-to-bottom) */ SimpleScan = "SimpleScan", /** Simple linear scan down columns (top-to-bottom, left-to-right) */ SimpleScanColumnsFirst = "SimpleScanColumnsFirst", /** Row-group scanning: highlight rows first, then cells within selected row */ RowColumnScan = "RowColumnScan", /** Column-group scanning: highlight columns first, then cells within selected column */ ColumnRowScan = "ColumnRowScan" } /** * Scanning configuration for a page or pageset * Controls how switch scanning operates */ export interface ScanningConfig { /** Method for advancing through items */ selectionMethod?: ScanningSelectionMethod; /** Order in which cells are scanned */ cellScanningOrder?: CellScanningOrder; /** Whether block scanning is enabled (group cells by scanBlock number) */ blockScanEnabled?: boolean; /** Whether to include the workspace/message bar in scanning */ scanWorkspace?: boolean; /** Time in milliseconds to highlight each item */ forwardScanSpeed?: number; /** Time in milliseconds to wait before auto-accepting selection */ dwellTime?: number; /** How the selection is accepted */ acceptScanMethod?: 'Switch' | 'Timeout' | 'Hold'; /** Whether to factor in error correction effort (e.g., missed hits) */ errorCorrectionEnabled?: boolean; /** Maximum number of loops before the scan times out */ maxLoops?: number; /** Estimated probability of missing a target (0.0 to 1.0) */ errorRate?: number; } export interface AACStyle { backgroundColor?: string; fontColor?: string; borderColor?: string; borderWidth?: number; fontSize?: number; fontFamily?: string; fontWeight?: string; fontStyle?: string; textUnderline?: boolean; labelOnTop?: boolean; transparent?: boolean; } export interface AACButton { id: string; label: string; message: string; targetPageId?: string; style?: AACStyle; audioRecording?: { id?: number; data?: Buffer; identifier?: string; metadata?: string; }; contentType?: 'Normal' | 'AutoContent' | 'Workspace' | 'LiveCell' | 'Inflector' | 'Prediction'; contentSubType?: string; image?: string; resolvedImageEntry?: string; symbolLibrary?: string; symbolPath?: string; x?: number; y?: number; columnSpan?: number; rowSpan?: number; /** * Scan block number (1-8) for block scanning * Buttons with the same scanBlock number are highlighted together * @deprecated Use scanBlock instead (singular, not array) */ scanBlocks?: number[]; /** * Scan block number (1-8) for block scanning * Buttons with the same scanBlock number are highlighted together * Reduces scanning effort by grouping buttons */ scanBlock?: number; visibility?: 'Visible' | 'Hidden' | 'Disabled' | 'PointerAndTouchOnly' | 'Empty'; directActivate?: boolean; audioDescription?: string; parameters?: { [key: string]: any; }; predictions?: string[]; semantic_id?: string; clone_id?: string; } export interface AACPage { id: string; name: string; grid: Array>; buttons: AACButton[]; parentId: string | null; style?: AACStyle; locale?: string; descriptionHtml?: string; images?: any[]; sounds?: any[]; wordListItems?: AACWordListItem[]; semantic_ids?: string[]; clone_ids?: string[]; scanningConfig?: ScanningConfig; scanBlocksConfig?: any[]; } /** * Generic metadata interface for AAC files * All processors can extend this with their specific properties */ export interface AACTreeMetadata { format?: string; version?: string; locale?: string; languages?: string[]; name?: string; description?: string; author?: string; copyright?: string; homepageUrl?: string; url?: string; id?: string; defaultHomePageId?: string; defaultKeyboardPageId?: string; hasGlobalToolbar?: boolean; toolbarId?: string; dashboardId?: string; [key: string]: any; } /** * Snap-specific metadata */ export interface SnapMetadata extends AACTreeMetadata { format: 'snap'; dashboardId?: string; } /** * GridSet-specific metadata */ export interface GridSetMetadata extends AACTreeMetadata { format: 'gridset'; isSmartBox?: boolean; passwordProtected?: boolean; pictureSearchKeys?: string[]; thumbnail?: string; thumbnailBackground?: string; documentationUrl?: string; documentationSlug?: string; appearance?: { textAtTop?: boolean; computerControlCellSize?: number; }; } /** * Asterics-specific metadata */ export interface AstericsGridMetadata extends AACTreeMetadata { format: 'asterics'; hasGlobalGrid?: boolean; globalGridId?: string; } /** * TouchChat-specific metadata */ export interface TouchChatMetadata extends AACTreeMetadata { format: 'touchchat'; } export interface AACTree { pages: { [key: string]: AACPage; }; metadata: AACTreeMetadata; rootId: string | null; toolbarId: string | null; addPage(page: AACPage): void; getPage(id: string): AACPage | undefined; } export interface AACProcessor { extractTexts(filePath: string | Buffer): Promise; loadIntoTree(filePath: string | Buffer): Promise; } /** * Word List Item for dynamic content cells (e.g., Grid 3 WordLists) */ export interface AACWordListItem { text: string; image?: string; partOfSpeech?: string; } /** * Mutation types for page modifications */ export type AACPageMutation = { type: 'addButton'; button: AACButton; } | { type: 'removeButton'; buttonId: string; } | { type: 'updateButton'; buttonId: string; patch: Partial; } | { type: 'addWordListItem'; item: AACWordListItem; } | { type: 'removeWordListItem'; match: string | ((item: AACWordListItem) => boolean); } | { type: 'clearWordList'; }; /** * Processor capabilities declaration */ export interface ProcessorCapabilities { /** * WordList support level * - 'native': addWordListItem writes a real WordList structure on disk * - 'fallback': addWordListItem becomes addButton (still useful, just not dynamic) * - 'none': addWordListItem throws CapabilityError */ wordList: 'native' | 'fallback' | 'none'; /** * Whether the processor has a real saveModifiedTree that keeps original images/settings * If false, saveModifiedTree falls back to saveFromTree with a warning */ preservesAssetsOnSave: boolean; /** * Rules for creating new cells * - 'allowed': addButton at any (x,y) creates a cell on save * - 'restricted': addButton routes to a WordList if (x,y) is a WordList cell, else dropped with warning * - 'forbidden': addButton requires explicit (x,y) of an existing cell; otherwise CapabilityError */ newCellCreation: 'allowed' | 'restricted' | 'forbidden'; }