/**
 * 框架生命周期事件集成
 * 自动在框架关键节点触发事件
 */ "use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "FrameworkEventManager", {
    enumerable: true,
    get: function() {
        return FrameworkEventManager;
    }
});
const _types = require("./types");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
let FrameworkEventManager = class FrameworkEventManager {
    /**
   * 触发应用启动事件
   */ emitAppStart(instanceId) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_START, {
            instanceId
        });
    }
    /**
   * 触发应用启动完成事件
   */ emitAppStarted(instanceId, duration) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_STARTED, {
            instanceId,
            duration
        });
    }
    /**
   * 触发应用初始化开始事件
   */ emitAppInitStart(instanceId) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_INIT_START, {
            instanceId
        });
    }
    /**
   * 触发应用初始化完成事件
   */ emitAppInitComplete(instanceId, context, duration) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_INIT_COMPLETE, {
            instanceId,
            context,
            duration
        });
    }
    /**
   * 触发应用初始化错误事件
   */ emitAppInitError(instanceId, error) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_INIT_ERROR, {
            instanceId,
            error
        });
    }
    /**
   * 触发应用渲染开始事件
   */ emitAppRenderStart(instanceId) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_RENDER_START, {
            instanceId
        });
    }
    /**
   * 触发应用渲染完成事件
   */ emitAppRenderComplete(instanceId, duration) {
        this.eventBus.emitSync(_types.FrameworkEventType.APP_RENDER_COMPLETE, {
            instanceId,
            duration
        });
    }
    /**
   * 触发路由变化事件
   */ emitRouteChange(from, to, params) {
        this.eventBus.emitSync(_types.FrameworkEventType.ROUTE_CHANGE, {
            from,
            to,
            params
        });
    }
    /**
   * 触发路由导航开始事件
   */ emitRouteNavigateStart(to, options) {
        this.eventBus.emitSync(_types.FrameworkEventType.ROUTE_NAVIGATE_START, {
            to,
            options
        });
    }
    /**
   * 触发路由导航完成事件
   */ emitRouteNavigateComplete(to, duration) {
        this.eventBus.emitSync(_types.FrameworkEventType.ROUTE_NAVIGATE_COMPLETE, {
            to,
            duration
        });
    }
    /**
   * 触发错误发生事件
   */ emitErrorOccurred(error, context) {
        this.eventBus.emitSync(_types.FrameworkEventType.ERROR_OCCURRED, {
            error,
            context
        });
    }
    /**
   * 触发实例创建事件
   */ emitInstanceCreated(instanceId) {
        this.eventBus.emitSync(_types.FrameworkEventType.INSTANCE_CREATED, {
            instanceId
        });
    }
    /**
   * 触发实例销毁事件
   */ emitInstanceDestroyed(instanceId) {
        this.eventBus.emitSync(_types.FrameworkEventType.INSTANCE_DESTROYED, {
            instanceId
        });
    }
    /**
   * 触发性能指标更新事件
   */ emitPerformanceUpdate(metrics) {
        this.eventBus.emitSync(_types.FrameworkEventType.PERFORMANCE_UPDATE, {
            metrics
        });
    }
    constructor(eventBus){
        _define_property(this, "eventBus", void 0);
        this.eventBus = eventBus;
    }
};

//# sourceMappingURL=frameworkEvents.js.map