/**
 * Flowtype definitions for date-f
 * Generated by Flowgen from a Typescript Definition
 * Flowgen v1.3.0
 * Author: [Joar Wilk](http://twitter.com/joarwilk)
 * Repo: http://github.com/joarwilk/flowgen
 */

declare interface CurriedFn1<A, R> {
  (a: A): R;
}
declare interface CurriedFn2<A, B, R> {
  (a: A): CurriedFn1<B, R>;
  (a: A, b: B): R;
}
declare interface CurriedFn3<A, B, C, R> {
  (a: A): CurriedFn2<B, C, R>;
  (a: A, b: B): CurriedFn1<C, R>;
  (a: A, b: B, c: C): R;
}
declare interface CurriedFn4<A, B, C, D, R> {
  (a: A): CurriedFn3<B, C, D, R>;
  (a: A, b: B): CurriedFn2<C, D, R>;
  (a: A, b: B, c: C): CurriedFn1<D, R>;
  (a: A, b: B, c: C, d: D): R;
}
declare type Interval = {
  start: Date | number,
  end: Date | number,
};
declare type IntervalAliased = Interval;
declare type Locale = {
  formatDistance: Function,
  formatRelative: Function,
  localize: {
    ordinalNumber: Function,
    era: Function,
    quarter: Function,
    month: Function,
    day: Function,
    dayPeriod: Function,
  },
  formatLong: Object,
  date: Function,
  time: Function,
  dateTime: Function,
  match: {
    ordinalNumber: Function,
    era: Function,
    quarter: Function,
    month: Function,
    day: Function,
    dayPeriod: Function,
  },
  options?: {
    weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
    firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
  },
};
declare type LocaleAliased = Locale;
declare module 'date-fns' {
  declare type Interval = {
    start: Date | number,
    end: Date | number,
  };
  declare type Locale = {
    formatDistance: Function,
    formatRelative: Function,
    localize: {
      ordinalNumber: Function,
      era: Function,
      quarter: Function,
      month: Function,
      day: Function,
      dayPeriod: Function,
    },
    formatLong: Object,
    date: Function,
    time: Function,
    dateTime: Function,
    match: {
      ordinalNumber: Function,
      era: Function,
      quarter: Function,
      month: Function,
      day: Function,
      dayPeriod: Function,
    },
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  };
  declare function addDays(date: Date | number, amount: number): Date;

  declare function addHours(date: Date | number, amount: number): Date;

  declare function addISOWeekYears(date: Date | number, amount: number): Date;

  declare function addMilliseconds(date: Date | number, amount: number): Date;

  declare function addMinutes(date: Date | number, amount: number): Date;

  declare function addMonths(date: Date | number, amount: number): Date;

  declare function addQuarters(date: Date | number, amount: number): Date;

  declare function addSeconds(date: Date | number, amount: number): Date;

  declare function addWeeks(date: Date | number, amount: number): Date;

  declare function addYears(date: Date | number, amount: number): Date;

  declare function areIntervalsOverlapping(
    intervalLeft: Interval,
    intervalRight: Interval,
  ): boolean;

  declare function closestIndexTo(
    dateToCompare: Date | number,
    datesArray: (Date | number)[],
  ): number;

  declare function closestTo(dateToCompare: Date | number, datesArray: (Date | number)[]): Date;

  declare function compareAsc(dateLeft: Date | number, dateRight: Date | number): number;

