aboutsummaryrefslogblamecommitdiff
path: root/src/content/repositories/KeymapRepository.ts
blob: 6a7d65673dd97e8a16a2dd86ae1b6592426d5d8b (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                 
                                           
                                    
                
 
                                               
                                   
                                     



                      
                                  
   
import Key from "../../shared/settings/Key";
import KeySequence from "../domains/KeySequence";

export default interface KeymapRepository {
  enqueueKey(key: Key): KeySequence;

  clear(): void;
}

let current: KeySequence = new KeySequence([]);

export class KeymapRepositoryImpl {
  enqueueKey(key: Key): KeySequence {
    current.push(key);
    return current;
  }

  clear(): void {
    current = new KeySequence([]);
  }
}