-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
77 lines (73 loc) · 1.94 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* Repo language
* @property name - Language name code
* @property color - Language color
* @property id - Language id in Github database
*/
declare type ILanguage = {
name: string;
color: string;
id: string;
};
/**
* Pinned Repo type
* @property name - Repo name
* @property url - Repo URL
* @property stargazerCount - Stargazer count
* @property primaryLanguage - Repo primary language
* @property description - Repo description
* @property createdAt - Repo creation date
* @property forkCount - Repo fork count
* @property homepageUrl - Repo homepage url
* @property id - Repo id
* @property isArchived - Is repo archived?
* @property isFork - Is repo a fork of another repo?
* @property isInOrganization - Is repo in an organization?
* @property isTemplate - Is repo a template?
* @property languages - All languages used in repo
*/
declare type IPinnedRepo = {
name: string;
url: string;
stargazerCount: string;
primaryLanguage: ILanguage;
description: string;
createdAt: string;
forkCount: number;
homepageUrl: string;
id: string;
isArchived: boolean;
isFork: boolean;
isInOrganization: boolean;
isTemplate: boolean;
languages: ILanguage[];
};
/**
* Response Type, includes the pinned repos
* @property user - Github user GQL response
* @property user.pinnedItems - Github user pinned repo GQL reponse
* @property user.pinnedItems.nodes - All pinned items
*/
declare type IRes = {
user: {
pinnedItems: {
nodes: IPinnedRepo[];
};
};
};
/**
* Main client class
*/
declare class Client {
/**
* Sets the global access token
* @param token - Github personal access token
*/
static setToken(token: string): void;
/**
* Gets the specified user's pinned repos
* @param username - User to fetch pinned repos of
* @returns All pinned repos
*/
static getPinnedRepos(username: string): IPinnedRepo[];
}