UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

48 lines (47 loc) 1.49 kB
/** * @file 用于显示日志的组件,比如显示命令行的输出结果 */ import React from 'react'; import type { RendererProps } from 'jamis-core'; import type { LogSchema } from './types'; interface LogProps extends RendererProps, Omit<LogSchema, 'type' | 'className'> { } interface LogState { lastLine: string; logs: string[]; originLogs: string[]; refresh: boolean; showLineNumber: boolean; filterWord: string; } export declare class Log extends React.Component<LogProps, LogState> { static defaultProps: { height: number; autoScroll: boolean; placeholder: string; encoding: string; }; isDone: boolean; autoScroll: boolean; logRef: React.RefObject<HTMLDivElement>; state: LogState; constructor(props: LogProps); componentWillUnmount(): void; componentDidMount(): void; componentDidUpdate(prevProps: LogProps): void; pauseOrResumeScrolling(): void; refresh: (e: React.MouseEvent<HTMLElement>) => void; clear: (e: React.MouseEvent<HTMLElement>) => void; changeFilterWord: (value: string) => void; loadLogs(): Promise<void>; renderHighlightWord(line: string): string | (string | JSX.Element)[]; renderHighlightWordWithAnsi(line: string): string; /** * 渲染某一行 */ renderLine(index: number, line: string, showLineNumber: boolean): JSX.Element; render(): JSX.Element; } export declare class LogRenderer extends Log { } export {};