{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24889","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24889/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24889/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24889/events","html_url":"https://github.com/Microsoft/TypeScript/issues/24889","id":331398632,"node_id":"MDU6SXNzdWUzMzEzOTg2MzI=","number":24889,"title":"Extension methods for interfaces","user":{"login":"oliverjanik","id":2280140,"node_id":"MDQ6VXNlcjIyODAxNDA=","avatar_url":"https://avatars1.githubusercontent.com/u/2280140?v=4","gravatar_id":"","url":"https://api.github.com/users/oliverjanik","html_url":"https://github.com/oliverjanik","followers_url":"https://api.github.com/users/oliverjanik/followers","following_url":"https://api.github.com/users/oliverjanik/following{/other_user}","gists_url":"https://api.github.com/users/oliverjanik/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverjanik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverjanik/subscriptions","organizations_url":"https://api.github.com/users/oliverjanik/orgs","repos_url":"https://api.github.com/users/oliverjanik/repos","events_url":"https://api.github.com/users/oliverjanik/events{/privacy}","received_events_url":"https://api.github.com/users/oliverjanik/received_events","type":"User","site_admin":false},"labels":[{"id":113971226,"node_id":"MDU6TGFiZWwxMTM5NzEyMjY=","url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-12T00:47:47Z","updated_at":"2018-06-29T17:39:45Z","closed_at":null,"author_association":"NONE","body":"Apologies I this is a dup.\r\n\r\nThe situation comes up often. I define an interfaces for my API JSON responses and I wish they were classes so I could define instance methods on them. Say for mutation, or just helpful convenience methods.\r\n\r\nSure I can use standalone functions that take the interface as the first parameter but discover-ability sucks.\r\n\r\nSomething like this:\r\n```typescript\r\ninterface Rect {\r\n    x: number;\r\n    y: number;\r\n    width: number;\r\n    height: number;\r\n}\r\n\r\nfunction area(rect: this Rect): number {\r\n    return rect.widht * rect.height;\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/401424209","html_url":"https://github.com/Microsoft/TypeScript/issues/24889#issuecomment-401424209","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/24889","id":401424209,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTQyNDIwOQ==","user":{"login":"typescript-bot","id":23042052,"node_id":"MDQ6VXNlcjIzMDQyMDUy","avatar_url":"https://avatars0.githubusercontent.com/u/23042052?v=4","gravatar_id":"","url":"https://api.github.com/users/typescript-bot","html_url":"https://github.com/typescript-bot","followers_url":"https://api.github.com/users/typescript-bot/followers","following_url":"https://api.github.com/users/typescript-bot/following{/other_user}","gists_url":"https://api.github.com/users/typescript-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/typescript-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typescript-bot/subscriptions","organizations_url":"https://api.github.com/users/typescript-bot/orgs","repos_url":"https://api.github.com/users/typescript-bot/repos","events_url":"https://api.github.com/users/typescript-bot/events{/privacy}","received_events_url":"https://api.github.com/users/typescript-bot/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T17:39:45Z","updated_at":"2018-06-29T17:39:45Z","author_association":"COLLABORATOR","body":"Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed."}}
{"actor":{"display_login":"typescript-bot"}}