diff --git a/typescript/scripting-api/index.d.ts b/typescript/scripting-api/index.d.ts index a3631602..8d1bb130 100644 --- a/typescript/scripting-api/index.d.ts +++ b/typescript/scripting-api/index.d.ts @@ -96,6 +96,11 @@ declare namespace WoT { value(): Promise; } + export interface Subscription { + active:boolean, + stop(options?: InteractionOptions):Promise + } + /** * The ConsumedThing interface instance represents a client API to operate a Thing. */ @@ -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; - - /** - * 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; + observeProperty(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise; /** * 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; - - /** - * 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; + subscribeEvent(name: string, listener: WotListener, errorListener?: ErrorListener, options?: InteractionOptions): Promise; /** * Returns the the object that represents the Thing Description. diff --git a/typescript/scripting-api/package.json b/typescript/scripting-api/package.json index 37f71029..b6f07d32 100644 --- a/typescript/scripting-api/package.json +++ b/typescript/scripting-api/package.json @@ -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",