UNPKG

@enact/moonstone

Version:

Large-screen/TV support library for Enact, containing a variety of UI components.

57 lines (48 loc) 1.74 kB
// Type definitions for moonstone/Item import { SpottableProps as spotlight_Spottable_SpottableProps } from "@enact/spotlight/Spottable"; import { MarqueeDecoratorProps as moonstone_Marquee_MarqueeDecoratorProps } from "@enact/moonstone/Marquee"; import { SkinnableProps as moonstone_Skinnable_SkinnableProps } from "@enact/moonstone/Skinnable"; import { ItemBaseProps as ui_Item_ItemBaseProps } from "@enact/ui/Item"; import * as React from "react"; type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N; export interface ItemBaseProps extends ui_Item_ItemBaseProps { /** * Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component. * * The following classes are supported: * * `item` - The root class name */ css?: object; } /** * A Moonstone styled item without any behavior. */ export class ItemBase extends React.Component< Merge<React.HTMLProps<HTMLElement>, ItemBaseProps> > {} export interface ItemDecoratorProps extends Merge< Merge< spotlight_Spottable_SpottableProps, moonstone_Marquee_MarqueeDecoratorProps >, moonstone_Skinnable_SkinnableProps > {} export function ItemDecorator<P>( Component: React.ComponentType<P> | string, ): React.ComponentType<P & ItemDecoratorProps>; export interface ItemProps extends Merge<ItemBaseProps, ItemDecoratorProps> {} /** * A Moonstone styled item with built-in support for marqueed text, and Spotlight focus. * * Usage: * ``` <Item>Item Content</Item> ``` */ export class Item extends React.Component< Merge<React.HTMLProps<HTMLElement>, ItemProps> > {} export default Item;