import { IndexableObject } from 'ng-zorro-antd/core/types';

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

type CandyDateMode = 'decade' | 'year' | 'quarter' | 'month' | 'day' | 'hour' | 'minute' | 'second';
type NormalizedMode = 'decade' | 'year' | 'month';
type WeekDayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;
type CandyDateType = CandyDate | Date | null;
type SingleValue = CandyDate | null;
type CompatibleValue = SingleValue | SingleValue[];
declare function wrongSortOrder(rangeValue: SingleValue[]): boolean;
declare function normalizeRangeValue(value: SingleValue[], hasTimePicker: boolean, type?: NormalizedMode, activePart?: 'left' | 'right'): CandyDate[];
declare function cloneDate(value: CompatibleValue): CompatibleValue;
/**
 * Wrapping kind APIs for date operating and unify
 * NOTE: every new API return new CandyDate object without side effects to the former Date object
 * NOTE: most APIs are based on local time other than customized locale id (this needs tobe support in future)
 * TODO: support format() against to angular's core API
 */
declare class CandyDate implements IndexableObject {
    nativeDate: Date;
    constructor(date?: Date | string | number);
    calendarStart(options?: {
        weekStartsOn: WeekDayIndex | undefined;
    }): CandyDate;
    getYear(): number;
    getMonth(): number;
    getDay(): number;
    getTime(): number;
    getDate(): number;
    getHours(): number;
    getMinutes(): number;
    getSeconds(): number;
    getMilliseconds(): number;
    clone(): CandyDate;
    setHms(hour: number, minute: number, second: number): CandyDate;
    setYear(year: number): CandyDate;
    addYears(amount: number): CandyDate;
    setMonth(month: number): CandyDate;
    addMonths(amount: number): CandyDate;
    setDay(day: number, options?: {
        weekStartsOn: WeekDayIndex;
    }): CandyDate;
    setDate(amount: number): CandyDate;
    getQuarter(): number;
    setQuarter(quarter: number): CandyDate;
    addDays(amount: number): CandyDate;
    add(amount: number, mode: NormalizedMode): CandyDate;
    isSame(date: CandyDateType, grain?: CandyDateMode): boolean;
    isSameYear(date: CandyDateType): boolean;
    isSameQuarter(date: CandyDateType): boolean;
    isSameMonth(date: CandyDateType): boolean;
    isSameDay(date: CandyDateType): boolean;
    isSameHour(date: CandyDateType): boolean;
    isSameMinute(date: CandyDateType): boolean;
    isSameSecond(date: CandyDateType): boolean;
    isBefore(date: CandyDateType, grain?: CandyDateMode): boolean;
    isBeforeYear(date: CandyDateType): boolean;
    isBeforeQuarter(date: CandyDateType): boolean;
    isBeforeMonth(date: CandyDateType): boolean;
    isBeforeDay(date: CandyDateType): boolean;
    isToday(): boolean;
    isValid(): boolean;
    isFirstDayOfMonth(): boolean;
    isLastDayOfMonth(): boolean;
    private toNativeDate;
}

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
declare const timeUnits: Array<[string, number]>;

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
interface TimeResult {
    hour: number | null;
    minute: number | null;
    second: number | null;
    period: number | null;
}
declare class NgTimeParser {
    private format;
    private localeId;
    regex: RegExp;
    matchMap: Record<string, null | number>;
    constructor(format: string, localeId: string);
    toDate(str: string): Date;
    getTimeResult(str: string): TimeResult | null;
    genRegexp(): void;
}

export { CandyDate, cloneDate, normalizeRangeValue, timeUnits, wrongSortOrder, NgTimeParser as ɵNgTimeParser };
export type { CandyDateMode, CandyDateType, CompatibleValue, NormalizedMode, SingleValue, WeekDayIndex, TimeResult as ɵTimeResult };
