react-terminal-plus
Version:
A improved version of `react-terminal` - react-terminal-plus
28 lines (27 loc) • 1.04 kB
TypeScript
import * as React from "react";
import { NoInfer } from "../common/Types";
import { DefaultThemes } from "../themes";
export type TerminalMessage = string | React.ReactNode | Function;
type ThemeSchema = {
themeBGColor?: string;
themeToolbarColor?: string;
themePromptColor?: string;
themeColor?: string;
};
export type TerminalProps<ThemesT extends string> = {
enableInput?: boolean;
caret?: boolean;
showControlBar?: boolean;
showControlButtons?: boolean;
controlButtonLabels?: string[];
prompt?: string;
commands?: Record<string, TerminalMessage>;
welcomeMessage?: TerminalMessage;
errorMessage?: TerminalMessage;
rounded?: boolean;
themes?: Record<ThemesT, ThemeSchema>;
theme?: NoInfer<ThemesT> | DefaultThemes;
defaultHandler?: (command: string, commandArguments: string) => TerminalMessage | Promise<TerminalMessage>;
};
export default function Terminal<ThemesT extends string>(props: TerminalProps<ThemesT>): React.JSX.Element;
export {};