UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

85 lines (70 loc) 2.04 kB
import * as React from 'react'; import { LinkBase } from './Link.base'; import { IStyle, ITheme } from '../../Styling'; import { IRefObject, IStyleFunctionOrObject } from '../../Utilities'; import { IKeytipProps } from '../../Keytip'; export interface ILink { /** Sets focus to the link. */ focus(): void; } export interface ILinkHTMLAttributes<T> extends React.HTMLAttributes<T> { // Shared type?: string; // Anchor download?: any; href?: string; hrefLang?: string; media?: string; rel?: string; target?: string; // Button autoFocus?: boolean; disabled?: boolean; form?: string; formAction?: string; formEncType?: string; formMethod?: string; formNoValidate?: boolean; formTarget?: string; name?: string; value?: string | string[] | number; // Any other props for HTMLElements or a React component passed to as= [index: string]: any; } export interface ILinkProps extends ILinkHTMLAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLElement | LinkBase> { /** * Optional callback to access the ILink interface. Use this instead of ref for accessing * the public methods and properties of the component. */ componentRef?: IRefObject<ILink>; /** * Whether the link is disabled */ disabled?: boolean; /** * Call to provide customized styling that will layer on top of the variant rules. */ styles?: IStyleFunctionOrObject<ILinkStyleProps, ILinkStyles>; /** * Theme (provided through customization.) */ theme?: ITheme; /** * A component that should be used as the root element of the link returned from the Link component. */ as?: string | React.ComponentClass | React.StatelessComponent; /** * Optional keytip for this Link */ keytipProps?: IKeytipProps; } export interface ILinkStyleProps { className?: string; isButton?: boolean; isDisabled?: boolean; theme: ITheme; } export interface ILinkStyles { root: IStyle; }