$ gnpm install @octokit/types
Shared TypeScript definitions for Octokit projects
See all exported types at https://octokit.github.io/types.ts
import { Endpoints } from "@octokit/types";
type listUserReposParameters =
Endpoints["GET /repos/{owner}/{repo}"]["parameters"];
type listUserReposResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"];
async function listRepos(
options: listUserReposParameters,
): listUserReposResponse["data"] {
// ...
}
import {
GetResponseTypeFromEndpointMethod,
GetResponseDataTypeFromEndpointMethod,
} from "@octokit/types";
import { Octokit } from "@octokit/rest";
const octokit = new Octokit();
type CreateLabelResponseType = GetResponseTypeFromEndpointMethod<
typeof octokit.issues.createLabel
>;
type CreateLabelResponseDataType = GetResponseDataTypeFromEndpointMethod<
typeof octokit.issues.createLabel
>;
See CONTRIBUTING.md
Copyright 2013 - present © cnpmjs.org | Home |