This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/repositories/FollowKeyRepository.ts
2019-05-22 20:30:20 +09:00

33 lines
489 B
TypeScript

export default interface FollowKeyRepository {
getKeys(): string[];
pushKey(key: string): void;
popKey(): void;
clearKeys(): void;
}
const current: {
keys: string[];
} = {
keys: [],
};
export class FollowKeyRepositoryImpl implements FollowKeyRepository {
getKeys(): string[] {
return current.keys;
}
pushKey(key: string): void {
current.keys.push(key);
}
popKey(): void {
current.keys.pop();
}
clearKeys(): void {
current.keys = [];
}
}