react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Missing type definitions for Typescript

Open aksingh opened this issue 10 years ago • 7 comments

Request: A type definitions file (.d.ts) that allows react-data-grid to be integrated with projects using Typescript would be awesome!

aksingh avatar Apr 07 '16 05:04 aksingh

I would also be happy to help to get this done :)

aksingh avatar Apr 07 '16 05:04 aksingh

hey @aksingh -- yeah i've thought about that too. traditionally we were using Flow (and in fact still have an exe in our repo) but over time abandoned it until it's at least officially supported on Windows.

Typings could definitely be an alternate route to go down, but my two cents are that I don't know if it's really worth it right now.

TypeScript doesn't handle nulls as well as Flow or handle things like algebraic data types, but equally Flow is a pain to set up and is still pre-release on Windows. That being said, TypeScript does have things like union types which would probably cover most cases..

So just in my opinion, I think we should wait a bit until they've both matured before revisiting the decision then. Or it could be that we adopt typings right now, but see how Flow compares later?

What does everyone think? :smile:

jpdriver avatar Apr 07 '16 10:04 jpdriver

I think Typescript is established well enough that I would go with the 2nd option of adopting typings now (it does not break anything) and perhaps also add flow support later?

aksingh avatar Apr 20 '16 05:04 aksingh

I'm waiting for the react-data-grid to support TypeScript and its definition file.

Also, TypeScript provides union type: https://www.typescriptlang.org/docs/handbook/advanced-types.html

samchon avatar Jun 08 '16 05:06 samchon

@malonecj @jpdriver I wrote some typings for DefinitelyTyped, you can check them out here. Please let me know if I missed anything, exposed something I wasn't supposed to, etc.

SupernaviX avatar Jun 30 '16 05:06 SupernaviX

@SupernaviX Thanks you so much! Should be installed like this:

typings i react-data-grid --save --source dt --global

and imported like this:

import * as ReactDataGrid from 'react-data-grid';

Timopheym avatar Aug 09 '16 17:08 Timopheym

Looks like this is already supported. Will close it, if there is anything missing fell free to open a new issue. Cheers.

diogofcunha avatar Jan 25 '17 15:01 diogofcunha