gatsby-plugin-transition-link icon indicating copy to clipboard operation
gatsby-plugin-transition-link copied to clipboard

Initial TypeScript typings

Open crutchcorn opened this issue 4 years ago • 5 comments

Like most software, this can be improved in a few ways and likely includes some form of errors. Review from someone more familiar with the codebase would be appreciated.

I know one of the ways these typings can be made to be more strict would be to decouple state of entry and exit and make them persist as their own meta types, which would enforce your inability to access state that's only present on entry from a trigger function accessing an exit state, but that's a level of complexity in typings that I wouldn't be comfortable introducing as an initial set of typings

Closes #115 #155

crutchcorn avatar Mar 29 '20 06:03 crutchcorn

Hi @crutchcorn , sorry for the extremely delayed response. To this day I haven't done much work with Typescript. Are you able to provide me some simple steps to get started trying out these typings in a project? I'm the only one deeply familiar with the codebase as far as I'm aware but like I mentioned I've only used Typescript a handful of times.

TylerBarnes avatar Jun 22 '20 05:06 TylerBarnes

@TylerBarnes I'ts workind, I tested it on my project.

felipe-heredia avatar Dec 01 '20 12:12 felipe-heredia

@crutchcorn add this lines on the AniLinkProps interface:

title?: string;
target?: string;

felipe-heredia avatar Dec 01 '20 13:12 felipe-heredia

any joy?

chrisbward avatar Feb 27 '21 22:02 chrisbward

@TylerBarnes I am so sorry for not responding when you'd made a comment. I spaced on it as I had a lot going on at the time and it just fell from my radar.

The best way to test this would be to either:

  1. Load up a TypeScript project that uses gatsby-plugin-transition-link and see if the code works as-intended
  2. Add TypeScript type tests using dtslint. An example of that can be seen here:

https://github.com/plopjs/node-plop/tree/master/types

I can setup dtslint tests if that would be helpful. I admittedly didn't know how to do that at the initial time of this PR

crutchcorn avatar Sep 10 '21 12:09 crutchcorn