parse.d.ts 775 B

1234567891011121314151617181920212223242526
  1. import { IconifyIcon } from '@iconify/types';
  2. import { IconifyIconBuildResult } from './build.js';
  3. import '../customisations/defaults.js';
  4. import './viewbox.js';
  5. /**
  6. * Parsed SVG content
  7. */
  8. interface ParsedSVGContent {
  9. attribs: Record<string, string>;
  10. body: string;
  11. }
  12. /**
  13. * Extract attributes and content from SVG
  14. */
  15. declare function parseSVGContent(content: string): ParsedSVGContent | undefined;
  16. /**
  17. * Convert parsed SVG to IconifyIconBuildResult
  18. */
  19. declare function buildParsedSVG(data: ParsedSVGContent): IconifyIconBuildResult | undefined;
  20. /**
  21. * Convert parsed SVG to IconifyIcon
  22. */
  23. declare function convertParsedSVG(data: ParsedSVGContent): IconifyIcon | undefined;
  24. export { type ParsedSVGContent, buildParsedSVG, convertParsedSVG, parseSVGContent };