import type { BridgeConfiguration } from './bridgeService.js';
import { IpcService } from './ipcService.js';
export interface HomebridgeOptions {
    keepOrphanedCachedAccessories?: boolean;
    hideQRCode?: boolean;
    insecureAccess?: boolean;
    customPluginPath?: string;
    noLogTimestamps?: boolean;
    debugModeEnabled?: boolean;
    forceColourLogging?: boolean;
    customStoragePath?: string;
    strictPluginResolution?: boolean;
}
export declare const enum ServerStatus {
    /**
     * When the server is starting up
     */
    PENDING = "pending",
    /**
     * When the server is online and has published the main bridge
     */
    OK = "ok",
    /**
     * When the server is shutting down
     */
    DOWN = "down"
}
export declare class Server {
    private options;
    private readonly api;
    private readonly pluginManager;
    private readonly bridgeService;
    private readonly externalPortService;
    readonly ipcService: IpcService;
    private readonly config;
    private readonly childBridges;
    private matterManager?;
    private readonly externalMatterBridgeRegistry;
    private matterMonitoringActive;
    private matterMonitoringClients;
    private readonly pendingMatterAccessoryInfoLookups;
    private serverStatus;
    constructor(options?: HomebridgeOptions);
    /**
     * Set the current server status and update parent via IPC
     * @param status
     */
    private setServerStatus;
    start(): Promise<void>;
    teardown(): Promise<void>;
    private publishBridge;
    /**
     * Handle Matter command trigger from IPC (for UI control)
     * This is called by IPC handlers, not API events
     */
    private handleTriggerMatterCommand;
    /**
     * Whether HAP should be published for the given bridge configuration.
     * HAP is on by default; users opt out via `bridge.hap.enabled: false`.
     * In externalsOnly mode the bridge accessory itself is not published, so
     * this returns false there too — externals are handled separately by
     * BridgeService.
     */
    static isHapEnabled(bridgeConfig: BridgeConfiguration): boolean;
    /**
     * Whether Matter is enabled for the given bridge.
     * Matter is opt-in: a `bridge.matter` block must be present and not
     * explicitly disabled via `bridge.matter.enabled: false`.
     */
    static isMatterEnabledForBridge(bridgeConfig: BridgeConfiguration): boolean;
    private static loadConfig;
    private loadAccessories;
    private loadPlatforms;
    /**
     * Validate an external bridge config
     */
    private validateChildBridgeConfig;
    /**
     * Takes care of the IPC Events sent to Homebridge
     */
    private initializeIpcEventHandlers;
    /**
     * Handle start Matter monitoring request from UI
     * Only starts monitoring if this is the first client.
     *
     * The UI parks each `startMatterMonitoring` request under a `correlationId`
     * so it can route the ack back to the matching waiter and gate its first
     * `getMatterAccessories` on it; echo it on the reply so the UI's dispatcher
     * (which drops events without a correlationId) can deliver it.
     */
    private handleStartMatterMonitoring;
    /**
     * Handle stop Matter monitoring request from UI
     * Only stops monitoring when no more clients.
     *
     * Echo the request's `correlationId` for the same reason as
     * `handleStartMatterMonitoring`.
     */
    private handleStopMatterMonitoring;
    /**
     * Register an external Matter bridge (e.g., robot vacuum with own bridge)
     * This allows routing control commands directly to the correct owner
     * @param externalBridgeUsername - Username of the external Matter bridge
     * @param ownerUsername - Username of the bridge that owns it (main bridge or child bridge username)
     */
    registerExternalMatterBridge(externalBridgeUsername: string, ownerUsername: string): void;
    /**
     * Cancel the pending fallback timer for a forwarded Matter accessory lookup.
     * Called by ChildBridgeService when a child responds with accessoryInfoData
     * so the 2s "Timed out" event isn't sent after a successful response.
     */
    private cancelPendingMatterAccessoryInfoLookup;
    /**
     * Get Matter accessories for a specific bridge or all bridges.
     *
     * The UI parks each request under a `correlationId` and routes responses
     * back to the matching waiter; events without the original correlationId
     * are dropped, so every emitted `accessoriesData` event must echo it.
     */
    private handleGetMatterAccessories;
    /**
     * Get detailed info for a specific Matter accessory
     */
    private handleGetMatterAccessoryInfo;
    /**
     * Handle Matter accessory control command
     */
    private handleMatterAccessoryControl;
    private printSetupInfo;
}
//# sourceMappingURL=server.d.ts.map