aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/repositories')
-rw-r--r--src/background/repositories/BookmarkRepository.ts3
-rw-r--r--src/background/repositories/BrowserSettingRepository.ts2
-rw-r--r--src/background/repositories/CompletionsRepository.ts3
-rw-r--r--src/background/repositories/FindRepository.ts2
-rw-r--r--src/background/repositories/MarkRepository.ts2
-rw-r--r--src/background/repositories/PersistentSettingRepository.ts2
-rw-r--r--src/background/repositories/SettingRepository.ts2
7 files changed, 16 insertions, 0 deletions
diff --git a/src/background/repositories/BookmarkRepository.ts b/src/background/repositories/BookmarkRepository.ts
index b4da509..d266ae6 100644
--- a/src/background/repositories/BookmarkRepository.ts
+++ b/src/background/repositories/BookmarkRepository.ts
@@ -1,3 +1,6 @@
+import { injectable } from 'tsyringe';
+
+@injectable()
export default class BookmarkRepository {
async create(
title: string, url: string
diff --git a/src/background/repositories/BrowserSettingRepository.ts b/src/background/repositories/BrowserSettingRepository.ts
index 33b35dd..9cfb35e 100644
--- a/src/background/repositories/BrowserSettingRepository.ts
+++ b/src/background/repositories/BrowserSettingRepository.ts
@@ -1,3 +1,4 @@
+import { injectable } from 'tsyringe';
import * as urls from '../../shared/urls';
declare namespace browser.browserSettings.homepageOverride {
@@ -16,6 +17,7 @@ declare namespace browser.browserSettings.homepageOverride {
function get(param: object): Promise<BrowserSettings>;
}
+@injectable()
export default class BrowserSettingRepository {
async getHomepageUrls(): Promise<string[]> {
let { value } = await browser.browserSettings.homepageOverride.get({});
diff --git a/src/background/repositories/CompletionsRepository.ts b/src/background/repositories/CompletionsRepository.ts
index 18af587..dfdbc27 100644
--- a/src/background/repositories/CompletionsRepository.ts
+++ b/src/background/repositories/CompletionsRepository.ts
@@ -1,6 +1,9 @@
+import { injectable } from 'tsyringe';
+
type Tab = browser.tabs.Tab;
type BookmarkTreeNode = browser.bookmarks.BookmarkTreeNode;
+@injectable()
export default class CompletionsRepository {
async queryBookmarks(keywords: string): Promise<BookmarkTreeNode[]> {
let items = await browser.bookmarks.search({ query: keywords });
diff --git a/src/background/repositories/FindRepository.ts b/src/background/repositories/FindRepository.ts
index bf286e6..6a087f5 100644
--- a/src/background/repositories/FindRepository.ts
+++ b/src/background/repositories/FindRepository.ts
@@ -1,7 +1,9 @@
+import { injectable } from 'tsyringe';
import MemoryStorage from '../infrastructures/MemoryStorage';
const FIND_KEYWORD_KEY = 'find-keyword';
+@injectable()
export default class FindRepository {
private cache: MemoryStorage;
diff --git a/src/background/repositories/MarkRepository.ts b/src/background/repositories/MarkRepository.ts
index 69c85f6..c106fff 100644
--- a/src/background/repositories/MarkRepository.ts
+++ b/src/background/repositories/MarkRepository.ts
@@ -1,8 +1,10 @@
+import { injectable } from 'tsyringe';
import MemoryStorage from '../infrastructures/MemoryStorage';
import GlobalMark from '../domains/GlobalMark';
const MARK_KEY = 'mark';
+@injectable()
export default class MarkRepository {
private cache: MemoryStorage;
diff --git a/src/background/repositories/PersistentSettingRepository.ts b/src/background/repositories/PersistentSettingRepository.ts
index ff882a5..927bce9 100644
--- a/src/background/repositories/PersistentSettingRepository.ts
+++ b/src/background/repositories/PersistentSettingRepository.ts
@@ -1,5 +1,7 @@
+import { injectable } from 'tsyringe';
import SettingData from '../../shared/SettingData';
+@injectable()
export default class SettingRepository {
async load(): Promise<SettingData | null> {
let { settings } = await browser.storage.local.get('settings');
diff --git a/src/background/repositories/SettingRepository.ts b/src/background/repositories/SettingRepository.ts
index eb83a2c..2f159e5 100644
--- a/src/background/repositories/SettingRepository.ts
+++ b/src/background/repositories/SettingRepository.ts
@@ -1,9 +1,11 @@
+import { injectable } from 'tsyringe';
import MemoryStorage from '../infrastructures/MemoryStorage';
import Settings from '../../shared/Settings';
import * as PropertyDefs from '../../shared/property-defs';
const CACHED_SETTING_KEY = 'setting';
+@injectable()
export default class SettingRepository {
private cache: MemoryStorage;