{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9027","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9027/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9027/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9027/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9027","id":148997686,"number":9027,"title":"Turf not importing and test file has errors","user":{"login":"pauldhawk","id":6777739,"avatar_url":"https://avatars.githubusercontent.com/u/6777739?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldhawk","html_url":"https://github.com/pauldhawk","followers_url":"https://api.github.com/users/pauldhawk/followers","following_url":"https://api.github.com/users/pauldhawk/following{/other_user}","gists_url":"https://api.github.com/users/pauldhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldhawk/subscriptions","organizations_url":"https://api.github.com/users/pauldhawk/orgs","repos_url":"https://api.github.com/users/pauldhawk/repos","events_url":"https://api.github.com/users/pauldhawk/events{/privacy}","received_events_url":"https://api.github.com/users/pauldhawk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-17T21:15:59Z","updated_at":"2016-04-19T22:27:46Z","closed_at":null,"body":"- [x] I tried using the latest `turf/turf.d.ts` file in this repo and had problems.\r\n- [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript\r\n- [ ] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/).  (Please ask any appropriate questions there).\r\n- [ ] I want to talk about `xxxx/xxxx.d.ts`.\r\n  - The authors of that type definition are cc/ @...gcroteau Guillaume Croteau.\r\n\r\nI cannot import the turf js library. When I run the test file or any other file referencing the turf library i get the following error : ReferenceError: turf is not defined\r\n\r\ni've used //<, import 'turf', import * as turf from 'turf', import turf = require('turf')\r\n\r\nother modules are importing no problem.\r\nmy tsconfig settings are \r\n{\r\n  \"compilerOptions\": {\r\n    \"target\": \"es5\",\r\n    \"module\": \"commonjs\",\r\n    \"moduleResolution\": \"node\",\r\n    \"sourceMap\": true,\r\n    \"emitDecoratorMetadata\": true,\r\n    \"experimentalDecorators\": true,\r\n    \"removeComments\": false,\r\n    \"noImplicitAny\": false\r\n  },\r\n  \"exclude\": [\r\n    \"node_modules\",\r\n    \"typings/main\",\r\n    \"typings/main.d.ts\"\r\n  ]\r\n} \r\n\r\nwhen i run the test file (or run)\r\n\r\nI've tried importing via // < and import but it \r\n\r\nthe error i get when trying to compile the turf-test.ts is:\r\n\r\nturf/turf-tests.ts(426,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'polygon' must be of type 'Polygon', but here has type 'Feature<Polygon>'.\r\nturf/turf-tests.ts(495,37): error TS2345: Argument of type 'Polygon' is not assignable to parameter of type 'Feature<Polygon>'.\r\n  Property 'geometry' is missing in type 'Polygon'.\r\n\r\n\r\nturf@2.0.2\r\nlatest def file\r\n\r\nany idea what is wrong\r\n"},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/212154666","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9027#issuecomment-212154666","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9027","id":212154666,"user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T22:27:46Z","updated_at":"2016-04-19T22:27:46Z","body":"Changing `declare namespace turf {` to `declare module \"turf\" {` in [`turf/index.d.ts`][1] fixed this for me. I'll send a PR.\r\n\r\n[1]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/544a35a10866b32afda9c7f029c0764558563f4f/turf/turf.d.ts#L8"}}