Skip to content

Commit b71e874

Browse files
authored
Merge pull request #93 from nulab/90/Add-type-annotation-for-parameters
Add type annotation for parameters
2 parents ec93aaa + 77b7b43 commit b71e874

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

Diff for: dist/types/backlog.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ export default class Backlog extends Request {
550550
/**
551551
* https://developer.nulab.com/docs/backlog/api/2/add-watching
552552
*/
553-
postWatchingListItem(params: any): Promise<Entity.WatchingList.WatchingListItem>;
553+
postWatchingListItem(params: Option.WatchingList.PostWatchingListItemParams): Promise<Entity.WatchingList.WatchingListItem>;
554554
/**
555555
* https://developer.nulab.com/docs/backlog/api/2/update-watching
556556
*/
@@ -572,7 +572,7 @@ export default class Backlog extends Request {
572572
* https://developer.nulab.com/docs/backlog/api/2/add-project-group
573573
* @deprecated
574574
*/
575-
postProjectGroup(projectIdOrKey: string | number, params: any): Promise<Entity.Group.Group>;
575+
postProjectGroup(projectIdOrKey: string | number, params: Option.Group.PostProjectGroupParams): Promise<Entity.Group.Group>;
576576
/**
577577
* https://developer.nulab.com/docs/backlog/api/2/delete-project-group
578578
* @deprecated

Diff for: dist/types/option.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,41 @@ export declare namespace User {
6161
count?: number;
6262
}
6363
}
64+
export declare namespace WatchingList {
65+
interface PostWatchingListItemParams {
66+
issueIdOrKey: string | number;
67+
note: string;
68+
}
69+
}
6470
export declare namespace Group {
71+
/**
72+
* @deprecated
73+
*/
6574
interface GetGroupsParams {
6675
order?: Order;
6776
offset?: number;
6877
count?: number;
6978
}
79+
/**
80+
* @deprecated
81+
*/
7082
interface PostGroupsParams {
7183
name: string;
7284
members?: string[];
7385
}
86+
/**
87+
* @deprecated
88+
*/
7489
interface PatchGroupParams {
7590
name?: string;
7691
members?: string[];
7792
}
93+
/**
94+
* @deprecated
95+
*/
96+
interface PostProjectGroupParams {
97+
groupId: number;
98+
}
7899
}
79100
export declare namespace Team {
80101
interface GetTeamsParams {

Diff for: src/backlog.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,9 @@ export default class Backlog extends Request {
11091109
/**
11101110
* https://developer.nulab.com/docs/backlog/api/2/add-watching
11111111
*/
1112-
public postWatchingListItem(params: any): Promise<Entity.WatchingList.WatchingListItem> {
1112+
public postWatchingListItem(
1113+
params: Option.WatchingList.PostWatchingListItemParams,
1114+
): Promise<Entity.WatchingList.WatchingListItem> {
11131115
return this.post(`watchings`, params);
11141116
}
11151117

@@ -1147,7 +1149,10 @@ export default class Backlog extends Request {
11471149
* https://developer.nulab.com/docs/backlog/api/2/add-project-group
11481150
* @deprecated
11491151
*/
1150-
public postProjectGroup(projectIdOrKey: string | number, params: any): Promise<Entity.Group.Group> {
1152+
public postProjectGroup(
1153+
projectIdOrKey: string | number,
1154+
params: Option.Group.PostProjectGroupParams,
1155+
): Promise<Entity.Group.Group> {
11511156
console.warn("Deprecated: Use postProjectTeam instead.");
11521157
return this.post(`projects/${projectIdOrKey}/groups`, params);
11531158
}

Diff for: src/option.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,45 @@
7979

8080
}
8181

82-
export namespace Group {
82+
export namespace WatchingList {
83+
export interface PostWatchingListItemParams {
84+
issueIdOrKey: string | number;
85+
note: string;
86+
}
87+
}
8388

89+
export namespace Group {
90+
/**
91+
* @deprecated
92+
*/
8493
export interface GetGroupsParams {
8594
order?: Order;
8695
offset?: number;
8796
count?: number;
8897
}
8998

99+
/**
100+
* @deprecated
101+
*/
90102
export interface PostGroupsParams {
91103
name: string;
92104
members?: string[];
93105
}
94106

107+
/**
108+
* @deprecated
109+
*/
95110
export interface PatchGroupParams {
96111
name?: string;
97112
members?: string[];
98113
}
99114

115+
/**
116+
* @deprecated
117+
*/
118+
export interface PostProjectGroupParams {
119+
groupId: number;
120+
}
100121
}
101122

102123
export namespace Team {

0 commit comments

Comments
 (0)