duration.d.ts 622 B

1234567891011121314151617181920
  1. /**
  2. * Represent a duration in seconds as a string
  3. *
  4. * @param value A finite number, or its string representation
  5. * @return Includes one or two `:` separators, and matches the pattern
  6. * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a
  7. * trailing `.sss` part for non-integer input
  8. *
  9. * @example
  10. * ```js
  11. * var mf = new MessageFormat();
  12. *
  13. * mf.compile('It has been {D, duration}')({ D: 123 })
  14. * // 'It has been 2:03'
  15. *
  16. * mf.compile('Countdown: {D, duration}')({ D: -151200.42 })
  17. * // 'Countdown: -42:00:00.420'
  18. * ```
  19. */
  20. export declare function duration(value: number | string): string;