Skip to content

Commit 15ec9d0

Browse files
committed
chore: update jsdoc
1 parent f9252d1 commit 15ec9d0

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

lib/health-check/health-check.error.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
22
* @deprecated
3-
* This class has been deprecated and will be removed in the next major release.
3+
* **This class has been deprecated and will be removed in the next major release.**
44
* Instead utilise the `HealthIndicatorService` to indicate the health of your health indicator.
5+
*
6+
* @see {@link https://docs.nestjs.com/migration-guide#terminus-module|Migration Guide}
57
*/
68
export class HealthCheckError extends Error {
79
causes: any;

lib/health-indicator/health-indicator.service.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ import { type HealthIndicatorResult } from './health-indicator-result.interface'
77
*/
88
@Injectable()
99
export class HealthIndicatorService {
10-
check<Key extends string>(key: Key) {
10+
check<const Key extends string>(key: Key) {
1111
return new HealthIndicatorSession(key);
1212
}
1313
}
1414

1515
type AdditionalData = Record<string, unknown>;
1616

17+
/**
18+
* Indicate the health of a health indicator with the given key
19+
*
20+
* @publicApi
21+
*/
1722
export class HealthIndicatorSession<Key extends Readonly<string> = string> {
1823
constructor(private readonly key: Key) {}
1924

2025
/**
21-
* Mark the health indicator as down
26+
* Mark the health indicator as `down`
2227
* @param data additional data which will get appended to the result object
2328
*/
2429
down<T extends AdditionalData>(
@@ -49,6 +54,10 @@ export class HealthIndicatorSession<Key extends Readonly<string> = string> {
4954
} as Record<Key, typeof detail>;
5055
}
5156

57+
/**
58+
* Mark the health indicator as `up`
59+
* @param data additional data which will get appended to the result object
60+
*/
5261
up<T extends AdditionalData>(data?: T): HealthIndicatorResult<Key, 'up', T>;
5362
up<T extends string>(
5463
data?: T,

lib/health-indicator/health-indicator.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ export type HealthIndicatorFunction = () =>
1010
| HealthIndicatorResult;
1111

1212
/**
13+
* @deprecated
14+
* **This class has been deprecated and will be removed in the next major release.**
15+
* Instead utilise the `HealthIndicatorService` to indicate the health of your health indicator.
16+
*
17+
* @see {@link https://docs.nestjs.com/migration-guide#terminus-module|Migration Guide}
18+
*
19+
* @description
1320
* Represents an abstract health indicator
1421
* with common functionalities
1522
*
1623
* A custom HealthIndicator should inherit the `HealthIndicator` class.
1724
*
25+
* @example
1826
* ```typescript
19-
*
2027
* class MyHealthIndicator extends HealthIndicator {
2128
* public check(key: string) {
2229
* // Replace with the actual check
@@ -26,11 +33,7 @@ export type HealthIndicatorFunction = () =>
2633
* }
2734
* }
2835
* ```
29-
*
3036
* @publicApi
31-
* @deprecated
32-
* This class has been deprecated and will be removed in the next major release.
33-
* Instead utilise the `HealthIndicatorService` to indicate the health of your health indicator.
3437
*/
3538
export abstract class HealthIndicator {
3639
/**

0 commit comments

Comments
 (0)