mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-29 18:06:43 +03:00
04f16e047b
Doesn't quite compile, untested.
21 lines
572 B
TypeScript
21 lines
572 B
TypeScript
import { Terminal } from 'xterm';
|
|
import { FitAddon } from 'xterm-addon-fit';
|
|
|
|
import { createState } from "../src/logic/state/base";
|
|
|
|
type Session = { term: Terminal, fit: FitAddon };
|
|
type Sessions = { [id: string]: Session; }
|
|
|
|
export interface TermState {
|
|
sessions: Sessions,
|
|
selected: string,
|
|
slogstream: null | EventSource,
|
|
};
|
|
|
|
const useTermState = createState<TermState>('Term', {
|
|
sessions: {},
|
|
selected: '', // empty string is default session
|
|
slogstream: null,
|
|
}, ['sessions', 'slogstream']); //TODO consider persisting
|
|
|
|
export default useTermState; |