build.d.cts 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. import { IconifyIcon } from '@iconify/types';
  2. import { IconifyIconCustomisations } from '../customisations/defaults.cjs';
  3. import { SVGViewBox } from './viewbox.cjs';
  4. /**
  5. * Interface for getSVGData() result
  6. */
  7. interface IconifyIconBuildResult {
  8. attributes: {
  9. width?: string;
  10. height?: string;
  11. viewBox: string;
  12. };
  13. viewBox: SVGViewBox;
  14. body: string;
  15. }
  16. /**
  17. * Check if value should be unset. Allows multiple keywords
  18. */
  19. declare const isUnsetKeyword: (value: unknown) => value is "unset" | "undefined" | "none";
  20. /**
  21. * Get SVG attributes and content from icon + customisations
  22. *
  23. * Does not generate style to make it compatible with frameworks that use objects for style, such as React.
  24. * Instead, it generates 'inline' value. If true, rendering engine should add verticalAlign: -0.125em to icon.
  25. *
  26. * Customisations should be normalised by platform specific parser.
  27. * Result should be converted to <svg> by platform specific parser.
  28. * Use replaceIDs to generate unique IDs for body.
  29. */
  30. declare function iconToSVG(icon: IconifyIcon, customisations?: IconifyIconCustomisations): IconifyIconBuildResult;
  31. export { type IconifyIconBuildResult, iconToSVG, isUnsetKeyword };