Documentation
    Preparing search index...

    Interface DocumentLike

    A host document this package may not name — window.document in a browser, a tiny fake in Node tests.

    Duck-typed on the three members the mirror actually calls. matchMedia and defaultView are optional so a test document that has no notion of preferences is still a DocumentLike.

    interface DocumentLike {
        body: { appendChild(node: ElementLike): unknown } | null;
        defaultView?: { matchMedia?(query: string): { matches: boolean } } | null;
        createElement(tagName: string): ElementLike;
        getElementById(id: string): ElementLike | null;
        matchMedia?(query: string): { matches: boolean };
    }
    Index
    body: { appendChild(node: ElementLike): unknown } | null
    defaultView?: { matchMedia?(query: string): { matches: boolean } } | null
    • Parameters

      • tagName: string

      Returns ElementLike

    • Parameters

      • id: string

      Returns ElementLike | null

    • Parameters

      • query: string

      Returns { matches: boolean }