/**
 * 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 { SchemaKey } from '@formily/json-schema';
import type { DataSource } from '../data-source';
import type { CollectionFieldOptions, CollectionOptions, GetCollectionFieldPredicate } from './Collection';
import { Collection } from './Collection';
export declare class CollectionManager {
    dataSource: DataSource;
    collectionInstancesMap: Record<string, Collection>;
    collectionInstancesArr: Collection[];
    constructor(collections: CollectionOptions[], dataSource: DataSource);
    get dataSourceManager(): import("../data-source").DataSourceManager;
    get app(): import("../..").Application;
    protected getCollectionInstance(collection: CollectionOptions): any;
    private getInstancesMap;
    addCollections(collections?: CollectionOptions[]): void;
    setCollections(collections: CollectionOptions[]): void;
    reAddCollections(collectionInstances?: Collection[]): void;
    /**
     * Get a collection
     * @example
     * getCollection('users'); // Get the 'users' collection
     * getCollection('users.profile'); // Get the associated collection of the 'profile' field in the 'users' collection
     * getCollection('a.b.c'); // Get the associated collection of the 'c' field in the 'a' collection, which is associated with the 'b'  field in the 'a' collection
     */
    getCollection<Mixins = {}>(path: SchemaKey | CollectionOptions): (Mixins & Collection) | undefined;
    getCollections(predicate?: (collection: Collection) => boolean): Collection[];
    getCollectionName(path: SchemaKey | CollectionOptions): string | undefined;
    /**
     * Get collection field
     * @example
     * getField('users.username'); // Get the 'username' field of the 'users' collection
     * getField('a.b.c'); // Get the associated collection of the 'c' field in the 'a' collection, which is associated with the 'b' field in the 'a' collection
     */
    getCollectionField(path: SchemaKey | CollectionFieldOptions): any;
    getCollectionFields(collectionName: string, predicate?: GetCollectionFieldPredicate): CollectionFieldOptions[];
    getCollectionAllFields(collectionName: string, predicate?: GetCollectionFieldPredicate): CollectionFieldOptions[];
    /**
     * @example
     * getFilterByTK('users', { id: 1 }); // 1
     * getFilterByTK('users.profile', { name: 'name' }); // name
     *
     * @param collectionOrAssociation - collection name or association name
     * @param collectionRecordOrAssociationRecord - collection record or association record
     * @returns the value of the filterByTK
     */
    getFilterByTK(collectionOrAssociation: string | Collection, collectionRecordOrAssociationRecord: Record<string, any>): any;
    getSourceKeyByAssociation(associationName: string): any;
    /**
     * @internal
     */
    clone(collections?: CollectionOptions[]): CollectionManager;
}
