Skip to content

Commit 99c3d0e

Browse files
committed
docs(algorithms,types): standardize JSDoc @typeparam to @template
Replace non-standard @typeparam with standard @template tag for generic type documentation across algorithms and types packages. This improves compatibility with documentation generators.
1 parent 79aa39e commit 99c3d0e

File tree

18 files changed

+62
-62
lines changed

18 files changed

+62
-62
lines changed

packages/algorithms/src/clustering/infomap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ interface Transition {
4848
*
4949
* Infomap uses information theory to find communities by minimizing the
5050
* description length (map equation) of random walks on the network.
51-
* @typeParam N - Node type
52-
* @typeParam E - Edge type
51+
* @template N - Node type
52+
* @template E - Edge type
5353
* @param graph - Input graph (directed or undirected)
5454
* @param options - Optional configuration
5555
* @param options.weightFn - Weight function for edges (default: all edges weight 1.0)

packages/algorithms/src/clustering/label-propagation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import type { WeightFunction } from '../types/weight-function';
3030
* Fast semi-supervised clustering algorithm that propagates labels through
3131
* the network based on neighbor voting. Nodes iteratively adopt the most
3232
* frequent label among their neighbors.
33-
* @typeParam N - Node type
34-
* @typeParam E - Edge type
33+
* @template N - Node type
34+
* @template E - Edge type
3535
* @param graph - Input graph (directed or undirected)
3636
* @param options - Optional configuration
3737
* @param options.weightFn - Weight function for edges (default: all edges weight 1.0)

packages/algorithms/src/clustering/leiden.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ interface InternalCommunity {
4040
*
4141
* The Leiden algorithm improves upon Louvain by adding a refinement phase that
4242
* guarantees all detected communities are connected subgraphs.
43-
* @typeParam N - Node type
44-
* @typeParam E - Edge type
43+
* @template N - Node type
44+
* @template E - Edge type
4545
* @param graph - Input graph (directed or undirected)
4646
* @param options - Optional configuration
4747
* @param options.weightFn - Weight function for edges (default: all edges weight 1.0)

packages/algorithms/src/clustering/louvain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export const shuffle = <T>(array: T[], seed?: number): T[] => {
119119
*
120120
* The Louvain method is a greedy optimization method that attempts to optimize
121121
* the modularity of a partition of the network.
122-
* @typeParam N - Node type
123-
* @typeParam E - Edge type
122+
* @template N - Node type
123+
* @template E - Edge type
124124
* @param graph - Input graph (directed or undirected)
125125
* @param options - Optional configuration (combines legacy and optimization parameters)
126126
* @param options.weightFn - Weight function for edges (default: all edges weight 1.0) [Legacy]

packages/algorithms/src/decomposition/biconnected.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ const extractRemainingComponent = (state: TarjanState): BiconnectedComponent<str
276276
* 3. Detect articulation points: low[child] ≥ disc[v]
277277
* 4. Extract components by popping edge stack on backtrack
278278
* 5. Handle disconnected graphs (DFS from each unvisited node)
279-
* @typeParam N - Node type
280-
* @typeParam E - Edge type
279+
* @template N - Node type
280+
* @template E - Edge type
281281
* @param graph - Undirected graph to analyze
282282
* @returns Result containing biconnected components and articulation points, or error
283283
* @example

packages/algorithms/src/decomposition/core-periphery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export interface CorePeripheryOptions {
4949
* Identifies a dense core of highly connected nodes and a sparse periphery.
5050
* Core nodes have high coreness scores (> threshold) and are densely connected to each other.
5151
* Periphery nodes have low coreness scores and are sparsely connected.
52-
* @typeParam N - Node type
53-
* @typeParam E - Edge type
52+
* @template N - Node type
53+
* @template E - Edge type
5454
* @param graph - Input graph (directed or undirected)
5555
* @param options - Optional parameters (threshold, iterations, epsilon)
5656
* @returns Result with core-periphery structure or error

packages/algorithms/src/graph/graph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Err,Ok, type Result } from '../types/result';
99
/**
1010
* Generic graph data structure supporting both directed and undirected graphs.
1111
* Uses adjacency list representation for efficient neighbor lookup (O(1) average case).
12-
* @typeParam N - Node type (must extend Node interface with id and type fields)
13-
* @typeParam E - Edge type (must extend Edge interface with source, target fields)
12+
* @template N - Node type (must extend Node interface with id and type fields)
13+
* @template E - Edge type (must extend Edge interface with source, target fields)
1414
* @example
1515
* ```typescript
1616
* type WorkNode = { id: string; type: 'work'; title: string };

packages/algorithms/src/hierarchical/clustering.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ const buildDendrogram = <N extends Node>(nodes: N[], merges: MergeStep[], height
294294

295295
/**
296296
* Perform hierarchical clustering on a graph.
297-
* @typeParam N - Node type
298-
* @typeParam E - Edge type
297+
* @template N - Node type
298+
* @template E - Edge type
299299
* @param graph - Input graph (directed or undirected)
300300
* @param options - Configuration options
301301
* @param options.linkage - Linkage method: 'single', 'complete', or 'average' (default: 'average')

packages/algorithms/src/metrics/cluster-quality.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import { calculateModularity } from './modularity';
2828
* - 1.0 = complete graph (all possible edges present)
2929
* - 0.0 = no internal edges
3030
* - Higher density indicates tighter community structure
31-
* @typeParam N - Node type
32-
* @typeParam E - Edge type
31+
* @template N - Node type
32+
* @template E - Edge type
3333
* @param graph - Input graph
3434
* @param clusterNodes - Set of nodes in the cluster
3535
* @returns Density score in range [0.0, 1.0]
@@ -93,8 +93,8 @@ export const calculateDensity = <N extends Node, E extends Edge>(graph: Graph<N,
9393

9494
/**
9595
* Calculate average density across multiple clusters.
96-
* @typeParam N - Node type
97-
* @typeParam E - Edge type
96+
* @template N - Node type
97+
* @template E - Edge type
9898
* @param graph - Input graph
9999
* @param clusters - Array of node sets representing clusters
100100
* @returns Average density score
@@ -130,8 +130,8 @@ export const calculateAverageDensity = <N extends Node, E extends Edge>(graph: G
130130
* Range: [0.0, 1.0]
131131
* - Higher coverage means most edges are within communities
132132
* - Lower coverage means many inter-community edges
133-
* @typeParam N - Node type
134-
* @typeParam E - Edge type
133+
* @template N - Node type
134+
* @template E - Edge type
135135
* @param graph - Input graph
136136
* @param clusters - Array of node sets representing clusters
137137
* @returns Coverage ratio
@@ -191,8 +191,8 @@ export const calculateCoverageRatio = <N extends Node, E extends Edge>(graph: Gr
191191
*
192192
* Computes modularity, average conductance, average density, coverage ratio,
193193
* and cluster count for a complete clustering.
194-
* @typeParam N - Node type
195-
* @typeParam E - Edge type
194+
* @template N - Node type
195+
* @template E - Edge type
196196
* @param graph - Input graph
197197
* @param communities - Array of communities
198198
* @returns Aggregated ClusterMetrics
@@ -234,8 +234,8 @@ export const calculateClusterMetrics = <N extends Node, E extends Edge>(graph: G
234234
* Update ClusterMetrics with per-community density values.
235235
*
236236
* Modifies community objects to include their individual density scores.
237-
* @typeParam N - Node type
238-
* @typeParam E - Edge type
237+
* @template N - Node type
238+
* @template E - Edge type
239239
* @param graph - Input graph
240240
* @param communities - Array of communities (modified in place)
241241
* @example

packages/algorithms/src/metrics/conductance.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import type { Edge,Node } from '../types/graph';
2222
* - Lower values indicate better cluster quality (fewer boundary edges)
2323
* - φ < 0.1 typically indicates strong cluster cohesion
2424
* - φ > 0.5 indicates weak cluster structure
25-
* @typeParam N - Node type
26-
* @typeParam E - Edge type
25+
* @template N - Node type
26+
* @template E - Edge type
2727
* @param graph - Input graph
2828
* @param clusterNodes - Set of nodes in the cluster
2929
* @returns Conductance score in range [0.0, 1.0]
@@ -112,8 +112,8 @@ export const calculateConductance = <N extends Node, E extends Edge>(graph: Grap
112112

113113
/**
114114
* Calculate average conductance across multiple clusters.
115-
* @typeParam N - Node type
116-
* @typeParam E - Edge type
115+
* @template N - Node type
116+
* @template E - Edge type
117117
* @param graph - Input graph
118118
* @param clusters - Array of node sets representing clusters
119119
* @returns Average conductance score
@@ -146,8 +146,8 @@ export const calculateAverageConductance = <N extends Node, E extends Edge>(grap
146146
* Calculate weighted average conductance (weighted by cluster size).
147147
*
148148
* Larger clusters have more influence on the average.
149-
* @typeParam N - Node type
150-
* @typeParam E - Edge type
149+
* @template N - Node type
150+
* @template E - Edge type
151151
* @param graph - Input graph
152152
* @param clusters - Array of node sets representing clusters
153153
* @returns Weighted average conductance score

0 commit comments

Comments
 (0)