1
0
mirror of https://github.com/Picovoice/porcupine.git synced 2022-01-28 03:27:53 +03:00
This commit is contained in:
Kwangsoo Yeo
2022-01-13 12:28:35 -08:00
committed by GitHub
parent 8d2be5afe6
commit 437707759b
2 changed files with 15 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@picovoice/porcupine-web-core",
"version": "2.0.0",
"version": "2.0.1",
"description": "Porcupine types for web bindings",
"main": "src/index.ts",
"types": "dist/types/index.d.ts",

View File

@@ -87,3 +87,17 @@ export interface PorcupineEngine {
/** Maps the keyword detection index (e.g. 0, 1) returned by Porcupine to the label (e.g. "Hey Pico", "Grasshopper") */
readonly keywordLabels: Map<number, string>;
}
export interface PorcupineWorker extends Omit<Worker, 'postMessage'> {
postMessage(command: PorcupineWorkerRequest): void;
}
export interface PorcupineWorkerFactory {
create(
accessKey: string,
keywords: Array<PorcupineKeyword | string> | PorcupineKeyword | string,
keywordDetectionCallback?: (label: string) => void,
processErrorCallback?: (error: string | Error) => void,
start?: boolean
): Promise<PorcupineWorker>;
}