From 1f10eac90011e6c3c1ad20ce91b358911dc74dcb Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 11 Aug 2020 21:34:11 +0900 Subject: Enable @typescript-eslint/ban-types rule --- src/background/presenters/TabPresenter.ts | 24 ++++++++++++++++++++-- .../repositories/BrowserSettingRepository.ts | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'src/background') diff --git a/src/background/presenters/TabPresenter.ts b/src/background/presenters/TabPresenter.ts index 09cfa23..2f8f5d9 100644 --- a/src/background/presenters/TabPresenter.ts +++ b/src/background/presenters/TabPresenter.ts @@ -8,7 +8,17 @@ type Tab = browser.tabs.Tab; export default interface TabPresenter { open(url: string, tabId?: number): Promise; - create(url: string, opts?: object): Promise; + create( + url: string, + opts?: { + active?: boolean; + cookieStoreId?: string; + index?: number; + openerTabId?: number; + pinned?: boolean; + windowId?: number; + } + ): Promise; getCurrent(): Promise; @@ -44,7 +54,17 @@ export class TabPresenterImpl implements TabPresenter { return browser.tabs.update(tabId, { url }); } - create(url: string, opts?: object): Promise { + create( + url: string, + opts?: { + active?: boolean; + cookieStoreId?: string; + index?: number; + openerTabId?: number; + pinned?: boolean; + windowId?: number; + } + ): Promise { return browser.tabs.create({ url, ...opts }); } diff --git a/src/background/repositories/BrowserSettingRepository.ts b/src/background/repositories/BrowserSettingRepository.ts index 20013f4..272cc1e 100644 --- a/src/background/repositories/BrowserSettingRepository.ts +++ b/src/background/repositories/BrowserSettingRepository.ts @@ -13,7 +13,7 @@ declare namespace browser.browserSettings.homepageOverride { | "controllable_by_this_extension" | "controlled_by_this_extension"; - function get(param: object): Promise; + function get(param: { [key: string]: string }): Promise; } @injectable() -- cgit v1.2.3