  declare function compareDesc(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInCalendarDays(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInCalendarISOWeeks(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInCalendarISOWeekYears(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInCalendarMonths(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInCalendarQuarters(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInCalendarWeeks(
    dateLeft: Date | number,
    dateRight: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): number;

  declare function differenceInCalendarYears(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInDays(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInHours(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInISOWeekYears(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInMilliseconds(
    dateLeft: Date | number,
    dateRight: Date | number,
  ): number;

  declare function differenceInMinutes(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInMonths(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInQuarters(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInSeconds(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInWeeks(dateLeft: Date | number, dateRight: Date | number): number;

  declare function differenceInYears(dateLeft: Date | number, dateRight: Date | number): number;

  declare function eachDayOfInterval(
    interval: Interval,
    options?: {
      step?: number,
    },
  ): Date[];

  declare function eachWeekendOfInterval(interval: Interval): Date[];

  declare function eachWeekendOfMonth(date: Date | number): Date[];

  declare function eachWeekendOfYear(date: Date | number): Date[];

  declare function eachWeekOfInterval(
    interval: Interval,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
    },
  ): Date[];

  declare function endOfDay(date: Date | number): Date;

  declare function endOfDecade(
    date: Date | number,
    options?: {
      additionalDigits?: 0 | 1 | 2,
    },
  ): Date;

  declare function endOfHour(date: Date | number): Date;

  declare function endOfISOWeek(date: Date | number): Date;

  declare function endOfISOWeekYear(date: Date | number): Date;

  declare function endOfMinute(date: Date | number): Date;

  declare function endOfMonth(date: Date | number): Date;

  declare function endOfQuarter(date: Date | number): Date;

  declare function endOfSecond(date: Date | number): Date;

  declare function endOfWeek(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): Date;

  declare function endOfYear(date: Date | number): Date;

  declare function format(
    date: Date | number,
    format: string,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: number,
      locale?: Locale,
      awareOfUnicodeTokens?: boolean,
    },
  ): string;

  declare function formatDistance(
    date: Date | number,
    baseDate: Date | number,
    options?: {
      includeSeconds?: boolean,
      addSuffix?: boolean,
      locale?: Locale,
    },
  ): string;

  declare function formatDistanceStrict(
    date: Date | number,
    baseDate: Date | number,
    options?: {
      addSuffix?: boolean,
      unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
      roundingMethod?: 'floor' | 'ceil' | 'round',
      locale?: Locale,
    },
  ): string;

  declare function formatRelative(
    date: Date | number,
    baseDate: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): string;

  declare function fromUnixTime(unixTime: number): Date;

  declare function getDate(date: Date | number): number;

  declare function getDay(date: Date | number): number;

  declare function getDayOfYear(date: Date | number): number;

  declare function getDaysInMonth(date: Date | number): number;

  declare function getDaysInYear(date: Date | number): number;

  declare function getDecade(date: Date | number): number;

  declare function getHours(date: Date | number): number;

  declare function getISODay(date: Date | number): number;

  declare function getISOWeek(date: Date | number): number;

  declare function getISOWeeksInYear(date: Date | number): number;

  declare function getISOWeekYear(date: Date | number): number;

  declare function getMilliseconds(date: Date | number): number;

  declare function getMinutes(date: Date | number): number;

  declare function getMonth(date: Date | number): number;

  declare function getOverlappingDaysInIntervals(
    intervalLeft: Interval,
    intervalRight: Interval,
  ): number;

  declare function getQuarter(date: Date | number): number;

  declare function getSeconds(date: Date | number): number;

  declare function getTime(date: Date | number): number;

  declare function getUnixTime(date: Date | number): number;

  declare function getWeek(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  ): number;

  declare function getWeekOfMonth(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
    },
  ): number;

  declare function getWeeksInMonth(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): number;

  declare function getWeekYear(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  ): number;

  declare function getYear(date: Date | number): number;

  declare function isAfter(date: Date | number, dateToCompare: Date | number): boolean;

  declare function isBefore(date: Date | number, dateToCompare: Date | number): boolean;

  declare function isDate(value: any): boolean;

  declare function isEqual(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isFirstDayOfMonth(date: Date | number): boolean;

  declare function isFriday(date: Date | number): boolean;

  declare function isLastDayOfMonth(date: Date | number): boolean;

  declare function isLeapYear(date: Date | number): boolean;

  declare function isMonday(date: Date | number): boolean;

  declare function isSameDay(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameHour(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameISOWeek(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameISOWeekYear(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameMinute(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameMonth(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameQuarter(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameSecond(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSameWeek(
    dateLeft: Date | number,
    dateRight: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): boolean;

  declare function isSameYear(dateLeft: Date | number, dateRight: Date | number): boolean;

  declare function isSaturday(date: Date | number): boolean;

  declare function isSunday(date: Date | number): boolean;

  declare function isThursday(date: Date | number): boolean;

  declare function isTuesday(date: Date | number): boolean;

  declare function isValid(date: any): boolean;

  declare function isWednesday(date: Date | number): boolean;

  declare function isWeekend(date: Date | number): boolean;

  declare function isWithinInterval(date: Date | number, interval: Interval): boolean;

  declare function lastDayOfDecade(date: Date | number): Date;

  declare function lastDayOfISOWeek(date: Date | number): Date;

  declare function lastDayOfISOWeekYear(date: Date | number): Date;

  declare function lastDayOfMonth(date: Date | number): Date;

  declare function lastDayOfQuarter(
    date: Date | number,
    options?: {
      additionalDigits?: 0 | 1 | 2,
    },
  ): Date;

  declare function lastDayOfWeek(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): Date;

  declare function lastDayOfYear(date: Date | number): Date;

  declare function lightFormat(date: Date | number, format: string): string;

  declare function max(datesArray: (Date | number)[]): Date;

  declare function min(datesArray: (Date | number)[]): Date;

  declare function parse(
    dateString: string,
    formatString: string,
    baseDate: Date | number,
    options?: {
      locale?: Locale,
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
      awareOfUnicodeTokens?: boolean,
    },
  ): Date;

  declare function parseISO(
    argument: string,
    options?: {
      additionalDigits?: 0 | 1 | 2,
    },
  ): Date;

  declare function roundToNearestMinutes(
    date: Date | number,
    options?: {
      nearestTo?: number,
    },
  ): Date;

  declare function setDate(date: Date | number, dayOfMonth: number): Date;

  declare function setDay(
    date: Date | number,
    day: number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): Date;

  declare function setDayOfYear(date: Date | number, dayOfYear: number): Date;

  declare function setHours(date: Date | number, hours: number): Date;

  declare function setISODay(date: Date | number, day: number): Date;

  declare function setISOWeek(date: Date | number, isoWeek: number): Date;

  declare function setISOWeekYear(date: Date | number, isoWeekYear: number): Date;

  declare function setMilliseconds(date: Date | number, milliseconds: number): Date;

  declare function setMinutes(date: Date | number, minutes: number): Date;

  declare function setMonth(date: Date | number, month: number): Date;

  declare function setQuarter(date: Date | number, quarter: number): Date;

  declare function setSeconds(date: Date | number, seconds: number): Date;

  declare function setWeek(
    date: Date | number,
    week: number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  ): Date;

  declare function setWeekYear(
    date: Date | number,
    weekYear: number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  ): Date;

  declare function setYear(date: Date | number, year: number): Date;

  declare function startOfDay(date: Date | number): Date;

  declare function startOfDecade(date: Date | number): Date;

  declare function startOfHour(date: Date | number): Date;

  declare function startOfISOWeek(date: Date | number): Date;

  declare function startOfISOWeekYear(date: Date | number): Date;

  declare function startOfMinute(date: Date | number): Date;

  declare function startOfMonth(date: Date | number): Date;

  declare function startOfQuarter(date: Date | number): Date;

  declare function startOfSecond(date: Date | number): Date;

  declare function startOfWeek(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      locale?: Locale,
    },
  ): Date;

  declare function startOfWeekYear(
    date: Date | number,
    options?: {
      weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
      firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
    },
  ): Date;

  declare function startOfYear(date: Date | number): Date;

  declare function subDays(date: Date | number, amount: number): Date;

  declare function subHours(date: Date | number, amount: number): Date;

  declare function subISOWeekYears(date: Date | number, amount: number): Date;

  declare function subMilliseconds(date: Date | number, amount: number): Date;

  declare function subMinutes(date: Date | number, amount: number): Date;

  declare function subMonths(date: Date | number, amount: number): Date;

  declare function subQuarters(date: Date | number, amount: number): Date;

  declare function subSeconds(date: Date | number, amount: number): Date;

  declare function subWeeks(date: Date | number, amount: number): Date;

  declare function subYears(date: Date | number, amount: number): Date;

  declare function toDate(argument: Date | number): Date;
}
