@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
44 lines (43 loc) • 1.6 kB
TypeScript
import React, { ReactNode } from 'react';
import PropTypes from 'prop-types';
import BaseComponent from '../_base/baseComponent';
import LinkFoundation, { LinkAdapter } from '@douyinfe/semi-foundation/lib/cjs/anchor/linkFoundation';
import { AnchorContextType } from './anchor-context';
export interface LinkProps {
href?: string;
title?: ReactNode;
className?: string;
children?: ReactNode;
style?: React.CSSProperties;
disabled?: boolean;
level?: number;
direction?: 'ltr' | 'rtl';
}
export default class Link extends BaseComponent<LinkProps, {}> {
static propTypes: {
href: PropTypes.Requireable<string>;
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
};
static defaultProps: {
href: string;
title: string;
className: string;
};
static contextType: React.Context<AnchorContextType>;
foundation: LinkFoundation;
context: AnchorContextType;
constructor(props: LinkProps);
get adapter(): LinkAdapter;
handleAddLink(): void;
handleRemoveLink(): void;
handleUpdateLink(href: string, prevHref: string): void;
handleClick(e: React.KeyboardEvent | React.MouseEvent): void;
componentDidMount(): void;
componentDidUpdate(prevProps: LinkProps): void;
componentWillUnmount(): void;
renderTitle: () => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element;
renderChildren: () => React.JSX.Element;
render(): React.JSX.Element;
}