From 81c5a7f9d5a1862d245fc62584acd7f14df45489 Mon Sep 17 00:00:00 2001 From: Patrick Seal Date: Tue, 14 Nov 2023 18:04:53 -0800 Subject: [PATCH] docs: typedoc upgrade changes --- src/client.ts | 22 +++++++++++----------- src/device/index.ts | 6 +++--- src/plug/index.ts | 6 +++--- src/shared/schedule.ts | 2 +- src/utils.ts | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/client.ts b/src/client.ts index a66c528..b1f75bc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -200,13 +200,13 @@ export interface ClientEvents { * Invalid/Unknown response from device. */ 'discovery-invalid': ({ - rinfo, - response, - decryptedResponse, - }: { - rinfo: RemoteInfo; - response: Buffer; - decryptedResponse: Buffer; + rinfo, + response, + decryptedResponse, + }: { + rinfo: RemoteInfo; + response: Buffer; + decryptedResponse: Buffer; }) => void; /** @@ -228,7 +228,7 @@ declare interface Client { /** * Client that sends commands to specified devices or discover devices on the local subnet. * - Contains factory methods to create devices. - * - Events are emitted after {@link #startDiscovery} is called. + * - Events are emitted after {@link Client#startDiscovery} is called. * @noInheritDoc */ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging @@ -336,7 +336,7 @@ class Client extends EventEmitter { * * @returns parsed JSON response * @throws {@link ResponseError} - * @throws {@link Error} + * @throws Error */ async getSysInfo( host: string, @@ -457,7 +457,7 @@ class Client extends EventEmitter { * * See [Device constructor]{@link Device}, [Bulb constructor]{@link Bulb}, [Plug constructor]{@link Plug} for valid options * @param deviceOptions - passed to device constructor - * @throws {@link Error} + * @throws Error */ getDeviceFromSysInfo( sysInfo: Sysinfo, @@ -497,7 +497,7 @@ class Client extends EventEmitter { * * - Sends a discovery packet (via UDP) to the `broadcast` address every `discoveryInterval`(ms). * - Stops discovery after `discoveryTimeout`(ms) (if `0`, runs until {@link Client.stopDiscovery} is called). - * - If a device does not respond after `offlineTolerance` number of attempts, {@link Client.device-offline} is emitted. + * - If a device does not respond after `offlineTolerance` number of attempts, {@link ClientEvents.device-offline} is emitted. * - If `deviceTypes` are specified only matching devices are found. * - If `macAddresses` are specified only devices with matching MAC addresses are found. * - If `excludeMacAddresses` are specified devices with matching MAC addresses are excluded. diff --git a/src/device/index.ts b/src/device/index.ts index 0c95aa2..e3af220 100644 --- a/src/device/index.ts +++ b/src/device/index.ts @@ -407,7 +407,7 @@ abstract class Device extends EventEmitter { /** * Sends command(s) to device. * - * Calls {@link #send} and processes the response. + * Calls {@link Device#send} and processes the response. * * - Adds context.child_ids:[] to the command. * - If `childIds` parameter is set. _or_ @@ -417,9 +417,9 @@ abstract class Device extends EventEmitter { * - Promise fulfills with specific parsed JSON response for command.\ * Example: `{system:{get_sysinfo:{}}}` * - resolves to: `{err_code:0,...}`\ - * - instead of: `{system:{get_sysinfo:{err_code:0,...}}}` (as {@link #send} would) + * - instead of: `{system:{get_sysinfo:{err_code:0,...}}}` (as {@link Device#send} would) * - If more than one operation was sent: - * - Promise fulfills with full parsed JSON response (same as {@link #send}) + * - Promise fulfills with full parsed JSON response (same as {@link Device#send}) * * Also, the response's `err_code`(s) are checked, if any are missing or != `0` the Promise is rejected with {@link ResponseError}. * @returns parsed JSON response diff --git a/src/plug/index.ts b/src/plug/index.ts index f28cef2..70c2c31 100644 --- a/src/plug/index.ts +++ b/src/plug/index.ts @@ -121,7 +121,7 @@ declare interface Plug { * If Plug is instantiated with a childId it will control the outlet associated with that childId. * Some functions only apply to the entire device, and are noted below. * - * Emits events after device status is queried, such as {@link #getSysInfo} and {@link #getEmeterRealtime}. + * Emits events after device status is queried, such as {@link Plug#getSysInfo} and {@link Plug#emeter.getRealtime}. * @extends Device * @extends EventEmitter * @fires Plug#power-on @@ -548,7 +548,7 @@ class Plug extends Device { } /** - * Same as {@link #inUse}, but requests current `emeter.get_realtime`. Supports childId. + * Same as {@link Plug#inUse}, but requests current `emeter.get_realtime`. Supports childId. * @returns parsed JSON response * @throws {@link ResponseError} */ @@ -594,7 +594,7 @@ class Plug extends Device { /** * Get Plug relay state (on/off). * - * Requests `system.get_sysinfo` and returns true if On. Calls {@link #relayState}. Supports childId. + * Requests `system.get_sysinfo` and returns true if On. Calls {@link Plug#relayState}. Supports childId. * @throws {@link ResponseError} */ async getPowerState(sendOptions?: SendOptions): Promise { diff --git a/src/shared/schedule.ts b/src/shared/schedule.ts index 8edb148..89d16e9 100644 --- a/src/shared/schedule.ts +++ b/src/shared/schedule.ts @@ -277,7 +277,7 @@ export default abstract class Schedule { * * Requests `schedule.get_rules` and return rule matching Id. Supports childId. * @throws {@link ResponseError} - * @throws {@link Error} + * @throws Error */ async getRule( id: string, diff --git a/src/utils.ts b/src/utils.ts index 9dd5691..98ec7a6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -268,7 +268,7 @@ export function processResponse( * @param path passed to `lodash.get` * @param typeGuardFn * @returns value of `path` in `response` - * @throws {@link Error} + * @throws Error * @throws {@link TypeError} */ export function extractResponse(