Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare module '@stoprocent/bleno' {
onWriteRequest?: OnWriteRequestFn | null;
}

export class Characteristic {
export class Characteristic extends EventEmitter {
uuid: string;
properties: ReadonlyArray<Property>;
secure: ReadonlyArray<Property>;
Expand All @@ -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;
Expand Down Expand Up @@ -92,7 +100,7 @@ declare module '@stoprocent/bleno' {
characteristics?: ReadonlyArray<Characteristic> | null;
}

export class PrimaryService {
export class PrimaryService extends EventEmitter {
uuid: string;
characteristics: ReadonlyArray<Characteristic>;

Expand Down
Loading