@avaturn-live/web-sdk 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +22 -35
- package/dist/main.d.ts +22 -8
- package/dist/main.js +401 -430
- package/dist/type.d.ts +6 -0
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { DailyCall } from "@daily-co/daily-js";
|
|
2
2
|
import { Axios } from "axios";
|
|
3
3
|
import { AvaturnEventCallback, AvaturnHeadConfig, AvaturnHeadEvent, IAvaturnHead } from "./type";
|
|
4
|
+
interface SessionData {
|
|
5
|
+
id: string;
|
|
6
|
+
limited_access_token: string;
|
|
7
|
+
room_url: string;
|
|
8
|
+
session_config: {
|
|
9
|
+
uses_stacked_alpha: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
4
12
|
export declare class AvaturnHead implements IAvaturnHead {
|
|
5
13
|
inited: boolean;
|
|
6
14
|
mediaStream: MediaStream;
|
|
7
15
|
session_id: string;
|
|
16
|
+
protected shadow: ShadowRoot | null;
|
|
8
17
|
protected frameHandle: ReturnType<typeof requestAnimationFrame>;
|
|
9
18
|
protected rootElement?: HTMLElement;
|
|
10
19
|
protected abortController: AbortController;
|
|
@@ -15,6 +24,11 @@ export declare class AvaturnHead implements IAvaturnHead {
|
|
|
15
24
|
protected handlers: {
|
|
16
25
|
[K in AvaturnHeadEvent]?: AvaturnEventCallback<K>[];
|
|
17
26
|
};
|
|
27
|
+
protected uiOptions: {
|
|
28
|
+
background: {
|
|
29
|
+
transparent: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
18
32
|
/**
|
|
19
33
|
* Creates an instance of AvaturnHead using API options.
|
|
20
34
|
* @constructor
|
|
@@ -28,16 +42,19 @@ export declare class AvaturnHead implements IAvaturnHead {
|
|
|
28
42
|
* @param options Configuration options.
|
|
29
43
|
*/
|
|
30
44
|
constructor(rootElement: HTMLElement, options: AvaturnHeadConfig);
|
|
45
|
+
get sessionId(): string;
|
|
31
46
|
private parseConfig;
|
|
32
|
-
protected drawUI(
|
|
33
|
-
transparent: boolean;
|
|
34
|
-
}): void;
|
|
47
|
+
protected drawUI(): void;
|
|
35
48
|
protected startIdleTimeout(): void;
|
|
36
49
|
protected restartIdleTimeout(): void;
|
|
50
|
+
protected applyEventHandlers(data: SessionData, config?: {
|
|
51
|
+
timeout?: number;
|
|
52
|
+
}): void;
|
|
53
|
+
attachDOMNode(node: HTMLElement): void;
|
|
37
54
|
cancelAllTasks(): Promise<void>;
|
|
38
55
|
init(config?: {
|
|
39
56
|
timeout?: number;
|
|
40
|
-
}): Promise<
|
|
57
|
+
}): Promise<void>;
|
|
41
58
|
task(text: string): Promise<any>;
|
|
42
59
|
on<T extends AvaturnHeadEvent>(eventName: T, cb: AvaturnEventCallback<T>): void;
|
|
43
60
|
off<T extends AvaturnHeadEvent>(eventName: T, cb: AvaturnEventCallback<T>): void;
|
|
@@ -50,12 +67,9 @@ export declare class AvaturnAssistantHead extends AvaturnHead {
|
|
|
50
67
|
constructor(config: AvaturnHeadConfig & {
|
|
51
68
|
assistantSessionToken: string;
|
|
52
69
|
});
|
|
53
|
-
init(config: {
|
|
54
|
-
timeout?: number;
|
|
55
|
-
assistant_id: string;
|
|
56
|
-
}): Promise<unknown>;
|
|
57
70
|
task(text: string, config?: {
|
|
58
71
|
waitForSpeechEnd: boolean;
|
|
59
72
|
}): Promise<any>;
|
|
60
73
|
dispose(): Promise<void>;
|
|
61
74
|
}
|
|
75
|
+
export {};
|