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 openhab-js tern defs #2627

Merged
merged 1 commit into from
Jun 25, 2024
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
43 changes: 41 additions & 2 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 @@ -204,6 +204,14 @@
"!doc": "Query the next update time of a given item.",
"!type": "fn(serviceId?: string) -> ZonedDateTime|null"
},
"lastChange": {
"!doc": "Query the last change time of a given item.",
"!type": "fn(serviceId?: string) -> ZonedDateTime|null"
},
"nextChange": {
"!doc": "Query the next change time of a given item.",
"!type": "fn(serviceId?: string) -> ZonedDateTime|null"
},
"maximumBetween": {
"!doc": "Gets the maximum value of the persisted states of a given Item between two certain points in time.",
"!type": "fn(begin: +Date|+ZonedDateTime, end: +Date|+ZonedDateTime, serviceId?: string) -> PersistedItem|null"
Expand All @@ -229,8 +237,8 @@
"!type": "fn(timestamp: +Date|+ZonedDateTime, serviceId?: string) -> PersistedItem"
},
"persist": {
"!doc": "Persists the state of a given item",
"!type": "fn(serviceId?: string)"
"!doc": "Persists the current state of a given item or the given state at a given timestamp or a TimeSeries (see JavaScript Scripting docs/Standard Library/Items)",
"!type": "fn(timestamp?: +Date|+ZonedDateTime, state?: ?, timeSeries?: TimeSeries, serviceId?: string)"
},
"previousState": {
"!doc": "Returns the previous state of a given item.",
Expand Down Expand Up @@ -309,6 +317,32 @@
"!type": "QuantityClass|null"
}
},
"TimeSeries": {
"policy": {
"!doc": "Policy of the TimeSeries",
"!type": "string"
},
"begin": {
"!doc": "Timestamp of the first element in the TimeSeries",
"!type": "+Instant"
},
"end": {
"!doc": "Timestamp of the last element in the TimeSeries",
"!type": "+Instant"
},
"size": {
"!doc": "Number of elements in the TimeSeries",
"!type": "number"
},
"states": {
"!doc": "Array of states in the TimeSeries",
"!type": "[?]"
},
"add": {
"!doc": "Adds a new element to the TimeSeries",
"!type": "fn(timestamp: ?, state: ?)"
}
},
"ItemSemantics": {
"equipmentType": {
"!doc": "The type of the semantic equipment.",
Expand Down Expand Up @@ -416,6 +450,11 @@
"!doc": "Helper function to ensure an Item name is valid. All invalid characters are replaced with an underscore.",
"!type": "fn(s: string) -> string"
},
"TimeSeries": {
"!doc": "A TimeSeries is used to transport a set of states together with their timestamp.",
"!type": "fn(policy: string)",
"prototype": "TimeSeries"
},
"NAME": {
"!doc": "Gets an Item using it's name on the items namespace, e.g. items.Hallway_Light",
"!type": "Item"
Expand Down