mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Add plugin types (#1527)
Covered following plugins - addAttributesToSVGElement.js - addClassesToSVGElement.js - cleanupAttrs.js - convertEllipseToCircle.js - removeAttributesBySelector.js - removeAttrs.js - removeComments.js - removeDesc.js - removeDoctype.js - removeElementsByAttr.js - removeEmptyText.js - removeMetadata.js - removeRasterImages.js - removeScriptElement.js - removeStyleElement.js - removeTitle.js - removeXMLProcInst.js
This commit is contained in:
@ -11,9 +11,7 @@ exports.description =
|
||||
/**
|
||||
* Remove arbitrary SVG elements by ID or className.
|
||||
*
|
||||
* @param id
|
||||
* examples:
|
||||
*
|
||||
* @example id
|
||||
* > single: remove element with ID of `elementID`
|
||||
* ---
|
||||
* removeElementsByAttr:
|
||||
@ -26,9 +24,7 @@ exports.description =
|
||||
* - 'elementID'
|
||||
* - 'anotherID'
|
||||
*
|
||||
* @param class
|
||||
* examples:
|
||||
*
|
||||
* @example class
|
||||
* > single: remove all elements with class of `elementClass`
|
||||
* ---
|
||||
* removeElementsByAttr:
|
||||
@ -42,6 +38,11 @@ exports.description =
|
||||
* - 'anotherClass'
|
||||
*
|
||||
* @author Eli Dupuis (@elidupuis)
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<{
|
||||
* id?: string | Array<string>,
|
||||
* class?: string | Array<string>
|
||||
* }>}
|
||||
*/
|
||||
exports.fn = (root, params) => {
|
||||
const ids =
|
||||
|
Reference in New Issue
Block a user