aboutsummaryrefslogtreecommitdiff
path: root/src/background/domains
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/domains')
-rw-r--r--src/background/domains/CommandDocs.ts3
-rw-r--r--src/background/domains/CompletionGroup.ts17
-rw-r--r--src/background/domains/CompletionItem.ts29
-rw-r--r--src/background/domains/Completions.ts27
-rw-r--r--src/background/domains/GlobalMark.ts28
5 files changed, 17 insertions, 87 deletions
diff --git a/src/background/domains/CommandDocs.ts b/src/background/domains/CommandDocs.ts
index 734c68e..25ea62a 100644
--- a/src/background/domains/CommandDocs.ts
+++ b/src/background/domains/CommandDocs.ts
@@ -8,5 +8,4 @@ export default {
bdeletes: 'Close all tabs matched by keywords',
quit: 'Close the current tab',
quitall: 'Close all tabs',
-};
-
+} as {[key: string]: string};
diff --git a/src/background/domains/CompletionGroup.ts b/src/background/domains/CompletionGroup.ts
index 1749d72..1eea7d8 100644
--- a/src/background/domains/CompletionGroup.ts
+++ b/src/background/domains/CompletionGroup.ts
@@ -1,14 +1,7 @@
-export default class CompletionGroup {
- constructor(name, items) {
- this.name0 = name;
- this.items0 = items;
- }
+import CompletionItem from './CompletionItem';
- get name() {
- return this.name0;
- }
-
- get items() {
- return this.items0;
- }
+export default interface CompletionGroup {
+ name: string;
+ items: CompletionItem[];
+ // eslint-disable-next-line semi
}
diff --git a/src/background/domains/CompletionItem.ts b/src/background/domains/CompletionItem.ts
index c7ad8a1..657efaa 100644
--- a/src/background/domains/CompletionItem.ts
+++ b/src/background/domains/CompletionItem.ts
@@ -1,24 +1,7 @@
-export default class CompletionItem {
- constructor({ caption, content, url, icon }) {
- this.caption0 = caption;
- this.content0 = content;
- this.url0 = url;
- this.icon0 = icon;
- }
-
- get caption() {
- return this.caption0;
- }
-
- get content() {
- return this.content0;
- }
-
- get url() {
- return this.url0;
- }
-
- get icon() {
- return this.icon0;
- }
+export default interface CompletionItem {
+ readonly caption?: string;
+ readonly content?: string;
+ readonly url?: string;
+ readonly icon?: string;
+ // eslint-disable-next-line semi
}
diff --git a/src/background/domains/Completions.ts b/src/background/domains/Completions.ts
deleted file mode 100644
index f399743..0000000
--- a/src/background/domains/Completions.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export default class Completions {
- constructor(groups) {
- this.g = groups;
- }
-
- get groups() {
- return this.g;
- }
-
- serialize() {
- return this.groups.map(group => ({
- name: group.name,
- items: group.items.map(item => ({
- caption: item.caption,
- content: item.content,
- url: item.url,
- icon: item.icon,
- })),
- }));
- }
-
- static empty() {
- return EMPTY_COMPLETIONS;
- }
-}
-
-let EMPTY_COMPLETIONS = new Completions([]);
diff --git a/src/background/domains/GlobalMark.ts b/src/background/domains/GlobalMark.ts
index f0586f1..0964373 100644
--- a/src/background/domains/GlobalMark.ts
+++ b/src/background/domains/GlobalMark.ts
@@ -1,24 +1,6 @@
-export default class GlobalMark {
- constructor(tabId, url, x, y) {
- this.tabId0 = tabId;
- this.url0 = url;
- this.x0 = x;
- this.y0 = y;
- }
-
- get tabId() {
- return this.tabId0;
- }
-
- get url() {
- return this.url0;
- }
-
- get x() {
- return this.x0;
- }
-
- get y() {
- return this.y0;
- }
+export interface GlobalMark {
+ readonly tabId: number;
+ readonly url: string;
+ readonly x: number;
+ readonly y: number;
}