"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterAPI = void 0;
class FilterAPI {
    context;
    constructor(context) {
        this.context = context;
    }
    /**
     * 应用过滤器
     */
    async applyFilter(dashboardId, filters) {
        const { window } = this.context;
        if (!window.BI) {
            throw new Error('FineBI SDK (window.BI) not found in the simulated environment.');
        }
        try {
            const filterArray = Array.isArray(filters) ? filters : [filters];
            // 模拟前端调用组件更新过滤器的逻辑
            console.log(`Applying filters on dashboard ${dashboardId}:`, filterArray);
            // 例如： await window.BI.Dashboard.applyFilter(dashboardId, filterArray);
            return true;
        }
        catch (error) {
            console.error('Error applying filter:', error);
            throw error;
        }
    }
}
exports.FilterAPI = FilterAPI;
