Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Fix: DOM types (#172)
Browse files Browse the repository at this point in the history
Fixes:

- Node: A couple of type errors which were mistakenly introduced when excluding global DOM types

- Web: Node types were mistakenly being included by `tsconfig.web.json`, as well as `src/dom/index.ts` (which wasn't actually in use, it was a naive first attempt at setting up aliasing for each target's DOM implementation)
  • Loading branch information
eyelidlessness authored Mar 16, 2023
1 parent ef48622 commit 5e6892a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/dom/index.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/dom/node/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type { DOM } from '../abstract';
import { NodeTypes } from '../shared';
import { XPathResult } from './XPathResult';

type Node = typeof libxmljs.Node;

const { Document, Element } = libxmljs;

/** @package */
Expand Down
2 changes: 1 addition & 1 deletion src/dom/node/XPathResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class XPathResult implements DOM.XPathResult {
return this.results.length;
}

constructor(private results: Node[]) {}
constructor(private results: DOM.Node[]) {}

snapshotItem(index: number) {
return this.results[index];
Expand Down
1 change: 1 addition & 0 deletions tsconfig.web.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"exclude": [
"dist",
"node_modules",
"src/dom/node/*",
"./typings/env/node.d.ts",
"./typings/env/test.d.ts"
],
Expand Down

0 comments on commit 5e6892a

Please sign in to comment.