/** * Options for getRootNode */ type GetRootNodeOptions = { /** * Allow the function to return the document object even if the element is not attached to the DOM tree. */ allowDetached?: boolean; }; /** * Returns the the RootNode of the given element. * * If the element is not provided, it will return the global document object. * If the document object is not available (such as React Server Components, Server Side Rendering, etc.), it will return undefined. * * ** Why do we need rootNode? ** * - When the element is inside a Shadow DOM, the rootNode is the shadowRoot instead of Document, so we should handle everything inside it. * * @param element - The element to get the document object from. * * @param options - Advanced options for getting root node * * @returns The Document object or ShadowRoot or undefined if not available. */ export declare function getRootNode(element?: HTMLElement | null, options?: GetRootNodeOptions): Node | undefined; export {};