### Import Example Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native Example of how to import the Deno DOM API with the native binary backend. ```APIDOC ```typescript import * as This_module_exposes_the_Deno_DOM_API_with_the_native_binary_backend__Unlike_the_WASM_backend_the_native_backend_requires_more_permissions_due_to_the_nature_of_how_native_bindings_work__They_include________unstable_ffi_______allow_ffi_______allow_env_______allow_read_______allow_net_deno_land__ from "@b-fuze/deno-dom/native"; ``` Or using a JSR specifier: ```typescript import * as This_module_exposes_the_Deno_DOM_API_with_the_native_binary_backend__Unlike_the_WASM_backend_the_native_backend_requires_more_permissions_due_to_the_nature_of_how_native_bindings_work__They_include________unstable_ffi_______allow_ffi_______allow_env_______allow_read_______allow_net_deno_land__ from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Install @b-fuze/deno-dom Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/wasm-noinit/~/DOMParser.prototype Use this command to add the package to your project. This is the initial setup step before importing any symbols. ```bash deno add jsr:@b-fu-fuze/deno-dom ``` -------------------------------- ### Deno DOM Initialization Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.48/all_symbols?full= Example demonstrating how to initialize and use Deno DOM for parsing HTML. ```APIDOC ## Example: Deno DOM Initialization and Usage ### Description This example shows how to import `DOMParser` and `initParser`, initialize the parser, and then use `parseFromString` to parse HTML content. It further demonstrates querying the parsed document using `querySelector`. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser await initParser(); // Create a DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query the document const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Deno DOM Initialization and Usage Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/all_symbols?full= Example demonstrating how to initialize Deno DOM and use the DOMParser to parse HTML and query elements. ```APIDOC ## Example: Deno DOM Initialization and Usage ### Description This example shows how to import and initialize Deno DOM, then use `DOMParser` to parse an HTML string and `querySelector` to find an element. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser await initParser(); // Create a DOMParser instance const parser = new DOMParser(); // Parse an HTML string const doc = parser.parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query for an element const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Example Usage Source: https://jsr.io/%40b-fuze/deno-dom/doc/all_symbols Demonstrates how to initialize and use the DOMParser from deno-dom. ```APIDOC ## Example 1: Basic DOM Parsing ### Description This example shows how to import and initialize the `DOMParser` and `initParser` from `jsr:@b-fuze/deno-dom/native`, and then use it to parse an HTML string and query elements. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser (required for Deno DOM) await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query elements from the parsed document const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Wasm Noinit Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.50...0.1.56/all_symbols?full= Example demonstrating the initialization and usage of Deno DOM's WASM-based parser. ```APIDOC ### Example: Wasm Noinit ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // Initialize the parser await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Use DOM methods const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` ``` -------------------------------- ### Native DOMParser Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.49...0.1.56/all_symbols?full= Example demonstrating how to use the native DOMParser in Deno, including initialization and parsing HTML. ```APIDOC ## Example: Native DOMParser Usage ### Description This example shows how to import and use the native `DOMParser` from `@b-fuze/deno-dom/native`. It includes the necessary initialization step and demonstrates parsing an HTML string and querying the resulting document. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser before use await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query the document for a paragraph element const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Wasm Noinit Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/all_symbols?full= Example demonstrating the initialization and usage of Deno DOM with the wasm-noinit module for parsing HTML. ```APIDOC ## Example: Wasm Noinit ### Description This example shows how to initialize and use the Deno DOM parser from the `wasm-noinit` module. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // Initialize the parser await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query for an element and log its text content const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### DOMParser Example Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/all_symbols?full= Example demonstrating how to use DOMParser to parse an HTML string and query elements. ```APIDOC ## Example: Parsing HTML with DOMParser ### Description This example shows how to create a `DOMParser` instance, parse an HTML string, and then use `querySelector` to find and log the text content of a paragraph element. ### Code ```typescript import { DOMParser, Element } from "jsr:@b-fuze/deno-dom"; const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` ``` -------------------------------- ### Deno DOM Initialization and Usage Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.47/all_symbols?full= Example demonstrating how to initialize and use the Deno DOM parser. ```APIDOC ## Example: Deno DOM Initialization and Usage ### Description This example shows how to import, initialize, and use the `DOMParser` from Deno DOM, including parsing HTML and querying elements. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // Initialize the parser await initParser(); // Create a new DOMParser instance const parser = new DOMParser(); // Parse an HTML string const htmlString = `

Hello World!

Hello from Deno!

