flow-field.js icon indicating copy to clipboard operation
flow-field.js copied to clipboard

Add base typescript support

Open joeyfigaro opened this issue 1 year ago • 0 comments

Closes #2

  • add and configure required dependencies
  • expand build process to output type declarations
  • add types to package.json for new declaration output
  • update README
  • rename index.js to index.ts
  • use @ts-nocheck to silence compiler errors and add ham-fisted typings to relevant function return values

6c671e1 includes a change that I'm not 100% sure on yet and was hoping to get your eyes on–there was a scope conflict for particle previously:

particles?.forEach((particle) => { // particle defined here
    particle.line = particle.line.filter((particle) => {  // particle also defined here
      return isInBound(particle[0], particle[1], width, height, margin); // which particle are we referring to here? The innermost?
    });
  });

Thank you in advance for your time and consideration!

EDIT: and the incredibly easy to use library. :)

joeyfigaro avatar Nov 30 '22 15:11 joeyfigaro