@basmilius/homey-common 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import Homey from "homey";
2
2
  import type HomeyNS from "homey/lib/Homey";
3
+ import type { Device, Driver } from "./device";
3
4
  import { Registry } from "./registry";
4
5
  import type { Language } from "./types";
5
6
  export declare class App<TApp extends App<any>> extends Homey.App {
6
7
  #private;
7
8
  get registry(): Registry<TApp>;
8
9
  constructor(...args: any[]);
9
- getDevice<TDevice extends Homey.Device>(id: string): Promise<TDevice | null>;
10
- getDevices<TDevice extends Homey.Device>(driverId: string): Promise<TDevice[] | null>;
11
- getDrivers(): Promise<Homey.Driver[]>;
10
+ getDevice<TDevice extends Device<TApp>>(id: string): Promise<TDevice | null>;
11
+ getDevices<TDevice extends Device<TApp>>(driverId: string): Promise<TDevice[] | null>;
12
+ getDrivers(): Promise<Driver<TApp>[]>;
12
13
  }
13
14
  export declare class Shortcuts<TApp extends App<TApp>> {
14
15
  #private;
@@ -0,0 +1,17 @@
1
+ import Homey from "homey";
2
+ import type HomeyNS from "homey/lib/Homey";
3
+ import type { App } from "./app";
4
+ import type { Language } from "./types";
5
+ export declare class Device<TApp extends App<TApp>> extends Homey.Device {
6
+ get app(): TApp;
7
+ get id(): string;
8
+ get dashboards(): HomeyNS["dashboards"];
9
+ get flow(): HomeyNS["flow"];
10
+ get language(): Language;
11
+ }
12
+ export declare class Driver<TApp extends App<TApp>> extends Homey.Driver {
13
+ get app(): TApp;
14
+ get dashboards(): HomeyNS["dashboards"];
15
+ get flow(): HomeyNS["flow"];
16
+ get language(): Language;
17
+ }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export type { ApiRequest, Color, Constructor, FlowCardType, Icon, Language, WidgetApiRequest, Action, AutocompleteProvider, Condition, Trigger } from "./types";
2
2
  export { App, Shortcuts } from "./app";
3
3
  export { action, autocomplete, condition, trigger } from "./decorator";
4
+ export { Device, Driver } from "./device";
4
5
  export { FlowEntity, FlowActionEntity, FlowAutocompleteProvider, FlowConditionEntity, FlowTriggerEntity } from "./flow";
5
6
  export { Registry } from "./registry";
6
7
  export { colors, icons } from "./data";