UNPKG

@linkdesign/screen

Version:

屏组件库,但使用场景又不局限于屏。主要用于BI、大盘和屏

61 lines (60 loc) 1.27 kB
import React, { PureComponent, ReactNode } from 'react'; import dayjs from 'dayjs'; import { ITitle } from '../title'; interface ITimeObj { days: number; hours: number; minutes: number; seconds: number; } interface IProps extends ITitle { /** * 人性化 * 默认:true */ humanize?: boolean; /** * 时间格式 同 momentjs * 默认:'MM月DD日 HH:mm:ss' */ format?: string; /** * 开始时间 */ start?: dayjs.Dayjs; /** * 结束时间 */ end?: dayjs.Dayjs; /** * 自定义 */ render?: (obj: dayjs.Dayjs | number, origin: ReactNode) => ReactNode; } interface IState { time: any; } /** * 时间器 * * @class Timer * @extends {PureComponent<IProps, IState>} */ declare class Timer extends PureComponent<IProps, IState> { private updateTimer; constructor(props: IProps); componentDidMount(): void; componentWillUnmount(): void; updateTime(): void; processTime(a: any, b: any): { diff: any; days: any; hours: any; minutes: any; seconds: any; }; renderFormatTime(obj: ITimeObj): JSX.Element; renderTime(): any; render(): React.ReactNode; } export default Timer;