@sv443-network/userutils 4.2.0 → 4.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sv443-network/userutils
2
2
 
3
+ ## 4.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0462e35: Fixed TS types for overload of SelectorObserver constructor
8
+
3
9
  ## 4.2.0
4
10
 
5
11
  ### Minor Changes
@@ -9,7 +9,7 @@
9
9
  // ==UserLibrary==
10
10
  // @name UserUtils
11
11
  // @description Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent user configurations, modify the DOM more easily and more
12
- // @version 4.2.0
12
+ // @version 4.2.1
13
13
  // @license MIT
14
14
  // @copyright Sv443 (https://github.com/Sv443)
15
15
 
@@ -26,6 +26,7 @@ export type SelectorObserverOptions = {
26
26
  /** Whether to ensure the observer is enabled when a new listener is added - default is true */
27
27
  enableOnAddListener?: boolean;
28
28
  };
29
+ export type SelectorObserverConstructorOptions = MutationObserverInit & SelectorObserverOptions;
29
30
  /** Observes the children of the given element for changes */
30
31
  export declare class SelectorObserver {
31
32
  private enabled;
@@ -39,13 +40,13 @@ export declare class SelectorObserver {
39
40
  * @param baseElementSelector The selector of the element to observe
40
41
  * @param options Fine-tune what triggers the MutationObserver's checking function - `subtree` and `childList` are set to true by default
41
42
  */
42
- constructor(baseElementSelector: string, options?: SelectorObserverOptions & MutationObserverInit);
43
+ constructor(baseElementSelector: string, options?: SelectorObserverConstructorOptions);
43
44
  /**
44
45
  * Creates a new SelectorObserver that will observe the children of the given base element for changes (only creation and deletion of elements by default)
45
46
  * @param baseElement The element to observe
46
47
  * @param options Fine-tune what triggers the MutationObserver's checking function - `subtree` and `childList` are set to true by default
47
48
  */
48
- constructor(baseElement: Element, options?: SelectorObserverOptions);
49
+ constructor(baseElement: Element, options?: SelectorObserverConstructorOptions);
49
50
  private checkAllSelectors;
50
51
  private checkSelector;
51
52
  private debounce;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sv443-network/userutils",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent user configurations, modify the DOM more easily and more",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",