@foisit/react-wrapper 2.0.1 → 2.1.2
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/README.md +571 -29
- package/index.d.ts +6 -0
- package/index.js +412 -0
- package/index.mjs +1084 -0
- package/lib/components/AssistantActivator.d.ts +8 -0
- package/lib/components/AssistantProvider.d.ts +9 -0
- package/lib/hooks/useAssistant.d.ts +3 -0
- package/lib/hooks/useAssistantState.d.ts +3 -0
- package/lib/react-wrapper.d.ts +2 -0
- package/lib/services/AssistantService.d.ts +39 -0
- package/lib/types/index.d.ts +0 -0
- package/lib/utils/index.d.ts +0 -0
- package/package.json +6 -2
- package/style.css +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AssistantService } from '../services/AssistantService';
|
|
2
|
+
import { AssistantConfig } from '../../../../core/src/index.ts';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare const AssistantContext: React.Context<AssistantService | null>;
|
|
6
|
+
export declare const AssistantProvider: React.FC<{
|
|
7
|
+
config: AssistantConfig;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AssistantConfig, AssistantCommand, InteractiveResponse } from '../../../../core/src/index.ts';
|
|
2
|
+
|
|
3
|
+
export declare class AssistantService {
|
|
4
|
+
private config;
|
|
5
|
+
private commandHandler;
|
|
6
|
+
private fallbackHandler;
|
|
7
|
+
private voiceProcessor;
|
|
8
|
+
private textToSpeech;
|
|
9
|
+
private stateManager;
|
|
10
|
+
private isActivated;
|
|
11
|
+
private lastProcessedInput;
|
|
12
|
+
private processingLock;
|
|
13
|
+
private gestureHandler;
|
|
14
|
+
private overlayManager;
|
|
15
|
+
private defaultIntroMessage;
|
|
16
|
+
constructor(config: AssistantConfig);
|
|
17
|
+
/** Start listening for activation and commands */
|
|
18
|
+
startListening(): void;
|
|
19
|
+
/** Stop listening */
|
|
20
|
+
stopListening(): void;
|
|
21
|
+
/** Process activation command */
|
|
22
|
+
private processActivation;
|
|
23
|
+
/** Handle recognized commands */
|
|
24
|
+
private handleCommand;
|
|
25
|
+
/**
|
|
26
|
+
* Cleanup resources
|
|
27
|
+
*/
|
|
28
|
+
destroy(): void;
|
|
29
|
+
/** Unified response processing */
|
|
30
|
+
private processResponse;
|
|
31
|
+
/** Add a command dynamically (supports string or rich object) */
|
|
32
|
+
addCommand(commandOrObj: string | AssistantCommand, action?: (params?: any) => Promise<string | InteractiveResponse | void> | void): void;
|
|
33
|
+
/** Remove a command dynamically */
|
|
34
|
+
removeCommand(command: string): void;
|
|
35
|
+
/** Get all registered commands */
|
|
36
|
+
getCommands(): string[];
|
|
37
|
+
/** Toggle the assistant overlay */
|
|
38
|
+
toggle(onSubmit?: (text: string) => void, onClose?: () => void): void;
|
|
39
|
+
}
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foisit/react-wrapper",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"
|
|
14
|
+
"index.js",
|
|
15
|
+
"index.mjs",
|
|
16
|
+
"index.d.ts",
|
|
17
|
+
"lib",
|
|
18
|
+
"style.css",
|
|
15
19
|
"README.md"
|
|
16
20
|
],
|
|
17
21
|
"sideEffects": false,
|
package/style.css
ADDED
|
File without changes
|