2019-10-19 08:59:56 -08:00
|
|
|
import {Immutable} from 'seamless-immutable';
|
2020-06-19 04:51:34 -08:00
|
|
|
import Client from './utils/rpc';
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2019-10-12 07:29:25 -08:00
|
|
|
declare global {
|
|
|
|
|
interface Window {
|
|
|
|
|
__rpcId: string;
|
2020-06-19 04:51:34 -08:00
|
|
|
rpc: Client;
|
|
|
|
|
focusActiveTerm: (uid?: string) => void;
|
2019-10-12 07:29:25 -08:00
|
|
|
}
|
2022-04-14 08:50:54 -08:00
|
|
|
|
|
|
|
|
const snapshotResult: {
|
|
|
|
|
customRequire: {
|
|
|
|
|
(module: string): NodeModule;
|
|
|
|
|
cache: Record<string, {exports: NodeModule}>;
|
|
|
|
|
definitions: Record<string, {exports: any}>;
|
|
|
|
|
};
|
|
|
|
|
setGlobals(global: any, process: any, window: any, document: any, console: any, require: any): void;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const __non_webpack_require__: NodeRequire;
|
2019-10-12 07:29:25 -08:00
|
|
|
}
|
|
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ITermGroup = Immutable<{
|
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[];
|
2021-03-05 07:03:35 -09:00
|
|
|
}>;
|
2019-10-12 07:29:25 -08:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ITermGroups = Immutable<Record<string, ITermGroup>>;
|
2019-10-12 07:29:25 -08:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ITermState = Immutable<{
|
|
|
|
|
termGroups: Mutable<ITermGroups>;
|
2019-10-12 07:29:25 -08:00
|
|
|
activeSessions: Record<string, string>;
|
|
|
|
|
activeRootGroup: string | null;
|
2021-03-05 07:03:35 -09:00
|
|
|
}>;
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2020-03-07 05:38:46 -09:00
|
|
|
export type cursorShapes = 'BEAM' | 'UNDERLINE' | 'BLOCK';
|
2023-06-15 21:34:31 -08:00
|
|
|
import {FontWeight, IWindowsPty, Terminal} from 'xterm';
|
2021-03-05 07:03:35 -09:00
|
|
|
import {ColorMap} from './config';
|
2020-03-07 05:38:46 -09:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type uiState = Immutable<{
|
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;
|
2021-03-05 07:03:35 -09:00
|
|
|
colors: ColorMap;
|
2019-10-19 08:59:56 -08:00
|
|
|
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;
|
2020-11-24 04:18:50 -09:00
|
|
|
screenReaderMode: boolean;
|
2019-10-19 08:59:56 -08:00
|
|
|
scrollback: number;
|
|
|
|
|
selectionColor: string;
|
2020-04-27 05:32:08 -08:00
|
|
|
showHamburgerMenu: boolean | '';
|
2022-12-25 20:01:04 -09:00
|
|
|
showWindowControls: boolean | 'left' | '';
|
2019-10-19 08:59:56 -08:00
|
|
|
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;
|
2023-06-15 09:10:34 -08:00
|
|
|
webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | '';
|
2023-06-15 21:34:31 -08:00
|
|
|
windowsPty?: IWindowsPty;
|
2021-03-05 07:03:35 -09:00
|
|
|
}>;
|
2019-10-19 08:59:56 -08:00
|
|
|
|
|
|
|
|
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
|
|
|
};
|
2021-03-05 07:03:35 -09:00
|
|
|
export type sessionState = Immutable<{
|
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;
|
2021-03-05 07:03:35 -09:00
|
|
|
}>;
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ITermGroupReducer = Reducer<ITermState, HyperActions>;
|
2019-12-28 01:39:17 -09:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type IUiReducer = Reducer<uiState, HyperActions>;
|
2019-12-28 01:39:17 -09:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ISessionReducer = Reducer<sessionState, HyperActions>;
|
2019-10-19 08:59:56 -08:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
import {Middleware, Reducer} 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;
|
2020-06-19 04:51:34 -08:00
|
|
|
onRendererUnload: any;
|
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
|
|
|
};
|
|
|
|
|
|
2021-03-04 10:28:40 -09:00
|
|
|
export type HyperState = {
|
2021-03-05 07:03:35 -09:00
|
|
|
ui: uiState;
|
|
|
|
|
sessions: sessionState;
|
|
|
|
|
termGroups: ITermState;
|
2021-03-04 10:28:40 -09:00
|
|
|
};
|
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};
|
|
|
|
|
|
2020-01-02 08:49:57 -09:00
|
|
|
import configureStore from './store/configure-store';
|
|
|
|
|
export type HyperDispatch = ReturnType<typeof configureStore>['dispatch'];
|
|
|
|
|
|
2020-06-19 04:51:34 -08:00
|
|
|
import {ReactChild} from 'react';
|
2020-02-19 06:41:29 -09:00
|
|
|
type extensionProps = Partial<{
|
2020-06-19 04:51:34 -08:00
|
|
|
customChildren: ReactChild | ReactChild[];
|
|
|
|
|
customChildrenBefore: ReactChild | ReactChild[];
|
2019-11-11 06:21:42 -09:00
|
|
|
customCSS: string;
|
2020-06-19 04:51:34 -08:00
|
|
|
customInnerChildren: ReactChild | ReactChild[];
|
2020-02-19 06:41:29 -09:00
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2020-06-19 04:51:34 -08:00
|
|
|
import Terms from './components/terms';
|
2020-02-19 06:41:29 -09:00
|
|
|
import {TermsConnectedProps} from './containers/terms';
|
2020-06-19 04:51:34 -08:00
|
|
|
export type TermsProps = TermsConnectedProps & extensionProps & {ref_: (terms: Terms | null) => void};
|
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;
|
2020-03-18 07:26:46 -08:00
|
|
|
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
2020-03-10 03:16:00 -08:00
|
|
|
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;
|
2020-03-18 07:26:46 -08:00
|
|
|
onChange: (uid: string) => void;
|
|
|
|
|
onClose: (uid: string) => void;
|
2020-03-10 03:16:00 -08:00
|
|
|
fullScreen: boolean;
|
|
|
|
|
} & extensionProps;
|
2020-03-13 07:19:23 -08:00
|
|
|
|
|
|
|
|
export type NotificationProps = {
|
|
|
|
|
backgroundColor: string;
|
|
|
|
|
color?: string;
|
|
|
|
|
dismissAfter?: number;
|
|
|
|
|
onDismiss: Function;
|
|
|
|
|
text?: string | null;
|
|
|
|
|
userDismissable?: boolean | null;
|
|
|
|
|
userDismissColor?: string;
|
|
|
|
|
} & extensionProps;
|
|
|
|
|
|
2020-03-14 14:41:30 -08:00
|
|
|
export type NotificationState = {
|
|
|
|
|
dismissing: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-13 07:19:23 -08:00
|
|
|
export type SplitPaneProps = {
|
|
|
|
|
borderColor: string;
|
|
|
|
|
direction: 'horizontal' | 'vertical';
|
|
|
|
|
onResize: Function;
|
|
|
|
|
sizes?: Immutable<number[]> | null;
|
|
|
|
|
};
|
2020-03-16 06:32:04 -08:00
|
|
|
|
|
|
|
|
import Term from './components/term';
|
|
|
|
|
|
|
|
|
|
export type TermGroupOwnProps = {
|
|
|
|
|
cursorAccentColor?: string;
|
|
|
|
|
fontSmoothing?: string;
|
|
|
|
|
parentProps: TermsProps;
|
2020-06-19 04:51:34 -08:00
|
|
|
ref_: (uid: string, term: Term | null) => void;
|
2021-03-05 07:03:35 -09:00
|
|
|
termGroup: ITermGroup;
|
2020-03-16 06:32:04 -08:00
|
|
|
terms: Record<string, Term | null>;
|
|
|
|
|
} & Pick<
|
|
|
|
|
TermsProps,
|
|
|
|
|
| 'activeSession'
|
|
|
|
|
| 'backgroundColor'
|
|
|
|
|
| 'bell'
|
|
|
|
|
| 'bellSound'
|
|
|
|
|
| 'bellSoundURL'
|
|
|
|
|
| 'borderColor'
|
|
|
|
|
| 'colors'
|
|
|
|
|
| 'copyOnSelect'
|
|
|
|
|
| 'cursorBlink'
|
|
|
|
|
| 'cursorColor'
|
|
|
|
|
| 'cursorShape'
|
|
|
|
|
| 'disableLigatures'
|
|
|
|
|
| 'fontFamily'
|
|
|
|
|
| 'fontSize'
|
|
|
|
|
| 'fontWeight'
|
|
|
|
|
| 'fontWeightBold'
|
|
|
|
|
| 'foregroundColor'
|
|
|
|
|
| 'letterSpacing'
|
|
|
|
|
| 'lineHeight'
|
|
|
|
|
| 'macOptionSelectionMode'
|
|
|
|
|
| 'modifierKeys'
|
|
|
|
|
| 'onActive'
|
|
|
|
|
| 'onContextMenu'
|
2022-01-08 20:35:57 -09:00
|
|
|
| 'onCloseSearch'
|
2020-03-16 06:32:04 -08:00
|
|
|
| 'onData'
|
2022-01-08 20:35:57 -09:00
|
|
|
| 'onOpenSearch'
|
2020-03-16 06:32:04 -08:00
|
|
|
| 'onResize'
|
|
|
|
|
| 'onTitle'
|
|
|
|
|
| 'padding'
|
|
|
|
|
| 'quickEdit'
|
2020-11-24 04:18:50 -09:00
|
|
|
| 'screenReaderMode'
|
2020-03-16 06:32:04 -08:00
|
|
|
| 'scrollback'
|
|
|
|
|
| 'selectionColor'
|
|
|
|
|
| 'sessions'
|
|
|
|
|
| 'uiFontFamily'
|
|
|
|
|
| 'webGLRenderer'
|
2020-05-06 11:04:14 -08:00
|
|
|
| 'webLinksActivationKey'
|
2023-06-15 21:34:31 -08:00
|
|
|
| 'windowsPty'
|
2020-03-16 06:32:04 -08:00
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
import {TermGroupConnectedProps} from './components/term-group';
|
|
|
|
|
export type TermGroupProps = TermGroupConnectedProps & TermGroupOwnProps;
|
2020-03-18 07:26:46 -08:00
|
|
|
|
|
|
|
|
export type SearchBoxProps = {
|
2022-12-30 23:17:19 -09:00
|
|
|
caseSensitive: boolean;
|
|
|
|
|
wholeWord: boolean;
|
|
|
|
|
regex: boolean;
|
|
|
|
|
results: {resultIndex: number; resultCount: number} | undefined;
|
|
|
|
|
toggleCaseSensitive: () => void;
|
|
|
|
|
toggleWholeWord: () => void;
|
|
|
|
|
toggleRegex: () => void;
|
2020-03-18 07:26:46 -08:00
|
|
|
next: (searchTerm: string) => void;
|
|
|
|
|
prev: (searchTerm: string) => void;
|
|
|
|
|
close: () => void;
|
2022-12-30 23:17:19 -09:00
|
|
|
backgroundColor: string;
|
|
|
|
|
foregroundColor: string;
|
|
|
|
|
borderColor: string;
|
|
|
|
|
selectionColor: string;
|
|
|
|
|
font: string;
|
2020-03-18 07:26:46 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
import {FitAddon} from 'xterm-addon-fit';
|
|
|
|
|
import {SearchAddon} from 'xterm-addon-search';
|
|
|
|
|
export type TermProps = {
|
|
|
|
|
backgroundColor: string;
|
|
|
|
|
bell: string;
|
|
|
|
|
bellSound: string | null;
|
|
|
|
|
bellSoundURL: string | null;
|
|
|
|
|
borderColor: string;
|
|
|
|
|
cleared: boolean;
|
2021-03-05 07:03:35 -09:00
|
|
|
colors: ColorMap;
|
2020-03-18 07:26:46 -08:00
|
|
|
cols: number | null;
|
|
|
|
|
copyOnSelect: boolean;
|
|
|
|
|
cursorAccentColor?: string;
|
|
|
|
|
cursorBlink: boolean;
|
|
|
|
|
cursorColor: string;
|
|
|
|
|
cursorShape: cursorShapes;
|
|
|
|
|
disableLigatures: boolean;
|
|
|
|
|
fitAddon: FitAddon | null;
|
|
|
|
|
fontFamily: string;
|
|
|
|
|
fontSize: number;
|
|
|
|
|
fontSmoothing?: string;
|
|
|
|
|
fontWeight: FontWeight;
|
|
|
|
|
fontWeightBold: FontWeight;
|
|
|
|
|
foregroundColor: string;
|
|
|
|
|
isTermActive: boolean;
|
|
|
|
|
letterSpacing: number;
|
|
|
|
|
lineHeight: number;
|
|
|
|
|
macOptionSelectionMode: string;
|
|
|
|
|
modifierKeys: Immutable<{altIsMeta: boolean; cmdIsMeta: boolean}>;
|
|
|
|
|
onActive: () => void;
|
2022-01-08 20:35:57 -09:00
|
|
|
onCloseSearch: () => void;
|
2020-03-18 07:26:46 -08:00
|
|
|
onContextMenu: (selection: any) => void;
|
|
|
|
|
onCursorMove?: (cursorFrame: {x: number; y: number; width: number; height: number; col: number; row: number}) => void;
|
2020-06-19 04:51:34 -08:00
|
|
|
onData: (data: string) => void;
|
2022-01-08 20:35:57 -09:00
|
|
|
onOpenSearch: () => void;
|
2020-03-18 07:26:46 -08:00
|
|
|
onResize: (cols: number, rows: number) => void;
|
|
|
|
|
onTitle: (title: string) => void;
|
|
|
|
|
padding: string;
|
|
|
|
|
quickEdit: boolean;
|
|
|
|
|
rows: number | null;
|
2020-11-24 04:18:50 -09:00
|
|
|
screenReaderMode: boolean;
|
2020-03-18 07:26:46 -08:00
|
|
|
scrollback: number;
|
|
|
|
|
search: boolean;
|
|
|
|
|
searchAddon: SearchAddon | null;
|
|
|
|
|
selectionColor: string;
|
|
|
|
|
term: Terminal | null;
|
|
|
|
|
uid: string;
|
|
|
|
|
uiFontFamily: string;
|
|
|
|
|
url: string | null;
|
|
|
|
|
webGLRenderer: boolean;
|
2023-06-15 09:10:34 -08:00
|
|
|
webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | '';
|
2023-06-15 21:34:31 -08:00
|
|
|
windowsPty?: IWindowsPty;
|
2020-06-19 04:51:34 -08:00
|
|
|
ref_: (uid: string, term: Term | null) => void;
|
|
|
|
|
} & extensionProps;
|
2020-03-18 07:26:46 -08:00
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
// Utility types
|
|
|
|
|
|
|
|
|
|
export type Mutable<T> = T extends Immutable<infer U> ? (Exclude<U, T> extends never ? U : Exclude<U, T>) : T;
|
|
|
|
|
|
|
|
|
|
export type immutableRecord<T> = {[k in keyof T]: Immutable<T[k]>};
|
|
|
|
|
|
2020-03-18 07:26:46 -08:00
|
|
|
export type Assignable<T, U> = {[k in keyof U]: k extends keyof T ? T[k] : U[k]} & Partial<T>;
|