From 8af67815b0ad02b7f7585d21d1e856c3a053c87b Mon Sep 17 00:00:00 2001 From: reluc Date: Fri, 15 Oct 2021 14:22:50 +0200 Subject: [PATCH 1/3] chore: update TS definitions on NPM to 0.8.0-SNAPSHOT.20 --- typescript/scripting-api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/scripting-api/package.json b/typescript/scripting-api/package.json index 37f71029..2408a1de 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.20", "description": "TypeScript definitions for the W3C WoT Scripting API", "author": "W3C Web of Things Working Group", "license": "W3C-20150513", From 91b175589e374bf58df871d9eb6683da8e979540 Mon Sep 17 00:00:00 2001 From: reluc Date: Fri, 15 Oct 2021 15:28:56 +0200 Subject: [PATCH 2/3] fix(typescript): aling return type of subscribe and observe --- typescript/scripting-api/index.d.ts | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) 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. From 62801ca7e42e9eb7dbf005070aab40d6fd4fcbd6 Mon Sep 17 00:00:00 2001 From: reluc Date: Fri, 15 Oct 2021 15:29:30 +0200 Subject: [PATCH 3/3] chore: update TS definitions on NPM to 0.8.0-SNAPSHOT.21 --- typescript/scripting-api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/scripting-api/package.json b/typescript/scripting-api/package.json index 2408a1de..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.20", + "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",