interface.ts 983 B

123456789101112131415161718192021222324252627
  1. import React from 'react';
  2. import { PopoverProps } from '../popover';
  3. import { TooltipProps } from '../tooltip';
  4. import { ArrayElement } from '../_base/base';
  5. import { strings } from '@douyinfe/semi-foundation/typography/constants';
  6. export type EllipsisPos = 'end' | 'middle';
  7. export type ShowTooltip = {
  8. type?: string;
  9. opts?: Partial<PopoverProps> & Partial<TooltipProps>;
  10. };
  11. export type Ellipsis = {
  12. collapseText?: string;
  13. collapsible?: boolean;
  14. expandText?: string;
  15. expandable?: boolean;
  16. pos?: EllipsisPos;
  17. rows?: number;
  18. showTooltip?: boolean | ShowTooltip;
  19. suffix?: string;
  20. onExpand?: (expanded: boolean, event: React.MouseEvent<HTMLAnchorElement>) => void;
  21. };
  22. export type OmitTypographyProps = 'dangerouslySetInnerHTML';
  23. export type TypographyBaseType = ArrayElement<typeof strings.TYPE>;
  24. export type TypographyBaseSize = ArrayElement<typeof strings.SIZE>;
  25. export type TypographyBaseSpacing = ArrayElement<typeof strings.SPACING>;