import { Component } from "https://deno.land/x/docxml@2.4.2/src/classes/Component.ts";
Constructors
new
Component(props: PropsGeneric, ...children: ChildGeneric[])Type Parameters
optional
ChildGeneric extends AnyComponent | string = neverProperties
readonly
children: ChildGeneric[]The children given to this component instance.
readonly
props: PropsGenericThe props given to this component instance.
Methods
protected
childrenToNode(ancestry: Array<ComponentAncestor>): ComponentNode[]toNode(ancestry: Array<ComponentAncestor>): ComponentNodes
Create a DOM node for this XML component, one that can be stringified to schema-valid OOXML.
By default, an XML component would serialize to its children and string contents -- like a fragment. Most components have an override to use specific OOXML elememnts, such as <w:p>.
Static Properties
Informs the JSX pragma which child components are allowed in this component. The JSX pragma can use this to attempt repairs at invalidly nested children.
Informs the JSX pragma on wether or not this component can contain text (string) children. The JSX pragma can use this to attempt repairs at invalidly nested children.
Static Methods
fromNode(_node: Node): AnyComponent
matchesNode(_node: Node): boolean