/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import type { CollectionOptions } from '../collection';
import type { DataSourceManager } from './DataSourceManager';
import { CollectionManager } from '../collection';
type LoadCallback = (collections: CollectionOptions[]) => void;
export interface DataSourceOptions {
    key: string;
    displayName: string;
    collections?: CollectionOptions[];
    errorMessage?: string;
    status?: 'loaded' | 'loading-failed' | 'loading' | 'reloading';
    isDBInstance?: boolean;
}
export type DataSourceFactory = new (options: DataSourceOptions, dataSourceManager: DataSourceManager) => DataSource;
export declare abstract class DataSource {
    protected options: DataSourceOptions;
    dataSourceManager: DataSourceManager;
    collectionManager: CollectionManager;
    protected reloadCallbacks: LoadCallback[];
    constructor(options: DataSourceOptions, dataSourceManager: DataSourceManager);
    get app(): import("../..").Application;
    get key(): string;
    get displayName(): string;
    get status(): "loading" | "loaded" | "loading-failed" | "reloading";
    get errorMessage(): string;
    get collections(): import("../collection").Collection[];
    getOptions(): DataSourceOptions;
    setOptions(options: Partial<DataSourceOptions>): void;
    getOption<Key extends keyof DataSourceOptions>(key: Key): DataSourceOptions[Key];
    addReloadCallback(callback: LoadCallback): void;
    removeReloadCallback(callback: LoadCallback): void;
    abstract getDataSource(): Promise<Omit<Partial<DataSourceOptions>, 'key'>> | Omit<Partial<DataSourceOptions>, 'key'>;
    get flowEngineDataSourceManager(): import("@nocobase/flow-engine").DataSourceManager;
    reload(): Promise<DataSourceOptions>;
}
/**
 * @internal
 */
export declare class LocalDataSource extends DataSource {
    getDataSource(): {
        collections: import("../collection").Collection[];
    };
}
export {};
