UNPKG

@hakit/components

Version:
50 lines 2.36 kB
import { FilterByDomain, EntityName } from '@hakit/core'; import { HassEntity } from 'home-assistant-js-websocket'; import { CardBaseProps } from '../..'; export interface CalendarEvent { title: string; start: string; end?: string; backgroundColor?: string; borderColor?: string; calendar: string; eventData: CalendarEventData; } /** Data returned from the core APIs. */ export interface CalendarEventData { uid?: string; recurrence_id?: string; summary: string; dtstart: string; dtend: string; start?: string; end?: string; rrule?: string; description?: string; } export interface CalendarEventWithEntity extends CalendarEvent { entity: HassEntity; } type OmitProperties = "modalProps" | "onClick" | "children" | "active" | "as" | "title" | "disabled" | "entity" | "service" | "serviceData" | "ref" | "longPressCallback" | "disableRipples" | "disableScale" | "disableActiveState"; export interface CalendarCardProps extends Omit<CardBaseProps<"div", EntityName>, OmitProperties> { /** The names of your calendar entities */ entities: FilterByDomain<EntityName, "calendar">[]; /** if need be, you can provide a timezone to display time in a specific timezone */ timeZone?: string; /** the default rendered view @default "dayGridMonth" */ view?: "dayGridMonth" | "listWeek" | "dayGridDay"; /** disables the auto view switching based on the size of the card @default false */ disableAutoView?: boolean; /** disables the narrow class/styles from being added when the card is too small @default false */ disableNarrow?: boolean; /** include the header controls @default true */ includeHeader?: boolean; } /** * The CalendarCard is very similar to the home assistant calendar card, with the exception of not having delete/edit event functionality, the preview here contains only a month (the current month) of fake events to preview the functionality * * This component uses the REST API to retrieve events from home assistant, ensure you've followed the instructions [here](https://shannonhochkins.github.io/ha-component-kit/?path=/docs/core-hooks-usehass-hass-callapi--docs) * */ export declare function CalendarCard(props: CalendarCardProps): import("@emotion/react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=index.d.ts.map