matrix-react-sdk
Version:
SDK for matrix.org using React
23 lines (22 loc) • 786 B
TypeScript
import React, { HTMLProps } from "react";
import { formatSeconds } from "../../../DateUtils";
interface Props extends Pick<HTMLProps<HTMLSpanElement>, "aria-live" | "role"> {
seconds: number;
formatFn: (seconds: number) => string;
}
/**
* Clock which represents time periods rather than absolute time.
* Simply converts seconds using formatFn.
* Defaulting to formatSeconds().
* Note that in this case hours will not be displayed, making it possible to see "82:29".
*/
export default class Clock extends React.Component<Props> {
static defaultProps: {
formatFn: typeof formatSeconds;
};
constructor(props: Props);
shouldComponentUpdate(nextProps: Readonly<Props>): boolean;
private calculateDuration;
render(): React.ReactNode;
}
export {};