diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-08-11 21:34:11 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-08-11 21:34:11 +0900 |
commit | 1f10eac90011e6c3c1ad20ce91b358911dc74dcb (patch) | |
tree | 7913507c61396b65512f54c34c42e92a240e3f11 /src/background | |
parent | 3a4bdca8ba11a6448f4d16169e7a5161b2ad2e94 (diff) |
Enable @typescript-eslint/ban-types rule
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/presenters/TabPresenter.ts | 24 | ||||
-rw-r--r-- | src/background/repositories/BrowserSettingRepository.ts | 2 |
2 files changed, 23 insertions, 3 deletions
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<Tab>; - create(url: string, opts?: object): Promise<Tab>; + create( + url: string, + opts?: { + active?: boolean; + cookieStoreId?: string; + index?: number; + openerTabId?: number; + pinned?: boolean; + windowId?: number; + } + ): Promise<Tab>; getCurrent(): Promise<Tab>; @@ -44,7 +54,17 @@ export class TabPresenterImpl implements TabPresenter { return browser.tabs.update(tabId, { url }); } - create(url: string, opts?: object): Promise<Tab> { + create( + url: string, + opts?: { + active?: boolean; + cookieStoreId?: string; + index?: number; + openerTabId?: number; + pinned?: boolean; + windowId?: number; + } + ): Promise<Tab> { 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<BrowserSettings>; + function get(param: { [key: string]: string }): Promise<BrowserSettings>; } @injectable() |