diff options
Diffstat (limited to 'src/content/repositories/KeymapRepository.ts')
-rw-r--r-- | src/content/repositories/KeymapRepository.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/content/repositories/KeymapRepository.ts b/src/content/repositories/KeymapRepository.ts new file mode 100644 index 0000000..770ba0b --- /dev/null +++ b/src/content/repositories/KeymapRepository.ts @@ -0,0 +1,24 @@ +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([]); + } +} |