import { Request } from 'express';
import { components } from '../../../types/api';
import { DateRangeFilterValue, DateRange, FilterValue } from '../../_filters/types';
import RelativeDateRange, { RelativeOption } from './types';
import { defaultFilterValue } from '../../../utils/Personalisation/types';
type DateString = string | null | undefined;
export declare const dateIsInBounds: (startDate: DateString, endDate: DateString, min: string, max: string) => boolean;
export declare const setValueFromRequest: (filter: DateRangeFilterValue, req: Request, prefix: string) => DateRangeFilterValue["value"];
export declare const setDefaultValue: (req: Request, name: string) => {
    value: DateRange;
    name: string;
};
export declare const setFilterValueFromDefault: (defaultValue: defaultFilterValue, filter: FilterValue) => {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    min?: string;
    max?: string;
    relativeOptions?: {
        value: string;
        text: string;
        disabled?: boolean;
    }[];
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
} | {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    minimumLength?: number | undefined;
    pattern?: string | undefined;
    text: string;
    name: string;
    type: import("../../_filters/filter-input/enum").FilterType;
    mandatory?: boolean | undefined;
    index?: number | undefined;
} | {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    options: Array<import("../../_filters/types").FilterOption>;
    staticOptionNameValue?: string;
    dynamicResourceEndpoint?: string;
    text: string;
    name: string;
    type: import("../../_filters/filter-input/enum").FilterType;
    mandatory?: boolean | undefined;
    index?: number | undefined;
} | {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    values: string[];
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
    options: Array<import("../../_filters/types").FilterOption>;
    staticOptionNameValue?: string;
    dynamicResourceEndpoint?: string;
} | {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    min?: string;
    max?: string;
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
} | {
    value: {
        start: string;
        end: string;
        relative: string;
    };
    min?: string;
    max?: string;
    relativeOptions?: {
        value: string;
        text: string;
        disabled?: boolean;
    }[];
    quickFilterOptions?: {
        value: string;
        text: string;
        disabled?: boolean;
    }[];
    granularityOptions?: {
        value: string;
        text: string;
    }[];
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
};
export declare const getRelativeDateOptions: (min?: string, max?: string) => RelativeOption[];
export declare const mapRelativeValue: (value: RelativeDateRange) => string;
export declare const getRelativeValues: () => RelativeOption[];
export declare const getFilterFromDefinition: (filter: components["schemas"]["FilterDefinition"], filterData: FilterValue) => {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
} | {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    minimumLength?: number | undefined;
    pattern?: string | undefined;
    text: string;
    name: string;
    type: import("../../_filters/filter-input/enum").FilterType;
    mandatory?: boolean | undefined;
    index?: number | undefined;
} | {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    options: Array<import("../../_filters/types").FilterOption>;
    staticOptionNameValue?: string;
    dynamicResourceEndpoint?: string;
    text: string;
    name: string;
    type: import("../../_filters/filter-input/enum").FilterType;
    mandatory?: boolean | undefined;
    index?: number | undefined;
} | {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    values: string[];
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
    options: Array<import("../../_filters/types").FilterOption>;
    staticOptionNameValue?: string;
    dynamicResourceEndpoint?: string;
} | {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
} | {
    min: string | null | undefined;
    max: string | null | undefined;
    relativeOptions: RelativeOption[];
    value: DateRange;
    quickFilterOptions?: {
        value: string;
        text: string;
        disabled?: boolean;
    }[];
    granularityOptions?: {
        value: string;
        text: string;
    }[];
    type: import("../../_filters/filter-input/enum").FilterType;
    name: string;
    text: string;
    mandatory?: boolean | undefined | undefined;
    index?: number | undefined | undefined;
};
/**
 * Creates and appends the daterange query string
 * to an existing URLSearchParams
 *
 * @param {URLSearchParams} params
 * @param {string} fieldName
 * @param {string} defaultValue
 */
export declare const appendDateRangeValue: (params: URLSearchParams, fieldName: string, value: {
    start?: string;
    end?: string;
    relative?: string;
}) => void;
export type DateRangeDefaults = {
    start?: string;
    end?: string;
    relative?: string;
};
export declare const resolveDateRangeDefaults: (filter: components["schemas"]["FilterDefinition"]) => DateRangeDefaults | undefined;
declare const _default: {
    getRelativeDateOptions: (min?: string, max?: string) => RelativeOption[];
    getFilterFromDefinition: (filter: components["schemas"]["FilterDefinition"], filterData: FilterValue) => {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    } | {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        minimumLength?: number | undefined;
        pattern?: string | undefined;
        text: string;
        name: string;
        type: import("../../_filters/filter-input/enum").FilterType;
        mandatory?: boolean | undefined;
        index?: number | undefined;
    } | {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        options: Array<import("../../_filters/types").FilterOption>;
        staticOptionNameValue?: string;
        dynamicResourceEndpoint?: string;
        text: string;
        name: string;
        type: import("../../_filters/filter-input/enum").FilterType;
        mandatory?: boolean | undefined;
        index?: number | undefined;
    } | {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        values: string[];
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
        options: Array<import("../../_filters/types").FilterOption>;
        staticOptionNameValue?: string;
        dynamicResourceEndpoint?: string;
    } | {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    } | {
        min: string | null | undefined;
        max: string | null | undefined;
        relativeOptions: RelativeOption[];
        value: DateRange;
        quickFilterOptions?: {
            value: string;
            text: string;
            disabled?: boolean;
        }[];
        granularityOptions?: {
            value: string;
            text: string;
        }[];
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    };
    setValueFromRequest: (filter: DateRangeFilterValue, req: Request, prefix: string) => DateRangeFilterValue["value"];
    mapRelativeValue: (value: RelativeDateRange) => string;
    setDefaultValue: (req: Request, name: string) => {
        value: DateRange;
        name: string;
    };
    setFilterValueFromDefault: (defaultValue: defaultFilterValue, filter: FilterValue) => {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        min?: string;
        max?: string;
        relativeOptions?: {
            value: string;
            text: string;
            disabled?: boolean;
        }[];
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    } | {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        minimumLength?: number | undefined;
        pattern?: string | undefined;
        text: string;
        name: string;
        type: import("../../_filters/filter-input/enum").FilterType;
        mandatory?: boolean | undefined;
        index?: number | undefined;
    } | {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        options: Array<import("../../_filters/types").FilterOption>;
        staticOptionNameValue?: string;
        dynamicResourceEndpoint?: string;
        text: string;
        name: string;
        type: import("../../_filters/filter-input/enum").FilterType;
        mandatory?: boolean | undefined;
        index?: number | undefined;
    } | {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        values: string[];
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
        options: Array<import("../../_filters/types").FilterOption>;
        staticOptionNameValue?: string;
        dynamicResourceEndpoint?: string;
    } | {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        min?: string;
        max?: string;
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    } | {
        value: {
            start: string;
            end: string;
            relative: string;
        };
        min?: string;
        max?: string;
        relativeOptions?: {
            value: string;
            text: string;
            disabled?: boolean;
        }[];
        quickFilterOptions?: {
            value: string;
            text: string;
            disabled?: boolean;
        }[];
        granularityOptions?: {
            value: string;
            text: string;
        }[];
        type: import("../../_filters/filter-input/enum").FilterType;
        name: string;
        text: string;
        mandatory?: boolean | undefined | undefined;
        index?: number | undefined | undefined;
    };
    appendDateRangeValue: (params: URLSearchParams, fieldName: string, value: {
        start?: string;
        end?: string;
        relative?: string;
    }) => void;
};
export default _default;
