scripting_api library

Defines interfaces that follow the WoT Scripting API Specification.

Classes

ConsumedThing
Represents a client API to operate a Thing. Belongs to the WoT Consumer conformance class.
ExposedThing
The ExposedThing interface is the server API to operate the Thing that allows defining request handlers, Property, Action, and Event interactions.
InteractionOptions
Holds the interaction options that need to be exposed for application scripts according to the Thing Description.
InteractionOutput
Exposes the data obtained by Thing interactions.
Subscription
Represents a subscription to Property change and Event interactions.
ThingDiscovery
Provides the properties and methods controlling the discovery process.
ThingFilter
Contains the constraints for discovering Things as key-value pairs.
WoT
Interface for a WoT runtime.

Enums

DiscoveryMethod
Enumeration of possible discovery methods.
SubscriptionType
Indicates the type of the subscription.

Functions

findUnsubscribeForm(InteractionAffordance interaction, SubscriptionType type, Form form, int? formIndex) Form
Finds a matching unsubscribe Form for a subscription form.

Typedefs

ActionHandler = Future<void> Function(InteractionOutput params, InteractionOptions? options)
A function that is called when an external request for invoking an Action is received and defines what to do with such requests.
ErrorListener = void Function(Exception data)
User provided callback that is given an argument of type Error and is used for conveying critical and non-critical errors from the Protocol Bindings to applications.
EventListenerHandler = Future<InteractionInput?> Function()
A function that is called when an associated Event is triggered and provides the data to be sent with the Event to subscribers.
EventSubscriptionHandler = Future<void> Function(InteractionOptions? options)
A function that is called when an external request for subscribing to an Event is received and defines what to do with such requests.
ExposedThingInit = Map<String, dynamic>
Dictionary used for the initialization of an exposed Thing.
InteractionInput = Object?
The (optional) input for an interaction.
InteractionListener = void Function(InteractionOutput data)
User provided callback that is given an argument of type InteractionOutput and is used for observing Property changes and handling Event notifications.
PropertyReadHandler = Future<InteractionInput?> Function(InteractionOptions? options)
A function that is called when an external request for reading a Property is received and defines what to do with such requests.
PropertyReadMap = Map<String, InteractionOutput>
Maps multiple InteractionOutputs to property names.
PropertyWriteHandler = Future<void> Function(InteractionOutput value, InteractionOptions? options)
A function that is called when an external request for writing a Property is received and defines what to do with such requests.
PropertyWriteMap = Map<String, InteractionInput?>
Maps multiple InteractionInputs to property names.

Exceptions / Errors

UnsubscribeException
Exception that is thrown when error during the unsubscribe process occurs.