site/node_modules/hast-util-to-html/lib/omission/omission.d.ts

17 lines
612 B
TypeScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
/**
* Factory to check if a given node can have a tag omitted.
*
* @param {Record<string, OmitHandle>} handlers
* Omission handlers, where each key is a tag name, and each value is the
* corresponding handler.
* @returns {OmitHandle}
* Whether to omit a tag of an element.
*/
export function omission(handlers: Record<string, OmitHandle>): OmitHandle;
export type Element = import('hast').Element;
export type Parents = import('hast').Parents;
/**
* Check if a tag can be omitted.
*/
export type OmitHandle = (element: Element, index: number | undefined, parent: Parents | undefined) => boolean;