{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/15963","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/15963/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/15963/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/15963/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15963","id":222528594,"number":15963,"title":"Major hapi review, refactor and update to 16.1.1","user":{"login":"AJamesPhillips","id":526509,"avatar_url":"https://avatars3.githubusercontent.com/u/526509?v=3","gravatar_id":"","url":"https://api.github.com/users/AJamesPhillips","html_url":"https://github.com/AJamesPhillips","followers_url":"https://api.github.com/users/AJamesPhillips/followers","following_url":"https://api.github.com/users/AJamesPhillips/following{/other_user}","gists_url":"https://api.github.com/users/AJamesPhillips/gists{/gist_id}","starred_url":"https://api.github.com/users/AJamesPhillips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AJamesPhillips/subscriptions","organizations_url":"https://api.github.com/users/AJamesPhillips/orgs","repos_url":"https://api.github.com/users/AJamesPhillips/repos","events_url":"https://api.github.com/users/AJamesPhillips/events{/privacy}","received_events_url":"https://api.github.com/users/AJamesPhillips/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-18T20:01:23Z","updated_at":"2017-04-19T19:42:14Z","closed_at":null,"body":"I've completed updating the types for hapi 16.1.1 and some of the plugins.  They're now available here:  https://github.com/AJamesPhillips/DefinitelyTyped/tree/hapi-v16.1/types/hapi\r\nI made a mistake whilst updating the inert plugin types before: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15616/commits/b33942b17b4117f2fa5b2eae6ad3baa55323768f so I'm only going to submit these new types to the repository when I have tested them for a week or so.  If anyone else who uses Hapi with TypeScript could test these with real production code and suggest any improvements that'd obviously be very useful.\r\n\r\nThere are a large number of changes.  In terms of backwards compatible the major breaking change (vs the existing tests now in the v16.0 directory) is the lack of `IReply`.  From the docs it seemed there were many subtly different `reply(...)` methods some with and without `reply.continue()`... so these have become `IReplyWithContinue` and `IReplyNoContinue`.  Also I didn't put back in the generic `IReply` known as `IStrictReply`, did people find this useful?  I read somewhere (now can't find the link) about not using generic types unless the type was used in typing one or more of the function arguments.  Using it to type the return was suggested to be the same as casting the return but with extra steps.  Can obviously put back in if needed.\r\n\r\nThere are also concurrent changes to `inert` included within the branch above, as well as [PR to Hapi regarding some of the documentation](https://github.com/hapijs/hapi/pull/3479).\r\n\r\n@corbinu @MeirionHughes @eobrien-fsp @mmc41 @jasonswearingen\r\nThanks."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/295408315","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15963#issuecomment-295408315","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/15963","id":295408315,"user":{"login":"mmc41","id":17993,"avatar_url":"https://avatars0.githubusercontent.com/u/17993?v=3","gravatar_id":"","url":"https://api.github.com/users/mmc41","html_url":"https://github.com/mmc41","followers_url":"https://api.github.com/users/mmc41/followers","following_url":"https://api.github.com/users/mmc41/following{/other_user}","gists_url":"https://api.github.com/users/mmc41/gists{/gist_id}","starred_url":"https://api.github.com/users/mmc41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmc41/subscriptions","organizations_url":"https://api.github.com/users/mmc41/orgs","repos_url":"https://api.github.com/users/mmc41/repos","events_url":"https://api.github.com/users/mmc41/events{/privacy}","received_events_url":"https://api.github.com/users/mmc41/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T19:42:14Z","updated_at":"2017-04-19T19:42:14Z","body":"@AJamesPhillips @jasonswearingen If we are updating @types/hapi in a major way, I wonder if it would make sense to introduce two new types to help create hapi plugins/modules in a type safe manner. In my own project I have created these two types on the side, but I think it could make sense to declare them in @types/hapi (possibly after a rename):\r\n\r\n```\r\nexport interface HapiModuleFunctionAttributes {\r\n   name: string;\r\n   version: string;\r\n   multiple?: boolean;\r\n};\r\n\r\nexport interface HapiModuleFunction<O> {\r\n     (server: Server, options: O, next: (err?: any) => void): void;\r\n     attributes?: HapiModuleFunctionAttributes;\r\n}\r\n\r\n```\r\nThen can than be used when declaring an plugin:\r\n```\r\nexport const register: HapiModuleFunction<MyOptionsType> = function (server, options, next) {\r\n...\r\n}\r\n\r\nregister.attributes = {\r\n   name: 'uiPlugin',\r\n   version: '1.0.0'\r\n};\r\n```\r\n\r\nLet me know what you think?"}}
{"actor":{"display_login":"mmc41"}}