@hakit/components
Version:
A series of components to work with @hakit/core
47 lines • 2.8 kB
TypeScript
import { EntityName, FilterByDomain } from '@hakit/core';
import { CardBaseProps } from '../..';
import { MarqueeProps } from './Marquee';
import { Layout, VolumeLayout } from './constants';
type OmitProperties = "title" | "as" | "layout" | "entity" | "disabled" | "active" | "ref" | "disableActiveState" | "disableRipples" | "rippleProps";
type MediaPlayerString = FilterByDomain<EntityName, "media_player">;
export interface MediaPlayerCardProps extends Omit<CardBaseProps<"button", MediaPlayerString>, OmitProperties> {
/** the entity_id of the media_player to control */
entity: FilterByDomain<EntityName, "media_player">;
/** an optional override for the title of the entity */
title?: React.ReactNode;
/**
* if the entity supports grouping, you can provide the groupMembers as a list to join them together
* specify all the group members you want to group together, including the entity_id of the entity itself
*/
groupMembers?: FilterByDomain<EntityName, "media_player">[];
/** the layout of the card @default 'card' */
layout?: Layout;
/** properties to pass to the track title marquee element */
marqueeProps?: MarqueeProps;
/** the layout of the volume elements @default 'slider' */
volumeLayout?: VolumeLayout;
/** hide the mute button @default false */
hideMute?: boolean;
/** hide the app name eg YouTube @default false */
hideAppName?: boolean;
/** hide the entity friendly name @default false */
hideEntityName?: boolean;
/** disable the card manually if the internal disable functionality needs to be updated @default false */
disabled?: boolean;
/** hide the thumbnail element @default false */
hideThumbnail?: boolean;
/** hide the grouping button @default false */
hideGrouping?: boolean;
/** the size of the thumbnail to show @default 3rem */
thumbnailSize?: string;
/** show the artwork as the background of the card @default true */
showArtworkBackground?: boolean;
}
/** A MediaPlayerCard to control media similar to the mini-media-player from Hacs.
* - groups - if the player supports grouping, the popup for the media player will show group controls for related entities
* - group_members - if the group_members attribute is present on the primary entity, but the entity doesn't support grouping, you will only see volume controls in the popup for related entities
* - if you provide the groupMembers prop, but the entity doesn't support grouping at all, an error will be thrown
* It supports skip, previous, volume, mute, power, seeking, play, pause, grouping, artwork */
export declare function MediaPlayerCard(props: MediaPlayerCardProps): import("@emotion/react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map