move constants to typings as well

This commit is contained in:
Labhansh Agrawal 2023-07-25 16:09:11 +05:30
parent c62ed62752
commit f48c0e0608
22 changed files with 34 additions and 34 deletions

18
typings/constants/config.d.ts vendored Normal file
View file

@ -0,0 +1,18 @@
import type {configOptions} from '../config';
export const CONFIG_LOAD = 'CONFIG_LOAD';
export const CONFIG_RELOAD = 'CONFIG_RELOAD';
export interface ConfigLoadAction {
type: typeof CONFIG_LOAD;
config: configOptions;
now?: number;
}
export interface ConfigReloadAction {
type: typeof CONFIG_RELOAD;
config: configOptions;
now: number;
}
export type ConfigActions = ConfigLoadAction | ConfigReloadAction;

7
typings/constants/index.d.ts vendored Normal file
View file

@ -0,0 +1,7 @@
export const INIT = 'INIT';
export interface InitAction {
type: typeof INIT;
}
export type InitActions = InitAction;

15
typings/constants/notifications.d.ts vendored Normal file
View file

@ -0,0 +1,15 @@
export const NOTIFICATION_MESSAGE = 'NOTIFICATION_MESSAGE';
export const NOTIFICATION_DISMISS = 'NOTIFICATION_DISMISS';
export interface NotificationMessageAction {
type: typeof NOTIFICATION_MESSAGE;
text: string;
url: string | null;
dismissable: boolean;
}
export interface NotificationDismissAction {
type: typeof NOTIFICATION_DISMISS;
id: string;
}
export type NotificationActions = NotificationMessageAction | NotificationDismissAction;

93
typings/constants/sessions.d.ts vendored Normal file
View file

@ -0,0 +1,93 @@
export const SESSION_ADD = 'SESSION_ADD';
export const SESSION_RESIZE = 'SESSION_RESIZE';
export const SESSION_REQUEST = 'SESSION_REQUEST';
export const SESSION_ADD_DATA = 'SESSION_ADD_DATA';
export const SESSION_PTY_DATA = 'SESSION_PTY_DATA';
export const SESSION_PTY_EXIT = 'SESSION_PTY_EXIT';
export const SESSION_USER_EXIT = 'SESSION_USER_EXIT';
export const SESSION_SET_ACTIVE = 'SESSION_SET_ACTIVE';
export const SESSION_CLEAR_ACTIVE = 'SESSION_CLEAR_ACTIVE';
export const SESSION_USER_DATA = 'SESSION_USER_DATA';
export const SESSION_SET_XTERM_TITLE = 'SESSION_SET_XTERM_TITLE';
export const SESSION_SET_CWD = 'SESSION_SET_CWD';
export const SESSION_SEARCH = 'SESSION_SEARCH';
export interface SessionAddAction {
type: typeof SESSION_ADD;
uid: string;
shell: string | null;
pid: number | null;
cols: number | null;
rows: number | null;
splitDirection?: 'HORIZONTAL' | 'VERTICAL';
activeUid: string | null;
now: number;
profile: string;
}
export interface SessionResizeAction {
type: typeof SESSION_RESIZE;
uid: string;
cols: number;
rows: number;
isStandaloneTerm: boolean;
now: number;
}
export interface SessionRequestAction {
type: typeof SESSION_REQUEST;
}
export interface SessionAddDataAction {
type: typeof SESSION_ADD_DATA;
}
export interface SessionPtyDataAction {
type: typeof SESSION_PTY_DATA;
data: string;
uid: string;
now: number;
}
export interface SessionPtyExitAction {
type: typeof SESSION_PTY_EXIT;
uid: string;
}
export interface SessionUserExitAction {
type: typeof SESSION_USER_EXIT;
uid: string;
}
export interface SessionSetActiveAction {
type: typeof SESSION_SET_ACTIVE;
uid: string;
}
export interface SessionClearActiveAction {
type: typeof SESSION_CLEAR_ACTIVE;
}
export interface SessionUserDataAction {
type: typeof SESSION_USER_DATA;
}
export interface SessionSetXtermTitleAction {
type: typeof SESSION_SET_XTERM_TITLE;
uid: string;
title: string;
}
export interface SessionSetCwdAction {
type: typeof SESSION_SET_CWD;
cwd: string;
}
export interface SessionSearchAction {
type: typeof SESSION_SEARCH;
uid: string;
value: boolean;
}
export type SessionActions =
| SessionAddAction
| SessionResizeAction
| SessionRequestAction
| SessionAddDataAction
| SessionPtyDataAction
| SessionPtyExitAction
| SessionUserExitAction
| SessionSetActiveAction
| SessionClearActiveAction
| SessionUserDataAction
| SessionSetXtermTitleAction
| SessionSetCwdAction
| SessionSearchAction;

