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

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

/**
 * Miscellaneous data that is not related to pagination, sorting, or searching.
 * TODO: merge all DataView injections into one. https://leaflink.atlassian.net/browse/STASH-507
 */
export declare const DATA_VIEW_INJECTION: InjectionWithDefaults<DataViewInjection>;

export declare interface DataViewInjection {
    currentPage: ComputedRef<number>;
    /** Optional override for the next button disabled state  */
    isPaginateNextDisabled: ComputedRef<boolean>;
    isPaginationEnabled: ComputedRef<boolean>;
    pageCount: ComputedRef<number>;
    pageSize: ComputedRef<number>;
    totalDataCount: ComputedRef<number>;
    /** Updates the DataView internal state with the given page */
    setPage: SetPage;
    /** Updates the DataView internal state with the previous page */
    goPrevPage: GoPrevPage;
    /** Updates the DataView internal state with the next page */
    goNextPage: GoNextPage;
    currentSortId: ComputedRef<SortId | undefined>;
    currentSortOrder: ComputedRef<SortOrder | undefined>;
    /** Updates the DataView internal state with the given sortId */
    updateCurrentSort: UpdateCurrentSort;
    currentSearch: ComputedRef<string>;
    /** Updates the DataView internal state with the given searchTerm */
    updateCurrentSearch: UpdateCurrentSearch;
    /**
     * The DataView's padding; the default value is "comfortable". On small screens, the density will always be "compact".
     */
    density: ComputedRef<SpacingDensities | undefined>;
    /**
     * Defines if a DataView has a Toolbar rendered. This prop is updated when DataViewToolbar exists and is mounted.
     */
    hasToolbar?: Ref<boolean>;
    /**
     * Enables certain loading indicators to be displayed within the DataView.
     */
    isLoading?: ComputedRef<boolean>;
    /**
     * Enables certain empty states to be displayed within the DataView.
     */
    isEmpty?: ComputedRef<boolean>;
    /**
     * Allows Table to control whether or not a DataViewToolbar should show a checkmark
     */
    isSelectable?: Ref<boolean>;
    /**
     * Whether or not the DataView is rendered within a Module; the value is inferred based on being
     * able to inject details from Module.
     *
     * Note: This is sent to DataView child components so they only need to worry about interfacing
     * with the DataViewInjection API.
     */
    isWithinModule: ComputedRef<boolean>;
    /**
     * The DataView's variant; the default value is undefined.
     */
    variant: ComputedRef<DataViewVariants | undefined>;
}

export declare interface DataViewProps {
    /**
     * Can be used to provide the initial page.
     * Also, it can be used to control the active page with `v-model:current-page="myPage"`.
     */
    currentPage?: number;
    /**
     * Can be used to set the initial search term.
     * Also, it can be used to control the active search term with `v-model:current-search="mySearchTerm"`.
     */
    currentSearch?: string;
    /**
     * Can be used to provide the initial sort order.
     * Also, it can be used to control the active sort order with `v-model:current-sort="mySortOrder"`.
     */
    currentSort?: SortValue;
    /**
     * A list of records. If pagination is enabled, `data` must be only the current page of records.
     */
    data?: object[];
    /**
     * Controls the DataView's padding; the default value is "comfortable". On small screens, "compact" density is applied regardless of this prop's value.
     */
    density?: SpacingDensities;
    /**
     * The number of records to display per page.
     */
    pageSize?: number;
    /**
     * Opt-out of displaying pagination. Hides the pagination buttons and page stats.
     */
    disablePagination?: boolean;
    /**
     * Hides the bottom pagination without disabling the pagination from the toolbar
     */
    hideBottomPagination?: boolean;
    /**
     * The total number of records available.
     * Used to auto-enable pagination when results exist.
     * Use `Infinity` for activating 'n of many' pagination
     * DataView does not paginate data for you; instead, `props.data` should always show
     * the current page of results.
     */
    totalDataCount?: number;
    /**
     * Whether there is a next page of data or not as informed by the server.
     * This only applies when`totalDataCount="Infinity"` to determine if the "Next" pagination button should be disabled.
     */
    hasNextPage?: boolean;
    /**
     * DataView variant. The default value is `undefined`. Will default to `table` when used within
     * a `<Module variant="table">`.
     */
    variant?: DataViewVariants;
    isLoading?: boolean;
}

export declare enum DataViewVariant {
    Table = "table"
}

export declare type DataViewVariants = `${DataViewVariant}`;

