mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
move typings into a separate directory
This commit is contained in:
parent
33f7d2bad5
commit
c62ed62752
56 changed files with 87 additions and 78 deletions
|
|
@ -4,7 +4,7 @@ import {_import, getDefaultConfig} from './config/import';
|
||||||
import _openConfig from './config/open';
|
import _openConfig from './config/open';
|
||||||
import {cfgPath, cfgDir} from './config/paths';
|
import {cfgPath, cfgDir} from './config/paths';
|
||||||
import {getColorMap} from './utils/colors';
|
import {getColorMap} from './utils/colors';
|
||||||
import type {parsedConfig, configOptions} from '../lib/config';
|
import type {parsedConfig, configOptions} from '../typings/config';
|
||||||
import {app} from 'electron';
|
import {app} from 'electron';
|
||||||
|
|
||||||
const watchers: Function[] = [];
|
const watchers: Function[] = [];
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import {readFileSync, mkdirpSync} from 'fs-extra';
|
||||||
import {defaultCfg, cfgPath, plugs, defaultPlatformKeyPath} from './paths';
|
import {defaultCfg, cfgPath, plugs, defaultPlatformKeyPath} from './paths';
|
||||||
import {_init} from './init';
|
import {_init} from './init';
|
||||||
import notify from '../notify';
|
import notify from '../notify';
|
||||||
import type {rawConfig} from '../../lib/config';
|
import type {rawConfig} from '../../typings/config';
|
||||||
import {migrateHyper3Config} from './migrate';
|
import {migrateHyper3Config} from './migrate';
|
||||||
|
|
||||||
let defaultConfig: rawConfig;
|
let defaultConfig: rawConfig;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import vm from 'vm';
|
import vm from 'vm';
|
||||||
import notify from '../notify';
|
import notify from '../notify';
|
||||||
import mapKeys from '../utils/map-keys';
|
import mapKeys from '../utils/map-keys';
|
||||||
import type {parsedConfig, rawConfig, configOptions} from '../../lib/config';
|
import type {parsedConfig, rawConfig, configOptions} from '../../typings/config';
|
||||||
import merge from 'lodash/merge';
|
import merge from 'lodash/merge';
|
||||||
|
|
||||||
const _extract = (script?: vm.Script): Record<string, any> => {
|
const _extract = (script?: vm.Script): Record<string, any> => {
|
||||||
|
|
|
||||||
1
app/index.d.ts
vendored
1
app/index.d.ts
vendored
|
|
@ -1 +0,0 @@
|
||||||
// Dummy file, required by tsc
|
|
||||||
|
|
@ -15,10 +15,10 @@ import {availableExtensions} from './plugins/extensions';
|
||||||
import {install} from './plugins/install';
|
import {install} from './plugins/install';
|
||||||
import {plugs} from './config/paths';
|
import {plugs} from './config/paths';
|
||||||
import mapKeys from './utils/map-keys';
|
import mapKeys from './utils/map-keys';
|
||||||
import type {configOptions} from '../lib/config';
|
import type {configOptions} from '../typings/config';
|
||||||
import {promisify} from 'util';
|
import {promisify} from 'util';
|
||||||
import {exec, execFile} from 'child_process';
|
import {exec, execFile} from 'child_process';
|
||||||
import type {IpcMainWithCommands} from '../common';
|
import type {IpcMainWithCommands} from '../typings/common';
|
||||||
|
|
||||||
// local storage
|
// local storage
|
||||||
const cache = new Config();
|
const cache = new Config();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import {EventEmitter} from 'events';
|
||||||
import type {BrowserWindow, IpcMainEvent} from 'electron';
|
import type {BrowserWindow, IpcMainEvent} from 'electron';
|
||||||
import {ipcMain} from 'electron';
|
import {ipcMain} from 'electron';
|
||||||
import {v4 as uuidv4} from 'uuid';
|
import {v4 as uuidv4} from 'uuid';
|
||||||
import type {TypedEmitter, MainEvents, RendererEvents, FilterNever} from '../common';
|
import type {TypedEmitter, MainEvents, RendererEvents, FilterNever} from '../typings/common';
|
||||||
|
|
||||||
export class Server {
|
export class Server {
|
||||||
emitter: TypedEmitter<MainEvents>;
|
emitter: TypedEmitter<MainEvents>;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./**/*",
|
"./**/*",
|
||||||
"./package.json"
|
"./package.json",
|
||||||
|
"../typings/extend-electron.d.ts",
|
||||||
|
"../typings/ext-modules.d.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ import {execCommand} from '../commands';
|
||||||
import {setRendererType, unsetRendererType} from '../utils/renderer-utils';
|
import {setRendererType, unsetRendererType} from '../utils/renderer-utils';
|
||||||
import {decorateSessionOptions, decorateSessionClass} from '../plugins';
|
import {decorateSessionOptions, decorateSessionClass} from '../plugins';
|
||||||
import {enable as remoteEnable} from '@electron/remote/main';
|
import {enable as remoteEnable} from '@electron/remote/main';
|
||||||
import type {configOptions} from '../../lib/config';
|
import type {configOptions} from '../../typings/config';
|
||||||
import {getWorkingDirectoryFromPID} from 'native-process-working-directory';
|
import {getWorkingDirectoryFromPID} from 'native-process-working-directory';
|
||||||
import {existsSync} from 'fs';
|
import {existsSync} from 'fs';
|
||||||
import type {sessionExtraOptions} from '../../common';
|
import type {sessionExtraOptions} from '../../typings/common';
|
||||||
import {getDefaultProfile} from '../config';
|
import {getDefaultProfile} from '../config';
|
||||||
|
|
||||||
export function newWindow(
|
export function newWindow(
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config';
|
import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config';
|
||||||
import type {HyperActions} from '../hyper';
|
import type {HyperActions} from '../../typings/hyper';
|
||||||
import type {configOptions} from '../config';
|
import type {configOptions} from '../../typings/config';
|
||||||
|
|
||||||
export function loadConfig(config: configOptions): HyperActions {
|
export function loadConfig(config: configOptions): HyperActions {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
} from '../constants/ui';
|
} from '../constants/ui';
|
||||||
import rpc from '../rpc';
|
import rpc from '../rpc';
|
||||||
import {userExitTermGroup, setActiveGroup} from './term-groups';
|
import {userExitTermGroup, setActiveGroup} from './term-groups';
|
||||||
import type {HyperDispatch} from '../hyper';
|
import type {HyperDispatch} from '../../typings/hyper';
|
||||||
|
|
||||||
export function closeTab(uid: string) {
|
export function closeTab(uid: string) {
|
||||||
return (dispatch: HyperDispatch) => {
|
return (dispatch: HyperDispatch) => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import rpc from '../rpc';
|
import rpc from '../rpc';
|
||||||
import {INIT} from '../constants';
|
import {INIT} from '../constants';
|
||||||
import type {HyperDispatch} from '../hyper';
|
import type {HyperDispatch} from '../../typings/hyper';
|
||||||
|
|
||||||
export default function init() {
|
export default function init() {
|
||||||
return (dispatch: HyperDispatch) => {
|
return (dispatch: HyperDispatch) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications';
|
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications';
|
||||||
import type {HyperActions} from '../hyper';
|
import type {HyperActions} from '../../typings/hyper';
|
||||||
|
|
||||||
export function dismissNotification(id: string): HyperActions {
|
export function dismissNotification(id: string): HyperActions {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ import {
|
||||||
SESSION_SET_XTERM_TITLE,
|
SESSION_SET_XTERM_TITLE,
|
||||||
SESSION_SEARCH
|
SESSION_SEARCH
|
||||||
} from '../constants/sessions';
|
} from '../constants/sessions';
|
||||||
import type {HyperState, HyperDispatch, HyperActions} from '../hyper';
|
import type {HyperState, HyperDispatch, HyperActions} from '../../typings/hyper';
|
||||||
import type {Session} from '../../common';
|
import type {Session} from '../../typings/common';
|
||||||
|
|
||||||
export function addSession({uid, shell, pid, cols = null, rows = null, splitDirection, activeUid, profile}: Session) {
|
export function addSession({uid, shell, pid, cols = null, rows = null, splitDirection, activeUid, profile}: Session) {
|
||||||
return (dispatch: HyperDispatch, getState: () => HyperState) => {
|
return (dispatch: HyperDispatch, getState: () => HyperState) => {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {SESSION_REQUEST} from '../constants/sessions';
|
||||||
import findBySession from '../utils/term-groups';
|
import findBySession from '../utils/term-groups';
|
||||||
import {getRootGroups} from '../selectors';
|
import {getRootGroups} from '../selectors';
|
||||||
import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
|
import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
|
||||||
import type {ITermState, ITermGroup, HyperState, HyperDispatch, HyperActions} from '../hyper';
|
import type {ITermState, ITermGroup, HyperState, HyperDispatch, HyperActions} from '../../typings/hyper';
|
||||||
|
|
||||||
function requestSplit(direction: 'VERTICAL' | 'HORIZONTAL') {
|
function requestSplit(direction: 'VERTICAL' | 'HORIZONTAL') {
|
||||||
return (_activeUid: string | undefined, _profile: string | undefined) =>
|
return (_activeUid: string | undefined, _profile: string | undefined) =>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import {
|
||||||
|
|
||||||
import {setActiveGroup} from './term-groups';
|
import {setActiveGroup} from './term-groups';
|
||||||
import type parseUrl from 'parse-url';
|
import type parseUrl from 'parse-url';
|
||||||
import type {HyperState, HyperDispatch, HyperActions, ITermGroups} from '../hyper';
|
import type {HyperState, HyperDispatch, HyperActions, ITermGroups} from '../../typings/hyper';
|
||||||
import type {Stats} from 'fs';
|
import type {Stats} from 'fs';
|
||||||
import {stat} from 'fs';
|
import {stat} from 'fs';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../constants/updater';
|
import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../constants/updater';
|
||||||
import rpc from '../rpc';
|
import rpc from '../rpc';
|
||||||
import type {HyperActions} from '../hyper';
|
import type {HyperActions} from '../../typings/hyper';
|
||||||
|
|
||||||
export function installUpdate(): HyperActions {
|
export function installUpdate(): HyperActions {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {ipcRenderer} from './utils/ipc';
|
import {ipcRenderer} from './utils/ipc';
|
||||||
import type {HyperDispatch} from './hyper';
|
import type {HyperDispatch} from '../typings/hyper';
|
||||||
import {closeSearch} from './actions/sessions';
|
import {closeSearch} from './actions/sessions';
|
||||||
|
|
||||||
let commands: Record<string, (event: any, dispatch: HyperDispatch) => void> = {
|
let commands: Record<string, (event: any, dispatch: HyperDispatch) => void> = {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import {decorate, getTabsProps} from '../utils/plugins';
|
import {decorate, getTabsProps} from '../utils/plugins';
|
||||||
|
|
||||||
import Tabs_ from './tabs';
|
import Tabs_ from './tabs';
|
||||||
import type {HeaderProps} from '../hyper';
|
import type {HeaderProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const Tabs = decorate(Tabs_, 'Tabs');
|
const Tabs = decorate(Tabs_, 'Tabs');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, {useRef, useState} from 'react';
|
import React, {useRef, useState} from 'react';
|
||||||
import {VscChevronDown} from '@react-icons/all-files/vsc/VscChevronDown';
|
import {VscChevronDown} from '@react-icons/all-files/vsc/VscChevronDown';
|
||||||
import type {configOptions} from '../config';
|
import type {configOptions} from '../../typings/config';
|
||||||
import useClickAway from 'react-use/lib/useClickAway';
|
import useClickAway from 'react-use/lib/useClickAway';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, {forwardRef, useEffect, useRef, useState} from 'react';
|
import React, {forwardRef, useEffect, useRef, useState} from 'react';
|
||||||
import type {NotificationProps} from '../hyper';
|
import type {NotificationProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const Notification = forwardRef<HTMLDivElement, React.PropsWithChildren<NotificationProps>>((props, ref) => {
|
const Notification = forwardRef<HTMLDivElement, React.PropsWithChildren<NotificationProps>>((props, ref) => {
|
||||||
const dismissTimer = useRef<NodeJS.Timeout | undefined>(undefined);
|
const dismissTimer = useRef<NodeJS.Timeout | undefined>(undefined);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import React, {forwardRef} from 'react';
|
||||||
import {decorate} from '../utils/plugins';
|
import {decorate} from '../utils/plugins';
|
||||||
|
|
||||||
import Notification_ from './notification';
|
import Notification_ from './notification';
|
||||||
import type {NotificationsProps} from '../hyper';
|
import type {NotificationsProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const Notification = decorate(Notification_, 'Notification');
|
const Notification = decorate(Notification_, 'Notification');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, {useCallback, useRef, useEffect, forwardRef} from 'react';
|
import React, {useCallback, useRef, useEffect, forwardRef} from 'react';
|
||||||
import type {SearchBoxProps} from '../hyper';
|
import type {SearchBoxProps} from '../../typings/hyper';
|
||||||
import {VscArrowUp} from '@react-icons/all-files/vsc/VscArrowUp';
|
import {VscArrowUp} from '@react-icons/all-files/vsc/VscArrowUp';
|
||||||
import {VscArrowDown} from '@react-icons/all-files/vsc/VscArrowDown';
|
import {VscArrowDown} from '@react-icons/all-files/vsc/VscArrowDown';
|
||||||
import {VscClose} from '@react-icons/all-files/vsc/VscClose';
|
import {VscClose} from '@react-icons/all-files/vsc/VscClose';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import sum from 'lodash/sum';
|
import sum from 'lodash/sum';
|
||||||
import type {SplitPaneProps} from '../hyper';
|
import type {SplitPaneProps} from '../../typings/hyper';
|
||||||
|
|
||||||
export default class SplitPane extends React.PureComponent<
|
export default class SplitPane extends React.PureComponent<
|
||||||
React.PropsWithChildren<SplitPaneProps>,
|
React.PropsWithChildren<SplitPaneProps>,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, {forwardRef} from 'react';
|
import React, {forwardRef} from 'react';
|
||||||
import type {StyleSheetProps} from '../hyper';
|
import type {StyleSheetProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const StyleSheet = forwardRef<HTMLStyleElement, StyleSheetProps>((props, ref) => {
|
const StyleSheet = forwardRef<HTMLStyleElement, StyleSheetProps>((props, ref) => {
|
||||||
const {borderColor} = props;
|
const {borderColor} = props;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, {forwardRef} from 'react';
|
import React, {forwardRef} from 'react';
|
||||||
import type {TabProps} from '../hyper';
|
import type {TabProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const Tab = forwardRef<HTMLLIElement, TabProps>((props, ref) => {
|
const Tab = forwardRef<HTMLLIElement, TabProps>((props, ref) => {
|
||||||
const handleClick = (event: React.MouseEvent) => {
|
const handleClick = (event: React.MouseEvent) => {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import React, {forwardRef} from 'react';
|
||||||
import {decorate, getTabProps} from '../utils/plugins';
|
import {decorate, getTabProps} from '../utils/plugins';
|
||||||
|
|
||||||
import Tab_ from './tab';
|
import Tab_ from './tab';
|
||||||
import type {TabsProps} from '../hyper';
|
import type {TabsProps} from '../../typings/hyper';
|
||||||
import DropdownButton from './new-tab';
|
import DropdownButton from './new-tab';
|
||||||
|
|
||||||
const Tab = decorate(Tab_, 'Tab');
|
const Tab = decorate(Tab_, 'Tab');
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {decorate, getTermProps, getTermGroupProps} from '../utils/plugins';
|
||||||
import {resizeTermGroup} from '../actions/term-groups';
|
import {resizeTermGroup} from '../actions/term-groups';
|
||||||
import Term_ from './term';
|
import Term_ from './term';
|
||||||
import SplitPane_ from './split-pane';
|
import SplitPane_ from './split-pane';
|
||||||
import type {HyperState, HyperDispatch, TermGroupProps, TermGroupOwnProps} from '../hyper';
|
import type {HyperState, HyperDispatch, TermGroupProps, TermGroupOwnProps} from '../../typings/hyper';
|
||||||
|
|
||||||
const Term = decorate(Term_, 'Term');
|
const Term = decorate(Term_, 'Term');
|
||||||
const SplitPane = decorate(SplitPane_, 'SplitPane');
|
const SplitPane = decorate(SplitPane_, 'SplitPane');
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import Color from 'color';
|
||||||
import terms from '../terms';
|
import terms from '../terms';
|
||||||
import processClipboard from '../utils/paste';
|
import processClipboard from '../utils/paste';
|
||||||
import _SearchBox from './searchBox';
|
import _SearchBox from './searchBox';
|
||||||
import type {TermProps} from '../hyper';
|
import type {TermProps} from '../../typings/hyper';
|
||||||
import pickBy from 'lodash/pickBy';
|
import pickBy from 'lodash/pickBy';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import {decorate} from '../utils/plugins';
|
import {decorate} from '../utils/plugins';
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {decorate, getTermGroupProps} from '../utils/plugins';
|
||||||
import {registerCommandHandlers} from '../command-registry';
|
import {registerCommandHandlers} from '../command-registry';
|
||||||
import TermGroup_ from './term-group';
|
import TermGroup_ from './term-group';
|
||||||
import StyleSheet_ from './style-sheet';
|
import StyleSheet_ from './style-sheet';
|
||||||
import type {TermsProps, HyperDispatch} from '../hyper';
|
import type {TermsProps, HyperDispatch} from '../../typings/hyper';
|
||||||
import type Term from './term';
|
import type Term from './term';
|
||||||
import {ObjectTypedKeys} from '../utils/object';
|
import {ObjectTypedKeys} from '../utils/object';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type {configOptions} from '../config';
|
import type {configOptions} from '../../typings/config';
|
||||||
|
|
||||||
export const CONFIG_LOAD = 'CONFIG_LOAD';
|
export const CONFIG_LOAD = 'CONFIG_LOAD';
|
||||||
export const CONFIG_RELOAD = 'CONFIG_RELOAD';
|
export const CONFIG_RELOAD = 'CONFIG_RELOAD';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Header from '../components/header';
|
||||||
import {closeTab, changeTab, maximize, openHamburgerMenu, unmaximize, minimize, close} from '../actions/header';
|
import {closeTab, changeTab, maximize, openHamburgerMenu, unmaximize, minimize, close} from '../actions/header';
|
||||||
import {connect} from '../utils/plugins';
|
import {connect} from '../utils/plugins';
|
||||||
import {getRootGroups} from '../selectors';
|
import {getRootGroups} from '../selectors';
|
||||||
import type {HyperState, HyperDispatch, ITab} from '../hyper';
|
import type {HyperState, HyperDispatch, ITab} from '../../typings/hyper';
|
||||||
import {requestTermGroup} from '../actions/term-groups';
|
import {requestTermGroup} from '../actions/term-groups';
|
||||||
|
|
||||||
const isMac = /Mac/.test(navigator.userAgent);
|
const isMac = /Mac/.test(navigator.userAgent);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import stylis from 'stylis';
|
||||||
import {HeaderContainer} from './header';
|
import {HeaderContainer} from './header';
|
||||||
import TermsContainer from './terms';
|
import TermsContainer from './terms';
|
||||||
import NotificationsContainer from './notifications';
|
import NotificationsContainer from './notifications';
|
||||||
import type {HyperState, HyperProps, HyperDispatch} from '../hyper';
|
import type {HyperState, HyperProps, HyperDispatch} from '../../typings/hyper';
|
||||||
import type Terms from '../components/terms';
|
import type Terms from '../components/terms';
|
||||||
|
|
||||||
const isMac = /Mac/.test(navigator.userAgent);
|
const isMac = /Mac/.test(navigator.userAgent);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import Notifications from '../components/notifications';
|
||||||
import {installUpdate} from '../actions/updater';
|
import {installUpdate} from '../actions/updater';
|
||||||
import {connect} from '../utils/plugins';
|
import {connect} from '../utils/plugins';
|
||||||
import {dismissNotification} from '../actions/notifications';
|
import {dismissNotification} from '../actions/notifications';
|
||||||
import type {HyperState, HyperDispatch} from '../hyper';
|
import type {HyperState, HyperDispatch} from '../../typings/hyper';
|
||||||
|
|
||||||
const mapStateToProps = (state: HyperState) => {
|
const mapStateToProps = (state: HyperState) => {
|
||||||
const {ui} = state;
|
const {ui} = state;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
|
|
||||||
import {openContextMenu} from '../actions/ui';
|
import {openContextMenu} from '../actions/ui';
|
||||||
import {getRootGroups} from '../selectors';
|
import {getRootGroups} from '../selectors';
|
||||||
import type {HyperState, HyperDispatch} from '../hyper';
|
import type {HyperState, HyperDispatch} from '../../typings/hyper';
|
||||||
|
|
||||||
const mapStateToProps = (state: HyperState) => {
|
const mapStateToProps = (state: HyperState) => {
|
||||||
const {sessions} = state.sessions;
|
const {sessions} = state.sessions;
|
||||||
|
|
|
||||||
3
lib/ext-modules.d.ts
vendored
3
lib/ext-modules.d.ts
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
declare module 'php-escape-shell' {
|
|
||||||
export function php_escapeshellcmd(path: string): string;
|
|
||||||
}
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {addNotificationMessage} from './actions/notifications';
|
||||||
import {loadConfig, reloadConfig} from './actions/config';
|
import {loadConfig, reloadConfig} from './actions/config';
|
||||||
import HyperContainer from './containers/hyper';
|
import HyperContainer from './containers/hyper';
|
||||||
import configureStore from './store/configure-store';
|
import configureStore from './store/configure-store';
|
||||||
import type {configOptions} from './config';
|
import type {configOptions} from '../typings/config';
|
||||||
|
|
||||||
// On Linux, the default zoom was somehow changed with Electron 3 (or maybe 2).
|
// On Linux, the default zoom was somehow changed with Electron 3 (or maybe 2).
|
||||||
// Setting zoom factor to 1.2 brings back the normal default size
|
// Setting zoom factor to 1.2 brings back the normal default size
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {combineReducers} from 'redux';
|
||||||
import ui from './ui';
|
import ui from './ui';
|
||||||
import sessions from './sessions';
|
import sessions from './sessions';
|
||||||
import termGroups from './term-groups';
|
import termGroups from './term-groups';
|
||||||
import type {HyperActions, HyperState} from '../hyper';
|
import type {HyperActions, HyperState} from '../../typings/hyper';
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
ui,
|
ui,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {
|
||||||
SESSION_SET_CWD,
|
SESSION_SET_CWD,
|
||||||
SESSION_SEARCH
|
SESSION_SEARCH
|
||||||
} from '../constants/sessions';
|
} from '../constants/sessions';
|
||||||
import type {sessionState, session, Mutable, ISessionReducer} from '../hyper';
|
import type {sessionState, session, Mutable, ISessionReducer} from '../../typings/hyper';
|
||||||
|
|
||||||
const initialState: sessionState = Immutable<Mutable<sessionState>>({
|
const initialState: sessionState = Immutable<Mutable<sessionState>>({
|
||||||
sessions: {},
|
sessions: {},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import type {SessionAddAction} from '../constants/sessions';
|
||||||
import {SESSION_ADD, SESSION_SET_ACTIVE} from '../constants/sessions';
|
import {SESSION_ADD, SESSION_SET_ACTIVE} from '../constants/sessions';
|
||||||
import findBySession from '../utils/term-groups';
|
import findBySession from '../utils/term-groups';
|
||||||
import {decorateTermGroupsReducer} from '../utils/plugins';
|
import {decorateTermGroupsReducer} from '../utils/plugins';
|
||||||
import type {ITermGroup, ITermState, ITermGroups, ITermGroupReducer, Mutable} from '../hyper';
|
import type {ITermGroup, ITermState, ITermGroups, ITermGroupReducer, Mutable} from '../../typings/hyper';
|
||||||
|
|
||||||
const MIN_SIZE = 0.05;
|
const MIN_SIZE = 0.05;
|
||||||
const initialState: ITermState = Immutable<Mutable<ITermState>>({
|
const initialState: ITermState = Immutable<Mutable<ITermState>>({
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import {
|
||||||
SESSION_SET_CWD
|
SESSION_SET_CWD
|
||||||
} from '../constants/sessions';
|
} from '../constants/sessions';
|
||||||
import {UPDATE_AVAILABLE} from '../constants/updater';
|
import {UPDATE_AVAILABLE} from '../constants/updater';
|
||||||
import type {uiState, Mutable, IUiReducer} from '../hyper';
|
import type {uiState, Mutable, IUiReducer} from '../../typings/hyper';
|
||||||
import {release} from 'os';
|
import {release} from 'os';
|
||||||
|
|
||||||
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(navigator.platform) || process.platform === 'win32';
|
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(navigator.platform) || process.platform === 'win32';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {createSelector} from 'reselect';
|
import {createSelector} from 'reselect';
|
||||||
import type {HyperState} from './hyper';
|
import type {HyperState} from '../typings/hyper';
|
||||||
|
|
||||||
const getTermGroups = ({termGroups}: Pick<HyperState, 'termGroups'>) => termGroups.termGroups;
|
const getTermGroups = ({termGroups}: Pick<HyperState, 'termGroups'>) => termGroups.termGroups;
|
||||||
export const getRootGroups = createSelector(getTermGroups, (termGroups) =>
|
export const getRootGroups = createSelector(getTermGroups, (termGroups) =>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import effects from '../utils/effects';
|
||||||
import * as plugins from '../utils/plugins';
|
import * as plugins from '../utils/plugins';
|
||||||
import writeMiddleware from './write-middleware';
|
import writeMiddleware from './write-middleware';
|
||||||
import {composeWithDevTools} from '@redux-devtools/extension';
|
import {composeWithDevTools} from '@redux-devtools/extension';
|
||||||
import type {HyperState, HyperActions} from '../hyper';
|
import type {HyperState, HyperActions} from '../../typings/hyper';
|
||||||
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
|
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import rootReducer from '../reducers/index';
|
||||||
import effects from '../utils/effects';
|
import effects from '../utils/effects';
|
||||||
import * as plugins from '../utils/plugins';
|
import * as plugins from '../utils/plugins';
|
||||||
import writeMiddleware from './write-middleware';
|
import writeMiddleware from './write-middleware';
|
||||||
import type {HyperState, HyperActions} from '../hyper';
|
import type {HyperState, HyperActions} from '../../typings/hyper';
|
||||||
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
|
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
|
||||||
|
|
||||||
export default () =>
|
export default () =>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type {HyperActions, HyperState} from '../hyper';
|
import type {HyperActions, HyperState} from '../../typings/hyper';
|
||||||
import terms from '../terms';
|
import terms from '../terms';
|
||||||
import type {Dispatch, Middleware} from 'redux';
|
import type {Dispatch, Middleware} from 'redux';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type {Dispatch, Middleware} from 'redux';
|
import type {Dispatch, Middleware} from 'redux';
|
||||||
import type {HyperActions, HyperState} from '../hyper';
|
import type {HyperActions, HyperState} from '../../typings/hyper';
|
||||||
/**
|
/**
|
||||||
* Simple redux middleware that executes
|
* Simple redux middleware that executes
|
||||||
* the `effect` field if provided in an action
|
* the `effect` field if provided in an action
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {ipcRenderer as _ipc} from 'electron';
|
import {ipcRenderer as _ipc} from 'electron';
|
||||||
import type {IpcRendererWithCommands} from '../../common';
|
import type {IpcRendererWithCommands} from '../../typings/common';
|
||||||
|
|
||||||
export const ipcRenderer = _ipc as IpcRendererWithCommands;
|
export const ipcRenderer = _ipc as IpcRendererWithCommands;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import type {
|
||||||
TermProps,
|
TermProps,
|
||||||
Assignable,
|
Assignable,
|
||||||
HyperActions
|
HyperActions
|
||||||
} from '../hyper';
|
} from '../../typings/hyper';
|
||||||
import type {Dispatch, Middleware} from 'redux';
|
import type {Dispatch, Middleware} from 'redux';
|
||||||
import {ObjectTypedKeys} from './object';
|
import {ObjectTypedKeys} from './object';
|
||||||
import IPCChildProcess from './ipc-child-process';
|
import IPCChildProcess from './ipc-child-process';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
import {EventEmitter} from 'events';
|
import {EventEmitter} from 'events';
|
||||||
import type {IpcRendererEvent} from 'electron';
|
import type {IpcRendererEvent} from 'electron';
|
||||||
import type {FilterNever, IpcRendererWithCommands, MainEvents, RendererEvents, TypedEmitter} from '../../common';
|
import type {
|
||||||
|
FilterNever,
|
||||||
|
IpcRendererWithCommands,
|
||||||
|
MainEvents,
|
||||||
|
RendererEvents,
|
||||||
|
TypedEmitter
|
||||||
|
} from '../../typings/common';
|
||||||
import {ipcRenderer} from './ipc';
|
import {ipcRenderer} from './ipc';
|
||||||
|
|
||||||
export default class Client {
|
export default class Client {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type {ITermState} from '../hyper';
|
import type {ITermState} from '../../typings/hyper';
|
||||||
|
|
||||||
export default function findBySession(termGroupState: ITermState, sessionUid: string) {
|
export default function findBySession(termGroupState: ITermState, sessionUid: string) {
|
||||||
const {termGroups} = termGroupState;
|
const {termGroups} = termGroupState;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
"v8-snapshot:arch": "yarn run mk-snapshot && yarn run cp-snapshot",
|
"v8-snapshot:arch": "yarn run mk-snapshot && yarn run cp-snapshot",
|
||||||
"mk-snapshot": "cross-env ELECTRON_CUSTOM_VERSION=$npm_package_devDependencies_electron node node_modules/electron-mksnapshot/download-mksnapshot.js && node bin/mk-snapshot.js",
|
"mk-snapshot": "cross-env ELECTRON_CUSTOM_VERSION=$npm_package_devDependencies_electron node node_modules/electron-mksnapshot/download-mksnapshot.js && node bin/mk-snapshot.js",
|
||||||
"cp-snapshot": "node bin/cp-snapshot.js",
|
"cp-snapshot": "node bin/cp-snapshot.js",
|
||||||
"generate-schema": "typescript-json-schema ./lib/config.d.ts rawConfig -o ./app/config/schema.json --required"
|
"generate-schema": "typescript-json-schema ./typings/config.d.ts rawConfig -o ./app/config/schema.json --required"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
"./app/",
|
"./app/",
|
||||||
"./lib/",
|
"./lib/",
|
||||||
"./test/",
|
"./test/",
|
||||||
"./cli/"
|
"./cli/",
|
||||||
|
"./typings"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
2
common.d.ts → typings/common.d.ts
vendored
2
common.d.ts → typings/common.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
import type parseUrl from 'parse-url';
|
import type parseUrl from 'parse-url';
|
||||||
import type {IpcMain, IpcRenderer} from 'electron';
|
import type {IpcMain, IpcRenderer} from 'electron';
|
||||||
import type {ExecFileOptions, ExecOptions} from 'child_process';
|
import type {ExecFileOptions, ExecOptions} from 'child_process';
|
||||||
import type {configOptions} from './lib/config';
|
import type {configOptions} from './config';
|
||||||
|
|
||||||
export type Session = {
|
export type Session = {
|
||||||
uid: string;
|
uid: string;
|
||||||
0
lib/config.d.ts → typings/config.d.ts
vendored
0
lib/config.d.ts → typings/config.d.ts
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
declare module 'php-escape-shell' {
|
||||||
|
export function php_escapeshellcmd(path: string): string;
|
||||||
|
}
|
||||||
|
|
||||||
declare module 'git-describe' {
|
declare module 'git-describe' {
|
||||||
export function gitDescribe(...args: any[]): void;
|
export function gitDescribe(...args: any[]): void;
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import type {Server} from './rpc';
|
import type {Server} from '../app/rpc';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace Electron {
|
namespace Electron {
|
||||||
interface App {
|
interface App {
|
||||||
config: typeof import('./config');
|
config: typeof import('../app/config');
|
||||||
plugins: typeof import('./plugins');
|
plugins: typeof import('../app/plugins');
|
||||||
getWindows: () => Set<BrowserWindow>;
|
getWindows: () => Set<BrowserWindow>;
|
||||||
getLastFocusedWindow: () => BrowserWindow | null;
|
getLastFocusedWindow: () => BrowserWindow | null;
|
||||||
windowCallback?: (win: BrowserWindow) => void;
|
windowCallback?: (win: BrowserWindow) => void;
|
||||||
34
lib/hyper.d.ts → typings/hyper.d.ts
vendored
34
lib/hyper.d.ts → typings/hyper.d.ts
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
import type {Immutable} from 'seamless-immutable';
|
import type {Immutable} from 'seamless-immutable';
|
||||||
import type Client from './utils/rpc';
|
import type Client from '../lib/utils/rpc';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
@ -167,14 +167,14 @@ export type HyperState = {
|
||||||
termGroups: ITermState;
|
termGroups: ITermState;
|
||||||
};
|
};
|
||||||
|
|
||||||
import type {UIActions} from './constants/ui';
|
import type {UIActions} from '../lib/constants/ui';
|
||||||
import type {ConfigActions} from './constants/config';
|
import type {ConfigActions} from '../lib/constants/config';
|
||||||
import type {SessionActions} from './constants/sessions';
|
import type {SessionActions} from '../lib/constants/sessions';
|
||||||
import type {NotificationActions} from './constants/notifications';
|
import type {NotificationActions} from '../lib/constants/notifications';
|
||||||
import type {UpdateActions} from './constants/updater';
|
import type {UpdateActions} from '../lib/constants/updater';
|
||||||
import type {TermGroupActions} from './constants/term-groups';
|
import type {TermGroupActions} from '../lib/constants/term-groups';
|
||||||
import type {InitActions} from './constants';
|
import type {InitActions} from '../lib/constants';
|
||||||
import type {TabActions} from './constants/tabs';
|
import type {TabActions} from '../lib/constants/tabs';
|
||||||
|
|
||||||
export type HyperActions = (
|
export type HyperActions = (
|
||||||
| UIActions
|
| UIActions
|
||||||
|
|
@ -187,7 +187,7 @@ export type HyperActions = (
|
||||||
| TabActions
|
| TabActions
|
||||||
) & {effect?: () => void};
|
) & {effect?: () => void};
|
||||||
|
|
||||||
import type configureStore from './store/configure-store';
|
import type configureStore from '../lib/store/configure-store';
|
||||||
export type HyperDispatch = ReturnType<typeof configureStore>['dispatch'];
|
export type HyperDispatch = ReturnType<typeof configureStore>['dispatch'];
|
||||||
|
|
||||||
import type {ReactChild} from 'react';
|
import type {ReactChild} from 'react';
|
||||||
|
|
@ -198,17 +198,17 @@ type extensionProps = Partial<{
|
||||||
customInnerChildren: ReactChild | ReactChild[];
|
customInnerChildren: ReactChild | ReactChild[];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
import type {HeaderConnectedProps} from './containers/header';
|
import type {HeaderConnectedProps} from '../lib/containers/header';
|
||||||
export type HeaderProps = HeaderConnectedProps & extensionProps;
|
export type HeaderProps = HeaderConnectedProps & extensionProps;
|
||||||
|
|
||||||
import type {HyperConnectedProps} from './containers/hyper';
|
import type {HyperConnectedProps} from '../lib/containers/hyper';
|
||||||
export type HyperProps = HyperConnectedProps & extensionProps;
|
export type HyperProps = HyperConnectedProps & extensionProps;
|
||||||
|
|
||||||
import type {NotificationsConnectedProps} from './containers/notifications';
|
import type {NotificationsConnectedProps} from '../lib/containers/notifications';
|
||||||
export type NotificationsProps = NotificationsConnectedProps & extensionProps;
|
export type NotificationsProps = NotificationsConnectedProps & extensionProps;
|
||||||
|
|
||||||
import type Terms from './components/terms';
|
import type Terms from '../lib/components/terms';
|
||||||
import type {TermsConnectedProps} from './containers/terms';
|
import type {TermsConnectedProps} from '../lib/containers/terms';
|
||||||
export type TermsProps = TermsConnectedProps & extensionProps & {ref_: (terms: Terms | null) => void};
|
export type TermsProps = TermsConnectedProps & extensionProps & {ref_: (terms: Terms | null) => void};
|
||||||
|
|
||||||
export type StyleSheetProps = {
|
export type StyleSheetProps = {
|
||||||
|
|
@ -266,7 +266,7 @@ export type SplitPaneProps = {
|
||||||
sizes?: Immutable<number[]> | null;
|
sizes?: Immutable<number[]> | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
import type Term from './components/term';
|
import type Term from '../lib/components/term';
|
||||||
|
|
||||||
export type TermGroupOwnProps = {
|
export type TermGroupOwnProps = {
|
||||||
cursorAccentColor?: string;
|
cursorAccentColor?: string;
|
||||||
|
|
@ -318,7 +318,7 @@ export type TermGroupOwnProps = {
|
||||||
| 'imageSupport'
|
| 'imageSupport'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
import type {TermGroupConnectedProps} from './components/term-group';
|
import type {TermGroupConnectedProps} from '../lib/components/term-group';
|
||||||
export type TermGroupProps = TermGroupConnectedProps & TermGroupOwnProps;
|
export type TermGroupProps = TermGroupConnectedProps & TermGroupOwnProps;
|
||||||
|
|
||||||
export type SearchBoxProps = {
|
export type SearchBoxProps = {
|
||||||
Loading…
Reference in a new issue