utils.d.ts 671 B

123456789101112131415
  1. import type * as React from 'react';
  2. export type valueType = number | string;
  3. export type countdownValueType = number | string;
  4. export type Formatter = false | 'number' | 'countdown' | ((value: valueType, config?: FormatConfig) => React.ReactNode);
  5. export interface FormatConfig {
  6. formatter?: Formatter;
  7. decimalSeparator?: string;
  8. groupSeparator?: string;
  9. precision?: number;
  10. }
  11. export interface CountdownFormatConfig extends FormatConfig {
  12. format?: string;
  13. }
  14. export declare function formatTimeStr(duration: number, format: string): string;
  15. export declare function formatCounter(value: valueType, config: CountdownFormatConfig, down: boolean): string;