{"action":"created","issue":{"url":"https://api.github.com/repos/kawanet/int64-buffer/issues/2","repository_url":"https://api.github.com/repos/kawanet/int64-buffer","labels_url":"https://api.github.com/repos/kawanet/int64-buffer/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/kawanet/int64-buffer/issues/2/comments","events_url":"https://api.github.com/repos/kawanet/int64-buffer/issues/2/events","html_url":"https://github.com/kawanet/int64-buffer/pull/2","id":158385346,"number":2,"title":"add type definitions for Typescript projects","user":{"login":"pizza2code","id":15824044,"avatar_url":"https://avatars.githubusercontent.com/u/15824044?v=3","gravatar_id":"","url":"https://api.github.com/users/pizza2code","html_url":"https://github.com/pizza2code","followers_url":"https://api.github.com/users/pizza2code/followers","following_url":"https://api.github.com/users/pizza2code/following{/other_user}","gists_url":"https://api.github.com/users/pizza2code/gists{/gist_id}","starred_url":"https://api.github.com/users/pizza2code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pizza2code/subscriptions","organizations_url":"https://api.github.com/users/pizza2code/orgs","repos_url":"https://api.github.com/users/pizza2code/repos","events_url":"https://api.github.com/users/pizza2code/events{/privacy}","received_events_url":"https://api.github.com/users/pizza2code/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-03T14:52:56Z","updated_at":"2016-06-09T14:24:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kawanet/int64-buffer/pulls/2","html_url":"https://github.com/kawanet/int64-buffer/pull/2","diff_url":"https://github.com/kawanet/int64-buffer/pull/2.diff","patch_url":"https://github.com/kawanet/int64-buffer/pull/2.patch"},"body":"Greetings,\r\n\r\nThanks for the module! I've started to use it in a Typescript project, and was wondering if I could add a Typescript definition file (here in the pull request) directly to your module.  I already wrote it for my project, putting it here so ideally everyone can benefit.\r\n\r\nAlso, hopefully the code agrees with your intended module API."},"comment":{"url":"https://api.github.com/repos/kawanet/int64-buffer/issues/comments/224910551","html_url":"https://github.com/kawanet/int64-buffer/pull/2#issuecomment-224910551","issue_url":"https://api.github.com/repos/kawanet/int64-buffer/issues/2","id":224910551,"user":{"login":"pizza2code","id":15824044,"avatar_url":"https://avatars.githubusercontent.com/u/15824044?v=3","gravatar_id":"","url":"https://api.github.com/users/pizza2code","html_url":"https://github.com/pizza2code","followers_url":"https://api.github.com/users/pizza2code/followers","following_url":"https://api.github.com/users/pizza2code/following{/other_user}","gists_url":"https://api.github.com/users/pizza2code/gists{/gist_id}","starred_url":"https://api.github.com/users/pizza2code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pizza2code/subscriptions","organizations_url":"https://api.github.com/users/pizza2code/orgs","repos_url":"https://api.github.com/users/pizza2code/repos","events_url":"https://api.github.com/users/pizza2code/events{/privacy}","received_events_url":"https://api.github.com/users/pizza2code/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T14:24:33Z","updated_at":"2016-06-09T14:24:33Z","body":"You're exactly correct with the syntax!  To distinguish between at least some of the union types, how about something like:\r\n`\ttype ArrayType = Uint8Array | ArrayBuffer | number[];\r\n\r\n\tconstructor(buf: Buffer);\r\n\tconstructor(buf: Buffer, offset: number, value?: number);\r\n\tconstructor(buf: Buffer, offset: number, high: number, low: number);\r\n\tconstructor(buf: Buffer, offset: number, value: string, radix?: number);\r\n\tconstructor(array: ArrayType);\r\n\tconstructor(array: ArrayType, offset: number, value?: number);\r\n\tconstructor(array: ArrayType, offset: number, high: number, low: number);\r\n\tconstructor(array: ArrayType, offset: number, value: string, radix?: number);`\r\n\r\nOr it could be expanded further, for all the union terms."}}
{"actor":{"display_login":"pizza2code"}}