import * as React from "react";
import { TCatalogEntryItems, CatalogViewContentFilter } from "./Types";
import { CatalogComponentOptions } from "./Component";
import { CatalogFetcher } from "./Fetcher";
export declare type CatalogViewContentFilterCallback = (items: TCatalogEntryItems) => TCatalogEntryItems;
export interface CatalogViewContentFetchParams<VD> extends CatalogComponentOptions {
    filterContent?: CatalogViewContentFilter | CatalogViewContentFilterCallback;
    flat?: boolean;
    data?: VD;
}
export declare type CatalogViewContentFetchCallback<C, VD> = (options: CatalogViewContentFetchParams<VD>, fetcher: CatalogFetcher) => C | Promise<C>;
export interface CatalogViewState<C = TCatalogEntryItems[]> {
    loading: boolean;
    /**
     * The latest fetched data. This will only change, when a path has been completly loaded
     *
     * @type {(C | undefined)}
     */
    data: C | undefined;
    error: Error | undefined;
    /**
     * The path associated with the currently fetched data
     *
     * @type {string[]}
     */
    path: string[];
    addableTargetId?: string;
}
export interface CatalogViewRenderProps<C = TCatalogEntryItems[]> extends CatalogViewState<C> {
    path: string[];
}
export interface CatalogViewParams<C, VD> extends Partial<CatalogComponentOptions> {
    flat?: boolean;
    filterContent?: CatalogViewContentFilter;
    /**
     * Can be used to customize the fetching behaviour of this component
     *
     * @type {CatalogViewContentFetchCallback<C, VD>}
     */
    fetchContent?: CatalogViewContentFetchCallback<C, VD>;
    /**
     * Can be used to provide additional data to the fetchContent method. The content of the catalog view will be refetched,
     * if this property changes shallowly.
     *
     * @type {VD}
     */
    data?: VD;
    /**
     * Callback that will be executed once the content of a path has been loaded completly.
     *
     * @param {C} result
     * @param {(VD | undefined)} viewParams
     */
    onPathContentFetched?(result: C, viewParams: VD | undefined): void;
}
export declare const useCatalogView: <C = import("./Types").TCatalogEntryItem[], VD = unknown>(props: CatalogViewParams<C, VD>) => CatalogViewState<C>;
export interface CatalogViewProps<C, VD> extends CatalogViewParams<C, VD> {
    children(props: CatalogViewRenderProps<C>): React.ReactElement<any> | null;
}
declare const CatalogView: {
    <C = import("./Types").TCatalogEntryItem[], VD = unknown>(props: CatalogViewProps<C, VD>): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
    displayName: string;
};
export default CatalogView;
