Skip to content

Commit

Permalink
type definition
Browse files Browse the repository at this point in the history
Licence Indentifier
  • Loading branch information
Yusuf Can INCE authored and rzr committed Jan 26, 2021
1 parent 0080f19 commit 1c2e26c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-Licence-Indentifier: MIT
// By: Yusuf Can INCE <[email protected]>

/// <reference types="node" />

interface Device {
devId: number | null;
devUp: boolean | null;
/** USB-IF vendor ID. */
idVendor: number | null;
/** USB-IF product ID. */
idProduct: number | null;
/** Integer USB device number */
busNumber: number | null;
/** Integer USB device address */
deviceAddress: number | null;
}

declare class BluetoothHciSocket extends NodeJS.EventEmitter {
getDeviceList(): Device[];
isDevUp(): boolean;

start(): void;
stop(): void;
reset(): void;

bindRaw(devId: number): number;
bindUser(devId: number): number;
bindControl(): number;

setFilter(filter: Buffer): void;
write(data: Buffer): void;

on(event: "data", cb: (data: Buffer) => void): this;
on(event: "error", cb: (error: NodeJS.ErrnoException) => void): this;
}

export = BluetoothHciSocket;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.5.3-6",
"description": "Bluetooth HCI socket binding for Node.js",
"main": "index.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/abandonware/node-bluetooth-hci-socket.git"
Expand Down

0 comments on commit 1c2e26c

Please sign in to comment.