import { DataSource } from 'typeorm';
import { Resource } from '../entity';
import { MagicResourceService } from './core';
import { MagicDefinition } from './magic.provide';
export declare class MagicDataSource implements MagicDefinition {
    type: string;
    private dataSourceManager;
    magicResourceService: MagicResourceService;
    private logger;
    private idInMappingPath;
    init(reInit?: boolean): Promise<void>;
    /**
     * 添加数据源
     * @param resource
     * @param isThrow 是否抛出异常
     */
    add(resource: Resource, isThrow?: boolean): Promise<void>;
    /**
     * 删除数据源
     * @param id 资源id
     */
    removeById(id: string): Promise<void>;
    /**
     * 数据源是否连接
     * @param dataSourceName
     */
    checkConnected(dataSourceName: string): Promise<boolean>;
    /**
     * 获取默认数据源
     */
    getDefaultDataSource(): DataSource;
    /**
     * 获取所有数据源key
     */
    getDataSourceNames(): string[];
    /**
     * 获取数据源
     * @param dataSourceName
     */
    getDataSource(dataSourceName: string): DataSource;
    /**
     * 测试数据源
     * @param resource
     */
    testDataSource(resource: Resource): Promise<void>;
    /**
     * 生成定义
     */
    generateSpec(): string;
}
