
Enter a search term above to see results...
Enter a search term above to see results...
These internal methods handle specialized functionality needed by Query’s public API methods. While they’re exposed in the API surface, they’re typically not called directly in application code.
Internal Use Only The methods documented on this page are used internally by the Query library and aren’t intended for direct use in application code.
Creates a new Query instance containing the provided elements, preserving the original Query options.
$('selector').chain(elements)
Name | Type | Description |
---|---|---|
elements | mixed | Elements for the new Query instance |
A new Query instance with the provided elements and the same options as the original Query.
// Internal usage exampleconst newSet = $('div').chain(document.querySelectorAll('p'));
Queries for elements deeply across Shadow DOM boundaries.
$('selector').querySelectorAllDeep(root, selector, includeRoot)
Name | Type | Description |
---|---|---|
root | mixed | The root element to search within |
selector | mixed | CSS selector or element to search for |
includeRoot | boolean | Whether to include the root element in the results |
An array of all matching elements, including those within Shadow DOM.
// Internal usage exampleconst allButtons = $$().querySelectorAllDeep(document, 'button');
Finds the closest ancestor element that matches the selector, traversing through Shadow DOM boundaries.
$('selector').closestDeep(element, selector)
Name | Type | Description |
---|---|---|
element | Element | The element to start searching from |
selector | mixed | A selector to match ancestor elements |
The closest matching ancestor element, even if it’s outside the current Shadow DOM, or undefined
if not found.
// Internal usage exampleconst parentComponent = $$().closestDeep(buttonElement, 'my-component');
Gets the text content of an element and all its descendants, including across Shadow DOM boundaries.
$('selector').getTextContentRecursive(nodes)
Name | Type | Description |
---|---|---|
nodes | mixed | The nodes to extract text from |
A string containing the combined text content of all nodes and their descendants.
// Internal usage exampleconst allText = $$('my-component').getTextContentRecursive(componentElement.childNodes);
Inserts content at a specified position relative to a target element.
$('selector').insertContent(target, content, position)
Name | Type | Description |
---|---|---|
target | Element | The target element |
content | mixed | The content to insert |
position | string | Where to insert content relative to the element |
void
// Internal usage example - used by append(), prepend(), before(), after()$().insertContent(targetElement, '<div>Content</div>', 'beforeend');