aboutsummaryrefslogtreecommitdiff
path: root/src/console/actions/index.ts
blob: 308a09310a033930987a944fcfb3fb1dd9876b83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import Completions from "../Completions";
import CompletionType from "../../shared/CompletionType";

export const CONSOLE_HIDE = "console.hide";
export const CONSOLE_SHOW_COMMAND = "console.show.command";
export const CONSOLE_SHOW_ERROR = "console.show.error";
export const CONSOLE_SHOW_INFO = "console.show.info";
export const CONSOLE_HIDE_COMMAND = "console.hide.command";
export const CONSOLE_SET_CONSOLE_TEXT = "console.set.command";
export const CONSOLE_SET_COMPLETIONS = "console.set.completions";
export const CONSOLE_COMPLETION_NEXT = "console.completion.next";
export const CONSOLE_COMPLETION_PREV = "console.completion.prev";
export const CONSOLE_SHOW_FIND = "console.show.find";

export interface HideAction {
  type: typeof CONSOLE_HIDE;
}

export interface ShowCommand {
  type: typeof CONSOLE_SHOW_COMMAND;
  text: string;
  completionTypes: CompletionType[];
}

export interface ShowFindAction {
  type: typeof CONSOLE_SHOW_FIND;
}

export interface ShowErrorAction {
  type: typeof CONSOLE_SHOW_ERROR;
  text: string;
}

export interface ShowInfoAction {
  type: typeof CONSOLE_SHOW_INFO;
  text: string;
}

export interface HideCommandAction {
  type: typeof CONSOLE_HIDE_COMMAND;
}

export interface SetConsoleTextAction {
  type: typeof CONSOLE_SET_CONSOLE_TEXT;
  consoleText: string;
}

export interface SetCompletionsAction {
  type: typeof CONSOLE_SET_COMPLETIONS;
  completions: Completions;
  completionSource: string;
}

export interface CompletionNextAction {
  type: typeof CONSOLE_COMPLETION_NEXT;
}

export interface CompletionPrevAction {
  type: typeof CONSOLE_COMPLETION_PREV;
}

export type ConsoleAction =
  | HideAction
  | ShowCommand
  | ShowFindAction
  | ShowErrorAction
  | ShowInfoAction
  | HideCommandAction
  | SetConsoleTextAction
  | SetCompletionsAction
  | CompletionNextAction
  | CompletionPrevAction;