diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-03-25 06:50:09 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-03-25 06:50:09 +0900 |
commit | 6be2dabff6c35fb79d85ba39b692c5d06cd53125 (patch) | |
tree | 9140b88490cf6cb778a96b9ddacc17bb8f296cf1 /src/console | |
parent | 2e1356b4c67206e1eda82d842fe4280452a048ff (diff) |
Use typed completions on console
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/Completions.ts | 11 | ||||
-rw-r--r-- | src/console/actions/index.ts | 5 | ||||
-rw-r--r-- | src/console/reducers/index.ts | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/console/Completions.ts b/src/console/Completions.ts new file mode 100644 index 0000000..ec9135f --- /dev/null +++ b/src/console/Completions.ts @@ -0,0 +1,11 @@ +type Completions = { + readonly name: string; + readonly items: { + readonly caption?: string; + readonly content?: string; + readonly url?: string; + readonly icon?: string; + }[]; +}[] + +export default Completions;
\ No newline at end of file diff --git a/src/console/actions/index.ts b/src/console/actions/index.ts index 3770496..d36f8cd 100644 --- a/src/console/actions/index.ts +++ b/src/console/actions/index.ts @@ -1,4 +1,5 @@ -// console commands +import Completions from "../Completions"; + export const CONSOLE_HIDE = 'console.hide'; export const CONSOLE_SHOW_COMMAND = 'console.show.command'; export const CONSOLE_SHOW_ERROR = 'console.show.error'; @@ -44,7 +45,7 @@ interface SetConsoleTextAction { interface SetCompletionsAction { type: typeof CONSOLE_SET_COMPLETIONS; - completions: any[]; + completions: Completions; completionSource: string; } diff --git a/src/console/reducers/index.ts b/src/console/reducers/index.ts index 048a24f..677a982 100644 --- a/src/console/reducers/index.ts +++ b/src/console/reducers/index.ts @@ -1,11 +1,12 @@ import * as actions from '../actions'; +import Completions from "../Completions"; export interface State { mode: string; messageText: string; consoleText: string; completionSource: string; - completions: any[], + completions: Completions; select: number; viewIndex: number; } |