Skip to content

Commit

Permalink
chore: restructure DOM lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Feb 17, 2023
1 parent 8365641 commit f80b3cd
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 207 deletions.
37 changes: 34 additions & 3 deletions client/dist/engine/dom.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
export default class Dom {
/**
* Get the body of an HTML string
*
* @param html The html to parse
* @param removeScripts Whether to remove scripts from the html
* @returns The body of the html
*/
static getBody(html: string, removeScripts?: boolean): HTMLElement;
/**
* Get the type for a node
* @param {HTMLElement} node The node
* @return {String} The type
*/
static getNodeType(node: HTMLElement): string;
/**
* Get the content from a node
* @param {Node} node The node
* @return {String} The type
*/
static getNodeContent(node: HTMLElement): string | null;
/**
* Diff the DOM from a string and an element
*
* @param newNode The new node
* @param oldNode The old node
* @returns The diffed node
*/
static diff(newNode: string, oldNode: HTMLElement): void;
/**
* Diff the DOM from two elements
*
* @param newNode The new node
* @param oldNode The old node
* @returns The diffed node
*/
static diffElements(newNode: HTMLElement, oldNode: HTMLElement): void;
static getBody(html: string, removeScripts?: boolean): HTMLElement;
static flattenDomIntoArray(node: HTMLElement): HTMLCollection;
static compareNodesAndReturnChanges(newNode: HTMLElement, oldNode: HTMLElement): Record<string, Element | null>[];
}
121 changes: 58 additions & 63 deletions client/dist/ui.cjs.development.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/ui.cjs.development.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit f80b3cd

Please sign in to comment.