utils.d.ts 745 B

12345678910111213141516171819
  1. import type { VNodeTypes } from 'vue';
  2. export declare type valueType = number | string;
  3. export declare type countdownValueType = valueType | Date;
  4. export declare type Formatter = false | 'number' | 'countdown' | (({ value, config }: {
  5. value: valueType;
  6. config?: FormatConfig;
  7. }) => VNodeTypes);
  8. export interface FormatConfig {
  9. formatter?: Formatter;
  10. decimalSeparator?: string;
  11. groupSeparator?: string;
  12. precision?: number;
  13. prefixCls?: string;
  14. }
  15. export interface CountdownFormatConfig extends FormatConfig {
  16. format?: string;
  17. }
  18. export declare function formatTimeStr(duration: number, format: string): string;
  19. export declare function formatCountdown(value: countdownValueType, config: CountdownFormatConfig): string;