Skip to content

Commit bba401e

Browse files
committed
Add directive observable
1 parent 04b87b9 commit bba401e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

my-typings/avs/directives.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare namespace AVS {
2+
type Directive = AVS.SpeechRecognizer.ExpectSpeechDirective | AVS.AudioPlayer.PlayDirective;
3+
}

src/directives.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// https://developer.amazon.com/docs/alexa-voice-service/manage-http2-connection.html
22
import * as http2 from "http2";
3+
import {Observable} from "rxjs/Observable";
34

45
import {API_VERSION} from "./constants/general";
56

67
export default class Directives {
8+
private directive$: Observable<AVS.Directive>;
9+
710
constructor(private readonly client: http2.ClientHttp2Session) {}
811

912
public connect(accessToken: string): Promise<void> {
@@ -39,4 +42,8 @@ export default class Directives {
3942
req.end();
4043
});
4144
}
45+
46+
public get Directive$(): Observable<AVS.Directive> {
47+
return this.directive$;
48+
}
4249
}

0 commit comments

Comments
 (0)