Repository: capricorn86/happy-dom (ts)

Issue:
`document.links` is undefined
**Is your feature request related to a problem? Please describe.**
I'm using this API: https://developer.mozilla.org/en-US/docs/Web/API/Document/links
but it doesn't exist in happy-dom.

**Describe the solution you'd like**
Add `document.links`


Pull request description:
#896@minor: Add document.links.
close #896 

Patch:
diff --git a/packages/happy-dom/src/nodes/document/Document.ts b/packages/happy-dom/src/nodes/document/Document.ts
index 20840dc6..38a28276 100644
--- a/packages/happy-dom/src/nodes/document/Document.ts
+++ b/packages/happy-dom/src/nodes/document/Document.ts
@@ -258,6 +258,13 @@ export default class Document extends Node implements IDocument {
 		}
 	}
 
+	/**
+	 * Returns a collection of all area elements and a elements in a document with a value for the href attribute.
+	 */
+	public get links(): IHTMLCollection<IHTMLElement> {
+		return <IHTMLCollection<IHTMLElement>>this.querySelectorAll('a[href],area[href]');
+	}
+
 	/**
 	 * Last element child.
 	 *
diff --git a/packages/happy-dom/src/nodes/document/IDocument.ts b/packages/happy-dom/src/nodes/document/IDocument.ts
index 8dc3475e..73cf79aa 100644
--- a/packages/happy-dom/src/nodes/document/IDocument.ts
+++ b/packages/happy-dom/src/nodes/document/IDocument.ts
@@ -45,6 +45,7 @@ export default interface IDocument extends IParentNode {
 	readonly documentURI: string;
 	readonly visibilityState: VisibilityStateEnum;
 	readonly hidden: boolean;
+	readonly links: IHTMLCollection<IHTMLElement>;
 	cookie: string;
 	title: string;
 


Test patch:
diff --git a/packages/happy-dom/test/nodes/document/Document.test.ts b/packages/happy-dom/test/nodes/document/Document.test.ts
index eaaa3a1d..cba8c4d3 100644
--- a/packages/happy-dom/test/nodes/document/Document.test.ts
+++ b/packages/happy-dom/test/nodes/document/Document.test.ts
@@ -77,6 +77,28 @@ describe('Document', () => {
 		});
 	});
 
+	describe('get links()', () => {
+		it('Returns a elements.', () => {
+			const link1 = document.createElement('a');
+			const link2 = document.createElement('a');
+			link1.setAttribute('href', '');
+
+			document.body.appendChild(link1);
+			document.body.appendChild(link2);
+
+			let links = document.links;
+
+			expect(links.length).toBe(1);
+			expect(links[0]).toBe(link1);
+
+			link2.setAttribute('href', '');
+			links = document.links;
+			expect(links.length).toBe(2);
+			expect(links[0]).toBe(link1);
+			expect(links[1]).toBe(link2);
+		});
+	});
+
 	describe('get scripts()', () => {
 		it('Returns script elements.', () => {
 			const div = document.createElement('div');