chowa
Version:
UI component library based on React
45 lines (44 loc) • 1.47 kB
TypeScript
/**
* @license chowa v1.1.3
*
* Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn).
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { BaseStatisticProps } from './base-statistic';
import * as moment from 'moment';
import { OmitProps } from '../utils';
interface CountdownFormat {
value: moment.Duration;
format: (tpl: string) => string;
}
export interface CountdownProps extends OmitProps<BaseStatisticProps, 'valueNode'> {
value: number | moment.Moment;
formatter?: (cf: CountdownFormat) => React.ReactNode;
onFinish?: () => void;
refresInterval?: number;
}
export interface CountdownState {
result: number;
}
declare class Countdown extends React.PureComponent<CountdownProps, CountdownState> {
static propTypes: {
value: PropTypes.Validator<number | object>;
formatter: PropTypes.Requireable<(...args: any[]) => any>;
onFinish: PropTypes.Requireable<(...args: any[]) => any>;
refresInterval: PropTypes.Requireable<number>;
};
static defaultProps: {
formatter: (cf: CountdownFormat) => string;
refresInterval: number;
};
private timer;
constructor(props: CountdownProps);
componentDidMount(): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export default Countdown;