-
Notifications
You must be signed in to change notification settings - Fork 75
/
index.d.ts
58 lines (47 loc) · 1.34 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Type definitions for google-assistant v0.5.3
type AuthConfig = {
keyFilePath: string;
savedTokensPath: string;
tokenInput?(processTokens: any): void;
};
type AudioConfig = {
encodingOut?: "LINEAR16" | "MP3" | "OPUS_IN_OGG";
sampleRateOut?: number;
encodingIn?: "LINEAR16" | "FLAC";
sampleRateIn?: number;
};
type ConversationConfig = {
audio?: AudioConfig;
textQuery?: string;
deviceId?: string;
deviceModelId?: string;
lang?: string;
isNew?: boolean;
deviceLocation?: DeviceLocation;
screen?: ScreenConfig;
};
type DeviceLocation = {
coordinates: { latitude: number; longitude: number };
};
type ScreenConfig = { isOn: boolean };
declare class EventEmitter {
public emit(type: string, payload?: any): any;
public on(type: string, handler: Function): any;
}
declare class Conversation extends EventEmitter {
constructor(config: ConversationConfig);
public write(bytes: Uint8Array): void;
public end(): void;
}
declare class Assistant {}
declare class GoogleAssistant extends EventEmitter {
constructor(
authConfig: AuthConfig,
callback?: (callbackArg: Assistant | Error) => void
);
public start(
conversation?: ConversationConfig,
callback?: (callbackArg: Conversation | Error) => void
): void;
}
export = GoogleAssistant;