wot-typescript-definitions
Advanced tools
Comparing version
import { Observable } from 'rxjs/Observable'; | ||
import { Subscription } from 'rxjs/Subscription'; | ||
@@ -145,3 +146,3 @@ export as namespace WoT; | ||
* A Thing instance must have an id and a name and its Interactions do have forms and | ||
* functions to interact (get/set/run/subscribe/emit). | ||
* functions to interact (read/write/invoke/subscribe/emit). | ||
*/ | ||
@@ -169,8 +170,9 @@ export interface ThingInstance extends ThingFragment { | ||
{ | ||
get(): Promise<any>; | ||
set(value: any): Promise<void>; | ||
read(): Promise<any>; | ||
write(value: any): Promise<void>; | ||
subscribe(next?: (value: any) => void, error?: (error: any) => void, complete?: () => void): Subscription; | ||
} | ||
/** Represents an interactable Thing Action */ | ||
export interface ThingAction extends ThingInteraction, ActionFragment { | ||
run(parameter?: any): Promise<any>; | ||
invoke(parameter?: any): Promise<any>; | ||
} | ||
@@ -181,3 +183,5 @@ | ||
export interface ThingEvent extends ThingInteraction, EventFragment { | ||
emit(data?: any): void; | ||
subscribe(next?: (value: any) => void, error?: (error: any) => void, complete?: () => void): Subscription; | ||
// FIXME emit should be only on ExposedThings' ThingEvents - therefore move emit() to ExposedThing? | ||
emit?(data?: any): void; | ||
} | ||
@@ -187,3 +191,3 @@ | ||
export interface ConsumedThing extends ThingInstance { | ||
// TODO: subscribe | ||
// none defined | ||
} | ||
@@ -190,0 +194,0 @@ |
{ | ||
"name": "wot-typescript-definitions", | ||
"version": "0.5.0-SNAPSHOT.5", | ||
"version": "0.5.0-SNAPSHOT.6", | ||
"description": "TypeScript definitions for the W3C WoT Scripting API", | ||
@@ -5,0 +5,0 @@ "author": "the thingweb community", |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
15756
2.54%338
1.2%