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




                                  
                                                

                                   
                                     



                      
                                   
   
import Key from '../domains/Key';
import KeySequence from '../domains/KeySequence';

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

  clear(): void;

  // eslint-disable-next-line semi
}

let current: KeySequence = KeySequence.from([]);

export class KeymapRepositoryImpl {

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

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