Browse Source

feat: `@module` tsdoc comments so JSR is happy

Sv443 3 months ago
parent
commit
e0875f3a9d
15 changed files with 75 additions and 0 deletions
  1. 5 0
      lib/DataStore.ts
  2. 5 0
      lib/DataStoreSerializer.ts
  3. 5 0
      lib/Debouncer.ts
  4. 5 0
      lib/Dialog.ts
  5. 5 0
      lib/NanoEmitter.ts
  6. 5 0
      lib/SelectorObserver.ts
  7. 5 0
      lib/array.ts
  8. 5 0
      lib/colors.ts
  9. 5 0
      lib/crypto.ts
  10. 5 0
      lib/dom.ts
  11. 5 0
      lib/index.ts
  12. 5 0
      lib/math.ts
  13. 5 0
      lib/misc.ts
  14. 5 0
      lib/translation.ts
  15. 5 0
      lib/types.ts

+ 5 - 0
lib/DataStore.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/DataStore
+ * 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)
+ */
+
 import type { Prettify } from "./types.js";
 
 //#region types

+ 5 - 0
lib/DataStoreSerializer.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/DataStoreSerializer
+ * 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)
+ */
+
 import { getUnsafeWindow, computeHash, type DataStore } from "./index.js";
 
 export type DataStoreSerializerOptions = {

+ 5 - 0
lib/Debouncer.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/Debouncer
+ * 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)
+ */
+
 import { NanoEmitter } from "./NanoEmitter.js";
 
 //#region types

+ 5 - 0
lib/Dialog.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/Dialog
+ * 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)
+ */
+
 import { NanoEmitter } from "./NanoEmitter.js";
 import { addGlobalStyle } from "./dom.js";
 

+ 5 - 0
lib/NanoEmitter.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/NanoEmitter
+ * 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)
+ */
+
 import { createNanoEvents, type DefaultEvents, type Emitter, type EventsMap, type Unsubscribe } from "nanoevents";
 
 export interface NanoEmitterOptions {

+ 5 - 0
lib/SelectorObserver.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/SelectorObserver
+ * 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)
+ */
+
 import { Debouncer, debounce, type DebouncerType } from "./Debouncer.js";
 import type { Prettify } from "./types.js";
 

+ 5 - 0
lib/array.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/array
+ * 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)
+ */
+
 import { randRange } from "./math.js";
 
 /** Describes an array with at least one item */

+ 5 - 0
lib/colors.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/colors
+ * 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)
+ */
+
 import { clamp } from "./math.js";
 
 /**

+ 5 - 0
lib/crypto.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/crypto
+ * 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)
+ */
+
 import { getUnsafeWindow } from "./dom.js";
 import { mapRange, randRange } from "./math.js";
 

+ 5 - 0
lib/dom.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/dom
+ * 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)
+ */
+
 /**
  * Returns `unsafeWindow` if the `@grant unsafeWindow` is given, otherwise falls back to the regular `window`
  */

+ 5 - 0
lib/index.ts

@@ -1,3 +1,8 @@
+/**
+ * @module UserUtils
+ * 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
+ */
+
 export * from "./array.js";
 export * from "./colors.js";
 export * from "./crypto.js";

+ 5 - 0
lib/math.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/math
+ * This module contains various math functions - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#math)
+ */
+
 import type { Stringifiable } from "./types.js";
 
 /** Ensures the passed {@linkcode value} always stays between {@linkcode min} and {@linkcode max} */

+ 5 - 0
lib/misc.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/misc
+ * 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)
+ */
+
 import type { Prettify, Stringifiable } from "./types.js";
 
 /**

+ 5 - 0
lib/translation.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/translation
+ * 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)
+ */
+
 import type { Stringifiable } from "./types.js";
 
 //#region types

+ 5 - 0
lib/types.ts

@@ -1,3 +1,8 @@
+/**
+ * @module lib/types
+ * This module contains various TS types - [see the documentation for more info](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#utility-types)
+ */
+
 //#region UU types
 
 /** Represents any value that is either a string itself or can be converted to one (implicitly and explicitly) because it has a toString() method */