wot-typescript-definitions
Advanced tools
Comparing version
@@ -53,5 +53,18 @@ export as namespace WoT; | ||
export interface ThingFilter { | ||
/** | ||
* The method property represents the discovery type that should be used in the discovery process. The possible values are defined by the DiscoveryMethod enumeration that can be extended by string values defined by solutions (with no guarantee of interoperability). | ||
*/ | ||
method: DiscoveryMethod | string; // default value "any", DOMString | ||
/** | ||
* The url property represents additional information for the discovery method, such as the URL of the target entity serving the discovery request, such as a Thing Directory or a Thing. | ||
*/ | ||
url: USVString; | ||
description: object; | ||
/** | ||
* The query property represents a query string accepted by the implementation, for instance a SPARQL query. | ||
*/ | ||
query: USVString; | ||
/** | ||
* The constraints property represents additional information for the discovery method in the form of a list of sets of property-value pairs (dictionaries). The list elements (dictionaries) are in OR relationship, and within a constraint dictionary the key-value pairs are in AND relationship | ||
*/ | ||
constraints: [Map<any, any>]; // Dictionary | ||
} | ||
@@ -110,2 +123,5 @@ | ||
/** The name property represents the name of the Thing as specified in the TD. In this version it is read only. */ | ||
readonly name : string; | ||
/** | ||
@@ -151,6 +167,4 @@ * Returns the Thing Description of the Thing. | ||
// FIXME all XyzInit classes get changed to Xyz | ||
/** Represents the Thing Property description. */ | ||
export interface ThingPropertyInit extends SemanticAnnotations { | ||
export interface ThingProperty extends SemanticAnnotations { | ||
/** The name attribute provides the Property name. */ | ||
@@ -161,16 +175,11 @@ name: string; | ||
/** The intial value. */ | ||
value: any; | ||
value?: any; | ||
/** Indicates whether property is writable. */ | ||
writable?: boolean; // = false; | ||
writable?: boolean; // = true; | ||
/** Indicates whether property is observable. */ | ||
observable?: boolean; // = false; | ||
// /** On read callback */ | ||
// onRead?(oldValue: any): Promise<any>; | ||
// /** On write callback */ | ||
// onWrite?(oldValue: any, newValue: any): void; | ||
observable?: boolean; // = true; | ||
} | ||
/** The ThingActionInit dictionary describes the arguments and the return value. */ | ||
export interface ThingActionInit extends SemanticAnnotations { | ||
export interface ThingAction extends SemanticAnnotations { | ||
/** The name attribute provides the Action name. */ | ||
@@ -186,3 +195,3 @@ name: string; | ||
export interface ThingEventInit extends SemanticAnnotations { | ||
export interface ThingEvent extends SemanticAnnotations { | ||
/** The name attribute represents the event name. */ | ||
@@ -204,6 +213,6 @@ name: string; | ||
/** Generates the Thing Description given the properties, Actions and Event defined for this object. If a directory argument is given, make a request to register the Thing Description with the given WoT repository by invoking its register Action. */ | ||
register(directory: USVString): Promise<void> | ||
register(directory?: USVString): Promise<void> | ||
/** If a directory argument is given, make a request to unregister the Thing Description with the given WoT repository by invoking its unregister Action. Then, and in the case no arguments were provided to this function, stop the Thing and remove the Thing Description. */ | ||
unregister(directory: USVString): Promise<void> | ||
unregister(directory?: USVString): Promise<void> | ||
@@ -219,3 +228,3 @@ /** Emits an the event initialized with the event name specified by the eventName argument and data specified by the payload argument. */ | ||
*/ | ||
addProperty(property: ThingPropertyInit): ExposedThing | ||
addProperty(property: ThingProperty): ExposedThing | ||
@@ -230,3 +239,3 @@ /** | ||
*/ | ||
addAction(action: ThingActionInit): ExposedThing | ||
addAction(action: ThingAction): ExposedThing | ||
@@ -241,3 +250,3 @@ /** | ||
*/ | ||
addEvent(event: ThingEventInit): ExposedThing | ||
addEvent(event: ThingEvent): ExposedThing | ||
@@ -244,0 +253,0 @@ /** |
{ | ||
"name": "wot-typescript-definitions", | ||
"version": "0.4.0-SNAPSHOT.10", | ||
"version": "0.4.0-SNAPSHOT.11", | ||
"description": "Typescript definitions for the WoT scripting API", | ||
@@ -5,0 +5,0 @@ "main": "index.d.ts", |
15187
6.34%240
4.35%