import { makeStyles } from '@mui/styles'; import React from 'react'; import type { TypeAliasReferenceNode } from '../reference/index.js'; import MarkdownParser from '../tools/markdown/MarkdownParser.js'; import Type from './codeBuilders/Type.js'; interface TypeAliasHintProps { symbol: TypeAliasReferenceNode; } const useStyles = makeStyles( theme => ({ root: { position: 'relative', display: 'inline-block', fontWeight: 'normal', '&:hover > $hint': { display: 'block' } }, alias: { borderBottom: '1px dashed', cursor: 'help' }, hint: { position: 'absolute', display: 'none', top: '100%', left: '50%', zIndex: 1, transform: 'translateX(-50%)' }, toolTip: { position: 'relative', marginTop: 5, borderRadius: 3, padding: theme.spacing.unit, background: theme.colors.background.active, border: `1px solid ${theme.colors.border}`, textAlign: 'left', fontFamily: theme.fonts.default, width: 'min-content', minWidth: 250, '&::before, &::after': { content: '""', display: 'block', position: 'absolute', bottom: '100%', left: '50%', borderStyle: 'solid' }, '&::before': { marginLeft: -5, borderWidth: '0 5px 5px', borderColor: `transparent transparent ${theme.colors.border}` }, '&::after': { marginLeft: -4, borderWidth: '0 4px 4px', borderColor: `transparent transparent ${theme.colors.background.active}` }, '& code': { whiteSpace: 'pre-wrap', wordWrap: 'break-word' }, '& > :first-child': { marginTop: 0 }, '& > :last-child': { marginBottom: 0 } }, aliasedType: { fontFamily: theme.fonts.code } }), { name: 'TypeAliasHint' } ); const TypeAliasHint: React.FC = ({ symbol: { comment, name, type } }) => { const classes = useStyles(); return (
{name}
{comment?.shortText ? : null} {comment?.text ? : null}

Aliased type:{' '}

); }; export default TypeAliasHint;