/// <reference types="node" />
import { Context } from '@midwayjs/koa';
import { UploadFileInfo } from '@midwayjs/upload/dist/interface';
import { Resource } from '../entity';
import { MagicDataSource, MagicFunction, MagicLog, MagicResourceService, Response } from '../magic';
export declare class MagicController {
    ctx: Context;
    magicLog: MagicLog;
    magicDataSource: MagicDataSource;
    magicFunction: MagicFunction;
    magicResourceService: MagicResourceService;
    magicConfig: any;
    response: Response;
    /**
     * 获取所有资源
     */
    resource(): Promise<any>;
    /**
     * 导入
     * @param files 文件
     * @param fields 表单字段
     */
    importResource(files: UploadFileInfo<string>[], fields: {
        mode: string;
    }): Promise<void>;
    /**
     * 导出
     * @param body
     */
    exportResource(body: {
        ids: string[];
    }): Promise<string | Buffer | import("stream").Stream>;
    /**
     * 分组创建或修改
     * @param resource 资源对象
     */
    folderSave(resource: Resource): Promise<Resource>;
    /**
     * 分组查询
     * @param type 分组类型
     * @param groupId 分组id
     */
    folder(type: string, groupId?: string): Promise<Resource[]>;
    /**
     * 删除分组
     * @param id 分组id
     */
    folderDelete(id: string): Promise<Resource>;
    /**
     * 资源创建或修改
     * @param resource 资源对象
     */
    fileSave(resource: Resource): Promise<Resource>;
    /**
     * 根据id查询资源
     * @param id 资源id
     */
    fileById(id: string): Promise<Resource>;
    /**
     * 根据groupId查询资源
     * @param type 资源类型
     * @param groupId 资源分组id
     */
    fileByGroupId(type: string, groupId: string): Promise<Resource[]>;
    /**
     * 删除资源
     * @param id 资源id
     */
    filerDelete(id: string): Promise<Resource>;
    /**
     * 测试数据源
     * @param resource
     */
    testDataSource(resource: Resource): Promise<void>;
    /**
     * 运行日志
     */
    log(): Promise<void>;
    /**
     * 用户登录
     * @param body
     */
    login(body: {
        username: string;
        password: string;
    }): Promise<any>;
    /**
     * 用户登出
     */
    logout(): Promise<void>;
    /**
     * 用户信息
     */
    info(): Promise<any>;
    /**
     * 类型定义
     */
    spec(): Promise<string>;
}
