@homebridge/dbus-native 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +24 -13
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,21 +1,32 @@
1
- import {EventEmitter} from 'events'
2
- import {Socket} from 'net'
1
+ import { EventEmitter } from "events";
2
+ import { Socket } from "net";
3
3
 
4
- interface DbusInterface extends EventEmitter {
5
- on(event: string, callback: (error: Error, data: any) => void): void
6
- }
4
+ export function systemBus(): MessageBus;
7
5
 
8
- interface DbusService {
9
- getInterface(path: string, interfaceName: string, callback: (error: Error, interface: DbusInterface) => void): void
6
+ export class MessageBus {
7
+ connection: BusConnection;
8
+ public invoke(message: any, callback: (error: { name: string, message: any } | undefined, value: any) => void): void;
9
+ public getService(name: string): DBusService;
10
10
  }
11
11
 
12
- interface DbusBus {
13
- getService(serviceName: string): DbusService
12
+ export class BusConnection extends EventEmitter {
13
+ public stream: Socket;
14
14
  }
15
15
 
16
- function systemBus(): DbusBus
17
- function sessionBus(): DbusBus
16
+ export class DBusService {
17
+ public name: string;
18
+ public bus: MessageBus;
19
+ public getObject(name: string, callback: (error: null | Error, obj?: DBusObject) => void): DBusObject;
20
+ public getInterface(objName: string, ifaceName: string, callback: (error: null | Error, iface?: DBusInterface) => void): void;
21
+ }
18
22
 
19
- export {systemBus, sessionBus}
20
- export default {systemBus, sessionBus}
23
+ export class DBusObject {
24
+ public name: string;
25
+ public service: DBusService;
26
+ public as(name: string): DBusInterface;
27
+ }
21
28
 
29
+ export class DBusInterface extends EventEmitter implements Record<string, any> {
30
+ public $parent: DBusObject;
31
+ public $name: string; // string interface name
32
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@homebridge/dbus-native",
3
3
  "author": "Andrey Sidorov <sidorares@yandex.com>",
4
- "version": "0.7.0",
4
+ "version": "0.7.1",
5
5
  "keywords": [
6
6
  "dbus",
7
7
  "dcop",