Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DomUtility

static members for DOM manipulation

export

Hierarchy

  • DomUtility

Index

Constructors

Methods

  • getChildHtmlElementByQuery<TElement>(element: HTMLElement, query: string): null | TElement
  • gets the child element, extending @type {HTMLElement} from the specified query @type {string},

    Type parameters

    • TElement: HTMLElement

    Parameters

    • element: HTMLElement
    • query: string

    Returns null | TElement

  • getChildHtmlElementsByQuery<TElement>(element: HTMLElement, query: string): null | NodeListOf<TElement>
  • gets the child elements, extending @type {HTMLElement} from the specified query @type {string},

    Type parameters

    • TElement: HTMLElement

    Parameters

    • element: HTMLElement
    • query: string

    Returns null | NodeListOf<TElement>

  • getClosestHtmlElementByQuery<TElement>(element: HTMLElement, query: string): null | TElement
  • gets the child elements, extending @type {HTMLElement} from the specified query @type {string},

    Type parameters

    • TElement: HTMLElement

    Parameters

    • element: HTMLElement
    • query: string

    Returns null | TElement

  • getHtmlElement<TElement>(elementRef: {}): null | TElement
  • gets the element, extending @type {HTMLElement} from the specified @type {ElementRef}, usually derived from @ViewChild

    Type parameters

    • TElement: HTMLElement

    Parameters

    • elementRef: {}
      • [index: string]: any

    Returns null | TElement

  • getHtmlElements(collection: HTMLCollection): Element[]
  • get an array of @type {Element} from the specified collection

    Parameters

    • collection: HTMLCollection

    Returns Element[]

  • getHtmlHeadingElement(level?: number, windowDocument?: Document): null | HTMLHeadingElement
  • gets the @type {HTMLHeadingElement} from the specified heading level

    Parameters

    • level: number = 0
    • windowDocument: Document = document

    Returns null | HTMLHeadingElement

  • getStyleDeclaration(element: {}): null | CSSStyleDeclaration
  • gets the @type {CSSStyleDeclaration} from the specified @type {Element}

    Parameters

    • element: {}
      • [index: string]: any

    Returns null | CSSStyleDeclaration

  • parseAsHtmlElement<TElement>(markup: string, expectedElementName?: string): null | TElement
  • returns an element extending @type {HTMLElement[]} from the specified markup

    Type parameters

    • TElement: HTMLElement

    Parameters

    • markup: string
    • expectedElementName: string = 'div'

    Returns null | TElement

  • parseAsHtmlElements<TElement>(markup: string, expectedElementName: string): TElement[]
  • returns an array of elements extending @type {HTMLElement[]} from the specified markup

    Type parameters

    • TElement: HTMLElement

    Parameters

    • markup: string
    • expectedElementName: string

    Returns TElement[]

  • timeout(ms: number): Promise<unknown>
  • returns a @type {Promise} that resolves in the specified milliseconds

    Parameters

    • ms: number

    Returns Promise<unknown>

Generated using TypeDoc