From 5a1e8e3892ab02d7985bce8603b35450854020d9 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Wed, 13 Nov 2024 16:39:33 +0000 Subject: [PATCH] Added better typing for `ScriptCommon.engineType` attribute (#2962) --- packages/adapter/src/lib/adapter/adapter.ts | 10 +++++----- packages/types-dev/objects.d.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/adapter/src/lib/adapter/adapter.ts b/packages/adapter/src/lib/adapter/adapter.ts index 82010fc9d..c1dfc560f 100644 --- a/packages/adapter/src/lib/adapter/adapter.ts +++ b/packages/adapter/src/lib/adapter/adapter.ts @@ -161,14 +161,14 @@ export interface AdapterClass { /** * Extend an object and create it if it might not exist * - * @deprecated use `adapter.extendObject` without callback instead + * @deprecated use `adapter.extendObject` without a callback instead */ extendObjectAsync( id: string, objPart: ioBroker.PartialObject, options?: ioBroker.ExtendObjectOptions, ): ioBroker.SetObjectPromise; - /** Set capabilities of the given executable. Only works on Linux systems. */ + /** Set the capabilities of the given executable. Only works on Linux systems. */ setExecutableCapabilities( execPath: string, capabilities: string[], @@ -1606,7 +1606,7 @@ export class AdapterClass extends EventEmitter { * ... * } * ``` - + * @param featureName the name of the feature to check * @returns true/false if the feature is in the list of supported features */ @@ -2596,7 +2596,7 @@ export class AdapterClass extends EventEmitter { } /** - * Get the system secret, after retrived once it will be read from cache + * Get the system secret, after retrieved once it will be read from the cache */ private async getSystemSecret(): Promise { if (this._systemSecret !== undefined) { @@ -2624,7 +2624,7 @@ export class AdapterClass extends EventEmitter { ): ioBroker.Timeout | undefined; /** * Same as setTimeout, - * but it clears the running timers during the unload process + * but it clears the running timers during the unloading process * does not work after unload has been called * * @param cb - timer callback diff --git a/packages/types-dev/objects.d.ts b/packages/types-dev/objects.d.ts index a6c751822..6e141570a 100644 --- a/packages/types-dev/objects.d.ts +++ b/packages/types-dev/objects.d.ts @@ -453,7 +453,7 @@ declare global { interface ScriptCommon extends ObjectCommon { name: string; /** Defines the type of the script, e.g., TypeScript/ts, JavaScript/js or Blockly */ - engineType: string; + engineType: 'TypeScript/ts' | 'Blockly' | 'Rules' | 'JavaScript/js'; /** The instance id of the instance which executes this script */ engine: string; /** The source code of this script */