A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.1 KiB
58 lines
1.1 KiB
5 years ago
|
export default interface FollowMasterRepository {
|
||
|
setCurrentFollowMode(newTab: boolean, background: boolean): void;
|
||
|
|
||
|
getTags(): string[];
|
||
|
|
||
|
getTagsByPrefix(prefix: string): string[];
|
||
|
|
||
|
addTag(tag: string): void;
|
||
|
|
||
|
clearTags(): void;
|
||
|
|
||
|
getCurrentNewTabMode(): boolean;
|
||
|
|
||
|
getCurrentBackgroundMode(): boolean;
|
||
|
}
|
||
|
|
||
|
const current: {
|
||
|
newTab: boolean;
|
||
|
background: boolean;
|
||
|
tags: string[];
|
||
|
} = {
|
||
|
newTab: false,
|
||
|
background: false,
|
||
|
tags: [],
|
||
|
};
|
||
|
|
||
|
export class FollowMasterRepositoryImpl implements FollowMasterRepository {
|
||
|
setCurrentFollowMode(newTab: boolean, background: boolean): void {
|
||
|
current.newTab = newTab;
|
||
|
current.background = background;
|
||
|
}
|
||
|
|
||
|
getTags(): string[] {
|
||
|
return current.tags;
|
||
|
}
|
||
|
|
||
|
getTagsByPrefix(prefix: string): string[] {
|
||
|
return current.tags.filter(t => t.startsWith(prefix));
|
||
|
}
|
||
|
|
||
|
addTag(tag: string): void {
|
||
|
current.tags.push(tag);
|
||
|
}
|
||
|
|
||
|
clearTags(): void {
|
||
|
current.tags = [];
|
||
|
}
|
||
|
|
||
|
getCurrentNewTabMode(): boolean {
|
||
|
return current.newTab;
|
||
|
}
|
||
|
|
||
|
getCurrentBackgroundMode(): boolean {
|
||
|
return current.background;
|
||
|
}
|
||
|
}
|
||
|
|