/**
 * 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, Collection } from '../collection';
import type { Application } from '../../application/Application';
import { type DataSourceOptions, DataSource, DataSourceFactory } from './DataSource';
import { type CollectionTemplateFactory, CollectionTemplateManager } from '../collection-template';
import { type CollectionFieldInterfaceFactory, CollectionFieldInterfaceManager } from '../collection-field-interface';
export declare const DEFAULT_DATA_SOURCE_KEY = "main";
export declare const DEFAULT_DATA_SOURCE_TITLE = "{{t(\"Main\")}}";
export interface DataSourceManagerOptions {
    collectionTemplates?: CollectionTemplateFactory[];
    fieldInterfaces?: CollectionFieldInterfaceFactory[];
    fieldInterfaceGroups?: Record<string, {
        label: string;
        order?: number;
    }>;
    collectionMixins?: (typeof Collection)[];
    dataSources?: DataSourceOptions[];
    collections?: CollectionOptions[];
}
export declare class DataSourceManager {
    protected options: DataSourceManagerOptions;
    app: Application;
    protected dataSourceInstancesMap: Record<string, DataSource>;
    protected multiDataSources: [() => Promise<DataSourceOptions[]>, DataSourceFactory][];
    collectionMixins: (typeof Collection)[];
    collectionTemplateManager: CollectionTemplateManager;
    collectionFieldInterfaceManager: CollectionFieldInterfaceManager;
    constructor(options: DataSourceManagerOptions, app: Application);
    addCollectionMixins(mixins?: (typeof Collection)[]): void;
    getDataSources(filterDataSource?: (dataSource: DataSource) => boolean): DataSource[];
    setDataSources(dataSources: DataSourceOptions[]): void;
    getDataSource(key?: string): DataSource;
    removeDataSources(keys: string[]): void;
    addDataSource(DataSource: DataSourceFactory, options: DataSourceOptions): DataSource;
    addDataSources(request: () => Promise<DataSourceOptions[]>, DataSource: DataSourceFactory): Promise<void>;
    getAllCollections(options?: {
        filterCollection?: (collection: Collection) => boolean;
        filterDataSource?: (dataSource: DataSource) => boolean;
    }): (DataSourceOptions & {
        collections: Collection[];
    })[];
    addFieldInterfaceGroups(options: Record<string, {
        label: string;
        order?: number;
    }>): void;
    addCollectionTemplates(templateClasses?: CollectionTemplateFactory[]): void;
    addFieldInterfaces(fieldInterfaceClasses?: CollectionFieldInterfaceFactory[]): void;
    reload(): Promise<DataSourceOptions[]>;
}
