import { CSSResultGroup, PropertyValues } from "lit"; import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element"; //#region src/components/mutation-observer/mutation-observer.d.ts /** * * * @summary Watches child elements and dispatches an event when they mutate. * @tag sigvelo-mutation-observer * @documentation https://design-system.sigvelo.com/docs/components/mutation * @status stable * @since 1.0 * * @slot - The elements to observe. All direct children of the host element are observed, but not nested elements. * * @event sigvelo-mutation - Emitted when a slotted element is mutated. The `event.detail.record` property contains a * [`MutationRecord`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord) with information about * the mutation. * * @example Default * The component uses a MutationObserver to monitor when its direct children are added, removed, or modified. A `sigvelo-mutation` event is dispatched for each observed change, providing detailed information about what was mutated. * * The component is styled with `display: contents`, allowing you to easily apply flex and grid layouts to the containing element without the component interfering. * * ```html *
* *
1
*
2
*
3
*
*
* * Add box * * Add and remove some items, then open the console to inspect the output. * * * * * ``` * * **Note:** Remember that only direct children of the host element are observed. Nested elements will not trigger mutation events unless the `subtree` attribute is enabled. * * @example Providing content * Slot one or more elements into the mutation observer and listen for the `sigvelo-mutation` event. The event includes `event.detail.record`, which is a `MutationRecord` object that corresponds to the mutated element. * * In its simplest form, a mutation observer can be used like this. * * ```html * *
Item 1
*
Item 2
*
Item 3
*
* * * ``` * * @example Observing attribute changes * Use the `attr` attribute to monitor changes to element attributes. You can optionally specify `attr-old-value` to record the previous attribute value. * * ```html * *
Watch my attributes
*
* * * ``` * * @example Filtering specific attributes * Limit observations to specific attributes using the `attr-filter` attribute. Separate multiple attribute names with spaces. * * ```html * *
* Only class and data-state changes are observed *
*
* * * ``` * * @example Observing text content changes * Use the `character-data` attribute to monitor changes to text nodes. The `character-data-old-value` attribute records the previous text content. * * ```html * *

Original text content

*
* * * ``` * * @example Observing nested elements * By default, only direct children are observed. Add the `subtree` attribute to observe changes in nested elements as well. * * ```html * *
*
* Nested content *
*
*
* * * ``` * * @example Combining multiple observation types * You can observe multiple types of mutations simultaneously by combining attributes. * * ```html * *
*

This observer watches everything

*
*
* * * ``` * * @example Disabling the observer * Use the `disabled` attribute to temporarily stop observing mutations without removing the component. * * ```html * *
Changes to this content won't be observed
*
* * * ``` */ declare class SigveloMutationObserver extends SigveloElement { static styles: CSSResultGroup; private mutationObserver; /** Disables the mutation observer. */ disabled: boolean; /** Indicates whether attributes should be observed. */ attr: boolean; /** Indicates whether attribute old value should be recorded. */ attrOldValue: boolean; /** * One or more attributes to limit observations to, separate by a space. When not specified, all attributes are * observed. */ attrFilter: string; /** Indicates whether mutations to target's children are to be observed. */ childList: boolean; /** Indicates whether mutations to target's descendants are to be observed. */ subtree: boolean; /** Indicates whether character data should be observed. */ characterData: boolean; /** Indicates whether character data old value should be recorded. */ characterDataOldValue: boolean; connectedCallback(): void; disconnectedCallback(): void; updated(changedProperties: PropertyValues): void; /** Starts or restarts the mutation observer. */ private startObserver; /** Stops the mutation observer. */ private stopObserver; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "sigvelo-mutation-observer": SigveloMutationObserver; } } //#endregion export { SigveloMutationObserver as t };