Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich committed May 5, 2019
1 parent 4e03389 commit 34fbd63
Show file tree
Hide file tree
Showing 31 changed files with 7,387 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.rts2_cache_cjs/
/.rts2_cache_es/
/.rts2_cache_umd/
/node_modules/
1 change: 1 addition & 0 deletions dist/compute-domain.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function computeDomain(entityId: string): string;
22 changes: 22 additions & 0 deletions dist/const.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** Constants to be used in the frontend. */
/** Icon to use when no icon specified for domain. */
export declare const DEFAULT_DOMAIN_ICON = "hass:bookmark";
/** Panel to show when no panel is picked. */
export declare const DEFAULT_PANEL = "lovelace";
/** Domains that have a state card. */
export declare const DOMAINS_WITH_CARD: string[];
/** Domains with separate more info dialog. */
export declare const DOMAINS_WITH_MORE_INFO: string[];
/** Domains that show no more info dialog. */
export declare const DOMAINS_HIDE_MORE_INFO: string[];
/** Domains that should have the history hidden in the more info dialog. */
export declare const DOMAINS_MORE_INFO_NO_HISTORY: string[];
/** States that we consider "off". */
export declare const STATES_OFF: string[];
/** Domains where we allow toggle in Lovelace. */
export declare const DOMAINS_TOGGLE: Set<string>;
/** Temperature units. */
export declare const UNIT_C = "\u00B0C";
export declare const UNIT_F = "\u00B0F";
/** Entity ID of the default view. */
export declare const DEFAULT_VIEW_ENTITY_ID = "group.default_view";
28 changes: 28 additions & 0 deletions dist/fire-event.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
declare global {
interface HASSDomEvents {
}
}
export declare type ValidHassDomEvent = keyof HASSDomEvents;
export interface HASSDomEvent<T> extends Event {
detail: T;
}
/**
* Dispatches a custom event with an optional detail value.
*
* @param {string} type Name of event type.
* @param {*=} detail Detail value containing event-specific
* payload.
* @param {{ bubbles: (boolean|undefined),
* cancelable: (boolean|undefined),
* composed: (boolean|undefined) }=}
* options Object specifying options. These may include:
* `bubbles` (boolean, defaults to `true`),
* `cancelable` (boolean, defaults to false), and
* `node` on which to fire the event (HTMLElement, defaults to `this`).
* @return {Event} The new event that was fired.
*/
export declare const fireEvent: <HassEvent extends "undefined" | "haptic" | "value-changed" | "config-changed" | "hass-more-info" | "ll-rebuild" | "location-changed">(node: HTMLElement | Window, type: HassEvent, detail?: HASSDomEvents[HassEvent], options?: {
bubbles?: boolean;
cancelable?: boolean;
composed?: boolean;
}) => Event;
7 changes: 7 additions & 0 deletions dist/handle-click.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { HomeAssistant, ActionConfig } from "./types";
export declare const handleClick: (node: HTMLElement, hass: HomeAssistant, config: {
entity?: string;
camera_image?: string;
hold_action?: ActionConfig;
tap_action?: ActionConfig;
}, hold: boolean) => void;
10 changes: 10 additions & 0 deletions dist/haptic.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Utility function that enables haptic feedback
*/
export declare type HapticType = "success" | "warning" | "failure" | "light" | "medium" | "heavy" | "selection";
declare global {
interface HASSDomEvents {
haptic: HapticType;
}
}
export declare const forwardHaptic: (el: HTMLElement, hapticType: HapticType) => void;
9 changes: 9 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export * from "./compute-domain";
export * from "./const";
export * from "./fire-event";
export * from "./handle-click";
export * from "./haptic";
export * from "./navigate";
export * from "./toggle-entity";
export * from "./turn-on-off-entity";
export * from "./types";
2 changes: 2 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 34fbd63

Please sign in to comment.