Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 7 additions & 16 deletions typescript/scripting-api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ declare namespace WoT {
value(): Promise<DataSchemaValue>;
}

export interface Subscription {
active:boolean,
stop(options?: InteractionOptions):Promise<void>
}

/**
* The ConsumedThing interface instance represents a client API to operate a Thing.
*/
Expand Down Expand Up @@ -152,28 +157,14 @@ declare namespace WoT {
* Takes as arguments propertyName, listener and optionally options.
* It returns a Promise that resolves on success and rejects on failure.
*/
observeProperty(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise<void>;

/**
* Makes a request for Property value change notifications.
* Takes as arguments propertyName, listener and optionally options.
* It returns a Promise that resolves on success and rejects on failure.
*/
unobserveProperty(name: string): Promise<void>;
observeProperty(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise<Subscription>;

/**
* Makes a request for subscribing to Event notifications.
* Takes as arguments eventName, listener and optionally options.
* It returns a Promise to signal success or failure.
*/
subscribeEvent(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise<void>;

/**
* Makes a request for unsubscribing from Event notifications.
* Takes as arguments eventName and optionally options.
* It returns a Promise to signal success or failure.
*/
unsubscribeEvent(name: string): Promise<void>;
subscribeEvent(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise<Subscription>;

/**
* Returns the the object that represents the Thing Description.
Expand Down
2 changes: 1 addition & 1 deletion typescript/scripting-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wot-typescript-definitions",
"version": "0.8.0-SNAPSHOT.19",
"version": "0.8.0-SNAPSHOT.21",
"description": "TypeScript definitions for the W3C WoT Scripting API",
"author": "W3C Web of Things Working Group",
"license": "W3C-20150513",
Expand Down