1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function createElement(tagName) {
|
4 | return document.createElement(tagName);
|
5 | }
|
6 | function createElementNS(namespaceURI, qualifiedName) {
|
7 | return document.createElementNS(namespaceURI, qualifiedName);
|
8 | }
|
9 | function createTextNode(text) {
|
10 | return document.createTextNode(text);
|
11 | }
|
12 | function createComment(text) {
|
13 | return document.createComment(text);
|
14 | }
|
15 | function insertBefore(parentNode, newNode, referenceNode) {
|
16 | parentNode.insertBefore(newNode, referenceNode);
|
17 | }
|
18 | function removeChild(node, child) {
|
19 | node.removeChild(child);
|
20 | }
|
21 | function appendChild(node, child) {
|
22 | node.appendChild(child);
|
23 | }
|
24 | function parentNode(node) {
|
25 | return node.parentNode;
|
26 | }
|
27 | function nextSibling(node) {
|
28 | return node.nextSibling;
|
29 | }
|
30 | function tagName(elm) {
|
31 | return elm.tagName;
|
32 | }
|
33 | function setTextContent(node, text) {
|
34 | node.textContent = text;
|
35 | }
|
36 | function getTextContent(node) {
|
37 | return node.textContent;
|
38 | }
|
39 | function isElement(node) {
|
40 | return node.nodeType === 1;
|
41 | }
|
42 | function isText(node) {
|
43 | return node.nodeType === 3;
|
44 | }
|
45 | function isComment(node) {
|
46 | return node.nodeType === 8;
|
47 | }
|
48 | exports.htmlDomApi = {
|
49 | createElement: createElement,
|
50 | createElementNS: createElementNS,
|
51 | createTextNode: createTextNode,
|
52 | createComment: createComment,
|
53 | insertBefore: insertBefore,
|
54 | removeChild: removeChild,
|
55 | appendChild: appendChild,
|
56 | parentNode: parentNode,
|
57 | nextSibling: nextSibling,
|
58 | tagName: tagName,
|
59 | setTextContent: setTextContent,
|
60 | getTextContent: getTextContent,
|
61 | isElement: isElement,
|
62 | isText: isText,
|
63 | isComment: isComment,
|
64 | };
|
65 | exports.default = exports.htmlDomApi;
|
66 |
|
\ | No newline at end of file |