UNPKG

homebridge-virtual-accessories

Version:
40 lines (39 loc) 1.91 kB
import { Timer } from './timer.js'; import { VirtualLogger } from './virtualLogger.js'; import { ZonedDateTime } from '@js-joda/core'; import '@js-joda/timezone'; /** * shutdownSignal */ export declare const shutdownSignal: { isShuttingDown: boolean; }; /** * Utils */ export declare class Utils { static base64DecodeToHexString(base64String: string): string; static hexStringEncodeToBase64(hexString: string): string; static concatenate(num1: number, num2: number): number; static now(): ZonedDateTime; static zonedDateTime(datetime: string): ZonedDateTime; static secondsToHHmmss(seconds: number): string; static daysHoursMinutesSecondsToSeconds(days: number, hours: number, minutes: number, seconds: number): number; static secondsToDaysHoursMinutesSeconds(seconds: number): [number, number, number, number]; private static readonly debounceMillis; static debounce<T extends (...args: any[]) => void>(func: T, delayMillis: number | undefined, accessoryName: string, log: VirtualLogger): ((...args: any[]) => void) | undefined; static delay(millis: number, accessoryName: string, log: VirtualLogger): Promise<unknown>; static mapToJson(map: Map<string, string>): string; static jsonToMap(json: string): Map<string, string>; /** * Get the field name */ static proxiedPropertiesOf<TObj>(obj?: TObj): { [P in keyof TObj]?: P; }; static required(field: number | string | string[] | undefined): boolean; static notEmpty(field: string | string[]): boolean; static isPercentage(value: number): boolean; static isDegrees(value: number): boolean; static isValidTransition(value: number): boolean; static isValidTimeout(value: number): boolean; static restoreRunningTimer(timer: Timer, cachedStartTime: string, cachedDuration: number, callback: () => void, accessoryName: string, log: VirtualLogger): void; }