mirror of
https://github.com/Picovoice/porcupine.git
synced 2022-01-28 03:27:53 +03:00
Expose ppn types in react hook (#590)
This commit is contained in:
committed by
GitHub
parent
c861a45d4c
commit
69312b63a2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@picovoice/porcupine-web-react",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "React component for Porcupine Web SDK",
|
||||
"entry": "src/index.ts",
|
||||
"module": "dist/esm/index.js",
|
||||
|
||||
@@ -1 +1,18 @@
|
||||
export { usePorcupine } from './usePorcupine';
|
||||
import { usePorcupine } from './usePorcupine';
|
||||
|
||||
import {
|
||||
PorcupineHookArgs,
|
||||
PorcupineKeyword,
|
||||
PorcupineKeywordBuiltin,
|
||||
PorcupineKeywordCustom,
|
||||
PorcupineWorkerFactory,
|
||||
} from './porcupine_types';
|
||||
|
||||
export {
|
||||
usePorcupine,
|
||||
PorcupineHookArgs,
|
||||
PorcupineKeyword,
|
||||
PorcupineKeywordBuiltin,
|
||||
PorcupineKeywordCustom,
|
||||
PorcupineWorkerFactory,
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"description": "Porcupine React demo (made with Create React App)",
|
||||
"dependencies": {
|
||||
"@picovoice/porcupine-web-en-worker": "^2.0.2",
|
||||
"@picovoice/porcupine-web-react": "^2.0.0",
|
||||
"@picovoice/porcupine-web-react": "^2.0.1",
|
||||
"@picovoice/web-voice-processor": "^2.1.2",
|
||||
"@testing-library/jest-dom": "^5.11.4",
|
||||
"@testing-library/react": "^11.1.0",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { usePorcupine } from "@picovoice/porcupine-web-react";
|
||||
import { PorcupineWorkerFactory } from "@picovoice/porcupine-web-react";
|
||||
|
||||
export default function VoiceWidget() {
|
||||
const [keywordDetections, setKeywordDetections] = useState<string[]>([]);
|
||||
const [workerChunk, setWorkerChunk] = useState<any>({ factory: null });
|
||||
const [workerChunk, setWorkerChunk] = useState<Record<string, PorcupineWorkerFactory | null>>({ factory: null });
|
||||
const [isChunkLoaded, setIsChunkLoaded] = useState(false);
|
||||
const [accessKey, setAccessKey] = useState("");
|
||||
const [keywords] = useState([
|
||||
|
||||
Reference in New Issue
Block a user