@@ -23,60 +23,24 @@ import { createLoggers } from "./logger";
2323
2424const { debug } = createLoggers ( "core" , "wot-impl" ) ;
2525
26- export class ThingDiscoveryImpl implements WoT . ThingDiscovery {
27- filter ?: WoT . ThingFilter ;
28- active : boolean ;
29- done : boolean ;
30- error ?: Error ;
31- constructor ( filter ?: WoT . ThingFilter ) {
32- this . filter = filter ;
33- this . active = false ;
34- this . done = false ;
35- this . error = new Error ( "not implemented" ) ;
36- }
37-
38- start ( ) : void {
39- this . active = true ;
40- }
41-
42- next ( ) : Promise < WoT . ThingDescription > {
43- return new Promise < WoT . ThingDescription > ( ( resolve , reject ) => {
44- reject ( this . error ) ; // not implemented
45- } ) ;
46- }
47-
48- stop ( ) : void {
49- this . active = false ;
50- this . done = false ;
51- }
52- }
53- /**
54- * wot-type-definitions does not contain a implementation of Discovery method enums
55- * so we need to create them here. Sadly, we should keep this enum in sync with
56- * WoT.DiscoveryMethod
57- */
58- export enum DiscoveryMethod {
59- /** does not provide any restriction */
60- "any" ,
61- /** for discovering Things defined in the same device */
62- "local" ,
63- /** for discovery based on a service provided by a directory or repository of Things */
64- "directory" ,
65- /** for discovering Things in the device's network by using a supported multicast protocol */
66- "multicast" ,
67- }
6826export default class WoTImpl {
6927 private srv : Servient ;
70- DiscoveryMethod : typeof WoT . DiscoveryMethod ;
7128 constructor ( srv : Servient ) {
7229 this . srv = srv ;
73- // force casting cause tsc does not allow to use DiscoveryMethod as WoT.DiscoveryMethod even if they are the same
74- this . DiscoveryMethod = DiscoveryMethod as unknown as typeof WoT . DiscoveryMethod ;
7530 }
7631
7732 /** @inheritDoc */
78- discover ( filter ?: WoT . ThingFilter ) : WoT . ThingDiscovery {
79- return new ThingDiscoveryImpl ( filter ) ;
33+ async discover ( filter ?: WoT . ThingFilter ) : Promise < WoT . ThingDiscoveryProcess > {
34+ throw new Error ( "not implemented" ) ;
35+ }
36+
37+ /** @inheritDoc */
38+ async exploreDirectory ( url : string , filter ?: WoT . ThingFilter ) : Promise < WoT . ThingDiscoveryProcess > {
39+ throw new Error ( "not implemented" ) ;
40+ }
41+
42+ async requestThingDescription ( url : string ) : Promise < WoT . ThingDescription > {
43+ throw new Error ( "not implemented" ) ;
8044 }
8145
8246 /** @inheritDoc */
0 commit comments