import { Service } from "../device-wrapper.js"; import { TypedServiceEvent, TypedServiceEventDispatcher } from "../../service-events.js"; import { BoardVersion } from "../../device.js"; export declare class EventService implements Service { private deviceId; private dispatchTypedEvent; private getBoardVersion; uuid: string; private activeEventTypes; /** * Filters registered via named events (gestures, buttons), keyed as "source:value". * Persists across reconnects so we can replay them. */ private namedRequirements; /** * Filters registered via explicit {@link subscribeToEvent} calls, keyed as "source:value". * Only events matching these are dispatched as `microbitevent`. * Persists across reconnects so we can replay them. */ private explicitSubscriptions; /** * Tracks which named event types contributed which filter keys, * so we can clean up when a named event is stopped. */ private namedEventFilters; constructor(deviceId: string, dispatchTypedEvent: TypedServiceEventDispatcher, getBoardVersion: () => BoardVersion | undefined); getRelevantEvents(): TypedServiceEvent[]; startNotifications(type: TypedServiceEvent): Promise; stopNotifications(type: TypedServiceEvent): Promise; /** * Register interest in a specific micro:bit message bus event. * Tells the micro:bit to forward matching message bus traffic over BLE. * Matching events are dispatched as `microbitevent`. * Use 0 as the value to match all events from a source. */ subscribeToEvent(source: number, value: number): Promise; /** * Send an event to the micro:bit's message bus. */ sendEvent(source: number, value: number): Promise; private handleNotification; private demuxToNamedEvents; private writeRequirementsForNamedEvent; private matchesExplicitSubscription; private replayAllRequirements; private writeClientRequirement; private getSourceIds; }