import { createApiRef } from '@backstage/core-plugin-api' ; import { PullsListResponseData } from '@octokit/types' ; import { PullRequestState } from '../types' ; export const githubPullRequestsApiRef = createApiRef < GithubPullRequestsApi > ( { id : 'plugin.githubpullrequests.service' , } ) ; export type GithubPullRequestsApi = { listPullRequests : ( { token , owner , repo , pageSize , page , branch , state , baseUrl , } : { token : string ; owner : string ; repo : string ; pageSize ? : number ; page ? : number ; branch ? : string ; state ? : PullRequestState ; baseUrl : string | undefined ; } ) => Promise < { maxTotalItems ? : number ; pullRequestsData : PullsListResponseData ; } > ; } ;