/// <reference types="react" />
import { Result } from 'ahooks/es/useRequest/src/types';
import { ActionsItem } from '../../dataSourceForm/serve';
export interface Field {
    name: string;
    type: string;
    allowNull: boolean;
    primaryKey: boolean;
    unique: boolean;
    autoIncrement: boolean;
    description?: (null | string)[];
    possibleTypes?: string[];
    rawType: string;
    interface: string;
    uiSchema: UiSchema;
    key?: string;
    collectionName?: string;
    collectionKey?: any;
    dataSourceKey?: string;
    defaultValue?: any;
}
interface UiSchema {
    type?: string;
    'x-component': string;
    'x-component-props'?: Xcomponentprops;
    'x-validator'?: string;
    title: string;
    default?: any;
    enum?: any[];
}
interface Xcomponentprops {
    style?: Style;
    autoSize?: AutoSize;
    stringMode?: boolean;
    step?: string;
    dateFormat?: string;
    showTime?: boolean;
}
interface AutoSize {
    minRows: number;
}
interface Style {
    width: string;
}
export declare type ActionTypes = 'list' | 'get' | 'update' | 'create' | 'destroy';
export declare type DataSourceType = {
    fromSettingMeta: boolean;
    actions: {
        get: ActionsItem;
        update: ActionsItem;
        create: ActionsItem;
        delete: ActionsItem;
        list: ActionsItem;
    };
    headerDataSource: string;
    dataSourceKey: string;
    filterTargetKey: string;
    introspected: boolean;
    isCustomApi: boolean;
    key: string;
    tableName: string;
    logging: boolean;
    name: string;
    title: string;
    titleField: string;
    types: ActionTypes[];
    fields: Field[];
    options: {
        apiType: string;
        baseUrl: string;
    };
};
export declare type DataSourceContextProps = {
    dataSource: DataSourceType;
    children?: React.ReactNode;
    currentValue?: string;
    actions?: {
        list?: () => Promise<any>;
        get?: () => Promise<any>;
        update?: () => Promise<any>;
        create?: () => Promise<any>;
        destroy?: () => Promise<any>;
    };
    requestOptions?: {
        list?: any;
        get?: any;
        update?: any;
        create?: any;
        destroy?: any;
    };
    overrideData?: {
        list?: any;
        get?: any;
    };
    autoRun?: {
        list?: boolean;
        get?: boolean;
    };
    extraParams?: {
        list?: Record<string, any>;
        get?: Record<string, any>;
        update?: Record<string, any>;
        create?: Record<string, any>;
        destroy?: Record<string, any>;
    };
    __id?: string;
    __designMode?: string;
};
export interface DataSourceContextType {
    dataSource?: DataSourceType;
    list: Result<any, any>;
    destroy: Result<any, any>;
    get: Result<any, any>;
    update: Result<any, any>;
    create: Result<any, any>;
    __designMode?: string;
    getCurrentRecord: () => any;
}
export declare const DataSourceContext: import("react").Context<DataSourceContextType>;
export default DataSourceContext;
