From b4991c6983e754dcc2279e3a3c252ad3f81ba9c2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 06:59:33 +0000 Subject: [PATCH 1/3] Initial plan From 5efb03a0408ab154972bc795de45cd645e6787cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 07:02:12 +0000 Subject: [PATCH 2/3] fix: Characteristic and PrimaryService TypeScript types extend EventEmitter Agent-Logs-Url: https://github.com/stoprocent/bleno/sessions/9aac77fa-4469-43da-9c26-fba995d088ab Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com> --- index.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index b879be2..8efa32a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -42,7 +42,7 @@ declare module '@stoprocent/bleno' { onWriteRequest?: OnWriteRequestFn | null; } - export class Characteristic { + export class Characteristic extends EventEmitter { uuid: string; properties: ReadonlyArray; secure: ReadonlyArray; @@ -60,6 +60,14 @@ declare module '@stoprocent/bleno' { toString(): string; + on(event: 'readRequest', listener: (handle: ConnectionHandle, offset: number, callback: ReadRequestCallback) => void): this; + on(event: 'writeRequest', listener: (handle: ConnectionHandle, data: Buffer, offset: number, withoutResponse: boolean, callback: WriteRequestCallback) => void): this; + on(event: 'subscribe', listener: (handle: ConnectionHandle, maxValueSize: number, updateValueCallback: UpdateValueCallback) => void): this; + on(event: 'unsubscribe', listener: (handle: ConnectionHandle) => void): this; + on(event: 'notify', listener: (handle: ConnectionHandle) => void): this; + on(event: 'indicate', listener: (handle: ConnectionHandle) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + readonly RESULT_ATTR_NOT_LONG: number; readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; readonly RESULT_INVALID_OFFSET: number; @@ -92,7 +100,7 @@ declare module '@stoprocent/bleno' { characteristics?: ReadonlyArray | null; } - export class PrimaryService { + export class PrimaryService extends EventEmitter { uuid: string; characteristics: ReadonlyArray; From bb25698f20c22a2e9d43542044a15184333c661e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 06:59:33 +0000 Subject: [PATCH 3/3] chore(types): initial plan for Characteristic EventEmitter inheritance fix Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>