gbdrt commented on a change in pull request #72: Adding type definitions for
typescript
URL:
https://github.com/apache/incubator-openwhisk-client-js/pull/72#discussion_r138888314
##########
File path: lib/main.d.ts
##########
@@ -0,0 +1,286 @@
+import * as Swagger from 'swagger-schema-official'
Review comment:
The type of an api (used for `ow.routes`) is:
```
interface Api {
namespace: string;
gwApiActivated: boolean;
tenantId: boolean;
gwApiUrl: string;
apidoc: Swagger.Spec;
}
```
The field `apidoc` contains the swagger of the Api.
Rather than redefining the types for swagger, I used the package
swagger-schema-official which only contains the type definitions for Swagger.
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-schema-official
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services