{"action":"created","issue":{"url":"https://api.github.com/repos/epoberezkin/ajv/issues/251","repository_url":"https://api.github.com/repos/epoberezkin/ajv","labels_url":"https://api.github.com/repos/epoberezkin/ajv/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/epoberezkin/ajv/issues/251/comments","events_url":"https://api.github.com/repos/epoberezkin/ajv/issues/251/events","html_url":"https://github.com/epoberezkin/ajv/pull/251","id":167860854,"number":251,"title":"[typescript] Use Class in type's definition to allow use 'new' operator","user":{"login":"dalcib","id":240801,"avatar_url":"https://avatars.githubusercontent.com/u/240801?v=3","gravatar_id":"","url":"https://api.github.com/users/dalcib","html_url":"https://github.com/dalcib","followers_url":"https://api.github.com/users/dalcib/followers","following_url":"https://api.github.com/users/dalcib/following{/other_user}","gists_url":"https://api.github.com/users/dalcib/gists{/gist_id}","starred_url":"https://api.github.com/users/dalcib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalcib/subscriptions","organizations_url":"https://api.github.com/users/dalcib/orgs","repos_url":"https://api.github.com/users/dalcib/repos","events_url":"https://api.github.com/users/dalcib/events{/privacy}","received_events_url":"https://api.github.com/users/dalcib/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-27T13:59:16Z","updated_at":"2016-08-04T04:47:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/epoberezkin/ajv/pulls/251","html_url":"https://github.com/epoberezkin/ajv/pull/251","diff_url":"https://github.com/epoberezkin/ajv/pull/251.diff","patch_url":"https://github.com/epoberezkin/ajv/pull/251.patch"},"body":"After struggle a lot with the message `[ts] Only a void function can be called with the 'new' keyword`, every time that I try to use the code above, I got to resolve the issue  by using export class insted a namespace.\r\n\r\n```\r\nimport Ajv from 'ajv';\r\n...\r\nconst ajv = new Ajv(ajvOptions);\r\n```\r\nThis change allows to type cheking the options, outside of the parameter like this:\r\n```\r\nimport Ajv, {Options} from 'ajv';\r\nconst ajvOptions: Options = {...}\r\nconst ajv = new Ajv(ajvOptions);\r\n```"},"comment":{"url":"https://api.github.com/repos/epoberezkin/ajv/issues/comments/237451666","html_url":"https://github.com/epoberezkin/ajv/pull/251#issuecomment-237451666","issue_url":"https://api.github.com/repos/epoberezkin/ajv/issues/251","id":237451666,"user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T04:47:40Z","updated_at":"2016-08-04T04:47:40Z","body":"Also, changing it to a class instead of a function would completely break backward compatibility for people who do use it as a function currently. You should instead enable support for both ways."}}
{"actor":{"display_login":"blakeembrey"}}