mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
[kissfft-js]: add type declarations for kissfft-js
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// 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
|
||||
|
||||
declare abstract class AbstractKissFFT {
|
||||
constructor(size: number);
|
||||
forward(input: number[]): number[];
|
||||
inverse(input: number[]): number[];
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export class FFT extends AbstractKissFFT {
|
||||
}
|
||||
|
||||
export class FFTR extends AbstractKissFFT {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import {FFT} from "kissfft-js";
|
||||
import {FFTR} from "kissfft-js";
|
||||
|
||||
const fft = new 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 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,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"kissfft-js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user