import React, { ReactNode } from 'react';
import { UseRequestOptions, UseRequestService } from '../../api-client';
import { Designable } from '../../schema-component';
import { CollectionOptions } from '../collection';
import { CollectionRecord } from '../collection-record';
export interface AllDataBlockProps {
    collection: string | CollectionOptions;
    association: string;
    dataSource?: string;
    sourceId?: string | number;
    filterByTk: string | number;
    record: CollectionRecord;
    action?: 'list' | 'get';
    params?: {
        filterByTk?: string | number;
        [index: string]: any;
    };
    parentRecord?: CollectionRecord;
    requestService?: UseRequestService<any>;
    requestOptions?: UseRequestOptions;
    dataLoadingMode?: 'auto' | 'manual';
    [index: string]: any;
}
type CollectionCreateProps = Pick<AllDataBlockProps, 'collection' | 'dataSource'>;
interface CollectionGetProps extends Pick<AllDataBlockProps, 'collection' | 'dataSource' | 'filterByTk' | 'params' | 'requestService' | 'requestOptions'> {
    action: 'get';
}
interface CollectionListProps extends Pick<AllDataBlockProps, 'collection' | 'dataSource' | 'params' | 'requestService' | 'requestOptions'> {
    action: 'list';
}
type CollectionRecordProps = Pick<AllDataBlockProps, 'collection' | 'dataSource' | 'record' | 'requestService' | 'requestOptions'>;
type AssociationCreateProps = Pick<AllDataBlockProps, 'association' | 'dataSource' | 'sourceId' | 'parentRecord'>;
interface AssociationGetProps extends Pick<AllDataBlockProps, 'association' | 'dataSource' | 'sourceId' | 'parentRecord' | 'filterByTk' | 'params' | 'requestService' | 'requestOptions'> {
    action: 'get';
}
interface AssociationListProps extends Pick<AllDataBlockProps, 'association' | 'dataSource' | 'sourceId' | 'parentRecord' | 'params' | 'requestService' | 'requestOptions'> {
    action: 'list';
}
type AssociationRecordProps = Pick<AllDataBlockProps, 'association' | 'dataSource' | 'record' | 'parentRecord' | 'requestService' | 'requestOptions'>;
type AllDataBlockType = {
    CollectionCreate: CollectionCreateProps;
    CollectionGet: CollectionGetProps;
    CollectionList: CollectionListProps;
    CollectionRecord: CollectionRecordProps;
    AssociationCreate: AssociationCreateProps;
    AssociationGet: AssociationGetProps;
    AssociationList: AssociationListProps;
    AssociationRecord: AssociationRecordProps;
};
export type DataBlockProviderProps = AllDataBlockType[keyof AllDataBlockType];
export type UseDataBlockProps<T extends keyof AllDataBlockType> = (props: DataBlockProviderProps & {
    [index: string]: any;
}) => Omit<AllDataBlockType[T], 'association' | 'collection' | 'dataSource' | 'action'> & {
    [index: string]: any;
};
export interface DataBlockContextValue<T extends {} = {}> {
    props: AllDataBlockProps & T;
    dn: Designable;
}
export declare const DataBlockContext: React.Context<DataBlockContextValue<any>>;
/**
 * @internal
 */
export declare const AssociationOrCollectionProvider: (props: {
    collection: string | CollectionOptions;
    association: string;
    children: ReactNode;
    allowNull?: boolean;
}) => import("react/jsx-runtime").JSX.Element;
export declare const DataBlockProvider: React.FunctionComponent<any>;
export declare const useDataBlock: <T extends {}>() => DataBlockContextValue<T>;
export declare const useDataBlockProps: <T extends {}>() => DataBlockContextValue<T>["props"];
export {};
