index.d.ts 663 B

12345678910111213141516171819202122
  1. import type { Declaration } from 'inline-style-parser';
  2. export { Declaration };
  3. export interface StyleObject {
  4. [name: string]: string;
  5. }
  6. type Iterator = (property: string, value: string, declaration: Declaration) => void;
  7. /**
  8. * Parses inline style to object.
  9. *
  10. * @param style - Inline style.
  11. * @param iterator - Iterator.
  12. * @returns - Style object or null.
  13. *
  14. * @example Parsing inline style to object:
  15. *
  16. * ```js
  17. * import parse from 'style-to-object';
  18. * parse('line-height: 42;'); // { 'line-height': '42' }
  19. * ```
  20. */
  21. export default function StyleToObject(style: string, iterator?: Iterator): StyleObject | null;
  22. //# sourceMappingURL=index.d.ts.map