Skip to content

Commit 5500ff0

Browse files
committed
docs(README): TypeScript
1 parent 4a7f99f commit 5500ff0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ octokit.users.getAuthenticated();
5151

5252
There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md)
5353

54+
## TypeScript
55+
56+
Parameter and response types for all endpoint methods exported as `{ RestEndpointMethodTypes }`.
57+
58+
Example
59+
60+
```ts
61+
import { RestEndpointMethodTypes } from "@octokit/rest-endpoint-methods";
62+
63+
type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
64+
type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
65+
```
66+
5467
## Contributing
5568

5669
See [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)