@sv443-network/userutils 9.0.1 → 9.0.2

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
+ ## 9.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 69c4dd1: Fixed wrong readme being included in JSR package and added `@module` comments
8
+
3
9
  ## 9.0.1
4
10
 
5
11
  ### Patch Changes
@@ -8,7 +8,7 @@
8
8
  // ==UserLibrary==
9
9
  // @name UserUtils
10
10
  // @description Lightweight library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, create persistent & synchronous data stores, modify the DOM more easily and much more
11
- // @version 9.0.1
11
+ // @version 9.0.2
12
12
  // @license MIT
13
13
  // @copyright Sv443 (https://github.com/Sv443)
14
14
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/DataStore
3
+ * This module contains the DataStore class, which is a general purpose, sync and async persistent JSON database - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#datastore)
4
+ */
1
5
  import type { Prettify } from "./types.js";
2
6
  /** Dictionary of format version numbers and the function that migrates to them from the previous whole integer */
3
7
  export type DataMigrationsDict = Record<number, ((oldData: unknown) => unknown | Promise<unknown>)>;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/DataStoreSerializer
3
+ * This module contains the DataStoreSerializer class, which allows you to import and export serialized DataStore data - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#datastoreserializer)
4
+ */
1
5
  import { type DataStore } from "./index.js";
2
6
  export type DataStoreSerializerOptions = {
3
7
  /** Whether to add a checksum to the exported data */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/Debouncer
3
+ * This module contains the Debouncer class and debounce function that allow you to reduce the amount of calls in rapidly firing event listeners and such - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#debouncer)
4
+ */
1
5
  import { NanoEmitter } from "./NanoEmitter.js";
2
6
  /**
3
7
  * The type of edge to use for the debouncer - [see the docs for a diagram and explanation.](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#debouncer)
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/Dialog
3
+ * This module contains the Dialog class, which allows you to quickly and easily create modal dialogs - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#dialog)
4
+ */
1
5
  import { NanoEmitter } from "./NanoEmitter.js";
2
6
  export declare const defaultDialogCss: string;
3
7
  /** ID of the last opened (top-most) dialog */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/NanoEmitter
3
+ * This module contains the NanoEmitter class, which is a tiny event emitter powered by [nanoevents](https://www.npmjs.com/package/nanoevents) - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#nanoemitter)
4
+ */
1
5
  import { type DefaultEvents, type Emitter, type EventsMap, type Unsubscribe } from "nanoevents";
2
6
  export interface NanoEmitterOptions {
3
7
  /** If set to true, allows emitting events through the public method emit() */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/SelectorObserver
3
+ * This module contains the SelectorObserver class, allowing you to register listeners that get called whenever the element(s) behind a selector exist in the DOM - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#selectorobserver)
4
+ */
1
5
  import { type DebouncerType } from "./Debouncer.js";
2
6
  import type { Prettify } from "./types.js";
3
7
  /** Options for the `onSelector()` method of {@linkcode SelectorObserver} */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/array
3
+ * This module contains various functions for working with arrays - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#arrays)
4
+ */
1
5
  /** Describes an array with at least one item */
2
6
  export type NonEmptyArray<TArray = unknown> = [TArray, ...TArray[]];
3
7
  /** Returns a random item from the passed array */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/colors
3
+ * This module contains various functions for working with colors - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#colors)
4
+ */
1
5
  /**
2
6
  * Converts a hex color string in the format `#RRGGBB`, `#RRGGBBAA` (or even `RRGGBB` and `RGB`) to a tuple.
3
7
  * @returns Returns a tuple array where R, G and B are an integer from 0-255 and alpha is a float from 0 to 1, or undefined if no alpha channel exists.
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/crypto
3
+ * This module contains various cryptographic functions using the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#table-of-contents)
4
+ */
1
5
  /** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as a base64 string */
2
6
  export declare function compress(input: string | ArrayBuffer, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
3
7
  /** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as an ArrayBuffer */
package/dist/lib/dom.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/dom
3
+ * This module contains various functions for working with the DOM - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#dom)
4
+ */
1
5
  /**
2
6
  * Returns `unsafeWindow` if the `@grant unsafeWindow` is given, otherwise falls back to the regular `window`
3
7
  */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module UserUtils
3
+ * UserUtils is a lightweight library with various utilities for userscripts, allowing you to register listeners for when CSS selectors exist, intercept events, create persistent & synchronous data stores, modify the DOM more easily and much more
4
+ */
1
5
  export * from "./array.js";
2
6
  export * from "./colors.js";
3
7
  export * from "./crypto.js";
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/math
3
+ * This module contains various math functions - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#math)
4
+ */
1
5
  import type { Stringifiable } from "./types.js";
2
6
  /** Ensures the passed {@linkcode value} always stays between {@linkcode min} and {@linkcode max} */
3
7
  export declare function clamp(value: number, min: number, max: number): number;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/misc
3
+ * This module contains miscellaneous functions that don't fit in another category - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#misc)
4
+ */
1
5
  import type { Prettify, Stringifiable } from "./types.js";
2
6
  /**
3
7
  * Automatically appends an `s` to the passed {@linkcode word}, if {@linkcode num} is not equal to 1
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/translation
3
+ * This module contains a translation system that supports flat and nested JSON objects and value transformation functions - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#translation)
4
+ */
1
5
  import type { Stringifiable } from "./types.js";
2
6
  /**
3
7
  * Translation object to pass to {@linkcode tr.addTranslations()}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @module lib/types
3
+ * This module contains various TS types - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#utility-types)
4
+ */
1
5
  /** Represents any value that is either a string itself or can be converted to one (implicitly and explicitly) because it has a toString() method */
2
6
  export type Stringifiable = string | {
3
7
  toString(): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sv443-network/userutils",
3
3
  "libName": "UserUtils",
4
- "version": "9.0.1",
4
+ "version": "9.0.2",
5
5
  "description": "Lightweight library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, create persistent & synchronous data stores, modify the DOM more easily and much more",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",