{"action":"created","issue":{"url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/4279","labels_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/4279/labels{/name}","comments_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/4279/comments","events_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/4279/events","html_url":"https://github.com/borisyankov/DefinitelyTyped/issues/4279","id":73751305,"number":4279,"title":"node-uuid as a browser lib","user":{"login":"fredgalvao","id":616464,"avatar_url":"https://avatars.githubusercontent.com/u/616464?v=3","gravatar_id":"","url":"https://api.github.com/users/fredgalvao","html_url":"https://github.com/fredgalvao","followers_url":"https://api.github.com/users/fredgalvao/followers","following_url":"https://api.github.com/users/fredgalvao/following{/other_user}","gists_url":"https://api.github.com/users/fredgalvao/gists{/gist_id}","starred_url":"https://api.github.com/users/fredgalvao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredgalvao/subscriptions","organizations_url":"https://api.github.com/users/fredgalvao/orgs","repos_url":"https://api.github.com/users/fredgalvao/repos","events_url":"https://api.github.com/users/fredgalvao/events{/privacy}","received_events_url":"https://api.github.com/users/fredgalvao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-06T22:08:55Z","updated_at":"2015-05-08T11:57:00Z","closed_at":null,"body":"[node-uuid](https://github.com/broofa/node-uuid), as it is now, works on node and browser environments, but it's typed only as a node module for 2 reasons:\r\n- does **not** export a global scope `uuid` variable.\r\n- depends on `node.d.ts`\r\n\r\nThe first one is easy to fix: `declare var uuid: UUID;` at the end of the current node-uuid.d.ts file.\r\n\r\nFor the second one though, I haven't been able to come up with a solution that makes it work on both environments, but I'm far from an experienced TS coder and thus it might be possible. The problem is that I can't see how I'd declare that the API can receive either a Buffer or an Array without explicitly requiring node.d.ts.\r\n\r\nAs I only use node-uuid in a browser-like environment, all I had to do localy was change Buffer to Array, but I can't say how we'll make it work on both worlds without spliting files."},"comment":{"url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/comments/100209833","html_url":"https://github.com/borisyankov/DefinitelyTyped/issues/4279#issuecomment-100209833","issue_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/4279","id":100209833,"user":{"login":"vvakame","id":125332,"avatar_url":"https://avatars.githubusercontent.com/u/125332?v=3","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T11:57:00Z","updated_at":"2015-05-08T11:57:00Z","body":"for first one. please send a pull request.\r\nfor second one. I think It does not have to worry too much. We can refactor node-uuid.d.ts to node-uuid-common.d.ts, node-uuid-browser.d.ts and node-uuid.d.ts. extract common definitions to node-uuid-common.d.ts. extends it from node-uuid.d.ts or node-uuid-browser.d.ts."}}