feat(ast): create Element interface

This commit is contained in:
Guz
2025-05-16 15:08:06 -03:00
parent 70b6491565
commit 5dc04d29d9

37
ipub/ast/ast.go Normal file
View File

@@ -0,0 +1,37 @@
package ast
import (
"encoding/xml"
"fmt"
"io"
"slices"
)
type Element interface {
Kind() ElementKind
NextSibling() Element
SetNextSibling(Element)
PreviousSibling() Element
SetPreviousSibling(Element)
Parent() Element
SetParent(Element)
HasChildren() bool
ChildCount() uint
FirstChild() Element
LastChild() Element
AppendChild(self, v Element)
RemoveChild(self, v Element)
RemoveChildren(self Element)
ReplaceChild(self, v1, insertee Element)
InsertBefore(self, v1, insertee Element)
InsertAfter(self, v1, insertee Element)
}