aboutsummaryrefslogtreecommitdiff
path: root/src/console/clients
diff options
context:
space:
mode:
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;
+ }
}