Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type annotation for parameters #93

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/types/backlog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export default class Backlog extends Request {
/**
* https://developer.nulab.com/docs/backlog/api/2/add-watching
*/
postWatchingListItem(params: any): Promise<Entity.WatchingList.WatchingListItem>;
postWatchingListItem(params: Option.WatchingList.PostWatchingListItemParams): Promise<Entity.WatchingList.WatchingListItem>;
/**
* https://developer.nulab.com/docs/backlog/api/2/update-watching
*/
Expand All @@ -572,7 +572,7 @@ export default class Backlog extends Request {
* https://developer.nulab.com/docs/backlog/api/2/add-project-group
* @deprecated
*/
postProjectGroup(projectIdOrKey: string | number, params: any): Promise<Entity.Group.Group>;
postProjectGroup(projectIdOrKey: string | number, params: Option.Group.PostProjectGroupParams): Promise<Entity.Group.Group>;
/**
* https://developer.nulab.com/docs/backlog/api/2/delete-project-group
* @deprecated
Expand Down
21 changes: 21 additions & 0 deletions dist/types/option.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,41 @@ export declare namespace User {
count?: number;
}
}
export declare namespace WatchingList {
interface PostWatchingListItemParams {
issueIdOrKey: string | number;
note: string;
}
}
export declare namespace Group {
/**
* @deprecated
*/
interface GetGroupsParams {
order?: Order;
offset?: number;
count?: number;
}
/**
* @deprecated
*/
interface PostGroupsParams {
name: string;
members?: string[];
}
/**
* @deprecated
*/
interface PatchGroupParams {
name?: string;
members?: string[];
}
/**
* @deprecated
*/
interface PostProjectGroupParams {
groupId: number;
}
}
export declare namespace Team {
interface GetTeamsParams {
Expand Down
9 changes: 7 additions & 2 deletions src/backlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,9 @@ export default class Backlog extends Request {
/**
* https://developer.nulab.com/docs/backlog/api/2/add-watching
*/
public postWatchingListItem(params: any): Promise<Entity.WatchingList.WatchingListItem> {
public postWatchingListItem(
params: Option.WatchingList.PostWatchingListItemParams,
): Promise<Entity.WatchingList.WatchingListItem> {
return this.post(`watchings`, params);
}

Expand Down Expand Up @@ -1147,7 +1149,10 @@ export default class Backlog extends Request {
* https://developer.nulab.com/docs/backlog/api/2/add-project-group
* @deprecated
*/
public postProjectGroup(projectIdOrKey: string | number, params: any): Promise<Entity.Group.Group> {
public postProjectGroup(
projectIdOrKey: string | number,
params: Option.Group.PostProjectGroupParams,
): Promise<Entity.Group.Group> {
console.warn("Deprecated: Use postProjectTeam instead.");
return this.post(`projects/${projectIdOrKey}/groups`, params);
}
Expand Down
23 changes: 22 additions & 1 deletion src/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,45 @@

}

export namespace Group {
export namespace WatchingList {
export interface PostWatchingListItemParams {
issueIdOrKey: string | number;
note: string;
}
}

export namespace Group {
/**
* @deprecated
*/
export interface GetGroupsParams {
order?: Order;
offset?: number;
count?: number;
}

/**
* @deprecated
*/
export interface PostGroupsParams {
name: string;
members?: string[];
}

/**
* @deprecated
*/
export interface PatchGroupParams {
name?: string;
members?: string[];
}

/**
* @deprecated
*/
export interface PostProjectGroupParams {
groupId: number;
}
}

export namespace Team {
Expand Down
Loading