@appkit/dek-lib 0.1.0

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.
Files changed (103) hide show
  1. package/README.md +3 -0
  2. package/dist/components/Background/Background.d.ts +6 -0
  3. package/dist/components/Background/Background.styled.d.ts +10 -0
  4. package/dist/components/Board/Board.d.ts +5 -0
  5. package/dist/components/BoardProvider/BoardProvider.d.ts +8 -0
  6. package/dist/components/BoardProvider/BoardStyles.d.ts +6 -0
  7. package/dist/components/CommandGroup/CommandGroup.d.ts +5 -0
  8. package/dist/components/CommandGroup/CommandGroup.styled.d.ts +297 -0
  9. package/dist/components/Header/Header.d.ts +5 -0
  10. package/dist/components/Header/Header.styled.d.ts +822 -0
  11. package/dist/components/LayoutRenderer/LayoutRenderer.d.ts +5 -0
  12. package/dist/components/RouteResolver/RouteResolver.d.ts +12 -0
  13. package/dist/components/Router/Router.d.ts +6 -0
  14. package/dist/components/Router/Router.styled.d.ts +273 -0
  15. package/dist/components/Zone/Zone.d.ts +5 -0
  16. package/dist/data/fetchUserData.d.ts +4 -0
  17. package/dist/data/fetchUserPlugins.d.ts +5 -0
  18. package/dist/data/fetchUserToken.d.ts +2 -0
  19. package/dist/data/getClient.d.ts +3 -0
  20. package/dist/data/types/fragment-masking.d.ts +15 -0
  21. package/dist/data/types/gql.d.ts +50 -0
  22. package/dist/data/types/graphql.d.ts +1283 -0
  23. package/dist/data/types/index.d.ts +2 -0
  24. package/dist/data/watchUser.d.ts +2 -0
  25. package/dist/index.d.ts +7 -0
  26. package/dist/index.es.js +65766 -0
  27. package/dist/index.umd.js +65783 -0
  28. package/dist/lib/data.d.ts +1 -0
  29. package/dist/lib/globals.d.ts +14 -0
  30. package/dist/lib/hooks/useUserConfig.d.ts +4 -0
  31. package/dist/lib/plugins.d.ts +5 -0
  32. package/dist/lib/state.d.ts +16 -0
  33. package/dist/lib/utils/delay.d.ts +5 -0
  34. package/dist/lib/utils/extractErrorMessage.d.ts +1 -0
  35. package/dist/lib/utils/loadCustomPlugin.d.ts +6 -0
  36. package/dist/lib/utils/noop.d.ts +2 -0
  37. package/dist/lib/utils/parsePropsForComponent.d.ts +6 -0
  38. package/dist/lib/utils/tryAsync.d.ts +2 -0
  39. package/dist/lib/utils/waitForChange.d.ts +2 -0
  40. package/dist/main.d.ts +1 -0
  41. package/dist/plugins/base/boards/MainBoard.d.ts +2 -0
  42. package/dist/plugins/base/components/Greeting/Greeting.d.ts +2 -0
  43. package/dist/plugins/base/components/Greeting/Greeting.styled.d.ts +545 -0
  44. package/dist/plugins/base/lib/formatDateTime.d.ts +2 -0
  45. package/dist/plugins/base/plugin.d.ts +19 -0
  46. package/dist/plugins/base/screens/AboutScreen.d.ts +2 -0
  47. package/dist/plugins/base/screens/SettingsScreen.d.ts +2 -0
  48. package/dist/plugins/calendar/CalendarTiles/CalendarTiles.d.ts +11 -0
  49. package/dist/plugins/calendar/CalendarTiles/CalendarTiles.styled.d.ts +817 -0
  50. package/dist/plugins/calendar/CalendarTiles/UpcomingEvents.d.ts +7 -0
  51. package/dist/plugins/calendar/api/events.d.ts +2 -0
  52. package/dist/plugins/calendar/hooks/useEvents.d.ts +31 -0
  53. package/dist/plugins/calendar/lib/areEventsEqual.d.ts +3 -0
  54. package/dist/plugins/calendar/lib/findPastEvents.d.ts +3 -0
  55. package/dist/plugins/calendar/lib/findUpcomingEvents.d.ts +3 -0
  56. package/dist/plugins/calendar/lib/formatDateTime.d.ts +2 -0
  57. package/dist/plugins/calendar/lib/getTextWidth.d.ts +10 -0
  58. package/dist/plugins/calendar/plugin.d.ts +24 -0
  59. package/dist/plugins/calendar/screens/EventScreen/DateBadge.d.ts +2 -0
  60. package/dist/plugins/calendar/screens/EventScreen/EventScreen.d.ts +5 -0
  61. package/dist/plugins/calendar/screens/EventScreen/EventScreen.styled.d.ts +273 -0
  62. package/dist/plugins/calendar/screens/EventScreen/TitleBarWithTime.d.ts +2 -0
  63. package/dist/plugins/calendar/types.d.ts +13 -0
  64. package/dist/plugins/clock/ClockComponent/ClockComponent.d.ts +2 -0
  65. package/dist/plugins/desktop/BrowserButton.d.ts +6 -0
  66. package/dist/plugins/desktop/api/browser.d.ts +1 -0
  67. package/dist/plugins/desktop/constants.d.ts +1 -0
  68. package/dist/plugins/home-assistant/EntityButton/EntityButton.d.ts +9 -0
  69. package/dist/plugins/home-assistant/MediaButton/MediaButton.d.ts +8 -0
  70. package/dist/plugins/home-assistant/MediaView/CoverArt/CoverArt.d.ts +7 -0
  71. package/dist/plugins/home-assistant/MediaView/CoverArt/CoverArt.styled.d.ts +6 -0
  72. package/dist/plugins/home-assistant/MediaView/MediaTrack/MediaTrack.d.ts +6 -0
  73. package/dist/plugins/home-assistant/MediaView/MediaView.d.ts +6 -0
  74. package/dist/plugins/home-assistant/MediaView/MediaView.styled.d.ts +1124 -0
  75. package/dist/plugins/home-assistant/WeatherView/WeatherIcon/WeatherIcon.d.ts +6 -0
  76. package/dist/plugins/home-assistant/WeatherView/WeatherIcon/WeatherIcon.styled.d.ts +7 -0
  77. package/dist/plugins/home-assistant/WeatherView/WeatherView.d.ts +2 -0
  78. package/dist/plugins/home-assistant/api/accessories.d.ts +7 -0
  79. package/dist/plugins/home-assistant/api/constants.d.ts +2 -0
  80. package/dist/plugins/home-assistant/api/getImageAsBase64.d.ts +2 -0
  81. package/dist/plugins/home-assistant/api/ha.d.ts +9 -0
  82. package/dist/plugins/home-assistant/api/index.d.ts +4 -0
  83. package/dist/plugins/home-assistant/api/media.d.ts +4 -0
  84. package/dist/plugins/home-assistant/api/state.d.ts +6 -0
  85. package/dist/plugins/home-assistant/api/transforms/transformMediaData.d.ts +3 -0
  86. package/dist/plugins/home-assistant/api/transforms/transformSwitchData.d.ts +3 -0
  87. package/dist/plugins/home-assistant/api/transforms/transformWeatherData.d.ts +3 -0
  88. package/dist/plugins/home-assistant/api/types.d.ts +32 -0
  89. package/dist/plugins/home-assistant/api/weather.d.ts +2 -0
  90. package/dist/plugins/home-assistant/hooks/useEntities.d.ts +27 -0
  91. package/dist/plugins/home-assistant/hooks/useEntity.d.ts +25 -0
  92. package/dist/plugins/home-assistant/plugin.d.ts +12 -0
  93. package/dist/plugins/homekit/HomekitButton.d.ts +8 -0
  94. package/dist/plugins/homekit/api/accessories.d.ts +6 -0
  95. package/dist/plugins/homekit/constants.d.ts +1 -0
  96. package/dist/plugins/weather/WeatherComponent/WeatherComponent.d.ts +2 -0
  97. package/dist/plugins/weather/WeatherComponent/WeatherComponent.styled.d.ts +817 -0
  98. package/dist/plugins/weather/WeatherDisplay/WeatherDisplay.d.ts +6 -0
  99. package/dist/plugins/weather/WeatherDisplay/WeatherDisplay.styled.d.ts +817 -0
  100. package/dist/plugins/weather/WeatherIcon/WeatherIcon.d.ts +6 -0
  101. package/dist/plugins/weather/WeatherIcon/WeatherIcon.styled.d.ts +6 -0
  102. package/dist/plugins/weather/getLocationWeather.d.ts +13 -0
  103. package/package.json +67 -0
@@ -0,0 +1,6 @@
1
+ import { WeatherType } from '../../api/types';
2
+ type Props = {
3
+ type: WeatherType;
4
+ };
5
+ declare const WeatherIcon: ({ type }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default WeatherIcon;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $top: number;
4
+ $left: number;
5
+ };
6
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const WeatherComponent: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default WeatherComponent;
@@ -0,0 +1,7 @@
1
+ import { ApiResult } from './types';
2
+ export type AccessoryState = 'off' | 'on' | 'unknown';
3
+ export type AccessoryData = {
4
+ state: AccessoryState;
5
+ };
6
+ export declare const getAccessory: (entityId: string) => Promise<ApiResult<AccessoryData>>;
7
+ export declare const setAccessoryState: (entityId: string, state: AccessoryState) => Promise<ApiResult<any>>;
@@ -0,0 +1,2 @@
1
+ export declare const serverUri = "https://home.daveweaver.net";
2
+ export declare const accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlN2Y0ZjdmMTY4YTQ0NzYyYTBkYmYxODBkNzljYjQyYSIsImlhdCI6MTY5OTI3NjkyOCwiZXhwIjoyMDE0NjM2OTI4fQ.efk7Z0qil3HbVQnOsWj0XzKr83TJj1b4Z8uVu7mS1b8";
@@ -0,0 +1,2 @@
1
+ declare function getImageAsBase64(url: string): Promise<string>;
2
+ export default getImageAsBase64;
@@ -0,0 +1,9 @@
1
+ import { HassEntities } from 'home-assistant-js-websocket';
2
+ import { HAConnection } from './types';
3
+ export declare function disconnect(): void;
4
+ export declare function connect(): Promise<HAConnection>;
5
+ export declare function onEntitiesUpdated(listener: (state: HassEntities) => void): void;
6
+ export declare function onEvent(listener: (ev: unknown) => void): void;
7
+ export declare function invokeService(domain: string, service: string, entityId: string, serviceData?: object): Promise<unknown>;
8
+ export declare function getEntityStates(): Promise<unknown>;
9
+ export declare function setEntityState(entityId: string, state: string): Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,4 @@
1
+ import { MediaState, SwitchState } from './types';
2
+ export declare function mediaPlayerSetState(entityId: string, state: MediaState): Promise<unknown>;
3
+ export declare function mediaPlayerPlayNextTrack(entityId: string): Promise<unknown>;
4
+ export declare function switchSetState(entityId: string, state: SwitchState): Promise<unknown>;
@@ -0,0 +1,4 @@
1
+ import { ApiResult, MediaData, MediaState } from './types';
2
+ export declare const getMedia: (entityId: string) => Promise<ApiResult<MediaData>>;
3
+ export declare const setMediaPlaybackState: (entityId: string, state: MediaState) => Promise<ApiResult<any>>;
4
+ export declare const setMediaPlaybackNext: (entityId: string) => Promise<ApiResult<any>>;
@@ -0,0 +1,6 @@
1
+ import { HassEntities } from 'home-assistant-js-websocket';
2
+ export type HomeAssistantState = {
3
+ entities: HassEntities;
4
+ };
5
+ declare const state: HomeAssistantState;
6
+ export default state;
@@ -0,0 +1,3 @@
1
+ import { MediaData } from '../types';
2
+ declare function transformMediaData(data: any): MediaData;
3
+ export default transformMediaData;
@@ -0,0 +1,3 @@
1
+ import { SwitchData } from '../types';
2
+ declare function transformSwitchData(data: any): SwitchData;
3
+ export default transformSwitchData;
@@ -0,0 +1,3 @@
1
+ import { WeatherData } from '../types';
2
+ declare function transformWeatherData(data: any): WeatherData;
3
+ export default transformWeatherData;
@@ -0,0 +1,32 @@
1
+ import { Connection, UnsubscribeFunc } from 'home-assistant-js-websocket';
2
+ export type ApiResult<T = any> = {
3
+ data?: T;
4
+ success: boolean;
5
+ error?: string;
6
+ };
7
+ export type HAConnection = {
8
+ instance: Connection | null;
9
+ entitiesSubscription: UnsubscribeFunc | null;
10
+ };
11
+ export type MediaState = 'idle' | 'playing' | 'paused' | 'unknown';
12
+ export type MediaData = {
13
+ name: string;
14
+ state: MediaState;
15
+ volume: number;
16
+ albumArtUrl: string;
17
+ duration: number;
18
+ position: number;
19
+ positionUpdatedAt: number;
20
+ title: string;
21
+ artist: string;
22
+ album: string;
23
+ };
24
+ export type SwitchState = 'off' | 'on' | 'unknown';
25
+ export type SwitchData = {
26
+ state: SwitchState;
27
+ };
28
+ export type WeatherData = {
29
+ type: WeatherType;
30
+ temperature: number;
31
+ };
32
+ export type WeatherType = 'sunny' | 'cloudy' | 'partlycloudy' | 'clear-night' | 'fog' | 'hail' | 'lightning' | 'lightning-raining' | 'pouring' | 'rainy' | 'snowy' | 'snowy-rainy' | 'windy' | 'windy-variant' | 'exceptional' | 'unknown';
@@ -0,0 +1,2 @@
1
+ import { ApiResult, WeatherData } from './types';
2
+ export declare const getWeather: () => Promise<ApiResult<WeatherData>>;
@@ -0,0 +1,27 @@
1
+ declare const useEntities: () => {
2
+ readonly [x: string]: {
3
+ readonly entity_id: string;
4
+ readonly state: string;
5
+ readonly last_changed: string;
6
+ readonly last_updated: string;
7
+ readonly attributes: {
8
+ readonly [x: string]: any;
9
+ readonly friendly_name?: string | undefined;
10
+ readonly unit_of_measurement?: string | undefined;
11
+ readonly icon?: string | undefined;
12
+ readonly entity_picture?: string | undefined;
13
+ readonly supported_features?: number | undefined;
14
+ readonly hidden?: boolean | undefined;
15
+ readonly assumed_state?: boolean | undefined;
16
+ readonly device_class?: string | undefined;
17
+ readonly state_class?: string | undefined;
18
+ readonly restored?: boolean | undefined;
19
+ };
20
+ readonly context: {
21
+ readonly id: string;
22
+ readonly user_id: string | null;
23
+ readonly parent_id: string | null;
24
+ };
25
+ };
26
+ };
27
+ export default useEntities;
@@ -0,0 +1,25 @@
1
+ declare const useEntity: (entityId: string) => {
2
+ readonly entity_id: string;
3
+ readonly state: string;
4
+ readonly last_changed: string;
5
+ readonly last_updated: string;
6
+ readonly attributes: {
7
+ readonly [x: string]: any;
8
+ readonly friendly_name?: string | undefined;
9
+ readonly unit_of_measurement?: string | undefined;
10
+ readonly icon?: string | undefined;
11
+ readonly entity_picture?: string | undefined;
12
+ readonly supported_features?: number | undefined;
13
+ readonly hidden?: boolean | undefined;
14
+ readonly assumed_state?: boolean | undefined;
15
+ readonly device_class?: string | undefined;
16
+ readonly state_class?: string | undefined;
17
+ readonly restored?: boolean | undefined;
18
+ };
19
+ readonly context: {
20
+ readonly id: string;
21
+ readonly user_id: string | null;
22
+ readonly parent_id: string | null;
23
+ };
24
+ } | undefined;
25
+ export default useEntity;
@@ -0,0 +1,12 @@
1
+ import { DekPlugin, DekPluginConfig } from '@appkit/dek-plugin';
2
+ declare class Plugin implements DekPlugin {
3
+ readonly config: DekPluginConfig;
4
+ constructor(config: DekPluginConfig);
5
+ load(config: DekPluginConfig): Promise<void>;
6
+ unload(): Promise<void>;
7
+ get components(): {
8
+ key: string;
9
+ element: (props: any) => import("react/jsx-runtime").JSX.Element;
10
+ }[];
11
+ }
12
+ export default Plugin;
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ title: string;
3
+ uuid: string;
4
+ iconName?: string;
5
+ disabled?: boolean;
6
+ };
7
+ declare const HomekitButton: ({ title, uuid, disabled, iconName, }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default HomekitButton;
@@ -0,0 +1,6 @@
1
+ export type AccessoryState = 0 | 1;
2
+ export type Accessory = {
3
+ state: AccessoryState;
4
+ };
5
+ export declare const getAccessory: (uuid: string) => Promise<Accessory>;
6
+ export declare const setAccessoryState: (uuid: string, state: AccessoryState) => Promise<Accessory>;
@@ -0,0 +1 @@
1
+ export declare const serverUri = "https://connect.daveweaver.net";
@@ -0,0 +1,2 @@
1
+ declare const WeatherComponent: () => import("react/jsx-runtime").JSX.Element;
2
+ export default WeatherComponent;