Class: Variant

Variant(signature, value)

A class to represent DBus variants for both the client and service interfaces. The ProxyInterface and Interface methods, signals, and properties will use this type to represent variant types. The user should use this class directly for sending variants to methods if their signature expects the type to be a variant.

Constructor

new Variant(signature, value)

Construct a new Variant with the given signature and value.

Parameters:
Name Type Description
signature string

a DBus type signature for the Variant.

value any

the value of the Variant with type specified by the type signature.

Source:
Example
let str = new Variant('s', 'hello');
let num = new Variant('d', 53);
let map = new Variant('a{ss}', { foo: 'bar' });
let list = new Variant('as', [ 'foo', 'bar' ]);