aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-03-28 21:35:06 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-03-28 21:43:40 +0900
commitea63c5f78b4c985e9d6dd106afe4f97bfeedbcd0 (patch)
treef0accb862f9f3b75c8c86f78361e2acab46f11ef /src/shared
parenta8d78f1286fb3fe456a786b2c0e534d212835560 (diff)
Complete tabs by the completion packages
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/TabFlag.ts7
-rw-r--r--src/shared/messages.ts17
2 files changed, 24 insertions, 0 deletions
diff --git a/src/shared/TabFlag.ts b/src/shared/TabFlag.ts
new file mode 100644
index 0000000..b10d5c6
--- /dev/null
+++ b/src/shared/TabFlag.ts
@@ -0,0 +1,7 @@
+enum TabFlag {
+ CurrentTab = '%',
+ LastTab = '#',
+ None = '',
+}
+
+export default TabFlag \ No newline at end of file
diff --git a/src/shared/messages.ts b/src/shared/messages.ts
index be6a2e1..3f6b7bf 100644
--- a/src/shared/messages.ts
+++ b/src/shared/messages.ts
@@ -1,5 +1,6 @@
import * as operations from './operations';
import CompletionType from "./CompletionType";
+import TabFlag from "./TabFlag";
export const BACKGROUND_OPERATION = 'background.operation';
@@ -16,6 +17,7 @@ export const CONSOLE_GET_COMPLETION_TYPES = 'console.get.completion.types'
export const CONSOLE_REQUEST_SEARCH_ENGINES_MESSAGE = 'console.qresut.searchEngines';
export const CONSOLE_REQUEST_BOOKMARKS = 'console.request.bookmarks';
export const CONSOLE_REQUEST_HISTORY = 'console.request.history';
+export const CONSOLE_REQUEST_TABS = 'console.request.tabs';
export const FOLLOW_START = 'follow.start';
export const FOLLOW_REQUEST_COUNT_TARGETS = 'follow.request.count.targets';
@@ -119,6 +121,20 @@ export interface ConsoleRequestHistoryMessage {
query: string;
}
+export interface ConsoleRequestTabsMessage {
+ type: typeof CONSOLE_REQUEST_TABS;
+ query: string;
+ excludePinned: boolean;
+}
+
+export type ConsoleRequesttabsResponse = {
+ index: number
+ flag: TabFlag
+ title: string
+ url: string
+ faviconUrl?: string
+}[]
+
export type ConsoleGetCompletionTypesResponse = CompletionType[];
export type ConsoleRequestSearchEnginesResponse = {
@@ -279,6 +295,7 @@ export type Message =
ConsoleHideMessage |
ConsoleRequestBookmarksMessage |
ConsoleRequestHistoryMessage |
+ ConsoleRequestTabsMessage |
ConsoleGetCompletionTypesMessage |
ConsoleRequestSearchEnginesMessage |
FollowStartMessage |