1- import { dotNetTicksToDate } from ' ../utils/dotnetTicks' ;
1+ import { dotNetTicksToDate } from " ../utils/dotnetTicks" ;
22import {
33 findGrid3Users ,
44 Grid3UserPath ,
55 readAllGrid3History as readAllGrid3HistoryImpl ,
66 readGrid3History as readGrid3HistoryImpl ,
77 readGrid3HistoryForUser as readGrid3HistoryForUserImpl ,
8- } from ' ../processors/gridset/helpers' ;
8+ } from " ../processors/gridset/helpers" ;
99import {
1010 findSnapUsers ,
1111 readSnapUsage as readSnapUsageImpl ,
1212 readSnapUsageForUser as readSnapUsageForUserImpl ,
1313 SnapUserInfo ,
14- } from ' ../processors/snap/helpers' ;
14+ } from " ../processors/snap/helpers" ;
1515
16- export type HistorySource = ' Grid' | ' Snap' ;
16+ export type HistorySource = " Grid" | " Snap" ;
1717
1818export interface HistoryOccurrence {
1919 timestamp : Date ;
@@ -48,44 +48,47 @@ export { dotNetTicksToDate };
4848export function readGrid3History ( historyDbPath : string ) : HistoryEntry [ ] {
4949 return readGrid3HistoryImpl ( historyDbPath ) . map ( ( e ) => ( {
5050 ...e ,
51- source : ' Grid' ,
51+ source : " Grid" ,
5252 } ) ) ;
5353}
5454
5555/**
5656 * Read Grid 3 history for a specific user/language combination.
5757 */
58- export function readGrid3HistoryForUser ( userName : string , langCode ?: string ) : HistoryEntry [ ] {
58+ export function readGrid3HistoryForUser (
59+ userName : string ,
60+ langCode ?: string ,
61+ ) : HistoryEntry [ ] {
5962 return readGrid3HistoryForUserImpl ( userName , langCode ) . map ( ( e ) => ( {
6063 ...e ,
61- source : ' Grid' ,
64+ source : " Grid" ,
6265 } ) ) ;
6366}
6467
6568/**
6669 * Read every available Grid 3 history database on the machine.
6770 */
6871export function readAllGrid3History ( ) : HistoryEntry [ ] {
69- return readAllGrid3HistoryImpl ( ) . map ( ( e ) => ( { ...e , source : ' Grid' } ) ) ;
72+ return readAllGrid3HistoryImpl ( ) . map ( ( e ) => ( { ...e , source : " Grid" } ) ) ;
7073}
7174
7275/**
7376 * Read Snap button usage from a pageset database and tag entries with source.
7477 */
7578export function readSnapUsage ( pagesetPath : string ) : HistoryEntry [ ] {
76- return readSnapUsageImpl ( pagesetPath ) . map ( ( e ) => ( { ...e , source : ' Snap' } ) ) ;
79+ return readSnapUsageImpl ( pagesetPath ) . map ( ( e ) => ( { ...e , source : " Snap" } ) ) ;
7780}
7881
7982/**
8083 * Read Snap usage for a specific user across all discovered pagesets.
8184 */
8285export function readSnapUsageForUser (
8386 userId ?: string ,
84- packageNamePattern = ' TobiiDynavox'
87+ packageNamePattern = " TobiiDynavox" ,
8588) : HistoryEntry [ ] {
8689 return readSnapUsageForUserImpl ( userId , packageNamePattern ) . map ( ( e ) => ( {
8790 ...e ,
88- source : ' Snap' ,
91+ source : " Snap" ,
8992 } ) ) ;
9093}
9194
@@ -106,6 +109,8 @@ export function listGrid3Users(): Grid3UserPath[] {
106109 */
107110export function collectUnifiedHistory ( ) : HistoryEntry [ ] {
108111 const gridHistory = readAllGrid3History ( ) ;
109- const snapHistory = findSnapUsers ( ) . flatMap ( ( u ) => readSnapUsageForUser ( u . userId ) ) ;
112+ const snapHistory = findSnapUsers ( ) . flatMap ( ( u ) =>
113+ readSnapUsageForUser ( u . userId ) ,
114+ ) ;
110115 return [ ...gridHistory , ...snapHistory ] ;
111116}
0 commit comments