2019-10-19 08:59:56 -08:00
|
|
|
import {Immutable} from 'seamless-immutable';
|
|
|
|
|
|
2019-10-12 07:29:25 -08:00
|
|
|
declare global {
|
|
|
|
|
interface Window {
|
|
|
|
|
__rpcId: string;
|
2019-11-11 06:21:42 -09:00
|
|
|
rpc: any;
|
|
|
|
|
focusActiveTerm: any;
|
2019-10-12 07:29:25 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type ITermGroup = {
|
2019-10-20 00:08:48 -08:00
|
|
|
uid: string;
|
2019-10-12 07:29:25 -08:00
|
|
|
sessionUid: string | null;
|
|
|
|
|
parentUid: string | null;
|
2020-03-07 05:38:46 -09:00
|
|
|
direction: 'HORIZONTAL' | 'VERTICAL' | null;
|
2019-10-12 07:29:25 -08:00
|
|
|
sizes: number[] | null;
|
|
|
|
|
children: string[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ITermGroups = Record<string, ITermGroup>;
|
|
|
|
|
|
|
|
|
|
export type ITermState = {
|
|
|
|
|
termGroups: ITermGroups;
|
|
|
|
|
activeSessions: Record<string, string>;
|
|
|
|
|
activeRootGroup: string | null;
|
|
|
|
|
};
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2020-03-07 05:38:46 -09:00
|
|
|
export type cursorShapes = 'BEAM' | 'UNDERLINE' | 'BLOCK';
|
|
|
|
|
import {FontWeight} from 'xterm';
|
|
|
|
|
|
2019-10-19 08:59:56 -08:00
|
|
|
export type uiState = {
|
2019-12-28 01:39:17 -09:00
|
|
|
_lastUpdate: number | null;
|
2019-10-19 08:59:56 -08:00
|
|
|
activeUid: string | null;
|
2019-11-11 06:21:42 -09:00
|
|
|
activityMarkers: Record<string, boolean>;
|
2019-10-19 08:59:56 -08:00
|
|
|
backgroundColor: string;
|
|
|
|
|
bell: string;
|
|
|
|
|
bellSoundURL: string | null;
|
|
|
|
|
bellSound: string | null;
|
|
|
|
|
borderColor: string;
|
|
|
|
|
colors: {
|
|
|
|
|
black: string;
|
|
|
|
|
blue: string;
|
|
|
|
|
cyan: string;
|
|
|
|
|
green: string;
|
|
|
|
|
lightBlack: string;
|
|
|
|
|
lightBlue: string;
|
|
|
|
|
lightCyan: string;
|
|
|
|
|
lightGreen: string;
|
|
|
|
|
lightMagenta: string;
|
|
|
|
|
lightRed: string;
|
|
|
|
|
lightWhite: string;
|
|
|
|
|
lightYellow: string;
|
|
|
|
|
magenta: string;
|
|
|
|
|
red: string;
|
|
|
|
|
white: string;
|
|
|
|
|
yellow: string;
|
|
|
|
|
};
|
|
|
|
|
cols: number | null;
|
|
|
|
|
copyOnSelect: boolean;
|
|
|
|
|
css: string;
|
|
|
|
|
cursorAccentColor: string;
|
|
|
|
|
cursorBlink: boolean;
|
|
|
|
|
cursorColor: string;
|
2020-03-07 05:38:46 -09:00
|
|
|
cursorShape: cursorShapes;
|
2019-10-19 08:59:56 -08:00
|
|
|
cwd?: string;
|
|
|
|
|
disableLigatures: boolean;
|
|
|
|
|
fontFamily: string;
|
|
|
|
|
fontSize: number;
|
|
|
|
|
fontSizeOverride: null | number;
|
|
|
|
|
fontSmoothingOverride: string;
|
2020-03-07 05:38:46 -09:00
|
|
|
fontWeight: FontWeight;
|
|
|
|
|
fontWeightBold: FontWeight;
|
2019-10-19 08:59:56 -08:00
|
|
|
foregroundColor: string;
|
|
|
|
|
fullScreen: boolean;
|
|
|
|
|
letterSpacing: number;
|
|
|
|
|
lineHeight: number;
|
|
|
|
|
macOptionSelectionMode: string;
|
|
|
|
|
maximized: boolean;
|
|
|
|
|
messageDismissable: null | boolean;
|
2019-12-28 01:39:17 -09:00
|
|
|
messageText: string | null;
|
|
|
|
|
messageURL: string | null;
|
2019-10-19 08:59:56 -08:00
|
|
|
modifierKeys: {
|
|
|
|
|
altIsMeta: boolean;
|
|
|
|
|
cmdIsMeta: boolean;
|
|
|
|
|
};
|
|
|
|
|
notifications: {
|
|
|
|
|
font: boolean;
|
|
|
|
|
message: boolean;
|
|
|
|
|
resize: boolean;
|
|
|
|
|
updates: boolean;
|
|
|
|
|
};
|
|
|
|
|
openAt: Record<string, number>;
|
|
|
|
|
padding: string;
|
|
|
|
|
quickEdit: boolean;
|
|
|
|
|
resizeAt: number;
|
|
|
|
|
rows: number | null;
|
|
|
|
|
scrollback: number;
|
|
|
|
|
selectionColor: string;
|
|
|
|
|
showHamburgerMenu: string;
|
|
|
|
|
showWindowControls: string;
|
|
|
|
|
termCSS: string;
|
|
|
|
|
uiFontFamily: string;
|
|
|
|
|
updateCanInstall: null | boolean;
|
2019-11-11 06:21:42 -09:00
|
|
|
updateNotes: string | null;
|
|
|
|
|
updateReleaseUrl: string | null;
|
|
|
|
|
updateVersion: string | null;
|
2019-10-19 08:59:56 -08:00
|
|
|
webGLRenderer: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type session = {
|
|
|
|
|
cleared: boolean;
|
2019-10-20 00:08:48 -08:00
|
|
|
cols: number | null;
|
|
|
|
|
pid: number | null;
|
|
|
|
|
resizeAt?: number;
|
|
|
|
|
rows: number | null;
|
2019-10-19 08:59:56 -08:00
|
|
|
search: boolean;
|
2019-12-28 01:39:17 -09:00
|
|
|
shell: string | null;
|
2019-10-19 08:59:56 -08:00
|
|
|
title: string;
|
|
|
|
|
uid: string;
|
2019-10-20 00:08:48 -08:00
|
|
|
url: string | null;
|
2020-03-07 05:38:46 -09:00
|
|
|
splitDirection?: 'HORIZONTAL' | 'VERTICAL';
|
2019-10-20 00:08:48 -08:00
|
|
|
activeUid?: string;
|
2019-10-19 08:59:56 -08:00
|
|
|
};
|
|
|
|
|
export type sessionState = {
|
2019-10-20 00:08:48 -08:00
|
|
|
sessions: Record<string, session>;
|
2019-10-19 08:59:56 -08:00
|
|
|
activeUid: string | null;
|
2019-11-11 06:21:42 -09:00
|
|
|
write?: any;
|
2019-10-19 08:59:56 -08:00
|
|
|
};
|
|
|
|
|
|
2019-12-28 01:39:17 -09:00
|
|
|
export {ITermGroupReducer} from './reducers/term-groups';
|
|
|
|
|
import {ITermGroupReducer} from './reducers/term-groups';
|
|
|
|
|
|
|
|
|
|
export {IUiReducer} from './reducers/ui';
|
|
|
|
|
import {IUiReducer} from './reducers/ui';
|
|
|
|
|
|
|
|
|
|
export {ISessionReducer} from './reducers/sessions';
|
|
|
|
|
import {ISessionReducer} from './reducers/sessions';
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2020-03-07 05:38:46 -09:00
|
|
|
import {Middleware} from 'redux';
|
2019-10-19 08:59:56 -08:00
|
|
|
export type hyperPlugin = {
|
|
|
|
|
getTabProps: any;
|
|
|
|
|
getTabsProps: any;
|
|
|
|
|
getTermGroupProps: any;
|
|
|
|
|
getTermProps: any;
|
|
|
|
|
mapHeaderDispatch: any;
|
|
|
|
|
mapHyperDispatch: any;
|
|
|
|
|
mapHyperTermDispatch: any;
|
|
|
|
|
mapNotificationsDispatch: any;
|
|
|
|
|
mapTermsDispatch: any;
|
|
|
|
|
mapHeaderState: any;
|
|
|
|
|
mapHyperState: any;
|
|
|
|
|
mapHyperTermState: any;
|
|
|
|
|
mapNotificationsState: any;
|
|
|
|
|
mapTermsState: any;
|
2020-03-07 05:38:46 -09:00
|
|
|
middleware: Middleware;
|
2019-10-19 08:59:56 -08:00
|
|
|
onRendererWindow: any;
|
2019-10-20 00:08:48 -08:00
|
|
|
reduceSessions: ISessionReducer;
|
|
|
|
|
reduceTermGroups: ITermGroupReducer;
|
|
|
|
|
reduceUI: IUiReducer;
|
2019-10-19 08:59:56 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
import rootReducer from './reducers/index';
|
|
|
|
|
export type HyperState = ReturnType<typeof rootReducer>;
|
2019-11-11 06:21:42 -09:00
|
|
|
|
2019-12-27 06:33:21 -09:00
|
|
|
import {UIActions} from './constants/ui';
|
|
|
|
|
import {ConfigActions} from './constants/config';
|
|
|
|
|
import {SessionActions} from './constants/sessions';
|
|
|
|
|
import {NotificationActions} from './constants/notifications';
|
|
|
|
|
import {UpdateActions} from './constants/updater';
|
|
|
|
|
import {TermGroupActions} from './constants/term-groups';
|
|
|
|
|
import {InitActions} from './constants';
|
|
|
|
|
import {TabActions} from './constants/tabs';
|
|
|
|
|
|
|
|
|
|
export type HyperActions = (
|
|
|
|
|
| UIActions
|
|
|
|
|
| ConfigActions
|
|
|
|
|
| SessionActions
|
|
|
|
|
| NotificationActions
|
|
|
|
|
| UpdateActions
|
|
|
|
|
| TermGroupActions
|
|
|
|
|
| InitActions
|
|
|
|
|
| TabActions
|
|
|
|
|
) & {effect?: () => void};
|
|
|
|
|
|
2019-11-11 06:21:42 -09:00
|
|
|
type immutableRecord<T> = {[k in keyof T]: Immutable<T[k]>};
|
|
|
|
|
|
2020-01-02 08:49:57 -09:00
|
|
|
import {ThunkDispatch} from 'redux-thunk';
|
|
|
|
|
import configureStore from './store/configure-store';
|
|
|
|
|
export type HyperThunkDispatch = ThunkDispatch<HyperState, undefined, HyperActions>;
|
|
|
|
|
export type HyperDispatch = ReturnType<typeof configureStore>['dispatch'];
|
|
|
|
|
|
2020-02-19 06:41:29 -09:00
|
|
|
type extensionProps = Partial<{
|
|
|
|
|
customChildren: any;
|
|
|
|
|
customChildrenBefore: any;
|
2019-11-11 06:21:42 -09:00
|
|
|
customCSS: string;
|
2020-02-19 06:41:29 -09:00
|
|
|
customInnerChildren: any;
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
import {HeaderConnectedProps} from './containers/header';
|
|
|
|
|
export type HeaderProps = HeaderConnectedProps & extensionProps;
|
|
|
|
|
|
|
|
|
|
import {HyperConnectedProps} from './containers/hyper';
|
|
|
|
|
export type HyperProps = HyperConnectedProps & extensionProps;
|
|
|
|
|
|
|
|
|
|
import {NotificationsConnectedProps} from './containers/notifications';
|
|
|
|
|
export type NotificationsProps = NotificationsConnectedProps & extensionProps;
|
|
|
|
|
|
|
|
|
|
import {TermsConnectedProps} from './containers/terms';
|
|
|
|
|
export type TermsProps = TermsConnectedProps & extensionProps & {ref_: any};
|
2020-03-10 03:16:00 -08:00
|
|
|
|
|
|
|
|
export type StyleSheetProps = {
|
|
|
|
|
backgroundColor: string;
|
|
|
|
|
borderColor: string;
|
|
|
|
|
fontFamily: string;
|
|
|
|
|
foregroundColor: string;
|
|
|
|
|
} & extensionProps;
|
|
|
|
|
|
|
|
|
|
export type TabProps = {
|
|
|
|
|
borderColor: string;
|
|
|
|
|
hasActivity: boolean;
|
|
|
|
|
isActive: boolean;
|
|
|
|
|
isFirst: boolean;
|
|
|
|
|
isLast: boolean;
|
|
|
|
|
onClick: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
onSelect: () => void;
|
|
|
|
|
text: string;
|
|
|
|
|
} & extensionProps;
|
|
|
|
|
|
|
|
|
|
export type ITab = {
|
|
|
|
|
uid: string;
|
|
|
|
|
title: string;
|
|
|
|
|
isActive: boolean;
|
|
|
|
|
hasActivity: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type TabsProps = {
|
|
|
|
|
tabs: ITab[];
|
|
|
|
|
borderColor: string;
|
|
|
|
|
onChange: () => void;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
fullScreen: boolean;
|
|
|
|
|
} & extensionProps;
|