From f2eee1625ef9264e5f8c19f8b148c1aab007d92d Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 26 May 2017 11:49:10 +0100 Subject: [PATCH 1/2] Turned on type script definitions --- .npmignore | 1 - package.json | 1 + tsconfig.json | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.npmignore b/.npmignore index 58c9c95d..6f1b3476 100644 --- a/.npmignore +++ b/.npmignore @@ -17,7 +17,6 @@ snowboydetect.py /node_modules /lib/node/*.ts -/lib/node/*.d.ts .npmignore .travis.yml diff --git a/package.json b/package.json index fae4e763..67717107 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.2.0", "description": "Snowboy is a customizable hotword detection engine", "main": "lib/node/index.js", + "typings": "lib/node/index.d.ts", "binary": { "module_name": "snowboy", "module_path": "./lib/node/binding/{configuration}/{node_abi}-{platform}-{arch}/", diff --git a/tsconfig.json b/tsconfig.json index e74e67e8..2914c2f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "jsx": "react", "experimentalDecorators": false, "emitDecoratorMetadata": false, - "declaration": false, + "declaration": true, "noImplicitAny": true, "noImplicitUseStrict": false, "noFallthroughCasesInSwitch": true, From abb442130b135022b872897fb743f854b24a6977 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 29 Aug 2017 15:28:11 +0100 Subject: [PATCH 2/2] Export the interfaces --- lib/node/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node/index.ts b/lib/node/index.ts index 024a8bb1..fac8c18d 100644 --- a/lib/node/index.ts +++ b/lib/node/index.ts @@ -17,7 +17,7 @@ enum ModelType { UMDL } -interface HotwordModel { +export interface HotwordModel { file: string; sensitivity?: string; hotwords: string | Array; @@ -29,13 +29,13 @@ interface HotwordModelsInterface { numHotwords(): number; } -interface DetectorOptions { +export interface DetectorOptions { resource: string; models: HotwordModels; audioGain?: number; } -interface SnowboyDetectInterface { +export interface SnowboyDetectInterface { reset(): boolean; runDetection(buffer: Buffer): number; setSensitivity(sensitivity: string): void;