`; const doc = parser.parseFromString(htmlString, "text/html"); // Query elements from the parsed document const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Importing nodesFromString Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native/~/nodesFromString Examples of how to import the nodesFromString function into your project. ```APIDOC ```typescript import { nodesFromString } from "@b-fuze/deno-dom/native"; ``` or ```typescript import { nodesFromString } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Importing DocumentType Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/DocumentType.prototype Examples of how to import the DocumentType class into your project. ```APIDOC ```typescript import { DocumentType } from "@b-fuze/deno-dom/native"; ``` or ```typescript import { DocumentType } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Importing Attr Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native/~/Attr Examples of how to import the Attr symbol into your project. ```typescript import { Attr } from "@b-fuze/deno-dom/native"; ``` ```typescript import { Attr } from "jsr:@b-fuze/deno-dom/native"; ``` -------------------------------- ### Build Script Example Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/plugin/build.rs This snippet shows a basic build script using static_vcruntime::metabuild(). ```rust fn main() { static_vcruntime::metabuild(); } ``` -------------------------------- ### Import deno-dom with Namespace Source: https://jsr.io/%40b-fuze/deno-dom%400.1.55 Example of importing the deno-dom library using a namespace. ```typescript import * as deno_dom from "@b-fuze/deno-dom"; ``` -------------------------------- ### Example Usage Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.55/all_symbols?full= Demonstrates how to initialize and use the Deno DOM parser to parse HTML and query elements. ```APIDOC ## Example 1: Basic DOM Parsing ### Description This example shows how to import, initialize, and use the `DOMParser` to parse an HTML string and then query elements using `querySelector`. ### Code ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser (required for Deno DOM) await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query for a paragraph element and log its text content const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` ``` -------------------------------- ### Importing Comment Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/Comment.prototype Examples of how to import the Comment class into your Deno project. ```APIDOC ```typescript import { Comment } from "@b-fuze/deno-dom"; ``` or ```typescript import { Comment } from "jsr:@b-fuze/deno-dom"; ``` ``` -------------------------------- ### Example 1: Basic DOM Parsing and Querying Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.51...0.1.56/all_symbols?full= Demonstrates how to initialize the Deno DOM parser, parse an HTML string, and query elements using `querySelector`. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // Initialize the parser await initParser(); // Parse an HTML string const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query an element and log its text content const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` -------------------------------- ### Import VisibilityState Source: https://jsr.io/%40b-fuze/deno-dom/doc/wasm-legacy/~/VisibilityState Examples of how to import the VisibilityState type alias into your Deno project. ```typescript import { type VisibilityState } from "@b-fuze/deno-dom/wasm-legacy"; ``` ```typescript import { type VisibilityState } from "jsr:@b-fuze/deno-dom/wasm-legacy"; ``` -------------------------------- ### Example 1: Basic DOM Parsing and Querying Source: https://jsr.io/%40b-fuze/deno-dom/doc/all_symbols Demonstrates how to initialize the WASM parser, parse an HTML string, and query elements using `querySelector`. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // Initialize the parser await initParser(); // Parse an HTML string const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query for an element and log its text content const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` -------------------------------- ### Example 1: DOMParser Initialization and Usage Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.54...0.1.56/all_symbols?full= Demonstrates how to initialize the WASM-based DOMParser and use it to parse an HTML string and query elements. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // Initialize the parser await initParser(); // Create a new DOMParser instance const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); // Query for an element and log its text content const p = doc.querySelector("p")!; console.log(p.textContent); // Output: "Hello from Deno!" ``` -------------------------------- ### Import VisibilityState Source: https://jsr.io/%40b-fuze/deno-dom/doc/wasm-noinit/~/VisibilityState Example of how to import the VisibilityState type alias from the @b-fuze/deno-dom package. ```typescript import { type VisibilityState } from "@b-fuze/deno-dom/wasm-noinit"; ``` -------------------------------- ### HTML Serialization Example Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/core/src/rcdom.rs Shows how the text-based DOM structure is serialized into an HTML string. ```html
text node
``` -------------------------------- ### Importing nodesAndTextNodes Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/nodesAndTextNodes Examples of how to import the nodesAndTextNodes function from the @b-fuze/deno-dom package. ```APIDOC ```typescript import { nodesAndTextNodes } from "@b-fuze/deno-dom/native"; ``` or ```typescript import { nodesAndTextNodes } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Initialize and Use DOMParser Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.49/wasm-noinit?full= Ensure the parser is initialized before use. This example demonstrates parsing an HTML string and querying elements. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // ...and when you need Deno DOM's parser make sure you initialize it... await initParser(); // Then you can use Deno DOM as you would normally const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` -------------------------------- ### Importing CharacterData Source: https://jsr.io/%40b-fuze/deno-dom/doc/~/CharacterData Examples of how to import the CharacterData symbol from the @b-fuze/deno-dom package. ```APIDOC ```typescript import { CharacterData } from "@b-fuze/deno-dom"; ``` ``` ```APIDOC ```typescript import { CharacterData } from "jsr:@b-fuze/deno-dom"; ``` ``` -------------------------------- ### Importing VisibilityState Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/VisibilityState Examples of how to import the VisibilityState type alias into your Deno or Node.js project. ```APIDOC ## Import Example ### Using deno add ```typescript import { type VisibilityState } from "@b-fuze/deno-dom"; ``` ### Using JSR Specifier ```typescript import { type VisibilityState } from "jsr:@b-fuze/deno-dom"; ``` ``` -------------------------------- ### Importing NodeList Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native/~/NodeList Examples of how to import the NodeList symbol from the @b-fuze/deno-dom package using different import syntaxes. ```APIDOC ## Import Symbol ```typescript import { NodeList } from "@b-fuze/deno-dom/native"; ``` or Import directly with a jsr specifier ```typescript import { NodeList } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Import VisibilityState Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/wasm-noinit/~/VisibilityState Examples of how to import the VisibilityState type alias into your project using deno add or directly with a JSR specifier. ```APIDOC Import symbol ```typescript import { type VisibilityState } from "@b-fuze/deno-dom/wasm-noinit"; ``` or Import directly with a jsr specifier ```typescript import { type VisibilityState } from "jsr:@b-fuze/deno-dom/wasm-noinit"; ``` ``` -------------------------------- ### Text Node Example Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/core/src/rcdom.rs Illustrates the serialization of a simple DOM structure containing a text node. ```text div +- "text node" +- span ``` -------------------------------- ### DocumentType.name Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the name of the document type. ```APIDOC ## DocumentType.name ### Description Returns the name of the document type (e.g., 'html'). ### Method DocumentType.name(): string ``` -------------------------------- ### Document.title Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets or sets the title of the document. ```APIDOC ## Document.title ### Description Gets or sets the title of the document. ### Method Document.title(): string (getter) or void (setter) ### Response - **Success Response (getter)**: Returns the document's title. - **Success Response (setter)**: Sets the document's title. ``` -------------------------------- ### Build Native Plugin with Make Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/README.md Execute this command to build the native Deno plugin for the Deno DOM project. ```bash make plugin ``` -------------------------------- ### Importing CharacterData Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native/~/CharacterData Examples of how to import the CharacterData symbol from the @b-fuze/deno-dom package using different import methods. ```APIDOC ```typescript import { CharacterData } from "@b-fuze/deno-dom/native"; ``` ``` ```APIDOC ```typescript import { CharacterData } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Deno DOM Worker Setup Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/test/wpt-runner-worker.ts This script sets up a Deno worker to parse HTML and execute JavaScript using the deno-dom library. It configures the worker's global scope to mimic a browser environment and handles messages for test setup. ```typescript /// type TestSetupEvent = { data: { backend: "wasm" | "native"; html: string; scripts: string[]; }; }; addEventListener("message", async (event) => { const { data: { backend, html, scripts } } = event as any as TestSetupEvent; const denoDom = await import("../deno-dom-" + backend + ".ts"); const { DOMParser, Comment } = denoDom; (self as any).window = self; (self as any).parent = self; Object.defineProperty(self, "location", { value: { href: import.meta.url, pathname: import.meta.url, protocol: "file:", host: "testmachine", hostname: "testmachine", port: "", search: "", hash: "", origin: "", }, }); const doc = new DOMParser().parseFromString(html, "text/html")!; (self as any).window.document = doc; for (const item of Object.keys(denoDom)) { (self as any)[item] = denoDom[item]; } // Assign anything with an ID to `window` for (const element of doc.querySelectorAll("[id]")) { const id = element.getAttribute("id"); if (!(id in self)) { (self as any)[id] = element; } } // Run scripts new Function(scripts.join("\n\n"))(); // Add fake XML document implementation to skip XML doc tests doc.implementation.createDocument = function ( ns: any, qualifiedName: any, documentType: any, ) { const newDoc = doc.implementation.createHTMLDocument(); // Return comments instead of PI's newDoc.createProcessingInstruction = function (...args: any[]) { return new Comment(args[0]); }; }; postMessage({ success: true, }); }); ``` -------------------------------- ### DocumentType.systemId Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the system identifier of the document type. ```APIDOC ## DocumentType.systemId ### Description Returns the system identifier of the document type. ### Method DocumentType.systemId(): string ``` -------------------------------- ### DocumentType.publicId Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the public identifier of the document type. ```APIDOC ## DocumentType.publicId ### Description Returns the public identifier of the document type. ### Method DocumentType.publicId(): string ``` -------------------------------- ### Document.cookie Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets or sets the cookie associated with the document. ```APIDOC ## Document.cookie ### Description Gets or sets the document's cookie. ### Method Document.cookie(): string (getter) or void (setter) ### Response - **Success Response (getter)**: Returns the document's cookies as a string. - **Success Response (setter)**: Sets the document's cookies. ``` -------------------------------- ### Setup and Test Execution for WPT Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/test/wpt.ts This code configures and runs Web Platform Tests (WPT) for the deno-dom package. It uses Deno's file system utilities to find test files and filters them based on inclusion and exclusion regular expressions. The tests are only executed if the '-w' or '--wpt' command-line arguments are provided. ```typescript import { walkSync } from "jsr:@std/fs@^1"; import { dirname, fromFileUrl, join, } from "https://deno.land/std@0.75.0/path/mod.ts"; import { run } from "./wpt-runner.ts"; import type { Backend } from "./wpt-runner.ts"; const wptDirRoot = join(dirname(fromFileUrl(import.meta.url)), "../wpt"); const wptNodeTests = wptDirRoot + "/dom/nodes"; const wptTraversalTests = wptDirRoot + "/dom/traversal"; const wptCollectionTests = wptDirRoot + "/dom/collections"; const include = new RegExp([ "ChildNode-", "Document-", "Comment-", "Element-", "getElementsByClassName-", "Node-", "ParentNode-", "Text-", ].join("|")); const exclude = new RegExp([ "-namespace", "TreeWalker", "ProcessingInstruction", "CDATA", // TODO: maybe implement CDATA support "createEvent", "nodes/Node-cloneNode-on-inactive-document-crash", // Tests iframe which won't be implemented "nodes/DOMImplementation-createHTMLDocument-with-null-browsing-context-crash", // Uses iframe ].join("|")); export function test(backend: Backend) { // WPT tests are only explicitly run if (!Deno.args.find((arg) => ["-w", "--wpt"].includes(arg))) { return; } const testFiles: string[] = []; const limit = Infinity; let count = 0; for (const testDir of [wptNodeTests]) { for (const entry of walkSync(testDir)) { const { path } = entry; if (path.endsWith(".html") && include.test(path) && !exclude.test(path)) { testFiles.push(path); count++; if (count === limit) { break; } } } } for (const test of testFiles) { const name = test .replace(/.+dom\//, "") .replace(".html", "") .replace(/\s+/g, " "); Deno.test(name, async () => { await run(test, wptDirRoot, backend); }); } } ``` -------------------------------- ### Build All Components with Make Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/README.md This command builds the WASM library, native plugin, and CLI tool for the Deno DOM project. ```bash make ``` -------------------------------- ### Initialize and Use Deno DOM Native Parser Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/deno-dom-native.ts Import and initialize the native DOM parser. Ensure you have the required permissions set for the native binary backend. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/native"; // ...and when you need Deno DOM make sure you initialize the parser... await initParser(); // Then you can use Deno DOM as you would normally const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` -------------------------------- ### Access children Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/DocumentFragment.prototype Get an HTMLCollection of the direct children of a DocumentFragment. ```typescript documentFragment.children ``` -------------------------------- ### initParser Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.48...0.1.56/all_symbols?full= Initializes the parser. No documentation available. ```APIDOC ## initParser(): Promise ### Description Initializes the parser. ### Parameters None ### Returns Promise ``` -------------------------------- ### Importing a Node Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/wasm-legacy/~/Document.prototype.importNode?full= This example demonstrates how to import a node from one document to another. The `deep` parameter controls whether child nodes are also imported. ```typescript const importedNode = document.importNode(node, deep); ``` -------------------------------- ### Comment.textContent Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets or sets the text content of the comment node. ```APIDOC ## Comment.textContent ### Description Gets or sets the text content of the comment node. ### Method Comment.textContent(): string (getter) or void (setter) ### Response - **Success Response (getter)**: Returns the text content of the comment. - **Success Response (setter)**: Sets the text content of the comment. ``` -------------------------------- ### Text.textContent Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets or sets the text content of the text node. ```APIDOC ## Text.textContent ### Description Gets or sets the text content of the text node. ### Method Text.textContent(): string (getter) or void (setter) ### Response - **Success Response (getter)**: Returns the text content of the node. - **Success Response (setter)**: Sets the text content of the node. ``` -------------------------------- ### Build CLI Tool with Make Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/README.md Run this command to build the Command Line Interface (CLI) tool for testing the Deno DOM parser output. ```bash make cli ``` -------------------------------- ### Importing ElementCreationOptions Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/ElementCreationOptions.is Demonstrates how to import the ElementCreationOptions type from the @b-fuze/deno-dom package. ```typescript import { type ElementCreationOptions } from "@b-fuze/deno-dom"; ``` ```typescript import { type ElementCreationOptions } from "jsr:@b-fuze/deno-dom"; ``` -------------------------------- ### previousSibling Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/node.ts Gets the node immediately preceding the current node, if any. ```APIDOC ## previousSibling ### Description Gets the node immediately preceding the current node, if any. ### Property Signature `get previousSibling(): Node | null` ### Returns - (Node | null) - The previous sibling node, or `null` if there is no previous sibling. ``` -------------------------------- ### nextSibling Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/node.ts Gets the node immediately following the current node, if any. ```APIDOC ## nextSibling ### Description Gets the node immediately following the current node, if any. ### Property Signature `get nextSibling(): Node | null` ### Returns - (Node | null) - The next sibling node, or `null` if there is no next sibling. ``` -------------------------------- ### Importing ElementCreationOptions Source: https://jsr.io/%40b-fuze/deno-dom/doc/wasm-noinit/~/ElementCreationOptions.is Demonstrates how to import the ElementCreationOptions type from the deno-dom library. ```APIDOC ```typescript import { type ElementCreationOptions } from "@b-fuze/deno-dom/wasm-noinit"; ``` or ```typescript import { type ElementCreationOptions } from "jsr:@b-fuze/deno-dom/wasm-noinit"; ``` ``` -------------------------------- ### Build WASM lib with Make Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/html-parser/README.md Use this command to build the WebAssembly (WASM) library for the Deno DOM project. ```bash make wasm ``` -------------------------------- ### Access childElementCount Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/DocumentFragment.prototype Get the number of child elements within a DocumentFragment. ```typescript documentFragment.childElementCount ``` -------------------------------- ### Document Class Initialization - deno-dom Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/document.ts Initializes a new Document instance. Sets up the DOM implementation and default properties like documentURI. ```typescript constructor() { super( "#document", NodeType.DOCUMENT_NODE, null, CTOR_KEY, ); this.implementation = new DOMImplementation(CTOR_KEY); } ``` -------------------------------- ### HTMLTemplateElement.outerHTML Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the HTML markup of the template element, including its content. ```APIDOC ## HTMLTemplateElement.outerHTML ### Description Gets the HTML markup of the template element, including its content and itself. ### Method HTMLTemplateElement.outerHTML(): string ``` -------------------------------- ### HTMLTemplateElement.innerHTML Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the HTML markup of the template element's content. ```APIDOC ## HTMLTemplateElement.innerHTML ### Description Gets the HTML markup of the template element's content. ### Method HTMLTemplateElement.innerHTML(): string ``` -------------------------------- ### Initialize and Use Deno DOM Parser Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/deno-dom-wasm-noinit.ts Import `DOMParser` and `initParser`. Call `await initParser()` before using `DOMParser` to parse HTML strings. This example demonstrates parsing an HTML string and accessing an element's text content. ```typescript import { DOMParser, initParser } from "jsr:@b-fuze/deno-dom/wasm-noinit"; // ...and when you need Deno DOM's parser make sure you initialize it... await initParser(); // Then you can use Deno DOM as you would normally const doc = new DOMParser().parseFromString( `

