Skip to content

Commit

Permalink
docs: typedoc upgrade changes
Browse files Browse the repository at this point in the history
  • Loading branch information
plasticrake committed Nov 15, 2023
1 parent fd336b2 commit 81c5a7f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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
Expand Down Expand Up @@ -336,7 +336,7 @@ class Client extends EventEmitter {
*
* @returns parsed JSON response
* @throws {@link ResponseError}
* @throws {@link Error}
* @throws Error
*/
async getSysInfo(
host: string,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/device/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/plug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
*/
Expand Down Expand Up @@ -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<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(
Expand Down

0 comments on commit 81c5a7f

Please sign in to comment.