mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 21:13:14 +08:00
11
types/beats/beats-tests.ts
Normal file
11
types/beats/beats-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import beats = require('beats');
|
||||
|
||||
const bins: beats.Bin[] = [
|
||||
{ lo: 0, hi: 512, threshold: 0, decay: 0.005 },
|
||||
{ lo: 512, hi: 1024, threshold: 0, decay: 0.005 },
|
||||
];
|
||||
|
||||
const detect = beats(bins, 1);
|
||||
|
||||
const frequencies = new Uint8Array(1024);
|
||||
const result = detect(frequencies);
|
||||
17
types/beats/index.d.ts
vendored
Normal file
17
types/beats/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for beats 0.0
|
||||
// Project: https://github.com/hughsk/beats/
|
||||
// Definitions by: Uri Shaked <https://github.com/urish>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = beats;
|
||||
|
||||
declare function beats(bins: ReadonlyArray<beats.Bin>, minSeparation?: number): (frequencies: Uint8Array | Float32Array | ReadonlyArray<number>, dt?: number) => Float32Array;
|
||||
|
||||
declare namespace beats {
|
||||
interface Bin {
|
||||
lo: number;
|
||||
hi: number;
|
||||
threshold: number;
|
||||
decay: number;
|
||||
}
|
||||
}
|
||||
23
types/beats/tsconfig.json
Normal file
23
types/beats/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"beats-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/beats/tslint.json
Normal file
1
types/beats/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user