wot-typescript-definitions
Advanced tools
Comparing version
@@ -93,13 +93,12 @@ import { Observable } from 'rxjs/Observable'; | ||
id?: string; | ||
/** The name attribute represents the user given name of the Thing */ | ||
name?: string; | ||
/** A human-readable description of the Thing */ | ||
description?: string; | ||
/** Information about the Thing maintainer, e.g., author or contact URI */ | ||
support?: string; | ||
/** A list of security schemas used by the Thing */ | ||
security?: Array<Security>; | ||
/** A map of PropertyFragments with decriptions only */ | ||
@@ -112,3 +111,3 @@ properties?: { [key: string]: PropertyFragment } | ||
/** A list of Web links to other Things or metadata */ | ||
links?: Array<WebLink>; | ||
links?: Array<Link>; | ||
/** | ||
@@ -126,4 +125,10 @@ * A collection of predicate terms that reference values of any type, | ||
export interface InteractionFragment { | ||
label?: string; | ||
/** A human-readable title for the Interaction, e.g., for UIs */ | ||
title?: string; | ||
/** A human-readable description of the Interaction */ | ||
description?: string; | ||
/** | ||
* A collection of predicate terms that reference values of any type, | ||
* e.g., @type, or other terms from the vocabulary defined in @context. | ||
*/ | ||
[key: string]: any; | ||
@@ -144,3 +149,5 @@ } | ||
export interface EventFragment extends InteractionFragment { | ||
subscription?: DataSchema; | ||
data?: DataSchema; | ||
cancellation?: DataSchema; | ||
} | ||
@@ -153,9 +160,14 @@ | ||
export interface ThingInstance extends ThingFragment { | ||
/** id becomes mandatory for Thing instances */ | ||
id: string; | ||
/** name becomes mandatory for Thing instances */ | ||
name: string; | ||
/** base becomes available for Thing instances (part of binding metadata) */ | ||
base?: string; | ||
/** A map of ThingProperties (PropertyFragment plus mandatory binding metadata (forms)) */ | ||
properties: { [key: string]: ThingProperty }; | ||
/** A map of ThingActions (ActionFragment plus mandatory binding metadata (forms)) */ | ||
actions: { [key: string]: ThingAction }; | ||
/** A map of ThingEvents (EventFragment plus mandatory binding metadata (forms)) */ | ||
events: { [key: string]: ThingEvent }; | ||
@@ -186,3 +198,3 @@ } | ||
export interface ThingEvent extends ThingInteraction, EventFragment { | ||
subscribe(next?: (value: any) => void, error?: (error: any) => void, complete?: () => void): Subscription; | ||
subscribe(next?: (data: any) => void, error?: (error: any) => void, complete?: () => void): Subscription; | ||
// FIXME emit should be only on ExposedThings' ThingEvents - therefore move emit() to ExposedThing? | ||
@@ -194,3 +206,3 @@ emit?(data?: any): void; | ||
export interface ConsumedThing extends ThingInstance { | ||
// none defined | ||
// no additional functions defined | ||
} | ||
@@ -291,12 +303,12 @@ | ||
href: USVString; | ||
mediaType?: USVString; | ||
rel?: USVString; | ||
} | ||
export interface WebLink extends Link { | ||
rel?: USVString | Array<USVString>; | ||
type?: USVString; // media type hint, no media type parameters | ||
anchor?: USVString; | ||
} | ||
export interface Form extends Link { | ||
export interface Form { | ||
href: USVString; | ||
subprotocol?: USVString; | ||
op?: USVString | Array<USVString>; | ||
contenttype?: USVString; // media type + parameter(s), e.g., text/plain;charset=utf8 | ||
security?: Security; | ||
@@ -303,0 +315,0 @@ } |
{ | ||
"name": "wot-typescript-definitions", | ||
"version": "0.5.0", | ||
"version": "0.6.0-SNAPSHOT.0", | ||
"description": "TypeScript definitions for the W3C WoT Scripting API", | ||
@@ -5,0 +5,0 @@ "author": "the thingweb community", |
17508
6.33%367
4.86%