import type { BaseResourceOptions } from '@gitbeaker/requester-utils'; import { ResourceMilestones } from '../templates'; import type { AllMilestonesOptions, BurndownChartEventSchema, MilestoneSchema, } from '../templates/ResourceMilestones'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, PaginationRequestOptions, PaginationTypes, ShowExpanded, Sudo, } from '../infrastructure'; import type { IssueSchema } from './Issues'; import type { MergeRequestSchema } from './MergeRequests'; export interface ProjectMilestones extends ResourceMilestones { all( projectId: string | number, options?: AllMilestonesOptions & PaginationRequestOptions

& Sudo & ShowExpanded, ): Promise>; allAssignedIssues( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise>; allAssignedMergeRequests( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise>; allBurndownChartEvents( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise>; create( projectId: string | number, title: string, options?: { description?: string; dueDate?: string; startDate?: string } & Sudo & ShowExpanded, ): Promise>; edit( projectId: string | number, milestoneId: number, options?: { title?: string; description?: string; dueDate?: string; startDate?: string; stateEvent?: 'close' | 'activate'; } & Sudo & ShowExpanded, ): Promise>; remove( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise>; show( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise>; } export class ProjectMilestones extends ResourceMilestones { constructor(options: BaseResourceOptions) { /* istanbul ignore next */ super('projects', options); } promote( projectId: string | number, milestoneId: number, options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.post()( this, endpoint`${projectId}/milestones/${milestoneId}/promote`, options, ); } }