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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

57 lines
1.1 KiB

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;
}
}