11
typings/constants/tabs.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
export const CLOSE_TAB = 'CLOSE_TAB';
export const CHANGE_TAB = 'CHANGE_TAB';
export interface CloseTabAction {
type: typeof CLOSE_TAB;
}
export interface ChangeTabAction {
type: typeof CHANGE_TAB;
}
export type TabActions = CloseTabAction | ChangeTabAction;

30
typings/constants/term-groups.d.ts vendored Normal file
View file

@ -0,0 +1,30 @@
export const TERM_GROUP_REQUEST = 'TERM_GROUP_REQUEST';
export const TERM_GROUP_EXIT = 'TERM_GROUP_EXIT';
export const TERM_GROUP_RESIZE = 'TERM_GROUP_RESIZE';
export const TERM_GROUP_EXIT_ACTIVE = 'TERM_GROUP_EXIT_ACTIVE';
export enum DIRECTION {
HORIZONTAL = 'HORIZONTAL',
VERTICAL = 'VERTICAL'
}
export interface TermGroupRequestAction {
type: typeof TERM_GROUP_REQUEST;
}
export interface TermGroupExitAction {
type: typeof TERM_GROUP_EXIT;
uid: string;
}
export interface TermGroupResizeAction {
type: typeof TERM_GROUP_RESIZE;
uid: string;
sizes: number[];
}
export interface TermGroupExitActiveAction {
type: typeof TERM_GROUP_EXIT_ACTIVE;
}
export type TermGroupActions =
| TermGroupRequestAction
| TermGroupExitAction
| TermGroupResizeAction
| TermGroupExitActiveAction;

127
typings/constants/ui.d.ts vendored Normal file
View file

