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
Methods
Methods
getActiveElement
getDocument
getWindow
isActiveElement
-
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.
- target: Element
isCSSImportRule
-
Provides basic prototype string type checking if
targetis a CSSImportRule.Parameters
- target: unknown
A potential CSSImportRule to test.
Returns target is CSSImportRule
Is
targeta CSSImportRule. - target: unknown
isCSSLayerBlockRule
-
Provides basic prototype string type checking if
targetis a CSSLayerBlockRule.Parameters
- target: unknown
A potential CSSLayerBlockRule to test.
Returns target is CSSLayerBlockRule
Is
targeta CSSLayerBlockRule. - target: unknown
isCSSStyleRule
-
Provides basic prototype string type checking if
targetis a CSSStyleRule.Parameters
- target: unknown
A potential CSSStyleRule to test.
Returns target is CSSStyleRule
Is
targeta CSSStyleRule. - target: unknown
isCSSStyleSheet
-
Provides basic prototype string type checking if
targetis a CSSStyleSheet.Parameters
- target: unknown
A potential CSSStyleSheet to test.
Returns target is CSSStyleSheet
Is
targeta CSSStyleSheet. - target: unknown
isDocument
-
Provides basic prototype string type checking if
targetis a Document.Parameters
- target: unknown
A potential Document to test.
Returns target is Document
Is
targeta Document. - target: unknown
isDocumentFragment
-
Provides precise type checking if
targetis a DocumentFragment.Parameters
- target: unknown
A potential DocumentFragment to test.
Returns target is DocumentFragment
Is
targeta DocumentFragment. - target: unknown
isDOMException
-
Provides basic duck type checking and error name for DOMException.
Parameters
- target: unknown
Error to duck type test.
- name: string
Specific error name.
Returns boolean
Is target a DOMException matching the error name.
- target: unknown
isElement
-
Provides precise type checking if
targetis an Element.Parameters
- target: unknown
A potential Element to test.
Returns target is Element
Is
targetan Element. - target: unknown
isEvent
-
Provides basic duck type checking for
Eventsignature 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
targetan Event with optional constructor name check. - target: unknown
isFocusableHTMLElement
-
Ensures that the given target is an
instanceofall 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
instanceoffocusable HTML element.
Returns boolean
Is target an
instanceofa focusable DOM element. - target: unknown
isHTMLAnchorElement
-
Provides precise type checking if
targetis a HTMLAnchorElement.Parameters
- target: unknown
A potential HTMLAnchorElement to test.
Returns target is HTMLAnchorElement
Is
targeta HTMLAnchorElement. - target: unknown
isHTMLElement
-
Provides precise type checking if
targetis an HTMLElement.Parameters
- target: unknown
A potential HTMLElement to test.
Returns target is HTMLElement
Is
targeta HTMLElement. - target: unknown
isNode
-
Provides precise type checking if
targetis a Node.Parameters
- target: unknown
A potential Node to test.
Returns target is Node
Is
targeta DOM Node. - target: unknown
isPointerEvent
-
Provides basic duck type checking for
Eventsignature for standard mouse / pointer events includingMouseEventandPointerEvent.Parameters
- target: unknown
A potential DOM event to test.
Returns target is PointerEvent
Is
targeta MouseEvent or PointerEvent. - target: unknown
isShadowRoot
-
Provides precise type checking if
targetis a ShadowRoot.Parameters
- target: unknown
A potential ShadowRoot to test.
Returns target is ShadowRoot
Is
targeta ShadowRoot. - target: unknown
isSVGElement
-
Provides precise type checking if
targetis a SVGElement.Parameters
- target: unknown
A potential SVGElement to test.
Returns target is SVGElement
Is
targeta SVGElement. - target: unknown
isUIEvent
-
Provides basic duck type checking for
Eventsignature for all UI events.Parameters
- target: unknown
A potential DOM event to test.
Returns target is UIEvent
Is
targeta UIEvent. - target: unknown
isURL
-
Provides basic prototype string type checking if
targetis a URL.Parameters
- target: unknown
A potential URL to test.
Returns target is URL
Is
targeta URL. - target: unknown
isUserInputEvent
-
Provides basic duck type checking for
Eventsignature for standard user input events includingKeyboardEvent,MouseEvent, andPointerEvent.Parameters
- target: unknown
A potential DOM event to test.
Returns target is KeyboardEvent | MouseEvent | PointerEvent
Is
targeta Keyboard, MouseEvent, or PointerEvent. - target: unknown
isWindow
-
Provides basic prototype string type checking if
targetis a Window.Parameters
- target: unknown
A potential Window to test.
Returns target is Window
Is
targeta Window. - target: unknown
Get
document.activeElementvalue for a given DOM or event target.