Skip to content
New issue

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

Typescript definition file for react-grid-layout #57

Closed
shadowfax92 opened this issue May 20, 2015 · 4 comments
Closed

Typescript definition file for react-grid-layout #57

shadowfax92 opened this issue May 20, 2015 · 4 comments

Comments

@shadowfax92
Copy link

Hi,
Does anyone here created a d.ts file for react-grid-layout?

@FlatMapIO
Copy link

Here https://gist.github.com/huodon/b73962bf606a28913e0c

But it seems that some error.

import * as ReactGridLayout;

console.log(ReactGridLayout); // This not a ReactComponent. 

console.log(ReactGrideLayout.Responsive); // is valid

@erfangc
Copy link

erfangc commented Jan 7, 2016

@huodon Works fine for me, weird that I didn't even need the legacy cjs import syntax of import ReactGridLayout = require('react-grid-layout');

What does your tsconfig.json file look like?

mine is:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es3",
        "noImplicitAny": false,
        "sourceMap": false
    },
    "exclude": [
        "node_modules",
        "jspm_packages"
    ]
}

the transpiled ES3 looks like:

var ReactGridLayout = require('react-grid-layout');
console.log(ReactGridLayout);

@erfangc
Copy link

erfangc commented Jan 7, 2016

@huodon btw, there are compilation errors in the definition file, specifically, we React.Component and React.ReactElement etc needs to be parametrized i.e. replace React.Component with React.Component<T>

@STRML
Copy link
Collaborator

STRML commented Feb 10, 2016

We now have Flow typing - please reopen as a PR if you have a .d.ts you'd like to contribute.

@STRML STRML closed this as completed Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants