Retrieves an element from the document and returns it if it has the expected type.

  • Type Parameters

    Parameters

    • document: Document

      The document from which to look up the element.

    • id: string

      The ID of the element.

    • Type: ConstructorOf<T>

      The type you expect the element to have.

    Returns null | T

    The requested element, if it has the expected type; null otherwise.