@homebridge/plugin-ui-utils
Version:
A tool to help plugins provide custom UI screens in the Homebridge UI.
66 lines • 2.43 kB
TypeScript
/**
* This script is injected into a plugins custom settings ui by the Homebridge UI
* You should not include it in your own code, however you can use it for type information if desired.
* It provides the interface to interact with the Homebridge UI service.
*/
declare let EventTargetConstructor: {
new (): EventTarget;
prototype: EventTarget;
};
declare class HomebridgePluginUi extends EventTargetConstructor {
private origin;
private lastBodyHeight;
private linkRequests;
toast: HomebridgeUiToastHelper;
plugin: any;
serverEnv: any;
constructor();
private _handleIncomingMessage;
_postMessage(message: any): void;
private _setBodyClass;
private _setInlineStyle;
private _setLinkElement;
private _monitorFrameHeight;
private _requestResponse;
fixScrollHeight(): void;
closeSettings(): void;
showSpinner(): void;
hideSpinner(): void;
disableSaveButton(): void;
enableSaveButton(): void;
showSchemaForm(): void;
hideSchemaForm(): void;
createForm(schema: any, data: any, submitButton?: string, cancelButton?: string): HomebridgeUiFormHelper;
endForm(): void;
getPluginConfig(): Promise<any>;
updatePluginConfig(pluginConfig: any): Promise<any>;
savePluginConfig(): Promise<any>;
getPluginConfigSchema(): Promise<any>;
getCachedAccessories(): Promise<Record<string, any>[]>;
getCachedMatterAccessories(): Promise<Record<string, any>[]>;
request(path: string, body?: any): Promise<any>;
userCurrentLightingMode(): Promise<'dark' | 'light'>;
i18nCurrentLang(): Promise<string>;
i18nGetTranslation(): Promise<Record<string, string>>;
}
declare class HomebridgeUiToastHelper {
private _postMessage;
success(message: string, title?: string): void;
error(message: string, title?: string): void;
warning(message: string, title?: string): void;
info(message: string, title?: string): void;
}
declare class HomebridgeUiFormHelper {
private parent;
private formId;
private _changeHandle?;
private _submitHandle?;
private _cancelHandle?;
end: () => void;
constructor(parent: HomebridgePluginUi, schema: Record<string, any>, data: Record<string, any>, submitButton?: string, cancelButton?: string);
private _eventHandle;
onChange(fn: any): void;
onSubmit(fn: any): void;
onCancel(fn: any): void;
}
//# sourceMappingURL=ui.d.ts.map