{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2179","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2179/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2179/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2179/events","html_url":"https://github.com/Microsoft/TypeScript/issues/2179","id":59450942,"number":2179,"title":"Supporting type `self` or something that can represents the current instance.","user":{"login":"vilic","id":970430,"avatar_url":"https://avatars.githubusercontent.com/u/970430?v=3","gravatar_id":"","url":"https://api.github.com/users/vilic","html_url":"https://github.com/vilic","followers_url":"https://api.github.com/users/vilic/followers","following_url":"https://api.github.com/users/vilic/following{/other_user}","gists_url":"https://api.github.com/users/vilic/gists{/gist_id}","starred_url":"https://api.github.com/users/vilic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vilic/subscriptions","organizations_url":"https://api.github.com/users/vilic/orgs","repos_url":"https://api.github.com/users/vilic/repos","events_url":"https://api.github.com/users/vilic/events{/privacy}","received_events_url":"https://api.github.com/users/vilic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-02T08:21:10Z","updated_at":"2015-03-02T20:08:16Z","closed_at":"2015-03-02T09:29:23Z","body":"When I am writing a declaration file, I found it really frustrating repeating the inherited method that returns the instance itself for a correct return type.\r\n\r\nE.g. for animation library GSAP, many classes are inherited from class `Animation`, I have to repeat almost every method to update return type `Animation` to the current class.\r\n\r\n```typescript\r\nclass Animation {\r\n    chain(): Animation;\r\n}\r\n\r\nclass TweenLite extends Animation {\r\n    ownProperty: any;\r\n    chain(): TweenLite;\r\n}\r\n```\r\n\r\nIt would be great if we may use some type like `self` to make this easier, like this:\r\n\r\n```typescript\r\nclass Animation {\r\n    chain(): self;\r\n}\r\n\r\nclass TweenLite extends Animation {\r\n    ownProperty: any;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/76803903","html_url":"https://github.com/Microsoft/TypeScript/issues/2179#issuecomment-76803903","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/2179","id":76803903,"user":{"login":"danquirk","id":7121557,"avatar_url":"https://avatars.githubusercontent.com/u/7121557?v=3","gravatar_id":"","url":"https://api.github.com/users/danquirk","html_url":"https://github.com/danquirk","followers_url":"https://api.github.com/users/danquirk/followers","following_url":"https://api.github.com/users/danquirk/following{/other_user}","gists_url":"https://api.github.com/users/danquirk/gists{/gist_id}","starred_url":"https://api.github.com/users/danquirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danquirk/subscriptions","organizations_url":"https://api.github.com/users/danquirk/orgs","repos_url":"https://api.github.com/users/danquirk/repos","events_url":"https://api.github.com/users/danquirk/events{/privacy}","received_events_url":"https://api.github.com/users/danquirk/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T20:08:16Z","updated_at":"2015-03-02T20:08:16Z","body":"Also see #513"}}