diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-01 23:10:37 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-02 22:07:53 +0900 |
commit | 0452370df43cc4263f268e7064f824d7e6e489b3 (patch) | |
tree | 3fb6677236687b085fceacc6fb2b6046cf5c1869 /src/background | |
parent | 8cf8a0e62549a8c56ef821e207dbf2bca6d182f0 (diff) |
Types on src/console
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/usecases/CompletionsUseCase.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/background/usecases/CompletionsUseCase.ts b/src/background/usecases/CompletionsUseCase.ts index 037d6eb..f3a808b 100644 --- a/src/background/usecases/CompletionsUseCase.ts +++ b/src/background/usecases/CompletionsUseCase.ts @@ -1,4 +1,3 @@ -import Completions from '../domains/Completions'; import CompletionGroup from '../domains/CompletionGroup'; import CommandDocs from '../domains/CommandDocs'; import CompletionsRepository from '../repositories/CompletionsRepository'; @@ -25,7 +24,7 @@ export default class CompletionsUseCase { this.settingRepository = new SettingRepository(); } - queryConsoleCommand(prefix: string): Promise<Completions> { + queryConsoleCommand(prefix: string): Promise<CompletionGroup[]> { let keys = Object.keys(CommandDocs); let items = keys .filter(name => name.startsWith(prefix)) @@ -38,10 +37,10 @@ export default class CompletionsUseCase { if (items.length === 0) { return Promise.resolve([]); } - return Promise.resolve([{ name: 'Console CompletionGroup', items }]); + return Promise.resolve([{ name: 'Console Command', items }]); } - async queryOpen(name: string, keywords: string): Promise<Completions> { + async queryOpen(name: string, keywords: string): Promise<CompletionGroup[]> { let settings = await this.settingRepository.get(); let groups: CompletionGroup[] = []; @@ -71,7 +70,10 @@ export default class CompletionsUseCase { } // eslint-disable-next-line max-statements - async queryBuffer(name: string, keywords: string): Promise<Completions> { + async queryBuffer( + name: string, + keywords: string, + ): Promise<CompletionGroup[]> { let lastId = await this.tabPresenter.getLastSelectedId(); let trimmed = keywords.trim(); let tabs: Tab[] = []; |