@@ -51,7 +51,7 @@ type Page struct {
5151 // Optional. Image URL of the page.
5252 ImageUrl string `json:"image_url"`
5353 // Optional. Content of the page.
54- Content string `json:"content"`
54+ Content [] Node `json:"content"`
5555 // Number of page views for the page.
5656 Views int64 `json:"views"`
5757 // Optional. Only returned if access_token passed. True, if the target Telegraph account can edit the page.
@@ -101,3 +101,21 @@ type PageViewsOpts struct {
101101 // If passed, the number of page views for the requested hour will be returned.
102102 Hour int64 `json:"hour"`
103103}
104+
105+ // Node is abstract object represents a DOM Node. It can be a String which represents a DOM text node or a
106+ // NodeElement object.
107+ type Node interface {}
108+
109+ // NodeElement represents a DOM element node.
110+ type NodeElement struct {
111+ // Name of the DOM element. Available tags: a, aside, b, blockquote, br, code, em, figcaption, figure,
112+ // h3, h4, hr, i, iframe, img, li, ol, p, pre, s, strong, u, ul, video.
113+ Tag string `json:"tag"`
114+
115+ // Attributes of the DOM element. Key of object represents name of attribute, value represents value
116+ // of attribute. Available attributes: href, src.
117+ Attrs map [string ]string `json:"attrs,omitempty"`
118+
119+ // List of child nodes for the DOM element.
120+ Children []Node `json:"children,omitempty"`
121+ }
0 commit comments