We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In case someone needs types. There are some unknown parts which I did not have time to explore
declare module "jsfft" { type Frequency = { real: number; imag: number }; type InputValue = ComplexArray | number[] | number; type Filterer = (frequency: Frequency, i: number, n: number) => void; function FFT(input: InputValue): ComplexArray; function InvFFT(input: InputValue): ComplexArray; function frequencyMap(input: InputValue, filterer: Filterer): ComplexArray; class ComplexArray { constructor(input: InputValue); length: number; real: Float32Array; imag: Float32Array; ArrayType(args: unknown): Float32Array; FFT(): ComplexArray; InvFFT(): ComplexArray; frequencyMap(filterer: Filterer): ComplexArray; conjugate(): unknown; forEach(iterator: Filterer): unknown; magnitude(): Float32Array; map(mapper: Filterer): ComplexArray; toString(): string; } }
The text was updated successfully, but these errors were encountered:
FWIW, here's what I came up with
type Value = { real: number, imag: number }; declare module 'jsfft' { function FFT(input: ComplexArray): ComplexArray; function InvFFT(input: ComplexArray): ComplexArray; function frequencyMap(input: ComplexArray, filterer: (value: Value, i: number, n: number) => Value): ComplexArray; class ComplexArray<TypedArray extends ArrayLike<number> = Float32Array> { real: TypedArray; imag: TypedArray; ArrayType: TypedArray; constructor(other: ComplexArray | number | ArrayLike<number> | ArrayBufferLike, arrayType?: TypedArray); toSting(): string; forEach(iterator: (value: Value, i: number, n: number) => void): void; map(iterator: (value: Value, i: number, n: number) => Value): ComplexArray<TypedArray>; conjugate(): ComplexArray<TypedArray>; magnitude(): TypedArray; FFT(): ComplexArray<TypedArray>; InvFFT(): ComplexArray<TypedArray>; frequencyMap(filterer: (value: Value, i: number, n: number) => Value): ComplexArray<TypedArray>; } }
Sorry, something went wrong.
No branches or pull requests
In case someone needs types. There are some unknown parts which I did not have time to explore
The text was updated successfully, but these errors were encountered: