Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Adding Typescript definition #311

Open
bendtherules opened this issue May 22, 2018 · 8 comments
Open

Adding Typescript definition #311

bendtherules opened this issue May 22, 2018 · 8 comments

Comments

@bendtherules
Copy link

I am trying to use it with a TypeScript project, but couldn't find any type definition file either in this repo or DefinitelyTyped.

I could spend time on adding those.

They can be maintained either directly within the repo, or Definitelytyped repo - I feel adding it directly to the repo has more benefits like proper version matching with lib. Let me know which approach you would prefer.

@pksunkara
Copy link
Owner

I prefer DefinitelyTyped.

@bendtherules
Copy link
Author

Sounds good. Will move forward accordingly.

@Junkern
Copy link

Junkern commented May 22, 2018

Wow, I also wanted to create an issue today about that. If you need help/assistance, feel free to contact me @bendtherules

@bendtherules
Copy link
Author

bendtherules commented May 26, 2018

Hi @Junkern,
Please go forward with the Implementation if you are interested.
I have decided to use the octokit library for the task at hand and probably will not get time to work on this.

Just a suggestion, please try to have typed response objects, probably using generics (instead of almost useless AnyResponse object, like how octokit/rest.js does it).

@pixelass
Copy link

I'm not sure if anybody needs this but I created typings for repos: (this helped me)

interface GithubRepository {
	id: number;
	node_id: string;
	name: string;
	full_name: string;
	private: boolean;
	owner: {
		login: string;
		id: number;
		node_id: string;
		avatar_url: string;
		gravatar_id: string;
		url: string;
		html_url: string;
		followers_url: string;
		following_url: string;
		gists_url: string;
		starred_url: string;
		subscriptions_url: string;
		organizations_url: string;
		repos_url: string;
		events_url: string;
		received_events_url: string;
		type: string;
		site_admin: false;
	};
	html_url: string;
	description: string;
	fork: boolean;
	url: string;
	forks_url: string;
	keys_url: string;
	collaborators_url: string;
	teams_url: string;
	hooks_url: string;
	issue_events_url: string;
	events_url: string;
	assignees_url: string;
	branches_url: string;
	tags_url: string;
	blobs_url: string;
	git_tags_url: string;
	git_refs_url: string;
	trees_url: string;
	statuses_url: string;
	languages_url: string;
	stargazers_url: string;
	contributors_url: string;
	subscribers_url: string;
	subscription_url: string;
	commits_url: string;
	git_commits_url: string;
	comments_url: string;
	issue_comment_url: string;
	contents_url: string;
	compare_url: string;
	merges_url: string;
	archive_url: string;
	downloads_url: string;
	issues_url: string;
	pulls_url: string;
	milestones_url: string;
	notifications_url: string;
	labels_url: string;
	releases_url: string;
	deployments_url: string;
	created_at: string;
	updated_at: string;
	pushed_at: string;
	git_url: string;
	ssh_url: string;
	clone_url: string;
	svn_url: string;
	homepage: string | null;
	size: number;
	stargazers_count: number;
	watchers_count: number;
	language: string;
	has_issues: boolean;
	has_projects: boolean;
	has_downloads: boolean;
	has_wiki: boolean;
	has_pages: boolean;
	forks_count: number;
	mirror_url: string | null;
	archived: boolean;
	open_issues_count: number;
	license: string | null;
	forks: number;
	open_issues: number;
	watchers: number;
	default_branch: string;
}

type GithubRepositories = GithubRepository[];

@doughlass
Copy link

@bendtherules did you ever release the typings?

@bendtherules
Copy link
Author

No. Finally, didn't create the typings.

@doughlass please work on this if you are interested

@johannbuscail
Copy link

Someone ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants