interface API {
    getActiveElement(target: GetTarget, options?: GetMethod): Element;
    getDocument(target: GetTarget, options?: GetMethod): Document;
    getWindow(target: GetTarget, options?: GetMethod): Window;
    isActiveElement(target: Element): boolean;
    isCSSImportRule(target: unknown): target is CSSImportRule;
    isCSSLayerBlockRule(target: unknown): target is CSSLayerBlockRule;
    isCSSStyleRule(target: unknown): target is CSSStyleRule;
    isCSSStyleSheet(target: unknown): target is CSSStyleSheet;
    isDocument(target: unknown): target is Document;
    isDocumentFragment(target: unknown): target is DocumentFragment;
    isDOMException(target: unknown, name: string): boolean;
    isElement(target: unknown): target is Element;
    isEvent(target: unknown, types?: string | Set<string>): target is Event;
    isFocusableHTMLElement(target: unknown): boolean;
    isHTMLAnchorElement(target: unknown): target is HTMLAnchorElement;
    isHTMLElement(target: unknown): target is HTMLElement;
    isNode(target: unknown): target is Node;
    isPointerEvent(target: unknown): target is PointerEvent;
    isShadowRoot(target: unknown): target is ShadowRoot;
    isSVGElement(target: unknown): target is SVGElement;
    isUIEvent(target: unknown): target is UIEvent;
    isURL(target: unknown): target is URL;
    isUserInputEvent(
        target: unknown,
    ): target is KeyboardEvent | MouseEvent | PointerEvent;
    isWindow(target: unknown): target is Window;
}
Index
  • Get document.activeElement value for a given DOM or event target.

    Parameters

    • target: GetTarget

      DOM Node / Element, EventTarget, Document, UIEvent or Window to query.

    • Optionaloptions: GetMethod

      Options.

    Returns Element

    Active element or undefined when throws option is false and the target is invalid.

    TypeError Target must be a DOM Node / Element, Document, UIEvent, or Window.

  • Get the Document value in for a given DOM or event target.

    Parameters

    • target: GetTarget

      DOM Node / Element, EventTarget, Document, UIEvent or Window to query.

    • Optionaloptions: GetMethod

      Options.

    Returns Document

    Active document or undefined when throws option is false and the target is invalid.

    TypeError Target must be a DOM Node / Element, Document, UIEvent, or Window.

  • Get the Window value for a given DOM or event target.

    Parameters

    • target: GetTarget

      DOM Node / Element, EventTarget, Document, UIEvent or Window to query.

    • Optionaloptions: GetMethod

      Options.

    Returns Window

    Active window or undefined when throws option is false and the target is invalid.

    TypeError Target must be a DOM Node / Element, Document, UIEvent, or Window.

  • Test if the given target element is the current active element.

    Parameters

    • target: Element

      Element to test as current active element.

    Returns boolean

    Whether the given element is the active element.

  • Provides basic prototype string type checking if target is a CSSImportRule.

    Parameters

    • target: unknown

      A potential CSSImportRule to test.

    Returns target is CSSImportRule

    Is target a CSSImportRule.

  • Provides basic prototype string type checking if target is a CSSLayerBlockRule.

    Parameters

    • target: unknown

      A potential CSSLayerBlockRule to test.

    Returns target is CSSLayerBlockRule

    Is target a CSSLayerBlockRule.

  • Provides basic prototype string type checking if target is a CSSStyleRule.

    Parameters

    • target: unknown

      A potential CSSStyleRule to test.

    Returns target is CSSStyleRule

    Is target a CSSStyleRule.

  • Provides basic prototype string type checking if target is a CSSStyleSheet.

    Parameters

    • target: unknown

      A potential CSSStyleSheet to test.

    Returns target is CSSStyleSheet

    Is target a CSSStyleSheet.

  • Provides basic prototype string type checking if target is a Document.

    Parameters

    • target: unknown

      A potential Document to test.

    Returns target is Document

    Is target a Document.

  • Provides precise type checking if target is a DocumentFragment.

    Parameters

    • target: unknown

      A potential DocumentFragment to test.

    Returns target is DocumentFragment

    Is target a DocumentFragment.

  • Provides precise type checking if target is an Element.

    Parameters

    • target: unknown

      A potential Element to test.

    Returns target is Element

    Is target an Element.

  • Provides basic duck type checking for Event signature and optional constructor name(s).

    Parameters

    • target: unknown

      A potential DOM event to test.

    • Optionaltypes: string | Set<string>

      Specific constructor name or Set of constructor names to match.

    Returns target is Event

    Is target an Event with optional constructor name check.

  • Ensures that the given target is an instanceof all known DOM elements that are focusable. Please note that additional checks are required regarding focusable state; use #runtime/util/a11y!A11yHelper.isFocusable for a complete check.

    Parameters

    • target: unknown

      Target to test for instanceof focusable HTML element.

    Returns boolean

    Is target an instanceof a focusable DOM element.

  • Provides precise type checking if target is a HTMLAnchorElement.

    Parameters

    • target: unknown

      A potential HTMLAnchorElement to test.

    Returns target is HTMLAnchorElement

    Is target a HTMLAnchorElement.

  • Provides precise type checking if target is an HTMLElement.

    Parameters

    • target: unknown

      A potential HTMLElement to test.

    Returns target is HTMLElement

    Is target a HTMLElement.

  • Provides precise type checking if target is a Node.

    Parameters

    • target: unknown

      A potential Node to test.

    Returns target is Node

    Is target a DOM Node.

  • Provides basic duck type checking for Event signature for standard mouse / pointer events including MouseEvent and PointerEvent.

    Parameters

    • target: unknown

      A potential DOM event to test.

    Returns target is PointerEvent

    Is target a MouseEvent or PointerEvent.

  • Provides precise type checking if target is a ShadowRoot.

    Parameters

    • target: unknown

      A potential ShadowRoot to test.

    Returns target is ShadowRoot

    Is target a ShadowRoot.

  • Provides precise type checking if target is a SVGElement.

    Parameters

    • target: unknown

      A potential SVGElement to test.

    Returns target is SVGElement

    Is target a SVGElement.

  • Provides basic prototype string type checking if target is a URL.

    Parameters

    • target: unknown

      A potential URL to test.

    Returns target is URL

    Is target a URL.

  • Provides basic duck type checking for Event signature for standard user input events including KeyboardEvent, MouseEvent, and PointerEvent.

    Parameters

    • target: unknown

      A potential DOM event to test.

    Returns target is KeyboardEvent | MouseEvent | PointerEvent

    Is target a Keyboard, MouseEvent, or PointerEvent.

  • Provides basic prototype string type checking if target is a Window.

    Parameters

    • target: unknown

      A potential Window to test.

    Returns target is Window

    Is target a Window.