@ -0,0 +1,127 @@
export const UI_FONT_SIZE_SET = 'UI_FONT_SIZE_SET';
export const UI_FONT_SIZE_INCR = 'UI_FONT_SIZE_INCR';
export const UI_FONT_SIZE_DECR = 'UI_FONT_SIZE_DECR';
export const UI_FONT_SIZE_RESET = 'UI_FONT_SIZE_RESET';
export const UI_FONT_SMOOTHING_SET = 'UI_FONT_SMOOTHING_SET';
export const UI_MOVE_LEFT = 'UI_MOVE_LEFT';
export const UI_MOVE_RIGHT = 'UI_MOVE_RIGHT';
export const UI_MOVE_TO = 'UI_MOVE_TO';
export const UI_MOVE_NEXT_PANE = 'UI_MOVE_NEXT_PANE';
export const UI_MOVE_PREV_PANE = 'UI_MOVE_PREV_PANE';
export const UI_SHOW_PREFERENCES = 'UI_SHOW_PREFERENCES';
export const UI_WINDOW_MOVE = 'UI_WINDOW_MOVE';
export const UI_WINDOW_MAXIMIZE = 'UI_WINDOW_MAXIMIZE';
export const UI_WINDOW_UNMAXIMIZE = 'UI_WINDOW_UNMAXIMIZE';
export const UI_WINDOW_GEOMETRY_CHANGED = 'UI_WINDOW_GEOMETRY_CHANGED';
export const UI_OPEN_FILE = 'UI_OPEN_FILE';
export const UI_OPEN_SSH_URL = 'UI_OPEN_SSH_URL';
export const UI_OPEN_HAMBURGER_MENU = 'UI_OPEN_HAMBURGER_MENU';
export const UI_WINDOW_MINIMIZE = 'UI_WINDOW_MINIMIZE';
export const UI_WINDOW_CLOSE = 'UI_WINDOW_CLOSE';
export const UI_ENTER_FULLSCREEN = 'UI_ENTER_FULLSCREEN';
export const UI_LEAVE_FULLSCREEN = 'UI_LEAVE_FULLSCREEN';
export const UI_CONTEXTMENU_OPEN = 'UI_CONTEXTMENU_OPEN';
export const UI_COMMAND_EXEC = 'UI_COMMAND_EXEC';
export interface UIFontSizeSetAction {
type: typeof UI_FONT_SIZE_SET;
value: number;
}
export interface UIFontSizeIncrAction {
type: typeof UI_FONT_SIZE_INCR;
}
export interface UIFontSizeDecrAction {
type: typeof UI_FONT_SIZE_DECR;
}
export interface UIFontSizeResetAction {
type: typeof UI_FONT_SIZE_RESET;
}
export interface UIFontSmoothingSetAction {
type: typeof UI_FONT_SMOOTHING_SET;
fontSmoothing: string;
}
export interface UIMoveLeftAction {
type: typeof UI_MOVE_LEFT;
}
export interface UIMoveRightAction {
type: typeof UI_MOVE_RIGHT;
}
export interface UIMoveToAction {
type: typeof UI_MOVE_TO;
}
export interface UIMoveNextPaneAction {
type: typeof UI_MOVE_NEXT_PANE;
}
export interface UIMovePrevPaneAction {
type: typeof UI_MOVE_PREV_PANE;
}
export interface UIShowPreferencesAction {
type: typeof UI_SHOW_PREFERENCES;
}
export interface UIWindowMoveAction {
type: typeof UI_WINDOW_MOVE;
}
export interface UIWindowMaximizeAction {
type: typeof UI_WINDOW_MAXIMIZE;
}
export interface UIWindowUnmaximizeAction {
type: typeof UI_WINDOW_UNMAXIMIZE;
}
export interface UIWindowGeometryChangedAction {
type: typeof UI_WINDOW_GEOMETRY_CHANGED;
isMaximized: boolean;
}
export interface UIOpenFileAction {
type: typeof UI_OPEN_FILE;
}
export interface UIOpenSshUrlAction {
type: typeof UI_OPEN_SSH_URL;
}
export interface UIOpenHamburgerMenuAction {
type: typeof UI_OPEN_HAMBURGER_MENU;
}
export interface UIWindowMinimizeAction {
type: typeof UI_WINDOW_MINIMIZE;
}
export interface UIWindowCloseAction {
type: typeof UI_WINDOW_CLOSE;
}
export interface UIEnterFullscreenAction {
type: typeof UI_ENTER_FULLSCREEN;
}
export interface UILeaveFullscreenAction {
type: typeof UI_LEAVE_FULLSCREEN;
}
export interface UIContextmenuOpenAction {
type: typeof UI_CONTEXTMENU_OPEN;
}
export interface UICommandExecAction {
type: typeof UI_COMMAND_EXEC;
command: string;
}
export type UIActions =
| UIFontSizeSetAction
| UIFontSizeIncrAction
| UIFontSizeDecrAction
| UIFontSizeResetAction
| UIFontSmoothingSetAction
| UIMoveLeftAction
| UIMoveRightAction
| UIMoveToAction
| UIMoveNextPaneAction
| UIMovePrevPaneAction
| UIShowPreferencesAction
| UIWindowMoveAction
| UIWindowMaximizeAction
| UIWindowUnmaximizeAction
| UIWindowGeometryChangedAction
| UIOpenFileAction
| UIOpenSshUrlAction
| UIOpenHamburgerMenuAction
| UIWindowMinimizeAction
| UIWindowCloseAction
| UIEnterFullscreenAction
| UILeaveFullscreenAction
| UIContextmenuOpenAction
| UICommandExecAction;

15
typings/constants/updater.d.ts vendored Normal file
View file

@ -0,0 +1,15 @@
export const UPDATE_INSTALL = 'UPDATE_INSTALL';
export const UPDATE_AVAILABLE = 'UPDATE_AVAILABLE';
export interface UpdateInstallAction {
type: typeof UPDATE_INSTALL;
}
export interface UpdateAvailableAction {
type: typeof UPDATE_AVAILABLE;
version: string;
notes: string | null;
releaseUrl: string;
canInstall: boolean;
}
export type UpdateActions = UpdateInstallAction | UpdateAvailableAction;

16
typings/hyper.d.ts vendored
View file

@ -167,14 +167,14 @@ export type HyperState = {
termGroups: ITermState;
};
import type {UIActions} from '../lib/constants/ui';
import type {ConfigActions} from '../lib/constants/config';
import type {SessionActions} from '../lib/constants/sessions';
import type {NotificationActions} from '../lib/constants/notifications';
import type {UpdateActions} from '../lib/constants/updater';
import type {TermGroupActions} from '../lib/constants/term-groups';
import type {InitActions} from '../lib/constants';
import type {TabActions} from '../lib/constants/tabs';
import type {UIActions} from './constants/ui';
import type {ConfigActions} from './constants/config';
import type {SessionActions} from './constants/sessions';
import type {NotificationActions} from './constants/notifications';
import type {UpdateActions} from './constants/updater';
import type {TermGroupActions} from './constants/term-groups';
import type {InitActions} from './constants';
import type {TabActions} from './constants/tabs';
export type HyperActions = (
| UIActions