declare const _default: __VLS_WithTemplateSlots<DefineComponent<DataViewProps, {
page: ComputedRef<number>;
pageSize: ComputedRef<number>;
setPage: SetPage;
goPrevPage: GoPrevPage;
goNextPage: GoNextPage;
ordering: ComputedRef<string | undefined>;
updateCurrentSort: UpdateCurrentSort;
search: ComputedRef<string>;
updateCurrentSearch: UpdateCurrentSearch;
filters: ComputedRef<object>;
updateCurrentFilters: UpdateCurrentFilters;
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
update: (state: UpdateEvent<object>) => any;
"update:currentFilters": (newFilters: object) => any;
"update:currentSearch": (searchTerm?: string | undefined) => any;
"update:currentSort": (payload?: string | undefined) => any;
"update:currentPage": (page: number, pageSize: number) => any;
}, string, PublicProps, Readonly<DataViewProps> & Readonly<{
onUpdate?: ((state: UpdateEvent<object>) => any) | undefined;
"onUpdate:currentFilters"?: ((newFilters: object) => any) | undefined;
"onUpdate:currentSearch"?: ((searchTerm?: string | undefined) => any) | undefined;
"onUpdate:currentSort"?: ((payload?: string | undefined) => any) | undefined;
"onUpdate:currentPage"?: ((page: number, pageSize: number) => any) | undefined;
}>, {
data: object[];
currentPage: number;
pageSize: number;
totalDataCount: number;
currentSearch: string;
density: SpacingDensities;
variant: DataViewVariants;
currentSort: SortValue;
disablePagination: boolean;
hideBottomPagination: boolean;
hasNextPage: boolean;
}, {}, {}, {}, string, ComponentProvideOptions, false, {
rootRef: HTMLDivElement;
}, HTMLDivElement>, {
    default?(_: {
        currentPage: number;
        currentSortId: string | undefined;
        currentSortOrder: SortOrder | undefined;
        data: object[];
        goPrevPage: GoPrevPage;
        goNextPage: GoNextPage;
        pageCount: number;
        setPage: SetPage;
        totalDataCount: number;
        updateCurrentSort: UpdateCurrentSort;
        updateCurrentSearch: UpdateCurrentSearch;
    }): any;
}>;
export default _default;

export declare const DEFAULT_PAGE_SIZE = 12;

/**
 * Receives a SortValue (ex: `'-product_name'`) and returns an object with a `id` and an `order`.
 */
export declare function deserializeSortValue(sort: SortValue): SortValueDeserialized;

/**
 * Given new and old sorting data, it returns the next sorting value using the following sorting cycle:
 *
 *     "unsorted --> ascending --> descending --> unsorted"
 */
export declare function getNextSort({ newId, newOrder, oldId, oldOrder }: GetNextSortArgs): SortValue | undefined;

declare interface GetNextSortArgs {
    newId: SortId | undefined;
    newOrder?: SortOrder;
    oldId?: SortId;
    oldOrder?: SortOrder;
}

/** Updates the DataView internal state with the next page */
export declare type GoNextPage = (options?: {
    /** If true, emits the `update:currentPage` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

/** Updates the DataView internal state with the previous page */
export declare type GoPrevPage = (options?: {
    /** If true, emits the `update:currentPage` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

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

declare interface InjectionWithDefaults<T> extends Injection<T> {
    defaults: T;
}

/**
 * Receives an object with a `id` and an `order` and returns a SortValue (ex: `'-product_name'`).
 */
export declare function serializeSortValue({ id, order }: SortValueDeserialized): SortValue;

/** Updates the DataView internal state with the given page */
export declare type SetPage = (page: number, options?: {
    /** If true, emits the `update:currentPage` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

/**
 * The SortValue with its leading hyphen/dash removed
 */
export declare type SortId = string;

/**
 * Determined by whether or not there is a leading hyphen/dash in the SortValue
 */
export declare type SortOrder = 'asc' | 'desc';

/**
 * A unique id for a sorting strategy. If the order is descending, it must begin with "-" (a hyphen/dash).
 *
 * Ex: `'product_name'` if ascending or `'-product_name'` if descending
 */
export declare type SortValue = string;

/**
 * A deserialized instance of a `SortValue`.
 */
export declare type SortValueDeserialized = {
    id: SortId;
    order: SortOrder;
};

declare type SpacingDensities = `${SpacingDensity}`;

/**
 * For controlling properties like "padding" and "margin" within and between components.
 */
declare enum SpacingDensity {
    Compact = "compact",
    Comfortable = "comfortable"
}

/** Updates the DataView internal state with the given filter values */
export declare type UpdateCurrentFilters<FilterValues = object> = (newFilters: FilterValues, options?: {
    /** If true, emits the `update:currentSearch` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

/** Updates the DataView internal state with the given searchTerm */
export declare type UpdateCurrentSearch = (searchTerm?: string, options?: {
    /** If true, emits the `update:currentSearch` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

/** Updates the DataView internal state with the given sortId */
export declare type UpdateCurrentSort = (sortId: SortId | undefined, options?: {
    sortOrder?: SortOrder;
    /** If true, emits the `update:currentSort` and `update` events from DataView */
    shouldEmit?: boolean;
}) => void;

export declare interface UpdateEvent<FilterValues = object> {
    page?: number;
    pageSize?: number;
    ordering?: string;
    search?: string;
    filters?: FilterValues;
}

export { }
