{"action":"opened","number":579,"pull_request":{"url":"https://api.github.com/repos/mzabriskie/axios/pulls/579","id":96713926,"html_url":"https://github.com/mzabriskie/axios/pull/579","diff_url":"https://github.com/mzabriskie/axios/pull/579.diff","patch_url":"https://github.com/mzabriskie/axios/pull/579.patch","issue_url":"https://api.github.com/repos/mzabriskie/axios/issues/579","number":579,"state":"open","locked":false,"title":"Update typings","user":{"login":"IRus","id":493656,"avatar_url":"https://avatars.githubusercontent.com/u/493656?v=3","gravatar_id":"","url":"https://api.github.com/users/IRus","html_url":"https://github.com/IRus","followers_url":"https://api.github.com/users/IRus/followers","following_url":"https://api.github.com/users/IRus/following{/other_user}","gists_url":"https://api.github.com/users/IRus/gists{/gist_id}","starred_url":"https://api.github.com/users/IRus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRus/subscriptions","organizations_url":"https://api.github.com/users/IRus/orgs","repos_url":"https://api.github.com/users/IRus/repos","events_url":"https://api.github.com/users/IRus/events{/privacy}","received_events_url":"https://api.github.com/users/IRus/received_events","type":"User","site_admin":false},"body":"Updating typings. \r\n\r\nI used Typescript 2.x\r\n\r\n- [x] Add generic type to both Promise and Response.\r\n- [x] Delete typings since es6-promise package contains type definitions.\r\n\r\nExample of usage before:\r\n\r\n```\r\nimport axios, * as axiosTypes from 'axios';\r\n\r\nexport class RestHttpService {\r\n  static Get<T>(path: string, config?: axiosTypes.AxiosRequestConfig): Promise<T> {\r\n    return axios.get(path, config).then(payload => payload.data);\r\n  };\r\n\r\n  static Post<T>(path: string, data?: any, config?: axiosTypes.AxiosRequestConfig): Promise<T> {\r\n    return axios.post(path, data, config).then(payload => payload.data) as Promise<T>;\r\n  };\r\n\r\n  static Put<T>(path: string, body?: any, config?: axiosTypes.AxiosRequestConfig): Promise<T> {\r\n    return axios.put(path, body, config).then(payload => payload.data) as Promise<T>;\r\n  };\r\n\r\n  static Remove<T>(path: string, config?: axiosTypes.AxiosRequestConfig): Promise<T> {\r\n    return axios.delete(path, config).then(payload => payload.data) as Promise<T>;\r\n  };\r\n}\r\n```\r\n\r\nExample of usage after:\r\n\r\n```\r\nimport axios, {AxiosRequestConfig, AxiosResponse, Promise} from 'axios';\r\n\r\nexport class RestHttpService {\r\n  static Get<T>(path: string, config?: AxiosRequestConfig): Promise<T> {\r\n    return axios.get<T>(path, config).then(payload => payload.data);\r\n  };\r\n\r\n  static Post<T>(path: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<T>> {\r\n    return axios.post<T>(path, data, config);\r\n  };\r\n\r\n  static Put<T>(path: string, body?: any, config?: AxiosRequestConfig): Promise<T> {\r\n    return axios.put<T>(path, body, config).then(payload => payload.data);\r\n  };\r\n\r\n  static Remove<T>(path: string, config?: AxiosRequestConfig): Promise<T> {\r\n    return axios.delete<T>(path, config).then(payload => payload.data);\r\n  };\r\n}\r\n```","created_at":"2016-12-06T12:20:58Z","updated_at":"2016-12-06T12:20:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b8c27b23172e7282a8f3d17344b976ab3ed174f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mzabriskie/axios/pulls/579/commits","review_comments_url":"https://api.github.com/repos/mzabriskie/axios/pulls/579/comments","review_comment_url":"https://api.github.com/repos/mzabriskie/axios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mzabriskie/axios/issues/579/comments","statuses_url":"https://api.github.com/repos/mzabriskie/axios/statuses/ff4042b4041402918d6792c1b95118cfca5c43a0","head":{"label":"IRus:master","ref":"master","sha":"ff4042b4041402918d6792c1b95118cfca5c43a0","user":{"login":"IRus","id":493656,"avatar_url":"https://avatars.githubusercontent.com/u/493656?v=3","gravatar_id":"","url":"https://api.github.com/users/IRus","html_url":"https://github.com/IRus","followers_url":"https://api.github.com/users/IRus/followers","following_url":"https://api.github.com/users/IRus/following{/other_user}","gists_url":"https://api.github.com/users/IRus/gists{/gist_id}","starred_url":"https://api.github.com/users/IRus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRus/subscriptions","organizations_url":"https://api.github.com/users/IRus/orgs","repos_url":"https://api.github.com/users/IRus/repos","events_url":"https://api.github.com/users/IRus/events{/privacy}","received_events_url":"https://api.github.com/users/IRus/received_events","type":"User","site_admin":false},"repo":{"id":75656226,"name":"axios","full_name":"IRus/axios","owner":{"login":"IRus","id":493656,"avatar_url":"https://avatars.githubusercontent.com/u/493656?v=3","gravatar_id":"","url":"https://api.github.com/users/IRus","html_url":"https://github.com/IRus","followers_url":"https://api.github.com/users/IRus/followers","following_url":"https://api.github.com/users/IRus/following{/other_user}","gists_url":"https://api.github.com/users/IRus/gists{/gist_id}","starred_url":"https://api.github.com/users/IRus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IRus/subscriptions","organizations_url":"https://api.github.com/users/IRus/orgs","repos_url":"https://api.github.com/users/IRus/repos","events_url":"https://api.github.com/users/IRus/events{/privacy}","received_events_url":"https://api.github.com/users/IRus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IRus/axios","description":"Promise based HTTP client for the browser and node.js","fork":true,"url":"https://api.github.com/repos/IRus/axios","forks_url":"https://api.github.com/repos/IRus/axios/forks","keys_url":"https://api.github.com/repos/IRus/axios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IRus/axios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IRus/axios/teams","hooks_url":"https://api.github.com/repos/IRus/axios/hooks","issue_events_url":"https://api.github.com/repos/IRus/axios/issues/events{/number}","events_url":"https://api.github.com/repos/IRus/axios/events","assignees_url":"https://api.github.com/repos/IRus/axios/assignees{/user}","branches_url":"https://api.github.com/repos/IRus/axios/branches{/branch}","tags_url":"https://api.github.com/repos/IRus/axios/tags","blobs_url":"https://api.github.com/repos/IRus/axios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IRus/axios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IRus/axios/git/refs{/sha}","trees_url":"https://api.github.com/repos/IRus/axios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IRus/axios/statuses/{sha}","languages_url":"https://api.github.com/repos/IRus/axios/languages","stargazers_url":"https://api.github.com/repos/IRus/axios/stargazers","contributors_url":"https://api.github.com/repos/IRus/axios/contributors","subscribers_url":"https://api.github.com/repos/IRus/axios/subscribers","subscription_url":"https://api.github.com/repos/IRus/axios/subscription","commits_url":"https://api.github.com/repos/IRus/axios/commits{/sha}","git_commits_url":"https://api.github.com/repos/IRus/axios/git/commits{/sha}","comments_url":"https://api.github.com/repos/IRus/axios/comments{/number}","issue_comment_url":"https://api.github.com/repos/IRus/axios/issues/comments{/number}","contents_url":"https://api.github.com/repos/IRus/axios/contents/{+path}","compare_url":"https://api.github.com/repos/IRus/axios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IRus/axios/merges","archive_url":"https://api.github.com/repos/IRus/axios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IRus/axios/downloads","issues_url":"https://api.github.com/repos/IRus/axios/issues{/number}","pulls_url":"https://api.github.com/repos/IRus/axios/pulls{/number}","milestones_url":"https://api.github.com/repos/IRus/axios/milestones{/number}","notifications_url":"https://api.github.com/repos/IRus/axios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IRus/axios/labels{/name}","releases_url":"https://api.github.com/repos/IRus/axios/releases{/id}","deployments_url":"https://api.github.com/repos/IRus/axios/deployments","created_at":"2016-12-05T18:53:24Z","updated_at":"2016-12-05T18:53:26Z","pushed_at":"2016-12-06T12:16:31Z","git_url":"git://github.com/IRus/axios.git","ssh_url":"git@github.com:IRus/axios.git","clone_url":"https://github.com/IRus/axios.git","svn_url":"https://github.com/IRus/axios","homepage":"","size":2234,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mzabriskie:master","ref":"master","sha":"cfe33d4fd391288158a3d14b9366b17c779b19e3","user":{"login":"mzabriskie","id":199035,"avatar_url":"https://avatars.githubusercontent.com/u/199035?v=3","gravatar_id":"","url":"https://api.github.com/users/mzabriskie","html_url":"https://github.com/mzabriskie","followers_url":"https://api.github.com/users/mzabriskie/followers","following_url":"https://api.github.com/users/mzabriskie/following{/other_user}","gists_url":"https://api.github.com/users/mzabriskie/gists{/gist_id}","starred_url":"https://api.github.com/users/mzabriskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzabriskie/subscriptions","organizations_url":"https://api.github.com/users/mzabriskie/orgs","repos_url":"https://api.github.com/users/mzabriskie/repos","events_url":"https://api.github.com/users/mzabriskie/events{/privacy}","received_events_url":"https://api.github.com/users/mzabriskie/received_events","type":"User","site_admin":false},"repo":{"id":23088740,"name":"axios","full_name":"mzabriskie/axios","owner":{"login":"mzabriskie","id":199035,"avatar_url":"https://avatars.githubusercontent.com/u/199035?v=3","gravatar_id":"","url":"https://api.github.com/users/mzabriskie","html_url":"https://github.com/mzabriskie","followers_url":"https://api.github.com/users/mzabriskie/followers","following_url":"https://api.github.com/users/mzabriskie/following{/other_user}","gists_url":"https://api.github.com/users/mzabriskie/gists{/gist_id}","starred_url":"https://api.github.com/users/mzabriskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzabriskie/subscriptions","organizations_url":"https://api.github.com/users/mzabriskie/orgs","repos_url":"https://api.github.com/users/mzabriskie/repos","events_url":"https://api.github.com/users/mzabriskie/events{/privacy}","received_events_url":"https://api.github.com/users/mzabriskie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzabriskie/axios","description":"Promise based HTTP client for the browser and node.js","fork":false,"url":"https://api.github.com/repos/mzabriskie/axios","forks_url":"https://api.github.com/repos/mzabriskie/axios/forks","keys_url":"https://api.github.com/repos/mzabriskie/axios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzabriskie/axios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzabriskie/axios/teams","hooks_url":"https://api.github.com/repos/mzabriskie/axios/hooks","issue_events_url":"https://api.github.com/repos/mzabriskie/axios/issues/events{/number}","events_url":"https://api.github.com/repos/mzabriskie/axios/events","assignees_url":"https://api.github.com/repos/mzabriskie/axios/assignees{/user}","branches_url":"https://api.github.com/repos/mzabriskie/axios/branches{/branch}","tags_url":"https://api.github.com/repos/mzabriskie/axios/tags","blobs_url":"https://api.github.com/repos/mzabriskie/axios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzabriskie/axios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzabriskie/axios/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzabriskie/axios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzabriskie/axios/statuses/{sha}","languages_url":"https://api.github.com/repos/mzabriskie/axios/languages","stargazers_url":"https://api.github.com/repos/mzabriskie/axios/stargazers","contributors_url":"https://api.github.com/repos/mzabriskie/axios/contributors","subscribers_url":"https://api.github.com/repos/mzabriskie/axios/subscribers","subscription_url":"https://api.github.com/repos/mzabriskie/axios/subscription","commits_url":"https://api.github.com/repos/mzabriskie/axios/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzabriskie/axios/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzabriskie/axios/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzabriskie/axios/issues/comments{/number}","contents_url":"https://api.github.com/repos/mzabriskie/axios/contents/{+path}","compare_url":"https://api.github.com/repos/mzabriskie/axios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzabriskie/axios/merges","archive_url":"https://api.github.com/repos/mzabriskie/axios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzabriskie/axios/downloads","issues_url":"https://api.github.com/repos/mzabriskie/axios/issues{/number}","pulls_url":"https://api.github.com/repos/mzabriskie/axios/pulls{/number}","milestones_url":"https://api.github.com/repos/mzabriskie/axios/milestones{/number}","notifications_url":"https://api.github.com/repos/mzabriskie/axios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzabriskie/axios/labels{/name}","releases_url":"https://api.github.com/repos/mzabriskie/axios/releases{/id}","deployments_url":"https://api.github.com/repos/mzabriskie/axios/deployments","created_at":"2014-08-18T22:30:27Z","updated_at":"2016-12-06T12:17:47Z","pushed_at":"2016-12-06T12:20:58Z","git_url":"git://github.com/mzabriskie/axios.git","ssh_url":"git@github.com:mzabriskie/axios.git","clone_url":"https://github.com/mzabriskie/axios.git","svn_url":"https://github.com/mzabriskie/axios","homepage":"","size":2234,"stargazers_count":9813,"watchers_count":9813,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":515,"mirror_url":null,"open_issues_count":55,"forks":515,"open_issues":55,"watchers":9813,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mzabriskie/axios/pulls/579"},"html":{"href":"https://github.com/mzabriskie/axios/pull/579"},"issue":{"href":"https://api.github.com/repos/mzabriskie/axios/issues/579"},"comments":{"href":"https://api.github.com/repos/mzabriskie/axios/issues/579/comments"},"review_comments":{"href":"https://api.github.com/repos/mzabriskie/axios/pulls/579/comments"},"review_comment":{"href":"https://api.github.com/repos/mzabriskie/axios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mzabriskie/axios/pulls/579/commits"},"statuses":{"href":"https://api.github.com/repos/mzabriskie/axios/statuses/ff4042b4041402918d6792c1b95118cfca5c43a0"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":17,"deletions":22,"changed_files":2}}
{"actor":{"display_login":"IRus"}}