-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhomey-override.d.ts
38 lines (33 loc) · 1.05 KB
/
homey-override.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type { DeviceType } from '@olivierzal/melcloud-api'
import type HomeyLib from 'homey/lib/Homey'
import type MELCloudApp from './app.mts'
import type { BaseMELCloudDriver } from './drivers/base-driver.mts'
import type { Manifest } from './types/common.mts'
import type { HomeySettings } from './types/index.mts'
declare module 'homey' {
interface Homey extends HomeyLib {
app: MELCloudApp
drivers: ManagerDrivers
manifest: Manifest
settings: ManagerSettings
}
interface ManagerDrivers extends HomeyLib.ManagerDrivers {
getDriver: <T extends DeviceType>(driverId: string) => BaseMELCloudDriver<T>
getDrivers: <T extends DeviceType>() => Record<
string,
BaseMELCloudDriver<T>
>
}
interface ManagerSettings extends HomeyLib.ManagerSettings {
get: <T extends keyof HomeySettings>(key: T) => HomeySettings[T]
set: <T extends keyof HomeySettings>(
key: T,
value: HomeySettings[T],
) => void
}
}
declare module 'homey/lib/Homey' {
interface Homey extends HomeyLib {
app: MELCloudApp
}
}