import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { ComputedRef } from 'vue';
import { DefineComponent } from 'vue';
import { ExtractPropTypes } from 'vue';
import { InjectionKey } from 'vue';
import { PropType } from 'vue';
import { PublicProps } from 'vue';
import { Ref } from 'vue';

declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;

declare type __VLS_Prettify<T> = {
    [K in keyof T]: T[K];
} & {};

declare type __VLS_TypePropsToRuntimeProps<T> = {
    [K in keyof T]-?: {} extends Pick<T, K> ? {
        type: PropType<__VLS_NonUndefinedable<T[K]>>;
    } : {
        type: PropType<T[K]>;
        required: true;
    };
};

declare type __VLS_WithDefaults<P, D> = {
    [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
        default: D[K];
    }> : P[K];
};

declare type __VLS_WithTemplateSlots<T, S> = T & {
    new (): {
        $slots: S;
    };
};

export declare const DATA_VIEW_FILTERS_UTILS_INJECTION: Injection<DataViewFiltersUtilsInjection>;

export declare interface DataViewFiltersProps {
    filtersLabelText?: string;
    /**
     * Props to pass to the `SearchBar` component.
     */
    searchBarProps?: SearchBarProps;
    showSearch?: boolean;
    /** 'cascade' displays all fields within every filter group; 'nested' displays only the group names and requires clicking a group to view its fields. */
    drawerStyle?: DrawerStyles;
    drawerProps?: ModalProps;
    /**
     * @deprecated The `activeGroup` prop is a sufficient replacement for this prop. A falsy `activeGroup` will hide the button and a truthy `activeGroup` will show it (when the `drawerStyle` is 'nested').
     *
     * **Note:** This prop has no effect when using a "cascade" `drawerStyle`.
     */
    showDrawerPreviousButton?: boolean;
    /**
     * Required when using filters. This prop should contain the return value of the `useFilters()` composable.
     */
    useFiltersInstance?: UseFiltersReturnType;
    onApply?: OnApplyFilters;
    /**
     * The name of the active filter group. The active filter group is determined by which instance of FilterDropdown or FilterDrawerItem is open.
     *
     * **Note:** This prop is required when using a "nested" `drawerStyle`, but has no effect when using a "cascade" `drawerStyle`.
     */
    activeGroup?: string;
}

export declare interface DataViewFiltersSlots {
    default?: () => unknown;
    drawer?: () => unknown;
    'filters-label'?: () => unknown;
}

export declare interface DataViewFiltersUtilsInjection {
    useFiltersInstance?: UseFiltersReturnType;
    drawerStyle?: DrawerStyles;
}

declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DataViewFiltersProps>, {
filtersLabelText: any;
isLoading: boolean;
drawerStyle: string;
drawerProps: undefined;
searchBarProps: undefined;
showDrawerPreviousButton: boolean;
showSearch: boolean;
useFiltersInstance: undefined;
onApply: undefined;
activeGroup: undefined;
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"open-drawer": () => void;
dismiss: () => void;
previous: () => void;
"reset-group": () => void;
"reset-all": () => void;
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DataViewFiltersProps>, {
filtersLabelText: any;
isLoading: boolean;
drawerStyle: string;
drawerProps: undefined;
searchBarProps: undefined;
showDrawerPreviousButton: boolean;
showSearch: boolean;
useFiltersInstance: undefined;
onApply: undefined;
activeGroup: undefined;
}>>> & Readonly<{
onDismiss?: (() => any) | undefined;
onPrevious?: (() => any) | undefined;
"onOpen-drawer"?: (() => any) | undefined;
"onReset-group"?: (() => any) | undefined;
"onReset-all"?: (() => any) | undefined;
}>, {
filtersLabelText: string;
searchBarProps: SearchBarProps;
showSearch: boolean;
drawerStyle: "cascade" | "nested";
drawerProps: ModalProps;
showDrawerPreviousButton: boolean;
useFiltersInstance: UseFiltersReturnType<object, string>;
onApply: OnApplyFilters;
activeGroup: string;
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, Readonly<DataViewFiltersSlots> & DataViewFiltersSlots>;
export default _default;

export declare enum DrawerStyle {
    /** Displays all groups and their fields without the need for navigating submenus. */
    Cascade = "cascade",
    /** Displays only group names or fields; navigation between the group names and a submenu of fields is required. */
    Nested = "nested"
}

export declare type DrawerStyles = `${DrawerStyle}`;

declare interface Injection<T> {
    key: InjectionKey<T>;
}

declare enum ModalPosition {
    Center = "center",
    Left = "left",
    Right = "right"
}

declare type ModalPositions = `${ModalPosition}`;

declare interface ModalProps {
    /**
     * Hides the "close" button
     */
    hideClose?: boolean;
    /**
     * Opens the modal when truthy; hides the modal when falsy.
     * @deprecated Use `isOpen` instead
     */
    open?: boolean;
    /**
     * Opens the modal when truthy; hides the modal when falsy.
     */
    isOpen?: boolean;
    /**
     * Use v-model:is-open or :is-open instead of :model-value and v-model.
     * @deprecated
     */
    modelValue?: boolean;
    /**
     * Sets a preset max-width on the modal.
     * Options: default (648px), narrow (360px), wide (960px)
     */
    size?: ModalSizes;
    /**
     * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to "left" or "right".
     */
    scrollable?: boolean;
    /**
     * Gives the modal body have a light gray background
     */
    contrast?: boolean;
    /**
     * Text to display in the modal header
     */
    title?: string;
    /**
     * Disables the default padding in the modal body.
     */
    disableBodyPadding?: boolean;
    /**
     * The position on the screen to display the modal.
     */
    position?: ModalPositions;
    /**
     * Hide the header. Typically used with the featuredContent slot to display a graphic and create a "promo" modal.
     */
    hideHeader?: boolean;
    /**
     * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to
     * accommodate images with different color backgrounds.
     */
    closeButtonColorClass?: string;
    /**
     * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.
     * Example: There are in-flight api requests and you do not want the modal to close until they are done.
     */
    preventDismiss?: boolean;
}

declare enum ModalSize {
    Narrow = "narrow",
    Medium = "medium",
    Wide = "wide"
}

declare type ModalSizes = `${ModalSize}`;

/**
 * A function that is called when the user clicks one of the "Apply" buttons in DataViewFilters.
 *
 * A return value of `{ preventDismiss: true }` can be used to prevent the DataViewFilters drawer or a FilterDropdown from closing, such as when some filters have invalid values.
 */
export declare type OnApplyFilters = () => Promise<{
    preventDismiss?: boolean;
} | void> | {
    preventDismiss?: boolean;
} | void;

declare interface SearchBarProps {
    /**
     * Indicates loading activity (for example async request) that should prevent search
     */
    isLoading?: boolean;
    /**
     * Sets a visual indicator that the search is active
     */
    isWorking?: boolean;
    /**
     * The search term
     */
    modelValue?: string;
    /**
     * Placeholder text for the input
     */
    placeholder?: string;
    /**
     * Label for search bar
     */
    label?: string;
    /**
     * Text below the input
     */
    hintText?: string;
}

/**
 * Provides utility functions for working with `DataViewFilters`.
 */
export declare function useFilters<Values extends object, Groups extends string>({ schema, dataViewRef, }: UseFiltersArgs<Values, Groups>): UseFiltersReturnType<Values, Groups>;

export declare interface UseFiltersArgs<Values extends object, Groups extends string> {
    schema: UseFiltersSchema<Values, Groups>;
    /** A ref for an instance of DataView */
    dataViewRef: Ref<unknown>;
}

export declare interface UseFiltersReturnType<Values = object, Groups extends string = string> {
    applyFilters: () => void;
    resetAllFilters: () => void;
    resetFilterGroup: (group: string) => void;
    undoWorkingFilters: () => void;
    activeFiltersCounts: ComputedRef<Record<Groups, number>>;
    totalActiveFiltersCount: ComputedRef<number>;
    appliedFilters: Ref<Values>;
    workingFilters: Ref<Values>;
}

/**
 * Contains metadata and configuration for the filters.
 * @see https://www.typescriptlang.org/docs/handbook/2/mapped-types.html
 */
export declare type UseFiltersSchema<Values extends object, Groups extends string> = {
    [Property in keyof Values]: {
        defaultValue?: Values[Property];
        group?: Groups;
        isActive?: (value: Values[Property]) => boolean;
    };
};

export { }
