(sensor: SensorData, includeImages: boolean)
| 22 | |
| 23 | // Format sensor content for display |
| 24 | const formatSensorContent = (sensor: SensorData, includeImages: boolean): string => { |
| 25 | if (sensor.type === 'screenshot' || sensor.type === 'camera') { |
| 26 | if (includeImages && sensor.content) { |
| 27 | return `[Image data - ${sensor.size || 'unknown'} bytes]`; |
| 28 | } |
| 29 | return `[${sensor.type} - ${sensor.size || 'unknown'} bytes]`; |
| 30 | } |
| 31 | |
| 32 | if (sensor.type === 'audio') { |
| 33 | const transcript = sensor.content?.transcript || ''; |
| 34 | const source = sensor.source ? ` (${sensor.source})` : ''; |
| 35 | return `${transcript}${source}`; |
| 36 | } |
| 37 | |
| 38 | if (typeof sensor.content === 'string') { |
| 39 | return sensor.content; |
| 40 | } |
| 41 | |
| 42 | return JSON.stringify(sensor.content, null, 2); |
| 43 | }; |
| 44 | |
| 45 | // Export as JSON |
| 46 | export const exportAsJSON = (data: ExportData, options: ExportOptions): string => { |
no outgoing calls
no test coverage detected