aboutsummaryrefslogtreecommitdiff
path: root/src/content/repositories/KeymapRepository.ts
blob: 339122932c184df03da5879dfa6d7a9adc983e9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import Key from '../../shared/settings/Key';
import KeySequence from '../../shared/settings/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([]);
  }
}