mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-28 17:48:52 +00:00
819e184095
Change-type: patch
18 lines
388 B
TypeScript
18 lines
388 B
TypeScript
import * as DBus from 'dbus';
|
|
|
|
export function createSystemInterface(
|
|
svc: DBus.DBusService | string,
|
|
objName: string,
|
|
ifaceName: string,
|
|
) {
|
|
const service = ((s: DBus.DBusService | string) => {
|
|
if (typeof s === 'string') {
|
|
return DBus.registerService('system', s);
|
|
}
|
|
return s;
|
|
})(svc);
|
|
|
|
const obj = service.createObject(objName);
|
|
return obj.createInterface(ifaceName);
|
|
}
|