mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #32841 from racerhere/master
[kissfft-js]: Add type declarations for kissfft-js
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for kissfft-js 0.1
|
||||
// Project: https://github.com/j-funk/kissfft-js#readme
|
||||
// Definitions by: racerhere <https://github.com/racerhere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/types/kissfft-js
|
||||
|
||||
export class FFT {
|
||||
constructor(size: number);
|
||||
forward(input: number[]): number[];
|
||||
inverse(input: number[]): number[];
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export class FFTR {
|
||||
constructor(size: number);
|
||||
forward(input: number[]): number[];
|
||||
inverse(input: number[]): number[];
|
||||
dispose(): void;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as kissFFT from "kissfft-js";
|
||||
|
||||
const fft = new kissFFT.FFT(0); // $ExpectType FFT
|
||||
fft.forward([1, 2, 3]); // $ExpectType number[]
|
||||
fft.inverse([1, 2, 3]); // $ExpectType number[]
|
||||
fft.dispose(); // $ExpectType void
|
||||
|
||||
const fftr = new kissFFT.FFTR(0); // $ExpectType FFTR
|
||||
fftr.forward([1, 2, 3]); // $ExpectType number[]
|
||||
fftr.inverse([1, 2, 3]); // $ExpectType number[]
|
||||
fftr.dispose(); // $ExpectType void
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"kissfft-js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user