Hello World!

Hello from Deno!

`, "text/html", ); const p = doc.querySelector("p")!; console.log(p.textContent); // "Hello from Deno!" ``` -------------------------------- ### Document.hidden Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets a boolean value indicating whether the document is in the background. ```APIDOC ## Document.hidden ### Description Returns a boolean value indicating whether the document is in the background or the tab is inactive. ### Method Document.hidden(): boolean ``` -------------------------------- ### DOMImplementation Constructor Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.52/native/~/DOMImplementation?full= Initializes a new instance of the DOMImplementation class. Requires a specific key for instantiation. ```APIDOC ## new DOMImplementation(key: CTOR_KEY) ### Description Constructs a new DOMImplementation object. The `key` parameter is a special internal key required for instantiation, ensuring it's called correctly. ### Parameters * **key** (CTOR_KEY) - Required - A constructor key to ensure proper instantiation. ``` -------------------------------- ### Document.documentURI Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/all_symbols Gets the document's Uniform Resource Identifier (URI). ```APIDOC ## Document.documentURI ### Description Returns the document's Uniform Resource Identifier (URI). ### Method Document.documentURI(): string ``` -------------------------------- ### textContent Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/wasm-noinit/~/Text.prototype?full= Gets or sets the text content of the Text node. ```APIDOC ## textContent: string ### Description Represents the text content of the node. This property is read-only. ### Property Type string ``` -------------------------------- ### Document Constructor Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.46/wasm-noinit/~/Document?full= Initializes a new instance of the Document class. ```APIDOC ## new Document() ### Description Creates a new Document object. ### Method `new Document()` ``` -------------------------------- ### textContent Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/wasm-noinit/~/Comment.prototype?full= Gets or sets the text content of the comment node. ```APIDOC ## textContent ### Description Represents the text content of the comment node. This property is inherited from the CharacterData interface. ### Type string ``` -------------------------------- ### Importing nodesFromString Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/nodesFromString Demonstrates how to import the nodesFromString function from the @b-fuze/deno-dom library. ```typescript import { nodesFromString } from "@b-fuze/deno-dom/native"; ``` ```typescript import { nodesFromString } from "jsr:@b-fuze/deno-dom/native"; ``` -------------------------------- ### Importing NodeList Source: https://jsr.io/%40b-fuze/deno-dom/doc/wasm-noinit/~/NodeList Instructions on how to import the NodeList type into your Deno project. ```APIDOC ## Import Symbol ```typescript import { NodeList } from "@b-fuze/deno-dom/wasm-noinit"; ``` or ## Import directly with a jsr specifier ```typescript import { NodeList } from "jsr:@b-fuze/deno-dom/wasm-noinit"; ``` ``` -------------------------------- ### DocumentType SystemId Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.48/native/~/DocumentType?full= Gets the system identifier of the document type, if specified. ```typescript readonly `systemId`: string ``` -------------------------------- ### DOMImplementation Constructor Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/wasm-noinit/~/DOMImplementation?full= Initializes a new instance of the DOMImplementation class. Requires a specific constructor key for instantiation. ```APIDOC ## new DOMImplementation(key: CTOR_KEY) ### Description Initializes a new instance of the DOMImplementation class. ### Parameters * **key** (CTOR_KEY) - Required - The constructor key required for instantiation. ``` -------------------------------- ### DocumentType PublicId Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.48/native/~/DocumentType?full= Gets the public identifier of the document type, if specified. ```typescript readonly `publicId`: string ``` -------------------------------- ### NamedNodeMap Get Attribute Value Method Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/~/NamedNodeMap?full= Retrieves the value of a specified attribute. ```typescript [getNamedNodeMapValueSym](attribute: string): string | undefined ``` -------------------------------- ### Run WPT tests for deno-dom (WASM) Source: https://jsr.io/%40b-fuze/deno-dom?full= Run Web Platform Tests (WPT) for the WASM backend by first updating the submodule and then appending '-- --wpt' to the test command. ```bash git submodule update --progress --depth 1 deno test --allow-read --allow-net wasm.test.ts -- --wpt ``` -------------------------------- ### Attribute Node Operations Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/element.ts Methods for getting and setting attribute nodes on an element. ```APIDOC ## getAttributeNode(rawName: string): Attr | null ### Description Retrieves an attribute node by its name. ### Method `getAttributeNode` ### Parameters #### Path Parameters - **rawName** (string) - The name of the attribute to retrieve. ### Response #### Success Response (Attr | null) - Returns the `Attr` node if found, otherwise `null`. ``` ```APIDOC ## setAttributeNode(attr: Attr): Attr | null ### Description Sets an attribute node on the element. If an attribute with the same name already exists, it is removed and the old attribute is returned. ### Method `setAttributeNode` ### Parameters #### Path Parameters - **attr** (Attr) - The `Attr` node to set. ### Request Body - **attr** (Attr) - Required - The `Attr` node to set. ### Response #### Success Response (Attr | null) - Returns the old `Attr` node if it existed, otherwise `null`. ### Errors - **TypeError**: If the provided argument does not implement the `Attr` interface. ``` -------------------------------- ### Run Native Tests Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/README.md Execute native backend tests using the deno test command with unstable and all permissions flags. Note that '-A' grants broad permissions. ```sh deno test --unstable -A native.test.ts ``` -------------------------------- ### Access lastElementChild Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/DocumentFragment.prototype Get the last child element of a DocumentFragment, or null if it has no child elements. ```typescript documentFragment.lastElementChild ``` -------------------------------- ### Importing Element Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/Element Instructions on how to import the Element symbol into your Deno project. ```APIDOC ```typescript import { Element } from "@b-fuze/deno-dom"; ``` or ```typescript import { Element } from "jsr:@b-fuze/deno-dom"; ``` ``` -------------------------------- ### Access firstElementChild Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/DocumentFragment.prototype Get the first child element of a DocumentFragment, or null if it has no child elements. ```typescript documentFragment.firstElementChild ``` -------------------------------- ### textContent Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/native/~/Text.prototype Gets or sets the text content of the Text node. This is a read-only property. ```APIDOC ## textContent: string ### Description Gets the text content of the Text node. This is a read-only property. ### Properties - **textContent** (string) - The text content of the node. ``` -------------------------------- ### initParser Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/wasm-noinit/~/initParser?full= Initializes the parser. This function returns a Promise that resolves when the parser is ready. ```APIDOC ## initParser ### Description Initializes the parser. This function returns a Promise that resolves when the parser is ready. ### Signature `initParser(): Promise` ### Return Type `Promise` ``` -------------------------------- ### NamedNodeMap Get Attribute Node Method Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/~/NamedNodeMap?full= Retrieves an Attr node by its attribute name. ```typescript [getNamedNodeMapAttrNodeSym](attribute: string): Attr ``` -------------------------------- ### Importing NamespaceURI Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/NamespaceURI Demonstrates how to import the NamespaceURI type alias into your Deno project. ```APIDOC import { type NamespaceURI } from "@b-fuze/deno-dom"; ``` ```APIDOC import { type NamespaceURI } from "jsr:@b-fuze/deno-dom"; ``` -------------------------------- ### UninitializedDOMTokenList.length Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/element.ts Gets the number of tokens in the list. Returns 0 if the list is not yet initialized. ```APIDOC ## length ### Description Gets the number of tokens in the list. Returns 0 if the list is not yet initialized. ### Property Type `number` ``` -------------------------------- ### DOMImplementation Constructor Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/native/~/DOMImplementation?full= Initializes a new instance of the DOMImplementation class. Requires a CTOR_KEY for instantiation. ```APIDOC ## new DOMImplementation(key: CTOR_KEY) ### Description Initializes a new instance of the DOMImplementation class. ### Parameters * **key** (CTOR_KEY) - Required - The key required for constructor invocation. ``` -------------------------------- ### DOMImplementation Constructor Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.46/native/~/DOMImplementation?full= Initializes a new instance of the DOMImplementation class. ```APIDOC ## new DOMImplementation(key: CTOR_KEY) ### Description Initializes a new instance of the DOMImplementation class. ### Parameters - **key** (CTOR_KEY) - Required - The key used for constructor invocation. ``` -------------------------------- ### Importing DocumentType Source: https://jsr.io/%40b-fuze/deno-dom/doc/wasm-noinit/~/DocumentType.prototype Demonstrates how to import the DocumentType class from the @b-fuze/deno-dom library using both the deno add command and direct import statements. ```bash deno add jsr:@b-fuze/deno-dom ``` ```typescript import { DocumentType } from "@b-fuze/deno-dom/wasm-noinit"; ``` ```typescript import { DocumentType } from "jsr:@b-fuze/deno-dom/wasm-noinit"; ``` -------------------------------- ### Importing VisibilityState Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/VisibilityState Demonstrates how to import the VisibilityState type alias from the @b-fuze/deno-dom package. ```typescript import { type VisibilityState } from "@b-fuze/deno-dom/native"; ``` ```typescript import { type VisibilityState } from "jsr:@b-fuze/deno-dom/native"; ``` -------------------------------- ### Get element by ID Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/~/DocumentFragment.prototype Find an element within a DocumentFragment by its ID. Returns null if not found. ```typescript documentFragment.getElementById(id) ``` -------------------------------- ### Importing NamespaceURI Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/NamespaceURI Demonstrates how to import the NamespaceURI type alias into your Deno or Node.js project. ```typescript import { type NamespaceURI } from "@b-fuze/deno-dom/native"; // Or using JSR specifier: import { type NamespaceURI } from "jsr:@b-fuze/deno-dom/native"; ``` -------------------------------- ### Get DocumentFragment.prototype.childElementCount Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/DocumentFragment.prototype.childElementCount The `childElementCount` property returns the number of child elements of a DocumentFragment. This property is read-only. ```typescript DocumentFragment.prototype.childElementCount(): number ``` -------------------------------- ### textContent Property Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.43/wasm-noinit/~/Text.prototype Gets or sets the text content of the Text node. This property is inherited from CharacterData. ```APIDOC ## textContent: string ### Description Represents the text content of the node. This is a read-only property. ### Properties - **textContent** (string) - The text content of the node. ``` -------------------------------- ### Importing Node Source: https://jsr.io/%40b-fuze/deno-dom/doc/native/~/Node Instructions on how to import the Node type into your Deno or Node.js project. ```APIDOC ```typescript import { Node } from "@b-fuze/deno-dom/native"; ``` or ```typescript import { Node } from "jsr:@b-fuze/deno-dom/native"; ``` ``` -------------------------------- ### Run WPT Tests for Deno DOM (WASM) Source: https://jsr.io/%40b-fuze/deno-dom%400.1.55 Execute Web Platform (WPT) tests for the WASM backend. Requires updating the WPT submodule and appending `-- --wpt` to the test command. ```bash deno test --allow-read --allow-net wasm.test.ts -- --wpt ``` -------------------------------- ### DOMTokenList.prototype.value Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.55...0.1.56/wasm-noinit/~/DOMTokenList.prototype.value The value method on the DOMTokenList prototype is used to get or set the string representation of the tokens. ```APIDOC ## DOMTokenList.prototype.value ### Description Retrieves or sets the string representation of the tokens in the list. ### Signature `DOMTokenList.prototype.value(input: string): void` ### Parameters #### Path Parameters - **input** (string) - Required - The string to set as the value of the token list. ``` -------------------------------- ### Get Document Title - @b-fuze/deno-dom Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.49...0.1.56/~/Document.prototype.title?full= Retrieves the current title of the HTML document. This property is read-only. ```typescript Document.prototype.title(): string ``` -------------------------------- ### initParser Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/all_symbols?full= Initializes the parser. This function is asynchronous and returns a Promise. ```APIDOC ## Function: initParser() ### Description Initializes the parser. This function is asynchronous and returns a Promise. ### Signature `initParser(): Promise` ``` -------------------------------- ### NamedNodeMap Get Named Item Method Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/~/NamedNodeMap?full= Retrieves an attribute by its name, returning null if not found. ```typescript getNamedItem(attribute: string): Attr | null ``` -------------------------------- ### Run Native Backend Tests for Deno DOM Source: https://jsr.io/%40b-fuze/deno-dom%400.1.55 Execute tests for the native backend of Deno DOM. Requires unstable FFI, and broad permissions. Consider using `-A` for convenience if risks are assessed. ```bash deno test --unstable -A native.test.ts ``` -------------------------------- ### Importing NodeList Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/wasm-noinit/~/NodeList Instructions on how to import the NodeList symbol from the @b-fuze/deno-dom package. ```typescript import { NodeList } from "@b-fuze/deno-dom/wasm-noinit"; ``` ```typescript import { NodeList } from "jsr:@b-fuze/deno-dom/wasm-noinit"; ``` -------------------------------- ### NamedNodeMap Get Attribute Names Method Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/~/NamedNodeMap?full= Retrieves an array of all attribute names present in the NamedNodeMap. ```typescript [getNamedNodeMapAttrNamesSym](): string[] ``` -------------------------------- ### Document Constructors Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.47...0.1.56/~/Document?full= Provides information on how to instantiate the Document class. ```APIDOC ## new Document() ### Description Creates a new instance of the Document class. ### Method `new Document()` ``` -------------------------------- ### innerText Property Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/element.ts Gets or sets the text content of the element and its descendants. This is an alias for the `textContent` property. ```APIDOC ## innerText Property ### Description Gets or sets the text content of the element and its descendants. This is an alias for the `textContent` property. ### Getter - **string**: The text content of the element. ### Setter - **text** (string): The text content to set for the element. ``` -------------------------------- ### Import HTMLTemplateElement Source: https://jsr.io/%40b-fuze/deno-dom%400.1.56/doc/native/~/HTMLTemplateElement.prototype Demonstrates how to import the HTMLTemplateElement class from the @b-fuze/deno-dom package. ```typescript import { HTMLTemplateElement } from "@b-fuze/deno-dom/native"; // or import { HTMLTemplateElement } from "jsr:@b-fuze/deno-dom/native"; ``` -------------------------------- ### NamedNodeMap Get Named Item Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/element.ts Retrieves an attribute by its name. Returns null if the attribute is not found. ```typescript getNamedItem(attribute: string): Attr | null { const safeAttrName = "a" + attribute; if (this.#map[safeAttrName] !== undefined) { return this[getNamedNodeMapAttrNodeSym](attribute); } return null; } ``` -------------------------------- ### UninitializedDOMTokenList.value Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/src/dom/element.ts Sets or gets the string representation of the tokens in the list. When setting, it initializes the actual DOMTokenList. ```APIDOC ## value ### Description Sets or gets the string representation of the tokens in the list. When setting, it initializes the actual DOMTokenList. ### Property Type `string` ### Usage - **Setter**: `uninitializedDOMTokenList.value = 'token1 token2';` - **Getter**: `const tokens = uninitializedDOMTokenList.value;` ``` -------------------------------- ### Create HTMLTemplateElement using document.createElement Source: https://jsr.io/%40b-fuze/deno-dom/0.1.56/test/units/HTMLTemplateElement.ts Demonstrates creating an HTMLTemplateElement instance using the document.createElement method and verifies its properties. ```typescript Deno.test('document.createElement("template")', () => { const doc = new DOMParser().parseFromString("", "text/html"); const templ = doc.createElement("template") as HTMLTemplateElement; assertEquals(templ.constructor, HTMLTemplateElement); assertEquals(templ.content?.constructor, DocumentFragment); assertEquals(templ.content.childNodes.length, 0); }); ``` -------------------------------- ### Document Constructors Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.56...0.1.49/native/~/Document?full= Initializes a new instance of the Document class. ```APIDOC ## new Document() ### Description Initializes a new instance of the Document class. ### Method `new Document()` ``` -------------------------------- ### Import deno-dom with JSR Specifier Source: https://jsr.io/%40b-fuze/deno-dom%400.1.55 Example of importing the deno-dom library directly using a JSR specifier. ```typescript import * as deno_dom from "jsr:@b-fuze/deno-dom"; ``` -------------------------------- ### initParser Source: https://jsr.io/%40b-fuze/deno-dom/diff/0.1.43...0.1.56/wasm-noinit?full= Initializes the parser. This function is asynchronous and returns a Promise that resolves when the parser is ready. ```APIDOC ## initParser() ### Description Initializes the parser. This function is asynchronous and returns a Promise that resolves when the parser is ready. ### Signature `initParser(): Promise` ``` -------------------------------- ### Importing HTMLCollection Source: https://jsr.io/%40b-fuze/deno-dom/doc/~/HTMLCollection Demonstrates how to import the HTMLCollection interface from the @b-fuze/deno-dom package. ```APIDOC ## Import HTMLCollection ### Description This snippet shows how to import the `HTMLCollection` interface using either the package name or a JSR specifier. ### Usage **Option 1: Using package name** ```typescript import { HTMLCollection } from "@b-fuze/deno-dom"; ``` **Option 2: Using JSR specifier** ```typescript import { HTMLCollection } from "jsr:@b-fuze/deno-dom"; ``` ```