Skip to content

Commit

Permalink
spelling and grammar in code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Apr 6, 2024
1 parent bc83087 commit c6a0157
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to `@homebridge/plugin-ui-utils` will be documented in this
- update CHANGELOG to match hb repo formats
- update example folder package json files
- update LICENSE file to match hb repo formats
- spelling and grammar in code comments

## v1.0.2 (2024-03-30)

Expand Down
6 changes: 3 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Homebridge Custom Plugin UI Base Class
* This provides the api to facilitate two way communication between a plugin
* This provides the api to facilitate two-way communication between a plugin
* custom UI HTML code and the server.
*
* This is a base class and is intended to be extended.
Expand Down Expand Up @@ -59,7 +59,7 @@ export class HomebridgePluginUiServer {
return process.env.HOMEBRIDGE_UI_VERSION;
}

private sendResponse(request, data: any, success = true) {
private sendResponse(request: any, data: any, success = true) {
if (!process.send) {
return;
}
Expand Down Expand Up @@ -185,7 +185,7 @@ export class RequestError extends Error {
}

type RequestResponse = string | number | Record<any, any> | Array<any>;
type RequestHandler = (any) => Promise<RequestResponse> | RequestResponse;
type RequestHandler = (arg: any) => Promise<RequestResponse> | RequestResponse;

setInterval(() => {
if (!process.connected) {
Expand Down
10 changes: 6 additions & 4 deletions src/ui.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export declare class IHomebridgePluginUi extends EventTarget {
public showSpinner(): void;

/**
* Hide theloading spinner overlay.
* Hide the loading spinner overlay.
*
* @example
* ```ts
Expand Down Expand Up @@ -144,11 +144,13 @@ export declare class IHomebridgePluginUi extends EventTarget {

/**
* Create a standalone form using a generic schema.
* This is not linked to the main config schema model and you must listen for changes yourself.
* This is not linked to the main config schema model, and you must listen for changes yourself.
*
* @param schema the schema used to generate the standlone form. See [schema guide](https://developers.homebridge.io/#/config-schema).
* @param schema the schema used to generate the standalone form. See [schema guide](https://developers.homebridge.io/#/config-schema).
* @param data the initial form data
*
* @param submitButton
* @param cancelButton
* @example
* ```ts
* const myForm = homebridge.createForm(
Expand Down Expand Up @@ -221,7 +223,7 @@ export declare class IHomebridgePluginUi extends EventTarget {

/**
* Save the plugin config.
* You must called `homebridge.updatePluginConfig` first.
* You must call `homebridge.updatePluginConfig` first.
*
* @example
* ```ts
Expand Down
4 changes: 2 additions & 2 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let EventTargetConstructor = window.EventTarget;

/**
* Pollyfill for older browsers that do not support EventTarget as a constructor.
* Polyfill for older browsers that do not support EventTarget as a constructor.
* https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
*/
if (!Object.prototype.hasOwnProperty.call(window.EventTarget, 'caller')) {
Expand Down Expand Up @@ -148,7 +148,7 @@ class HomebridgePluginUi extends EventTargetConstructor {
}

private async _requestResponse(payload): Promise<any> {
// generate a random request id so we can link the response
// generate a random request id, so we can link the response
const requestId = Math.random().toString(36).substring(2);
payload.requestId = requestId;

Expand Down

0 comments on commit c6a0157

Please sign in to comment.