import type { ReactElement, HTMLAttributes, Ref } from "react"; import type SlMutationObserverElement from "@shoelace-style/shoelace/dist/components/mutation-observer/mutation-observer.js"; import { SlMutationEvent } from "../events"; export type { SlMutationObserverElement }; export type SlMutationObserverMutationEventDetail = { mutationList: MutationRecord[]; }; export type SlMutationObserverMutationEvent = SlMutationEvent< SlMutationObserverElement, SlMutationEventDetail >; export interface SlMutationObserverProps extends HTMLAttributes { ref?: Ref; /** * Watches for changes to attributes. To watch only specific attributes, separate them by a space, e.g. * `attr="class id title"`. To watch all attributes, use `*`. */ attr?: string; /** * Indicates whether or not the attribute's previous value should be recorded when monitoring changes. */ attrOldValue?: boolean; /** * Watches for changes to the character data contained within the node. */ charData?: boolean; /** * Indicates whether or not the previous value of the node's text should be recorded. */ charDataOldValue?: boolean; /** * Watches for the addition or removal of new child nodes. */ childList?: boolean; /** * Disables the observer. */ disabled?: boolean; /** * Emitted when a mutation occurs. */ onSlMutation?: (event: SlMutationObserverMutationEvent) => void; /** * Emitted when a mutation occurs. */ onSlMutationCapture?: (event: SlMutationObserverMutationEvent) => void; } /** * The Mutation Observer component offers a thin, declarative interface to the [`MutationObserver API`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver). */ export default function SlMutationObserver( props: SlMutationObserverProps, ): ReactElement;