vail-systems / node-fft

Pure Node.js implementation of the Fast Fourier Transform (Cooley-Tukey method).
133 stars 24 forks source link

Typing #14

Open ierehon1905 opened 2 years ago

ierehon1905 commented 2 years ago

Hi, thank you for your library while working with it in a TS project I wrote some types hope they help someone

declare module "fft-js" {
  type Phasors = [number, number][];

  function dft(vector: number[]): Phasors;
  function fft(vector: number[]): Phasors;
  function fftInPlace(): unknown;
  function idft(phasors: Phasors): Phasors;
  function ifft(phasors: Phasors): Phasors;
  const util: {
    exponent: () => void;
    fftFreq: (phasors: Phasors, freq: number) => unknown;
    fftMag: (phasors: Phasors) => unknown;
  };
}