@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.
- package/README.md +3 -0
- package/dist/components/Background/Background.d.ts +6 -0
- package/dist/components/Background/Background.styled.d.ts +10 -0
- package/dist/components/Board/Board.d.ts +5 -0
- package/dist/components/BoardProvider/BoardProvider.d.ts +8 -0
- package/dist/components/BoardProvider/BoardStyles.d.ts +6 -0
- package/dist/components/CommandGroup/CommandGroup.d.ts +5 -0
- package/dist/components/CommandGroup/CommandGroup.styled.d.ts +297 -0
- package/dist/components/Header/Header.d.ts +5 -0
- package/dist/components/Header/Header.styled.d.ts +822 -0
- package/dist/components/LayoutRenderer/LayoutRenderer.d.ts +5 -0
- package/dist/components/RouteResolver/RouteResolver.d.ts +12 -0
- package/dist/components/Router/Router.d.ts +6 -0
- package/dist/components/Router/Router.styled.d.ts +273 -0
- package/dist/components/Zone/Zone.d.ts +5 -0
- package/dist/data/fetchUserData.d.ts +4 -0
- package/dist/data/fetchUserPlugins.d.ts +5 -0
- package/dist/data/fetchUserToken.d.ts +2 -0
- package/dist/data/getClient.d.ts +3 -0
- package/dist/data/types/fragment-masking.d.ts +15 -0
- package/dist/data/types/gql.d.ts +50 -0
- package/dist/data/types/graphql.d.ts +1283 -0
- package/dist/data/types/index.d.ts +2 -0
- package/dist/data/watchUser.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +65766 -0
- package/dist/index.umd.js +65783 -0
- package/dist/lib/data.d.ts +1 -0
- package/dist/lib/globals.d.ts +14 -0
- package/dist/lib/hooks/useUserConfig.d.ts +4 -0
- package/dist/lib/plugins.d.ts +5 -0
- package/dist/lib/state.d.ts +16 -0
- package/dist/lib/utils/delay.d.ts +5 -0
- package/dist/lib/utils/extractErrorMessage.d.ts +1 -0
- package/dist/lib/utils/loadCustomPlugin.d.ts +6 -0
- package/dist/lib/utils/noop.d.ts +2 -0
- package/dist/lib/utils/parsePropsForComponent.d.ts +6 -0
- package/dist/lib/utils/tryAsync.d.ts +2 -0
- package/dist/lib/utils/waitForChange.d.ts +2 -0
- package/dist/main.d.ts +1 -0
- package/dist/plugins/base/boards/MainBoard.d.ts +2 -0
- package/dist/plugins/base/components/Greeting/Greeting.d.ts +2 -0
- package/dist/plugins/base/components/Greeting/Greeting.styled.d.ts +545 -0
- package/dist/plugins/base/lib/formatDateTime.d.ts +2 -0
- package/dist/plugins/base/plugin.d.ts +19 -0
- package/dist/plugins/base/screens/AboutScreen.d.ts +2 -0
- package/dist/plugins/base/screens/SettingsScreen.d.ts +2 -0
- package/dist/plugins/calendar/CalendarTiles/CalendarTiles.d.ts +11 -0
- package/dist/plugins/calendar/CalendarTiles/CalendarTiles.styled.d.ts +817 -0
- package/dist/plugins/calendar/CalendarTiles/UpcomingEvents.d.ts +7 -0
- package/dist/plugins/calendar/api/events.d.ts +2 -0
- package/dist/plugins/calendar/hooks/useEvents.d.ts +31 -0
- package/dist/plugins/calendar/lib/areEventsEqual.d.ts +3 -0
- package/dist/plugins/calendar/lib/findPastEvents.d.ts +3 -0
- package/dist/plugins/calendar/lib/findUpcomingEvents.d.ts +3 -0
- package/dist/plugins/calendar/lib/formatDateTime.d.ts +2 -0
- package/dist/plugins/calendar/lib/getTextWidth.d.ts +10 -0
- package/dist/plugins/calendar/plugin.d.ts +24 -0
- package/dist/plugins/calendar/screens/EventScreen/DateBadge.d.ts +2 -0
- package/dist/plugins/calendar/screens/EventScreen/EventScreen.d.ts +5 -0
- package/dist/plugins/calendar/screens/EventScreen/EventScreen.styled.d.ts +273 -0
- package/dist/plugins/calendar/screens/EventScreen/TitleBarWithTime.d.ts +2 -0
- package/dist/plugins/calendar/types.d.ts +13 -0
- package/dist/plugins/clock/ClockComponent/ClockComponent.d.ts +2 -0
- package/dist/plugins/desktop/BrowserButton.d.ts +6 -0
- package/dist/plugins/desktop/api/browser.d.ts +1 -0
- package/dist/plugins/desktop/constants.d.ts +1 -0
- package/dist/plugins/home-assistant/EntityButton/EntityButton.d.ts +9 -0
- package/dist/plugins/home-assistant/MediaButton/MediaButton.d.ts +8 -0
- package/dist/plugins/home-assistant/MediaView/CoverArt/CoverArt.d.ts +7 -0
- package/dist/plugins/home-assistant/MediaView/CoverArt/CoverArt.styled.d.ts +6 -0
- package/dist/plugins/home-assistant/MediaView/MediaTrack/MediaTrack.d.ts +6 -0
- package/dist/plugins/home-assistant/MediaView/MediaView.d.ts +6 -0
- package/dist/plugins/home-assistant/MediaView/MediaView.styled.d.ts +1124 -0
- package/dist/plugins/home-assistant/WeatherView/WeatherIcon/WeatherIcon.d.ts +6 -0
- package/dist/plugins/home-assistant/WeatherView/WeatherIcon/WeatherIcon.styled.d.ts +7 -0
- package/dist/plugins/home-assistant/WeatherView/WeatherView.d.ts +2 -0
- package/dist/plugins/home-assistant/api/accessories.d.ts +7 -0
- package/dist/plugins/home-assistant/api/constants.d.ts +2 -0
- package/dist/plugins/home-assistant/api/getImageAsBase64.d.ts +2 -0
- package/dist/plugins/home-assistant/api/ha.d.ts +9 -0
- package/dist/plugins/home-assistant/api/index.d.ts +4 -0
- package/dist/plugins/home-assistant/api/media.d.ts +4 -0
- package/dist/plugins/home-assistant/api/state.d.ts +6 -0
- package/dist/plugins/home-assistant/api/transforms/transformMediaData.d.ts +3 -0
- package/dist/plugins/home-assistant/api/transforms/transformSwitchData.d.ts +3 -0
- package/dist/plugins/home-assistant/api/transforms/transformWeatherData.d.ts +3 -0
- package/dist/plugins/home-assistant/api/types.d.ts +32 -0
- package/dist/plugins/home-assistant/api/weather.d.ts +2 -0
- package/dist/plugins/home-assistant/hooks/useEntities.d.ts +27 -0
- package/dist/plugins/home-assistant/hooks/useEntity.d.ts +25 -0
- package/dist/plugins/home-assistant/plugin.d.ts +12 -0
- package/dist/plugins/homekit/HomekitButton.d.ts +8 -0
- package/dist/plugins/homekit/api/accessories.d.ts +6 -0
- package/dist/plugins/homekit/constants.d.ts +1 -0
- package/dist/plugins/weather/WeatherComponent/WeatherComponent.d.ts +2 -0
- package/dist/plugins/weather/WeatherComponent/WeatherComponent.styled.d.ts +817 -0
- package/dist/plugins/weather/WeatherDisplay/WeatherDisplay.d.ts +6 -0
- package/dist/plugins/weather/WeatherDisplay/WeatherDisplay.styled.d.ts +817 -0
- package/dist/plugins/weather/WeatherIcon/WeatherIcon.d.ts +6 -0
- package/dist/plugins/weather/WeatherIcon/WeatherIcon.styled.d.ts +6 -0
- package/dist/plugins/weather/getLocationWeather.d.ts +13 -0
- package/package.json +67 -0
|
@@ -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,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,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,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,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,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";
|