版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

25 righe
586 B

  1. import { PluginFunc, ConfigType } from 'dayjs'
  2. declare interface RelativeTimeThreshold {
  3. l: string
  4. r?: number
  5. d?: string
  6. }
  7. declare interface RelativeTimeOptions {
  8. rounding?: (num: number) => number
  9. thresholds?: RelativeTimeThreshold[]
  10. }
  11. declare const plugin: PluginFunc<RelativeTimeOptions>
  12. export = plugin
  13. declare module 'dayjs' {
  14. interface Dayjs {
  15. fromNow(withoutSuffix?: boolean): string
  16. from(compared: ConfigType, withoutSuffix?: boolean): string
  17. toNow(withoutSuffix?: boolean): string
  18. to(compared: ConfigType, withoutSuffix?: boolean): string
  19. }
  20. }