# @types/dom4

> TypeScript definitions for dom4

Latest version **2.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/dom4
pnpm add @types/dom4
yarn add @types/dom4
bun add @types/dom4
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/dom4
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dom4
- npm.io page: https://npm.io/package/@types/dom4

## Recent versions

- 2.0.4 (latest) — 2023-11-07
- 2.0.2 (ts3.6) — 2021-07-09
- 2.0.1 (ts2.0) — 2018-08-06
- 2.0.3 — 2023-10-18
- 2.0.0 — 2018-01-25
- 1.5.20 — 2016-09-19
- 0.0.19 — 2016-08-31
- 0.0.18 — 2016-07-14
- 0.0.17-alpha — 2016-07-08
- 0.0.16-alpha — 2016-07-04
- 0.0.15-alpha — 2016-07-02
- 0.0.14-alpha — 2016-07-01
- 0.0.13-alpha — 2016-07-01
- 0.0.12-alpha — 2016-05-25
- 0.0.11-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/dom4/versions

## README

# Installation
> `npm install --save @types/dom4`

# Summary
This package contains type definitions for dom4 (https://github.com/WebReflection/dom4).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dom4.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dom4/index.d.ts)
````ts
/**
 * https://dom.spec.whatwg.org/#parentnode
 */
interface ParentNode {
    /**
     * Returns the child elements.
     */
    readonly children: HTMLCollection;

    /**
     * Inserts `nodes` after the last child of this node, while replacing strings with equivalent `Text` nodes.
     */
    append(...nodes: Array<Node | string>): void;

    /**
     * Inserts `nodes` before the first child of this node, while replacing strings with equivalent `Text` nodes.
     */
    prepend(...nodes: Array<Node | string>): void;
}

/**
 * https://dom.spec.whatwg.org/#childnode
 */
interface ChildNode {
    /**
     * Inserts `nodes` just after this node, while replacing strings with equivalent `Text` nodes.
     */
    after(...nodes: Array<Node | string>): void;

    /**
     * Inserts `nodes` just before this node, while replacing strings with equivalent `Text` nodes.
     */
    before(...nodes: Array<Node | string>): void;

    /**
     * Replaces this node with `nodes`, while replacing strings in nodes with equivalent Text nodes.
     */
    replaceWith(...nodes: Array<Node | string>): void;

    /**
     * Removes this node.
     */
    remove(): void;
}

interface Element extends ParentNode {
    /**
     * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
     */
    closest(selectors: string): Element | null;

    /**
     * Returns true if matching selectors against element’s root yields element, and false otherwise.
     */
    matches(selectors: string): boolean;
}

interface Elements extends ParentNode, Array<Element> {
}

interface Document extends ParentNode {
}

interface DocumentFragment extends ParentNode {
}

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: none

# Credits
These definitions were written by [Adi Dahiya](https://github.com/adidahiya), and [Gilad Gray](https://github.com/giladgray).

---
_Source: https://npm.io/package/@types/dom4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
