Class: ProxyInterface

ProxyInterface()

A class to represent a proxy to an interface exported on the bus to be used by a client. A ProxyInterface is gotten by interface name from the ProxyObject from the MessageBus. This class is constructed dynamically based on the introspection data on the bus. The advertised methods of the interface are exposed as class methods that take arguments and return a Promsie that resolves to types specified by the type signature of the DBus method. The ProxyInterface is an EventEmitter that emits events with types that are specified by the type signature of the DBus signal advertised on the bus when that signal is received.

If an interface method call returns an error, ProxyInterface method call will throw a DBusError.

Constructor

new ProxyInterface()

Create a new ProxyInterface. This constructor should not be called directly. Use ProxyObject#getInterface to get a proxy interface.

Source:
Example
// this demonstrates the use of the standard
// `org.freedesktop.DBus.Properties` interface for an interface that exports
// some properties.
let bus = dbus.sessionBus();
let obj = await bus.getProxyObject('org.test.bus_name', '/org/test/path');
let properties = obj.getInterface('org.freedesktop.DBus.Properties');
// the `Get` method provided by this interface takes two strings and returns
// a Variant
let someProperty = await properties.Get('org.test.interface_name', 'SomeProperty');
// the `PropertiesChanged` signal provided by this interface will emit an
// event on the interface with its specified signal arguments.
properties.on('PropertiesChanged', (props, invalidated) => {});