{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue/issues/3509","repository_url":"https://api.github.com/repos/vuejs/vue","labels_url":"https://api.github.com/repos/vuejs/vue/issues/3509/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue/issues/3509/comments","events_url":"https://api.github.com/repos/vuejs/vue/issues/3509/events","html_url":"https://github.com/vuejs/vue/pull/3509","id":172849554,"number":3509,"title":"Add typescript definition","user":{"login":"kaorun343","id":5625395,"avatar_url":"https://avatars.githubusercontent.com/u/5625395?v=3","gravatar_id":"","url":"https://api.github.com/users/kaorun343","html_url":"https://github.com/kaorun343","followers_url":"https://api.github.com/users/kaorun343/followers","following_url":"https://api.github.com/users/kaorun343/following{/other_user}","gists_url":"https://api.github.com/users/kaorun343/gists{/gist_id}","starred_url":"https://api.github.com/users/kaorun343/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaorun343/subscriptions","organizations_url":"https://api.github.com/users/kaorun343/orgs","repos_url":"https://api.github.com/users/kaorun343/repos","events_url":"https://api.github.com/users/kaorun343/events{/privacy}","received_events_url":"https://api.github.com/users/kaorun343/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vuejs/vue/labels/in%20review","name":"in review","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-08-24T02:16:13Z","updated_at":"2016-09-01T05:58:36Z","closed_at":"2016-08-31T16:39:25Z","pull_request":{"url":"https://api.github.com/repos/vuejs/vue/pulls/3509","html_url":"https://github.com/vuejs/vue/pull/3509","diff_url":"https://github.com/vuejs/vue/pull/3509.diff","patch_url":"https://github.com/vuejs/vue/pull/3509.patch"},"body":"Hi.\r\n\r\nThis is a definition file for Vue.js 2.0.\r\nI would like to unite the way of providing these definition files, I think, so I took the same way of Vuex.\r\n\r\nI referenced a rc.vuejs.org, and it is not complete. These are the TODO List of this.\r\nI hope that this PR will be merged and modified the files to achieve these things by other people.\r\n\r\n* [x] Adding rest definitions since v1.0 such as lifecycle hooks.\r\n* [x] Adding the functions related to `createElement` and writing the interface `VNode` and others.\r\n* [x] Considering the naming of the interfaces, for instance, whether we should use the same name between TS and Flow.\r\n* Adding JSDoc/TSDoc comments for IDE. If allowed, I'd like to refer to the official documents.\r\n* [x] Adding a test if needed as well as we did in DefinitelyTyped\r\n* Modifying `vue-class-component` to use this new definition file when this is finished\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/vuejs/vue/issues/comments/243983658","html_url":"https://github.com/vuejs/vue/pull/3509#issuecomment-243983658","issue_url":"https://api.github.com/repos/vuejs/vue/issues/3509","id":243983658,"user":{"login":"HerringtonDarkholme","id":2883231,"avatar_url":"https://avatars.githubusercontent.com/u/2883231?v=3","gravatar_id":"","url":"https://api.github.com/users/HerringtonDarkholme","html_url":"https://github.com/HerringtonDarkholme","followers_url":"https://api.github.com/users/HerringtonDarkholme/followers","following_url":"https://api.github.com/users/HerringtonDarkholme/following{/other_user}","gists_url":"https://api.github.com/users/HerringtonDarkholme/gists{/gist_id}","starred_url":"https://api.github.com/users/HerringtonDarkholme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HerringtonDarkholme/subscriptions","organizations_url":"https://api.github.com/users/HerringtonDarkholme/orgs","repos_url":"https://api.github.com/users/HerringtonDarkholme/repos","events_url":"https://api.github.com/users/HerringtonDarkholme/events{/privacy}","received_events_url":"https://api.github.com/users/HerringtonDarkholme/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T05:58:36Z","updated_at":"2016-09-01T05:58:36Z","body":"One workaround is changin `index.d.ts` to this\r\n\r\n```typescript\r\nimport {Vue as _V} from './vue'\r\ndeclare class Vue extends _V {}\r\ndeclare namespace Vue {}\r\nexport = Vue\r\n```\r\n\r\n`declare namespace` statement is for bypassing export limitation.\r\n\r\n`declare class Vue extends _V`  is solely for bypassing import limitation in TS module declaration.\r\n\r\nThis is hideous hack, but limits changes in TS specific files.\r\n\r\nAnother way is adding two private fields to Vue:  `default` pointing to `Vue` itself and `__esModule` being `true`.\r\nThis change is compatible with ES5/commonJS/ES6/Babel/TypeScript. Every one shall be happy. But the change is to Vue itself.\r\n\r\nWhat's your opinions? @yyx990803 @kaorun343 @ktsn \r\n"}}
{"actor":{"display_login":"HerringtonDarkholme"}}