Skip to content

Commit

Permalink
feat: @module tsdoc comments so JSR is happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Jan 22, 2025
1 parent babc79d commit e0875f3
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/DataStore.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/DataStoreSerializer.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
5 changes: 5 additions & 0 deletions lib/Debouncer.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/Dialog.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
5 changes: 5 additions & 0 deletions lib/NanoEmitter.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions lib/SelectorObserver.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
5 changes: 5 additions & 0 deletions lib/array.ts
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions lib/colors.ts
Original file line number Diff line number Diff line change
@@ -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";

/**
Expand Down
5 changes: 5 additions & 0 deletions lib/crypto.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
5 changes: 5 additions & 0 deletions lib/dom.ts
Original file line number Diff line number Diff line change
@@ -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`
*/
Expand Down
5 changes: 5 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
5 changes: 5 additions & 0 deletions lib/math.ts
Original file line number Diff line number Diff line change
@@ -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} */
Expand Down
5 changes: 5 additions & 0 deletions lib/misc.ts
Original file line number Diff line number Diff line change
@@ -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";

/**
Expand Down
5 changes: 5 additions & 0 deletions lib/translation.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down

0 comments on commit e0875f3

Please sign in to comment.