treeloom
    Preparing search index...

    Function withDocumentItem

    • Add the public documentItem property to an API object: a getter, so the root is still only built when it is first read. Added after the API is assembled, since Object.assign would read (and so build) it.

      Type Parameters

      • T extends object

      Parameters

      • api: T

        The assembled API object

      Returns T & { documentItem: DomItemRoot }

      The same object