Module

DOM.Classy.Node

Package
purescript-dom-classy
Repository
garyb/purescript-dom-classy

#IsNode Source

class IsNode n  where

A class for subtypes of Node.

Members

Instances

#nodeType Source

nodeType :: forall n. Partial => IsNode n => n -> NodeType

The type of a node.

#nodeTypeIndex Source

nodeTypeIndex :: forall n. IsNode n => n -> Int

The numeric value for the type of a node.

#nodeName Source

nodeName :: forall n. IsNode n => n -> String

For elements this is the tag name, for document types this is the doctype name, for processing instructions this is the target, for all other nodes it is a string like "#text", `"#comment", etc. depending on the node type.

#baseURI Source

baseURI :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) String

The node's base URL.

#ownerDocument Source

ownerDocument :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Document)

The document the node belongs to, unless the node is a document in which case the value is null.

#parentNode Source

parentNode :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Node)

The parent node of the node.

#parentElement Source

parentElement :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Element)

The parent element of the node.

#hasChildNodes Source

hasChildNodes :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) Boolean

Indicates whether the node has any child nodes.

#childNodes Source

childNodes :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) NodeList

The children of the node.

#firstChild Source

firstChild :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Node)

The first child of the node, or null if the node has no children.

#lastChild Source

lastChild :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Node)

The last child of the node, or null if the node has no children.

#previousSibling Source

previousSibling :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Node)

The previous sibling node, or null if there is no previous sibling.

#nextSibling Source

nextSibling :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) (Maybe Node)

The next sibling node, or null if there is no next sibling.

#nodeValue Source

nodeValue :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) String

If the node type is text, comment, or processing instruction this is the node's data, or null in all other cases.

#setNodeValue Source

setNodeValue :: forall n eff. IsNode n => String -> n -> Eff (dom :: DOM | eff) Unit

If the node type is text, comment, or processing instruction this allows the node's data to be changed, or has no effect in all other cases.

#textContent Source

textContent :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) String

If the node type is document fragment, element, text, processing instruction, or comment this is the node's data, or null in all other cases.

#setTextContent Source

setTextContent :: forall n eff. IsNode n => String -> n -> Eff (dom :: DOM | eff) Unit

If the node type is document fragment, element, text, processing instruction, or comment this allows the node's data to be changed, or has no effect in all other cases.

#normalize Source

normalize :: forall n eff. IsNode n => n -> Eff (dom :: DOM | eff) Unit

Removes empty text nodes and then combines any remaining text nodes that are contiguous.

#isEqualNode Source

isEqualNode :: forall n1 n2 eff. IsNode n1 => IsNode n2 => n1 -> n2 -> Eff (dom :: DOM | eff) Boolean

Checks whether two nodes are equivalent.

#compareDocumentPositionBits Source

compareDocumentPositionBits :: forall n1 n2 eff. IsNode n1 => IsNode n2 => n1 -> n2 -> Eff (dom :: DOM | eff) Int

Compares the position of two nodes in the document.

#contains Source

contains :: forall n1 n2 eff. IsNode n1 => IsNode n2 => n1 -> n2 -> Eff (dom :: DOM | eff) Boolean

Checks whether the second node is contained within the first

#lookupPrefix Source

lookupPrefix :: forall n eff. IsNode n => String -> n -> Eff (dom :: DOM | eff) (Maybe String)

#lookupNamespaceURI Source

lookupNamespaceURI :: forall n eff. IsNode n => String -> n -> Eff (dom :: DOM | eff) (Maybe String)

#isDefaultNamespace Source

isDefaultNamespace :: forall n eff. IsNode n => String -> n -> Eff (dom :: DOM | eff) Boolean

#insertBefore Source

insertBefore :: forall n1 n2 n3 eff. IsNode n1 => IsNode n2 => IsNode n3 => n1 -> n2 -> n3 -> Eff (dom :: DOM | eff) Node

Inserts the first node before the second as a child of the third node.

#appendChild Source

appendChild :: forall n1 n2 eff. IsNode n1 => IsNode n2 => n1 -> n2 -> Eff (dom :: DOM | eff) Node

Appends the first node to the child node list of the second node.

#replaceChild Source

replaceChild :: forall n1 n2 n3 eff. IsNode n1 => IsNode n2 => IsNode n3 => n1 -> n2 -> n3 -> Eff (dom :: DOM | eff) Node

Uses the first node as a replacement for the second node in the children of the third node.

#removeChild Source

removeChild :: forall n1 n2 eff. IsNode n1 => IsNode n2 => n1 -> n2 -> Eff (dom :: DOM | eff) Node

Removes the first node from the children of the second node.