UNPKG

dbus-sdk

Version:

A Node.js SDK for interacting with DBus, enabling seamless service calling and exposure with TypeScript support

55 lines 2.84 kB
import { DBusObjectOpts } from './types/DBusObjectOpts'; import { DBusInterface } from './DBusInterface'; import { DBus } from './DBus'; import { DBusService } from './DBusService'; import { IntrospectNode } from './types/IntrospectNode'; export declare class DBusObject { #private; protected readonly opts: DBusObjectOpts; protected readonly dbus: DBus; protected readonly service: DBusService; readonly name: string; /** * Constructor for DBusObject. * Initializes the DBus object with the provided options and sets up references to the DBus connection * and service. * @param opts - Configuration options for the DBus object. */ constructor(opts: DBusObjectOpts); /** * Internal method to get a DBus interface by name. * Retrieves or caches introspection data for the specified interface and creates a DBusInterface instance. * @param iface - The name of the interface to retrieve. * @param shareIntrospect - Whether to use shared introspection data to avoid multiple introspections. * @returns A Promise resolving to a DBusInterface instance for the specified interface. * @throws InterfaceNotFoundError if the specified interface is not found. */ protected internalGetInterface(iface: string, shareIntrospect?: boolean): Promise<DBusInterface>; /** * Introspects the DBus object to retrieve its structure and metadata. * Invokes the Introspect method on the DBus object to get XML data, parses it, and constructs * an IntrospectNode object with details about interfaces, methods, properties, and signals. * @returns A Promise resolving to an IntrospectNode object representing the object's introspection data. */ introspect(): Promise<IntrospectNode>; /** * Lists all interface names available on this DBus object. * Performs introspection to retrieve the list of interfaces and optionally caches the result. * @returns A Promise resolving to an array of interface names as strings. */ listInterfaces(): Promise<string[]>; /** * Retrieves all DBus interfaces available on this object. * Uses shared introspection data to efficiently create DBusInterface instances for all interfaces. * @returns A Promise resolving to an array of DBusInterface instances for all interfaces on this object. */ getInterfaces(): Promise<DBusInterface[]>; /** * Retrieves a specific DBus interface by name from this object. * @param iface - The name of the interface to retrieve. * @returns A Promise resolving to a DBusInterface instance for the specified interface. * @throws InterfaceNotFoundError if the specified interface is not found. */ getInterface(iface: string): Promise<DBusInterface>; } //# sourceMappingURL=DBusObject.d.ts.map