aboutsummaryrefslogtreecommitdiff
path: root/src/console/clients
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/console/clients
parenta8d78f1286fb3fe456a786b2c0e534d212835560 (diff)
Complete tabs by the completion packages
Diffstat (limited to 'src/console/clients')
-rw-r--r--src/console/clients/CompletionClient.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/console/clients/CompletionClient.ts b/src/console/clients/CompletionClient.ts
index d5f9b01..19b4d99 100644
--- a/src/console/clients/CompletionClient.ts
+++ b/src/console/clients/CompletionClient.ts
@@ -2,9 +2,10 @@ import * as messages from "../../shared/messages";
import {
ConsoleGetCompletionTypesResponse,
ConsoleRequestBookmarksResponse,
- ConsoleRequestHistoryResponse, ConsoleRequestSearchEnginesResponse
+ ConsoleRequestHistoryResponse, ConsoleRequestSearchEnginesResponse, ConsoleRequesttabsResponse
} from "../../shared/messages";
import CompletionType from "../../shared/CompletionType";
+import TabFlag from "../../shared/TabFlag";
export type SearchEngines = {
title: string
@@ -20,6 +21,14 @@ export type HistoryItem = {
url: string
}
+export type TabItem = {
+ index: number
+ flag: TabFlag
+ title: string
+ url: string
+ faviconUrl?: string
+}
+
export default class CompletionClient {
async getCompletionTypes(): Promise<CompletionType[]> {
const resp = await browser.runtime.sendMessage({
@@ -51,4 +60,13 @@ export default class CompletionClient {
}) as ConsoleRequestHistoryResponse;
return resp;
}
+
+ async requestTabs(query: string, excludePinned: boolean): Promise<TabItem[]> {
+ const resp = await browser.runtime.sendMessage({
+ type: messages.CONSOLE_REQUEST_TABS,
+ query,
+ excludePinned,
+ }) as ConsoleRequesttabsResponse;
+ return resp;
+ }
}