mirror of
https://github.com/Picovoice/porcupine.git
synced 2022-01-28 03:27:53 +03:00
web core (#623)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user