UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

38 lines (37 loc) 1.55 kB
/// <reference types="react" /> import { IComponentStyles, IHTMLSlot, ISlotProp, IComponent, IStyleableComponentProps } from '../../Foundation'; import { IFontStyles } from '../../Styling'; export declare type ITextComponent = IComponent<ITextProps, ITextTokens, ITextStyles>; export declare type ITextTokenReturnType = ReturnType<Extract<ITextComponent['tokens'], Function>>; export declare type ITextStylesReturnType = ReturnType<Extract<ITextComponent['styles'], Function>>; export declare type ITextSlot = ISlotProp<ITextProps, React.ReactNode>; export interface ITextSlots { root?: IHTMLSlot; } export interface ITextProps extends ITextSlots, IStyleableComponentProps<ITextProps, ITextTokens, ITextStyles>, React.HTMLAttributes<HTMLElement> { /** * Optionally render the component as another component type or primitive. */ as?: React.ReactType<React.HTMLAttributes<HTMLElement>>; /** * Optional font type for Text. */ variant?: keyof IFontStyles; /** * Whether the text is displayed as a block element. * * Note that in order for ellipsis on overflow to work properly, * `block` and `nowrap` should be set to true. */ block?: boolean; /** * Whether the text is not wrapped. * * Note that in order for ellipsis on overflow to work properly, * `block` and `nowrap` should be set to true. */ nowrap?: boolean; } export interface ITextTokens { } export declare type ITextStyles = IComponentStyles<ITextSlots>;