Skip to content

Commit 7ad7cc8

Browse files
docs: update/clean docstrings in various pkgs
1 parent 8ffec13 commit 7ad7cc8

File tree

95 files changed

+307
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+307
-295
lines changed

packages/associative/src/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface HashMapOpts<K> {
7272
*/
7373
equiv?: Predicate2<K>;
7474
/**
75-
* Normalized max load factor in the open (0..1) interval. The map
75+
* Normalized max load factor in the open `(0,1)` interval. The map
7676
* will be resized (doubled in size) and all existing keys rehashed
7777
* every time a new key is to be added and the current size exceeds
7878
* this normalized load.

packages/axidraw/src/api.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type StopCommand = ["stop"];
1313
/** Return plotter to initial XY position */
1414
export type HomeCommand = ["home"];
1515

16-
/** Reset curr position as home (0,0) */
16+
/** Reset curr position as home `(0,0)` */
1717
export type ResetCommand = ["reset"];
1818

1919
/** Turn XY motors on/off */
@@ -115,7 +115,7 @@ export interface AxiDrawOpts {
115115
* thi.ng/units `quantity()`), the units used to define these dimensions are
116116
* irrelevant (and independent of {@link AxiDrawOpts.unitsPerInch}!) and
117117
* will be automatically converted. Also, the resulting bounds will always
118-
* be based on [0, 0].
118+
* be based on `[0,0]`.
119119
*
120120
* List of paper sizes/presets:
121121
* https://github.com/thi-ng/umbrella/blob/develop/packages/units/README.md#constants
@@ -205,7 +205,7 @@ export interface AxiDrawOpts {
205205
* means the available horizontal drawing space will be reduced by the same
206206
* amount...
207207
*
208-
* @defaultValue [0, 0]
208+
* @defaultValue `[0,0]`
209209
*/
210210
home: ReadonlyVec;
211211
/**

packages/binary/src/edit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { defMask } from "./mask.js";
77
* Clears bit in given uint `x`.
88
*
99
* @param x - value
10-
* @param bit - bit number (0..31)
10+
* @param bit - bit number `(0,31)`
1111
*/
1212
export const bitClear = (x: number, bit: Bit) => (x & ~(1 << bit)) >>> 0;
1313

@@ -23,7 +23,7 @@ export const bitFlip = (x: number, bit: Bit) => (x ^ (1 << bit)) >>> 0;
2323
* Sets bit in given uint `x`.
2424
*
2525
* @param x - value
26-
* @param bit - bit number (0..31)
26+
* @param bit - bit number `(0,31)`
2727
*/
2828
export const bitSet = (x: number, bit: Bit) => (x | (1 << bit)) >>> 0;
2929

packages/bitfield/src/bitfield.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class BitField implements IClear, ICopy<BitField>, ILength {
171171

172172
/**
173173
* Computes the Jaccard similarity with given `field`. Returns a value in
174-
* [0..1] interval: 1.0 if `a` and `b` are equal, or 0.0 if none of the
174+
* `[0,1]` interval: 1.0 if `a` and `b` are equal, or 0.0 if none of the
175175
* components match.
176176
*
177177
* @remarks

packages/blurhash/src/encode.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const BASE83 = new BaseNEncoder(B83_CHARS);
1414

1515
/**
1616
* Computes the blurhash for the given ABGR 32bit pixel array, image size and
17-
* detail settings (`detailX` & `detailY` both in [1..9] range, X default = 4, Y
18-
* default is same as X value).
17+
* detail settings (`detailX` & `detailY` both in `[1,9]` range, X default = 4,
18+
* Y default is same as X value).
1919
*
2020
* @param pixels
2121
* @param width

packages/cellular/src/1d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const WOLFRAM7: Kernel = [[-3, 0], ...WOLFRAM5, [3, 0]];
7676
* ```
7777
*
7878
* This example kernel defines a 5-cell neighborhood with a max. short term
79-
* memory of one additional previous generation (i.e. the [-2,1] and [2,1]
79+
* memory of one additional previous generation (i.e. the `[-2,1]` and `[2,1]`
8080
* offsets)
8181
*
8282
* The rules related to this kernel have a 32 bit address space (4 billion

packages/color/src/api.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface ChannelSpec {
7979
* color spaces to be slightly outside that sRGB gamut. These are soft
8080
* limits, for orientation only.
8181
*
82-
* @defaultValue [0,1]
82+
* @defaultValue `[0,1]`
8383
*/
8484
range?: Range;
8585
/**
@@ -226,7 +226,7 @@ export interface TypedColor<T>
226226

227227
/**
228228
* Randomizes all color channels based on channel ranges defined for this
229-
* color type (usually [0..1] interval). Alpha channel will remain
229+
* color type (usually `[0,1]` interval). Alpha channel will remain
230230
* untouched.
231231
*
232232
* @param rnd -

packages/color/src/clamp.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import type { Color, ReadonlyColor } from "./api.js";
66
import { __ensureAlpha } from "./internal/ensure.js";
77

88
/**
9-
* Clamps all color channels to [0,1] interval and calls `ensureAlpha` to ensure
10-
* alpha channel is defined (if missing sets it to `alpha`, default: 1).
9+
* Clamps all color channels to `[0,1]` interval and calls `ensureAlpha` to
10+
* ensure alpha channel is defined (if missing sets it to `alpha`, default: 1).
1111
*
1212
* @remarks
1313
* If `out` is null, the resulting color will be written back into `src`.
@@ -31,8 +31,8 @@ export const clamp = (out: Color | null, src: ReadonlyColor, alpha = 1) =>
3131
);
3232

3333
/**
34-
* Similar to {@link clamp}, but calls `ensureHue` to fold (instead of
35-
* clamping) the hue into [0,1] interval.
34+
* Similar to {@link clamp}, but calls `ensureHue` to fold (instead of clamping)
35+
* the hue into the `[0,1]` interval.
3636
*
3737
* @remarks
3838
* If `out` is null, the resulting color will be written back into `src`.

packages/color/src/cosine-gradients.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const COSINE_GRADIENTS: Record<CosineGradientPreset, CosGradientSpec> = {
167167

168168
/**
169169
* Computes a single linear RGBA color for given gradient spec and normalized
170-
* position `t` (in [0..1] interval).
170+
* position `t` (in `[0,1]` interval).
171171
*
172172
* @param spec -
173173
* @param t -

packages/color/src/hcy/hcy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export declare class HCY implements TypedColor<HCY> {
3737
/**
3838
* @remarks
3939
* Note: As with other hue-based color modes in this package, the hue is stored
40-
* normalized (in [0..1] interval) and NOT as degrees.
40+
* normalized (in `[0,1]` interval) and NOT as degrees.
4141
*/
4242
export const hcy = <ColorFactory<HCY>>defColor({
4343
mode: "hcy",

packages/color/src/hsi/hsi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export declare class HSI implements TypedColor<HSI> {
3737
/**
3838
* @remarks
3939
* Note: As with other hue-based color modes in this package, the hue is stored
40-
* normalized (in [0..1] interval) and NOT as degrees.
40+
* normalized (in `[0,1]` interval) and NOT as degrees.
4141
*/
4242
export const hsi = <ColorFactory<HSI>>defColor({
4343
mode: "hsi",

packages/color/src/hsl/hsl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export declare class HSL implements TypedColor<HSL> {
3838
/**
3939
* @remarks
4040
* Note: As with other hue-based color modes in this package, the hue is stored
41-
* normalized (in [0..1] interval) and NOT as degrees.
41+
* normalized (in `[0,1]` interval) and NOT as degrees.
4242
*/
4343
export const hsl = <ColorFactory<HSL>>defColor({
4444
mode: "hsl",

packages/color/src/hsv/hsv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export declare class HSV implements TypedColor<HSV> {
3838
/**
3939
* @remarks
4040
* Note: As with other hue-based color modes in this package, the hue is stored
41-
* normalized (in [0..1] interval) and NOT as degrees.
41+
* normalized (in `[0,1]` interval) and NOT as degrees.
4242
*/
4343
export const hsv = <ColorFactory<HSV>>defColor({
4444
mode: "hsv",

packages/color/src/lab/lab-css.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import { __labCss } from "../internal/css.js";
44

55
/**
66
* @remarks
7-
* Only supported in CSS Color Level 4 onwards
8-
* https://www.w3.org/TR/css-color-4/#specifying-lab-lch
9-
* https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
7+
* Only supported in CSS Color Level 4 onwards.
8+
*
9+
* References:
10+
*
11+
* - https://www.w3.org/TR/css-color-4/#specifying-lab-lch
12+
* - https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
1013
*
1114
* @param src -
1215
*/

packages/color/src/lch/lch-css.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import { __lchCss } from "../internal/css.js";
44

55
/**
66
* @remarks
7-
* Only supported in CSS Color Level 4 onwards
8-
* https://www.w3.org/TR/css-color-4/#specifying-lab-lch
9-
* https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
7+
* Only supported in CSS Color Level 4 onwards.
8+
*
9+
* References:
10+
*
11+
* - https://www.w3.org/TR/css-color-4/#specifying-lab-lch
12+
* - https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
1013
*
1114
* @param src -
1215
*/

packages/color/src/lch/lch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export declare class LCH implements TypedColor<LCH> {
4141
*
4242
* @remarks
4343
* Note: As with other hue-based color modes in this package, the hue is stored
44-
* normalized (in [0..1] interval) and NOT as degrees.
44+
* normalized (in `[0,1]` interval) and NOT as degrees.
4545
*/
4646
export const lch = <ColorFactory<LCH>>defColor({
4747
mode: "lch",

packages/color/src/mix.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const defMix: FnU4<FnN3, ColorMixFn> =
3131
* Single channel interpolation for (normalized) hues. Always interpolates via
3232
* smallest angle difference, i.e. such that the effective `abs(a-b) <= 0.5`.
3333
*
34-
* @param a - start hue in [0,1) interval
35-
* @param b - end hue in [0,1) interval
34+
* @param a - start hue in `[0,1)` interval
35+
* @param b - end hue in `[0,1)` interval
3636
* @param t - interpolation factor
3737
*/
3838
export const mixH: FnN3 = (a, b, t) => {
@@ -64,7 +64,7 @@ export const mixHNNN = defMix(mixH, mixN, mixN, mixN);
6464
export const mixNNHN = defMix(mixN, mixN, mixH, mixN);
6565

6666
/**
67-
* Channelwise linear interpolation between colors `a` and `b` using `t` [0..1]
67+
* Channelwise linear interpolation between colors `a` and `b` using `t` `[0,1]`
6868
* as blend factor.
6969
*
7070
* @param out -
@@ -76,7 +76,7 @@ export const mixNNNN: ColorMixFn = mixN4;
7676

7777
/**
7878
* Channelwise and {@link ColorMode}-aware interpolation between colors `a` and
79-
* `b` using `t` [0..1] as blend factor. `a` and `b` MUST be of same color
79+
* `b` using `t` `[0,1]` as blend factor. `a` and `b` MUST be of same color
8080
* type.
8181
*
8282
* @remarks

packages/color/src/oklab/oklab-css.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import { __labCss } from "../internal/css.js";
44

55
/**
66
* @remarks
7-
* Only supported in CSS Color Level 4 onwards
8-
* https://www.w3.org/TR/css-color-4/#specifying-lab-lch
9-
* https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
7+
* Only supported in CSS Color Level 4 onwards.
8+
*
9+
* References:
10+
*
11+
* - https://www.w3.org/TR/css-color-4/#specifying-lab-lch
12+
* - https://test.csswg.org/harness/results/css-color-4_dev/grouped/ (test reports)
1013
*
1114
* @param src -
1215
*/

packages/color/src/oklch/oklch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export declare class Oklch implements TypedColor<Oklch> {
3838
*
3939
* @remarks
4040
* Note: As with other hue-based color modes in this package, the hue is stored
41-
* normalized (in [0..1] interval) and NOT as degrees.
41+
* normalized (in `[0,1]` interval) and NOT as degrees.
4242
*
4343
* Reference: https://bottosson.github.io/posts/oklab/
4444
*/

packages/color/src/rotate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { __ensureAlpha } from "./internal/ensure.js";
1414
* If `out` is null, the resulting will be written back into `src`.
1515
*
1616
* As with all hue-based color modes in this package, the hue is stored
17-
* normalized (in [0..1] interval) and NOT as degrees. The same goes for the
17+
* normalized (in `[0,1]` interval) and NOT as degrees. The same goes for the
1818
* rotation angle `theta`.
1919
*
2020
* Only supported for hue based color modes:

packages/color/src/transform.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const S8 = 0.283;
2525
* @param out - result
2626
* @param mat - transform matrix
2727
* @param src - source color
28-
* @param clampOut - true, if result should be clamped to [0..1]
28+
* @param clampOut - true, if result should be clamped to `[0,1]`
2929
*/
3030
export const transform = __mulV45;
3131

@@ -126,7 +126,7 @@ export const hueRotateMat = (theta: number): ColorMatrix => {
126126

127127
/**
128128
* Color temperature adjustment matrix. `x` controls blue/yellow, `y` controls
129-
* green/magenta axis (both params in [-1,1] range).
129+
* green/magenta axis (both params in `[-1,1]` range).
130130
*
131131
* @param x
132132
* @param y

packages/color/src/xyy/xyy-xyz.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { __ensureAlpha } from "../internal/ensure.js";
66

77
/**
88
* @remarks
9-
* https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space
10-
* https://gamedev.stackexchange.com/a/70049
9+
* - https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space
10+
* - https://gamedev.stackexchange.com/a/70049
1111
*
1212
* @param out -
1313
* @param src -

packages/color/src/xyz/xyz-xyy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { __ensureAlpha } from "../internal/ensure.js";
66

77
/**
88
* @remarks
9-
* https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space
10-
* https://gamedev.stackexchange.com/a/70049
9+
* - https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space
10+
* - https://gamedev.stackexchange.com/a/70049
1111
*
1212
* @param out -
1313
* @param src -

packages/colored-noise/src/pink.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { preseed, sum } from "./utils.js";
77
* Exponential decay (1/f) noise, based on Voss-McCarthy algorithm.
88
*
99
* @remarks
10-
* The number of internal states should be in the [4..32] range (default: 8).
10+
* The number of internal states should be in the `[4,32]` range (default: 8).
1111
* Due to JS integer limitations, `n` > 32 are meaningless.
1212
*
1313
* References:

packages/complex/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export type ComplexOp1 = Fn<Complex, Complex>;
2222
export type ComplexOp2 = Fn2<Complex, Complex | number, Complex>;
2323

2424
/**
25-
* Complex `i` aka [0, 1]
25+
* Complex `i` aka `[0,1]`
2626
*/
2727
export const I: Complex = Object.freeze([0, 1]);
2828

2929
/**
30-
* Same as 1/i, i.e. [0, -1]
30+
* Same as 1/i, i.e. `[0,-1]`
3131
*/
3232
export const J: Complex = Object.freeze([0, -1]);
3333

packages/date/src/timecode.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Z2 } from "@thi.ng/strings/pad-left";
33
import { decomposeDuration } from "./duration.js";
44

55
/**
6-
* Returns a time formatter for given FPS (frames / second, in [1..1000] range),
7-
* e.g. `HH:mm:ss:ff`. The returned function takes a single arg (time in
6+
* Returns a time formatter for given FPS (frames / second, in `[1,1000]`
7+
* range), e.g. `HH:mm:ss:ff`. The returned function takes a single arg (time in
88
* milliseconds) and returns formatted string.
99
*
1010
* @remarks

packages/distance/src/manhattan.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import type { IDistance, Metric } from "./api.js";
1414
* The conversion are always based on n-D squares, i.e. the assumption that the
1515
* distance is equally shared in each dimension.
1616
*
17-
* E.g. a Manhattan distance of 30 could be obtained from [0,0] -> [10,20], but
18-
* would be interpreted here as distance from [0,0] -> [15,15], which produces
19-
* the same Manhattan value, but yields a different Eucledian result. For lack
20-
* of any other information about the distance values, this is however the only
21-
* way to approach conversion and is sufficient for the purposes of this
22-
* package...
17+
* E.g. a Manhattan distance of 30 could be obtained from `[0,0]` -> `[10,20]`,
18+
* but would be interpreted here as distance from `[0,0]` -> `[15,15]`, which
19+
* produces the same Manhattan value, but yields a different Eucledian result.
20+
* For lack of any other information about the distance values, this is however
21+
* the only way to approach conversion and is sufficient for the purposes of
22+
* this package...
2323
*
2424
* @example
2525
* ```ts tangle:../export/manhattan.ts

packages/dsp/src/adsr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface ADSROpts {
2525
*/
2626
d: number;
2727
/**
28-
* Sustain level/gain (in [0..1] range). Default: 1
28+
* Sustain level/gain (in `[0,1]` range). Default: 1
2929
*/
3030
s: number;
3131
/**

packages/dsp/src/foldback.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { AProc } from "./aproc.js";
77
* amplifies it with `amp` (default: 1/thresh).
88
*
99
* @remarks
10-
* Reference:
11-
* https://www.desmos.com/calculator/lkyf2ag3ta
10+
* [Interactive graph](https://www.desmos.com/calculator/lkyf2ag3ta)
1211
*
1312
* @param thresh - fold threshold
1413
* @param amp - post amplifier

0 commit comments

Comments
 (0)