SimonDegraeve / hapi-graphql

Create a GraphQL HTTP server with Hapi.
115 stars 27 forks source link

Add index.d.ts stub for compatibility with TypeScript #17

Closed lukewlms closed 7 years ago

lukewlms commented 8 years ago

This is a basic index.d.ts file that makes the module work out of the box with TypeScript. Without types, TypeScript users (like us) like us may not give the module a shot.

The stub is fully functional with the example use case in readme.md (just assigns a generic function type to the default export).

(.d.ts files can be in DefinitelyTyped or bundled with the module, as with this pull request; the latter means one less step for users of the module.)

Thanks for taking a look!