From b4aff86c8498ed8088fd4e7f9d0103c527a30286 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 12 Dec 2022 09:19:39 +0100 Subject: [PATCH] [MainUI] Update openhab-js tern defs (#1576) This updated the tern definitions for the openhab-js version included in the addon (3.1.2). Reference https://github.com/openhab/openhab-js/compare/v3.0.0...v3.1.2. Signed-off-by: Florian Hotze --- .../web/src/assets/openhab-js-tern-defs.json | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/assets/openhab-js-tern-defs.json b/bundles/org.openhab.ui/web/src/assets/openhab-js-tern-defs.json index 4df6f2b9a..f869cdd84 100644 --- a/bundles/org.openhab.ui/web/src/assets/openhab-js-tern-defs.json +++ b/bundles/org.openhab.ui/web/src/assets/openhab-js-tern-defs.json @@ -350,17 +350,31 @@ } }, "CacheNamespace": { + "shared": { + "!doc": "Shared cache that is shared across all rules and scripts, it can therefore be accessed from any automation language. A key is removed when all scripts that ever accessed it are unloaded, if the key stores a timer, the timer is cancelled.", + "!type": "JSCache" + }, + "private": { + "!doc": "Private cache for each script. It can only be accessed by the same script and is cleared when the script is unloaded. When the script is unloaded, all timers in the script are cancelled.", + "!type": "JSCache" + } + }, + "JSCache": { "get": { - "!doc": "Returns the value to which the specified key is mapped", + "!doc": "Returns the value to which the specified key is mapped. The optional defaultSupplier will return a default value if the key has no associated value.", "!type": "fn(key: string, defaultSupplier?: fn()) -> ?" }, "put": { - "!doc": "Associates the specified value with the specified key", + "!doc": "Associates the specified value with the specified key.", "!type": "fn(key: string, value: ?) -> ?" }, "remove": { - "!doc": "Removes the mapping for a key from this map if it is present", + "!doc": "Removes the mapping for a key from this map if it is present.", "!type": "fn(key: string) -> ?" + }, + "exists": { + "!doc": "Checks whether a value is associated with the given key.", + "!type": "fn(key: string) -> boolean" } }, "Timer": { @@ -637,7 +651,7 @@ "!type": "ThingsNamespace" }, "cache": { - "!doc": "Shared cache namespace. This namespace provides a default cache that can be use to set and retrieve objects that will be persisted between reloads of scripts.", + "!doc": "Cache namespace. This namespace provides caches that can be used to set and retrieve objects that will be persisted between reloads of scripts.", "!type": "CacheNamespace" }, "log": {