Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

758 linhas
22 KiB

  1. declare function moment(inp?: moment.MomentInput, format?: moment.MomentFormatSpecification, strict?: boolean): moment.Moment;
  2. declare function moment(inp?: moment.MomentInput, format?: moment.MomentFormatSpecification, language?: string, strict?: boolean): moment.Moment;
  3. declare namespace moment {
  4. type RelativeTimeKey = 's' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'M' | 'MM' | 'y' | 'yy';
  5. type CalendarKey = 'sameDay' | 'nextDay' | 'lastDay' | 'nextWeek' | 'lastWeek' | 'sameElse' | string;
  6. type LongDateFormatKey = 'LTS' | 'LT' | 'L' | 'LL' | 'LLL' | 'LLLL' | 'lts' | 'lt' | 'l' | 'll' | 'lll' | 'llll';
  7. interface Locale {
  8. calendar(key?: CalendarKey, m?: Moment, now?: Moment): string;
  9. longDateFormat(key: LongDateFormatKey): string;
  10. invalidDate(): string;
  11. ordinal(n: number): string;
  12. preparse(inp: string): string;
  13. postformat(inp: string): string;
  14. relativeTime(n: number, withoutSuffix: boolean,
  15. key: RelativeTimeKey, isFuture: boolean): string;
  16. pastFuture(diff: number, absRelTime: string): string;
  17. set(config: Object): void;
  18. months(): string[];
  19. jMonths(): string[];
  20. months(m: Moment, format?: string): string;
  21. jMonths(m: Moment): string;
  22. monthsShort(): string[];
  23. jMonthsShort():string[];
  24. monthsShort(m: Moment, format?: string): string;
  25. jMonthsParse(monthName: string): number;
  26. monthsParse(monthName: string, format: string, strict: boolean): number;
  27. monthsRegex(strict: boolean): RegExp;
  28. monthsShortRegex(strict: boolean): RegExp;
  29. week(m: Moment): number;
  30. firstDayOfYear(): number;
  31. firstDayOfWeek(): number;
  32. weekdays(): string[];
  33. weekdays(m: Moment, format?: string): string;
  34. weekdaysMin(): string[];
  35. weekdaysMin(m: Moment): string;
  36. weekdaysShort(): string[];
  37. weekdaysShort(m: Moment): string;
  38. weekdaysParse(weekdayName: string, format: string, strict: boolean): number;
  39. weekdaysRegex(strict: boolean): RegExp;
  40. weekdaysShortRegex(strict: boolean): RegExp;
  41. weekdaysMinRegex(strict: boolean): RegExp;
  42. isPM(input: string): boolean;
  43. meridiem(hour: number, minute: number, isLower: boolean): string;
  44. }
  45. interface StandaloneFormatSpec {
  46. format: string[];
  47. standalone: string[];
  48. isFormat?: RegExp;
  49. }
  50. interface WeekSpec {
  51. dow: number;
  52. doy: number;
  53. }
  54. type CalendarSpecVal = string | ((m?: MomentInput, now?: Moment) => string);
  55. interface CalendarSpec {
  56. sameDay?: CalendarSpecVal;
  57. nextDay?: CalendarSpecVal;
  58. lastDay?: CalendarSpecVal;
  59. nextWeek?: CalendarSpecVal;
  60. lastWeek?: CalendarSpecVal;
  61. sameElse?: CalendarSpecVal;
  62. // any additional properties might be used with moment.calendarFormat
  63. [x: string]: CalendarSpecVal | void; // undefined
  64. }
  65. type RelativeTimeSpecVal = (
  66. string |
  67. ((n: number, withoutSuffix: boolean,
  68. key: RelativeTimeKey, isFuture: boolean) => string)
  69. );
  70. type RelativeTimeFuturePastVal = string | ((relTime: string) => string);
  71. interface RelativeTimeSpec {
  72. future: RelativeTimeFuturePastVal;
  73. past: RelativeTimeFuturePastVal;
  74. s: RelativeTimeSpecVal;
  75. m: RelativeTimeSpecVal;
  76. mm: RelativeTimeSpecVal;
  77. h: RelativeTimeSpecVal;
  78. hh: RelativeTimeSpecVal;
  79. d: RelativeTimeSpecVal;
  80. dd: RelativeTimeSpecVal;
  81. M: RelativeTimeSpecVal;
  82. MM: RelativeTimeSpecVal;
  83. y: RelativeTimeSpecVal;
  84. yy: RelativeTimeSpecVal;
  85. }
  86. interface LongDateFormatSpec {
  87. LTS: string;
  88. LT: string;
  89. L: string;
  90. LL: string;
  91. LLL: string;
  92. LLLL: string;
  93. // lets forget for a sec that any upper/lower permutation will also work
  94. lts?: string;
  95. lt?: string;
  96. l?: string;
  97. ll?: string;
  98. lll?: string;
  99. llll?: string;
  100. }
  101. type MonthWeekdayFn = (momentToFormat: Moment, format?: string) => string;
  102. type WeekdaySimpleFn = (momentToFormat: Moment) => string;
  103. interface LocaleSpecification {
  104. useGregorianParser?: boolean;
  105. months?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
  106. monthsShort?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
  107. weekdays?: string[] | StandaloneFormatSpec | MonthWeekdayFn;
  108. weekdaysShort?: string[] | StandaloneFormatSpec | WeekdaySimpleFn;
  109. weekdaysMin?: string[] | StandaloneFormatSpec | WeekdaySimpleFn;
  110. meridiemParse?: RegExp;
  111. meridiem?: (hour: number, minute: number, isLower: boolean) => string;
  112. isPM?: (input: string) => boolean;
  113. longDateFormat?: LongDateFormatSpec;
  114. calendar?: CalendarSpec;
  115. relativeTime?: RelativeTimeSpec;
  116. invalidDate?: string;
  117. ordinal?: (n: number) => string;
  118. ordinalParse?: RegExp;
  119. week?: WeekSpec;
  120. // Allow anything: in general any property that is passed as locale spec is
  121. // put in the locale object so it can be used by locale functions
  122. [x: string]: any;
  123. }
  124. interface MomentObjectOutput {
  125. years: number;
  126. /* One digit */
  127. months: number;
  128. /* Day of the month */
  129. date: number;
  130. hours: number;
  131. minutes: number;
  132. seconds: number;
  133. milliseconds: number;
  134. }
  135. interface Duration {
  136. humanize(withSuffix?: boolean): string;
  137. abs(): Duration;
  138. as(units: unitOfTime.Base): number;
  139. get(units: unitOfTime.Base): number;
  140. milliseconds(): number;
  141. asMilliseconds(): number;
  142. seconds(): number;
  143. asSeconds(): number;
  144. minutes(): number;
  145. asMinutes(): number;
  146. hours(): number;
  147. asHours(): number;
  148. days(): number;
  149. asDays(): number;
  150. weeks(): number;
  151. asWeeks(): number;
  152. months(): number;
  153. asMonths(): number;
  154. years(): number;
  155. asYears(): number;
  156. add(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
  157. subtract(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
  158. locale(): string;
  159. locale(locale: LocaleSpecifier): Duration;
  160. localeData(): Locale;
  161. toISOString(keepTimeOffset?: boolean): string;
  162. toJSON(): string;
  163. /**
  164. * @deprecated since version 2.8.0
  165. */
  166. lang(locale: LocaleSpecifier): Moment;
  167. /**
  168. * @deprecated since version 2.8.0
  169. */
  170. lang(): Locale;
  171. /**
  172. * @deprecated
  173. */
  174. toIsoString(): string;
  175. }
  176. interface MomentRelativeTime {
  177. future: any;
  178. past: any;
  179. s: any;
  180. m: any;
  181. mm: any;
  182. h: any;
  183. hh: any;
  184. d: any;
  185. dd: any;
  186. M: any;
  187. MM: any;
  188. y: any;
  189. yy: any;
  190. }
  191. interface MomentLongDateFormat {
  192. L: string;
  193. LL: string;
  194. LLL: string;
  195. LLLL: string;
  196. LT: string;
  197. LTS: string;
  198. l?: string;
  199. ll?: string;
  200. lll?: string;
  201. llll?: string;
  202. lt?: string;
  203. lts?: string;
  204. }
  205. interface MomentParsingFlags {
  206. empty: boolean;
  207. unusedTokens: string[];
  208. unusedInput: string[];
  209. overflow: number;
  210. charsLeftOver: number;
  211. nullInput: boolean;
  212. invalidMonth: string | void; // null
  213. invalidFormat: boolean;
  214. userInvalidated: boolean;
  215. iso: boolean;
  216. parsedDateParts: any[];
  217. meridiem: string | void; // null
  218. }
  219. interface MomentParsingFlagsOpt {
  220. empty?: boolean;
  221. unusedTokens?: string[];
  222. unusedInput?: string[];
  223. overflow?: number;
  224. charsLeftOver?: number;
  225. nullInput?: boolean;
  226. invalidMonth?: string;
  227. invalidFormat?: boolean;
  228. userInvalidated?: boolean;
  229. iso?: boolean;
  230. parsedDateParts?: any[];
  231. meridiem?: string;
  232. }
  233. interface MomentBuiltinFormat {
  234. __momentBuiltinFormatBrand: any;
  235. }
  236. type MomentFormatSpecification = string | MomentBuiltinFormat | (string | MomentBuiltinFormat)[];
  237. namespace unitOfTime {
  238. type Base = (
  239. "year" | "years" | "y" | "jYear" |
  240. "month" | "months" | "M" | "jMonth" | "jmonth" |
  241. "week" | "weeks" | "w" | "jw" |
  242. "day" | "days" | "d" | "jDay" | "jD" |
  243. "hour" | "hours" | "h" |
  244. "minute" | "minutes" | "m" |
  245. "second" | "seconds" | "s" |
  246. "millisecond" | "milliseconds" | "ms"
  247. );
  248. type _quarter = "quarter" | "quarters" | "Q";
  249. type _isoWeek = "isoWeek" | "isoWeeks" | "W";
  250. type _date = "date" | "dates" | "D";
  251. type DurationConstructor = Base | _quarter;
  252. type DurationAs = Base;
  253. type StartOf = Base | _quarter | _isoWeek | _date;
  254. type Diff = Base | _quarter;
  255. type MomentConstructor = Base | _date;
  256. type All = Base | _quarter | _isoWeek | _date |
  257. "weekYear" | "weekYears" | "gg" |
  258. "isoWeekYear" | "isoWeekYears" | "GG" |
  259. "dayOfYear" | "dayOfYears" | "DDD" |
  260. "weekday" | "weekdays" | "e" |
  261. "isoWeekday" | "isoWeekdays" | "E";
  262. }
  263. interface MomentInputObject {
  264. years?: number;
  265. year?: number;
  266. y?: number;
  267. months?: number;
  268. month?: number;
  269. M?: number;
  270. days?: number;
  271. day?: number;
  272. d?: number;
  273. dates?: number;
  274. date?: number;
  275. D?: number;
  276. hours?: number;
  277. hour?: number;
  278. h?: number;
  279. minutes?: number;
  280. minute?: number;
  281. m?: number;
  282. seconds?: number;
  283. second?: number;
  284. s?: number;
  285. milliseconds?: number;
  286. millisecond?: number;
  287. ms?: number;
  288. }
  289. interface DurationInputObject extends MomentInputObject {
  290. quarters?: number;
  291. quarter?: number;
  292. Q?: number;
  293. weeks?: number;
  294. week?: number;
  295. w?: number;
  296. }
  297. interface MomentSetObject extends MomentInputObject {
  298. weekYears?: number;
  299. weekYear?: number;
  300. gg?: number;
  301. isoWeekYears?: number;
  302. isoWeekYear?: number;
  303. GG?: number;
  304. quarters?: number;
  305. quarter?: number;
  306. Q?: number;
  307. weeks?: number;
  308. week?: number;
  309. w?: number;
  310. isoWeeks?: number;
  311. isoWeek?: number;
  312. W?: number;
  313. dayOfYears?: number;
  314. dayOfYear?: number;
  315. DDD?: number;
  316. weekdays?: number;
  317. weekday?: number;
  318. e?: number;
  319. isoWeekdays?: number;
  320. isoWeekday?: number;
  321. E?: number;
  322. }
  323. interface FromTo {
  324. from: MomentInput;
  325. to: MomentInput;
  326. }
  327. type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  328. type DurationInputArg1 = Duration | number | string | FromTo | DurationInputObject | void; // null | undefined
  329. type DurationInputArg2 = unitOfTime.DurationConstructor;
  330. type LocaleSpecifier = string | Moment | Duration | string[] | boolean;
  331. interface MomentCreationData {
  332. input: MomentInput;
  333. format?: MomentFormatSpecification;
  334. locale: Locale;
  335. isUTC: boolean;
  336. strict?: boolean;
  337. }
  338. interface Moment extends Object{
  339. format(format?: string): string;
  340. startOf(unitOfTime: unitOfTime.StartOf): Moment;
  341. endOf(unitOfTime: unitOfTime.StartOf): Moment;
  342. add(amount?: DurationInputArg1, unit?: DurationInputArg2): Moment;
  343. /**
  344. * @deprecated reverse syntax
  345. */
  346. add(unit: unitOfTime.DurationConstructor, amount: number|string): Moment;
  347. subtract(amount?: DurationInputArg1, unit?: DurationInputArg2): Moment;
  348. /**
  349. * @deprecated reverse syntax
  350. */
  351. subtract(unit: unitOfTime.DurationConstructor, amount: number|string): Moment;
  352. calendar(time?: MomentInput, formats?: CalendarSpec): string;
  353. clone(): Moment;
  354. /**
  355. * @return Unix timestamp in milliseconds
  356. */
  357. valueOf(): number;
  358. // current date/time in local mode
  359. local(keepLocalTime?: boolean): Moment;
  360. isLocal(): boolean;
  361. // current date/time in UTC mode
  362. utc(keepLocalTime?: boolean): Moment;
  363. isUTC(): boolean;
  364. /**
  365. * @deprecated use isUTC
  366. */
  367. isUtc(): boolean;
  368. parseZone(): Moment;
  369. isValid(): boolean;
  370. invalidAt(): number;
  371. hasAlignedHourOffset(other?: MomentInput): boolean;
  372. creationData(): MomentCreationData;
  373. parsingFlags(): MomentParsingFlags;
  374. year(y: number): Moment;
  375. year(): number;
  376. jYear(y: number): Moment;
  377. jYear():number;
  378. /**
  379. * @deprecated use year(y)
  380. */
  381. years(y: number): Moment;
  382. /**
  383. * @deprecated use year()
  384. */
  385. years(): number;
  386. quarter(): number;
  387. quarter(q: number): Moment;
  388. quarters(): number;
  389. quarters(q: number): Moment;
  390. month(M: number|string): Moment;
  391. jMonth(M: number|string): Moment;
  392. month(): number;
  393. jMonth(): number;
  394. /**
  395. * @deprecated use month(M)
  396. */
  397. months(M: number|string): Moment;
  398. /**
  399. * @deprecated use month()
  400. */
  401. months(): number;
  402. day(d: number|string): Moment;
  403. day(): number;
  404. jDay(d: number|string): Moment;
  405. jDay(): number;
  406. days(d: number|string): Moment;
  407. days(): number;
  408. date(d: number): Moment;
  409. jDate(d: number): Moment;
  410. date(): number;
  411. jDate(): number;
  412. /**
  413. * @deprecated use date(d)
  414. */
  415. dates(d: number): Moment;
  416. /**
  417. * @deprecated use jDate(d)
  418. */
  419. jDates(d: number): Moment;
  420. /**
  421. * @deprecated use date()
  422. */
  423. dates(): number;
  424. /**
  425. * @deprecated use jDate()
  426. */
  427. jDates():number;
  428. hour(h: number): Moment;
  429. hour(): number;
  430. hours(h: number): Moment;
  431. hours(): number;
  432. minute(m: number): Moment;
  433. minute(): number;
  434. minutes(m: number): Moment;
  435. minutes(): number;
  436. second(s: number): Moment;
  437. second(): number;
  438. seconds(s: number): Moment;
  439. seconds(): number;
  440. millisecond(ms: number): Moment;
  441. millisecond(): number;
  442. milliseconds(ms: number): Moment;
  443. milliseconds(): number;
  444. weekday(): number;
  445. //TODO:jweekday
  446. weekday(d: number): Moment;
  447. isoWeekday(): number;
  448. isoWeekday(d: number|string): Moment;
  449. weekYear(): number;
  450. jWeekYear(): number;
  451. weekYear(d: number): Moment;
  452. jWeekYear(d: number): Moment;
  453. isoWeekYear(): number;
  454. isoWeekYear(d: number): Moment;
  455. week(): number;
  456. jWeek(): number;
  457. week(d: number): Moment;
  458. jWeek(d: number): Moment;
  459. weeks(): number;
  460. jWeeks(): number;//TODO:check it
  461. weeks(d: number): Moment;
  462. isoWeek(): number;
  463. isoWeek(d: number): Moment;
  464. isoWeeks(): number;
  465. isoWeeks(d: number): Moment;
  466. weeksInYear(): number;
  467. //TODO : jWeeksInYear
  468. isoWeeksInYear(): number;
  469. dayOfYear(): number;
  470. jDayOfYear(): number;
  471. dayOfYear(d: number): Moment;
  472. jDayOfYear(d: number): Moment;
  473. from(inp: MomentInput, suffix?: boolean): string;
  474. to(inp: MomentInput, suffix?: boolean): string;
  475. fromNow(withoutSuffix?: boolean): string;
  476. toNow(withoutPrefix?: boolean): string;
  477. diff(b: MomentInput, unitOfTime?: unitOfTime.Diff, precise?: boolean): number;
  478. toArray(): number[];
  479. toDate(): Date;
  480. toISOString(keepTimeOffset?: boolean): string;
  481. inspect(): string;
  482. toJSON(): string;
  483. unix(): number;
  484. isLeapYear(): boolean;
  485. jIsLeapYear(): boolean;
  486. /**
  487. * @deprecated in favor of utcOffset
  488. */
  489. zone(): number;
  490. zone(b: number|string): Moment;
  491. utcOffset(): number;
  492. utcOffset(b: number|string, keepLocalTime?: boolean): Moment;
  493. isUtcOffset(): boolean;
  494. daysInMonth(): number;
  495. jDaysInMonth(): number;
  496. isDST(): boolean;
  497. zoneAbbr(): string;
  498. zoneName(): string;
  499. isBefore(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
  500. isAfter(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
  501. isSame(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
  502. isSameOrAfter(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
  503. isSameOrBefore(inp?: MomentInput, granularity?: unitOfTime.StartOf): boolean;
  504. isBetween(a: MomentInput, b: MomentInput, granularity?: unitOfTime.StartOf, inclusivity?: "()" | "[)" | "(]" | "[]"): boolean;
  505. doAsGregorian(): Moment;
  506. /**
  507. * @deprecated as of 2.8.0, use locale
  508. */
  509. lang(language: LocaleSpecifier): Moment;
  510. /**
  511. * @deprecated as of 2.8.0, use locale
  512. */
  513. lang(): Locale;
  514. locale(): string;
  515. locale(locale: LocaleSpecifier): Moment;
  516. localeData(): Locale;
  517. /**
  518. * @deprecated no reliable implementation
  519. */
  520. isDSTShifted(): boolean;
  521. // NOTE(constructor): Same as moment constructor
  522. /**
  523. * @deprecated as of 2.7.0, use moment.min/max
  524. */
  525. max(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
  526. /**
  527. * @deprecated as of 2.7.0, use moment.min/max
  528. */
  529. max(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
  530. // NOTE(constructor): Same as moment constructor
  531. /**
  532. * @deprecated as of 2.7.0, use moment.min/max
  533. */
  534. min(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
  535. /**
  536. * @deprecated as of 2.7.0, use moment.min/max
  537. */
  538. min(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
  539. get(unit: unitOfTime.All): number;
  540. set(unit: unitOfTime.All, value: number): Moment;
  541. set(objectLiteral: MomentSetObject): Moment;
  542. toObject(): MomentObjectOutput;
  543. }
  544. export var version: string;
  545. export var fn: Moment;
  546. // NOTE(constructor): Same as moment constructor
  547. export function utc(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
  548. export function utc(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
  549. export function unix(timestamp: number): Moment;
  550. export function invalid(flags?: MomentParsingFlagsOpt): Moment;
  551. export function isMoment(m: any): m is Moment;
  552. export function isDate(m: any): m is Date;
  553. export function isDuration(d: any): d is Duration;
  554. /**
  555. * @deprecated in 2.8.0
  556. */
  557. export function lang(language?: string): string;
  558. /**
  559. * @deprecated in 2.8.0
  560. */
  561. export function lang(language?: string, definition?: Locale): string;
  562. export function locale(language?: string): string;
  563. export function locale(language?: string[]): string;
  564. export function locale(language?: string, definition?: LocaleSpecification | void): string; // null | undefined
  565. export function localeData(key?: string | string[]): Locale;
  566. export function duration(inp?: DurationInputArg1, unit?: DurationInputArg2): Duration;
  567. // NOTE(constructor): Same as moment constructor
  568. export function parseZone(inp?: MomentInput, format?: MomentFormatSpecification, strict?: boolean): Moment;
  569. export function parseZone(inp?: MomentInput, format?: MomentFormatSpecification, language?: string, strict?: boolean): Moment;
  570. export function months(): string[];
  571. export function months(index: number): string;
  572. export function months(format: string): string[];
  573. export function months(format: string, index: number): string;
  574. export function monthsShort(): string[];
  575. export function monthsShort(index: number): string;
  576. export function monthsShort(format: string): string[];
  577. export function monthsShort(format: string, index: number): string;
  578. export function jWeekOfYear(mom: Moment, firstDayOfWeek: number, firstDayOfWeekOfYear: number): MomentInput;
  579. export function jDaysInMonth(jMear: number, jMonth: number): number;
  580. export function jIsLeapYear(jYear: number): boolean;
  581. export function useJalaliSystemPrimarily(): void;
  582. export function useJalaliSystemSecondary(): void;
  583. export var jConvert: any;
  584. export function from (date: string, locale: string, format?: string): Moment;
  585. export function weekdays(): string[];
  586. export function weekdays(index: number): string;
  587. export function weekdays(format: string): string[];
  588. export function weekdays(format: string, index: number): string;
  589. export function weekdays(localeSorted: boolean): string[];
  590. export function weekdays(localeSorted: boolean, index: number): string;
  591. export function weekdays(localeSorted: boolean, format: string): string[];
  592. export function weekdays(localeSorted: boolean, format: string, index: number): string;
  593. export function weekdaysShort(): string[];
  594. export function weekdaysShort(index: number): string;
  595. export function weekdaysShort(format: string): string[];
  596. export function weekdaysShort(format: string, index: number): string;
  597. export function weekdaysShort(localeSorted: boolean): string[];
  598. export function weekdaysShort(localeSorted: boolean, index: number): string;
  599. export function weekdaysShort(localeSorted: boolean, format: string): string[];
  600. export function weekdaysShort(localeSorted: boolean, format: string, index: number): string;
  601. export function weekdaysMin(): string[];
  602. export function weekdaysMin(index: number): string;
  603. export function weekdaysMin(format: string): string[];
  604. export function weekdaysMin(format: string, index: number): string;
  605. export function weekdaysMin(localeSorted: boolean): string[];
  606. export function weekdaysMin(localeSorted: boolean, index: number): string;
  607. export function weekdaysMin(localeSorted: boolean, format: string): string[];
  608. export function weekdaysMin(localeSorted: boolean, format: string, index: number): string;
  609. export function min(...moments: MomentInput[]): Moment;
  610. export function max(...moments: MomentInput[]): Moment;
  611. /**
  612. * Returns unix time in milliseconds. Overwrite for profit.
  613. */
  614. export function now(): number;
  615. export function defineLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
  616. export function updateLocale(language: string, localeSpec: LocaleSpecification | void): Locale; // null
  617. export function locales(): string[];
  618. export function normalizeUnits(unit: unitOfTime.All): string;
  619. export function relativeTimeThreshold(threshold: string): number | boolean;
  620. export function relativeTimeThreshold(threshold: string, limit: number): boolean;
  621. export function relativeTimeRounding(fn: (num: number) => number): boolean;
  622. export function relativeTimeRounding(): (num: number) => number;
  623. export function calendarFormat(m: Moment, now: Moment): string;
  624. /**
  625. * Constant used to enable explicit ISO_8601 format parsing.
  626. */
  627. export var ISO_8601: MomentBuiltinFormat;
  628. export var defaultFormat: string;
  629. export var defaultFormatUtc: string;
  630. }
  631. export = moment;