import { type Component } from "https://deno.land/x/xml_renderer@5.0.7/mod.ts";
When creating an element rendering rule, an XPath test is matched to a Component. The rule component is expected to return null or a AstComponent -- which represents a node in the DOCX AST.
In the following example, the arrow function declaration is a rule component that returns the
Bold
docx component:
app.match('self::bold', ({ traverse }) => (
<Text bold>{traverse()}</Text>
));
definition: (props: Props<OutputGeneric, PropsGeneric>) => OutputGeneric