slim-select 3.6.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Pure classification of MutationObserver records on the native <select>.
3
+ *
4
+ * Select.observeCall() uses these flags to decide which sync path to run
5
+ * (class/disabled vs full structure vs selection-only). Keeping this logic
6
+ * separate makes it testable without spinning up a full SlimSelect instance.
7
+ */
8
+ /** What changed in a single observer callback batch (flags can all be true). */
9
+ export interface MutationFlags {
10
+ /** Native select class attribute changed — sync to render styles only. */
11
+ classChanged: boolean;
12
+ /** Native select disabled attribute changed — enable/disable SlimSelect. */
13
+ disabledChanged: boolean;
14
+ /**
15
+ * Options or optgroups were added, removed, or had attributes edited.
16
+ * Triggers a full structure sync (store + native DOM + render).
17
+ */
18
+ optgroupOptionChanged: boolean;
19
+ /**
20
+ * Selection may have changed without a separate `change` event yet.
21
+ * Used when a newly added <option> is already the select's value.
22
+ */
23
+ selectionChanged: boolean;
24
+ }
25
+ /**
26
+ * Scan a MutationObserver batch and return which kinds of updates are needed.
27
+ *
28
+ * The observer watches the <select> with subtree: true, so mutations can
29
+ * target the select itself or any child <option> / <optgroup>.
30
+ */
31
+ export declare function classifyMutations(mutations: MutationRecord[], select: HTMLSelectElement): MutationFlags;