Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JS Scripting tern definitions #1576

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions bundles/org.openhab.ui/web/src/assets/openhab-js-tern-defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down