import { IDataSource } from "./types";
export interface DataParser {
    type: string;
    parser: any;
}
export interface IProcessDataItem {
    id: string;
    data: any;
}
export interface IProcessData {
    id: string;
    finalKeyData: IProcessDataItem;
    finalUserData: IProcessDataItem;
    filteredData: IProcessDataItem;
    rawData: IProcessDataItem;
    noMappingData: any;
}
type DataSourceStatus = "pending" | "executing" | "completed";
interface IDataSourceState {
    id: string;
    status: DataSourceStatus;
    callbacks: Array<() => void>;
}
export declare class SHJDatasourceV2 {
    /**
     * 定时器池
     */
    static timerPool: Map<string, any>;
    /**
     * 数据源状态池 - 跟踪所有数据源的执行状态
     */
    static dataSourceStatePool: Map<string, IDataSourceState>;
    /**
     * 等待执行的数据源池 - 存储因依赖关系而等待的数据源
     */
    static waitingPool: Map<string, {
        item: IDataSource;
        callback: any;
        noUseMapping: boolean;
        isInterval: boolean;
        isEditor: boolean;
    }>;
    /**
     * 数据源解析器
     */
    private static parsers;
    /**
     * 添加数据源解析器
     * @param type - 数据源类型
     * @param parser - 解析器函数
     */
    static addParser(type: string, parser: any): void;
    /**
     * 获取数据源解析器
     * @param type - 数据源类型
     * @returns 解析器函数，如果未找到则返回undefined
     */
    static getParser(type: string): any | undefined;
    /**
     * 解析数据源
     * @param sources 数据源
     * @param callback 回调函数
     * @param noUseMapping 是否不使用映射
     * @param isInterval 是否开启定时任务
     * @param isEditor 是否为编辑器模式
     * @returns
     */
    static parse({ sources, callback, noUseMapping, isInterval, isEditor, }: {
        sources: any;
        callback?: (datas: any) => any;
        noUseMapping?: boolean;
        isInterval?: boolean;
        isEditor?: boolean;
    }): void;
    /**
     * 处理数据源执行逻辑，根据pid确定执行顺序
     */
    private static handleDataSourceExecution;
    /**
     * 初始化数据源状态
     */
    private static initializeDataSourceState;
    /**
     * 标记数据源为执行中状态
     */
    private static markDataSourceExecuting;
    /**
     * 标记数据源为已完成状态，并触发依赖它的数据源
     */
    private static markDataSourceCompleted;
    /**
     *
     * 如果有，且当前数据源已完成，则立即执行它们。没完成加入callbacks继续等待
     */
    private static checkAndExecuteWaitingChildren;
    /**
     * 执行数据源
     */
    private static executeDataSource;
    /**
     * 设置定时任务
     */
    private static setupInterval;
    /**
     * 执行任务
     */
    private static executeTask;
    /**
     * 处理数据并返回最终结果
     * @param source
     * @param data
     * @param sourceId
     * @param noUseMapping
     * @returns
     */
    static processData(source: IDataSource["source"], data: any, sourceId: string, noUseMapping?: boolean): Promise<IProcessData>;
    /**
     * 过滤数据
     * @param filterCode
     * @param data
     * @returns
     */
    static filterData(filterCode: string, data: any): Promise<any>;
    /**
     * 销毁数据源
     */
    static destroy(): void;
    static clearMqttConnectionById(id: string): void;
    static clearWebSocketConnectionById(id: string): void;
}
export * from "./utils/utils";
