import type { Device, DeviceManifest, EventDetails, EventListenerOptions, EventListenerRegister, MediaManager, MediaObject, ScryptedDevice, ScryptedInterfaceDescriptor, ScryptedInterfaceProperty, ScryptedNativeId, SystemDeviceState } from '@scrypted/types'; import type { AccessControls } from './acl'; export interface PluginLogger { log(level: string, message: string): Promise; clear(): Promise; clearAlert(message: string): Promise; clearAlerts(): Promise; } export interface PluginHostInfo { serverVersion: string; } export interface PluginAPI { setState(nativeId: ScryptedNativeId, key: string, value: any): Promise; onDevicesChanged(deviceManifest: DeviceManifest): Promise; onDeviceDiscovered(device: Device): Promise; onDeviceEvent(nativeId: ScryptedNativeId, eventInterface: string, eventData?: any): Promise; onMixinEvent(id: string, nativeId: ScryptedNativeId, eventInterface: string, eventData?: any): Promise; onDeviceRemoved(nativeId: string): Promise; setStorage(nativeId: string, storage: { [key: string]: any; }): Promise; getDeviceById(id: string): Promise; setDeviceProperty(id: string, property: ScryptedInterfaceProperty, value: any): Promise; removeDevice(id: string): Promise; listen(EventListener: (id: string, eventDetails: EventDetails, eventData: any) => void): Promise; listenDevice(id: string, event: string | EventListenerOptions, callback: (eventDetails: EventDetails, eventData: any) => void): Promise; getLogger(nativeId: ScryptedNativeId): Promise; getComponent(id: string): Promise; getMediaManager(): Promise; requestRestart(): Promise; setScryptedInterfaceDescriptors(typesVersion: string, descriptors: { [scryptedInterface: string]: ScryptedInterfaceDescriptor; }): Promise; } export declare class PluginAPIManagedListeners { listeners: Set; manageListener(listener: EventListenerRegister): EventListenerRegister; removeListeners(): void; } export declare class PluginAPIProxy extends PluginAPIManagedListeners implements PluginAPI { api: PluginAPI; mediaManager?: MediaManager; acl: AccessControls; constructor(api: PluginAPI, mediaManager?: MediaManager); setScryptedInterfaceDescriptors(typesVersion: string, descriptors: { [scryptedInterface: string]: ScryptedInterfaceDescriptor; }): Promise; setState(nativeId: ScryptedNativeId, key: string, value: any): Promise; onDevicesChanged(deviceManifest: DeviceManifest): Promise; onDeviceDiscovered(device: Device): Promise; onDeviceEvent(nativeId: ScryptedNativeId, eventInterface: any, eventData?: any): Promise; onMixinEvent(id: string, nativeId: ScryptedNativeId, eventInterface: string, eventData?: any): Promise; onDeviceRemoved(nativeId: string): Promise; setStorage(nativeId: ScryptedNativeId, storage: { [key: string]: any; }): Promise; getDeviceById(id: string): Promise; setDeviceProperty(id: string, property: ScryptedInterfaceProperty, value: any): Promise; removeDevice(id: string): Promise; listen(callback: (id: string, eventDetails: EventDetails, eventData: any) => void): Promise; listenDevice(id: string, event: string | EventListenerOptions, callback: (eventDetails: EventDetails, eventData: any) => void): Promise; getLogger(nativeId: ScryptedNativeId): Promise; getComponent(id: string): Promise; getMediaManager(): Promise; requestRestart(): Promise; } export interface PluginRemoteLoadZipOptions { debug?: boolean; zipHash: string; fork?: boolean; main?: string; clusterId: string; clusterWorkerId: string; clusterSecret: string; } export declare class PluginZipAPI { getZip: () => Promise; constructor(getZip: () => Promise); } export interface PluginRemote { loadZip(packageJson: any, zipAPI: PluginZipAPI, options: PluginRemoteLoadZipOptions): Promise; setSystemState(state: { [id: string]: { [property: string]: SystemDeviceState; }; }): Promise; setNativeId(nativeId: ScryptedNativeId, id: string, storage: { [key: string]: any; }): Promise; updateDeviceState(id: string, state: { [property: string]: SystemDeviceState; }): Promise; /** * @deprecated */ notify(id: string, eventTime: number, eventInterface: string, property: string | undefined, value: SystemDeviceState | any, changed?: boolean): Promise; notify(id: string, eventDetails: EventDetails, eventData: SystemDeviceState | any): Promise; ioEvent(id: string, event: string, message?: any): Promise; createDeviceState(id: string, setState: (property: string, value: any) => Promise): Promise; getServicePort(name: string, ...args: any[]): Promise<[number, string]>; } export interface MediaObjectRemote extends MediaObject { getData(): Promise; }