import type { TCloseReason, TEmoji, TIssueState, TLockReasons, TUpdateMode, TUserPermission, } from '../types'; export interface IIssueBaseInfo { owner: string; repo: string; issueNumber: number; token: string; } export interface IListIssuesParams { state: TIssueState | 'all'; creator?: string; assignee?: string; mentioned?: string; labels?: string; } export type TIssueInfo = { number: number; title: string; body: string; user: { login: string; }; assignees: { login: string; }[]; labels: { name: string; }[]; state: TIssueState; created_at: string; updated_at: string; pull_request?: any; }; export type TIssueList = TIssueInfo[]; export type TCommentInfo = { id: number; body: string; user: { login: string; }; created_at: string; updated_at: string; }; export type TCommentList = TCommentInfo[]; export interface IIssueCoreEngine { setIssueNumber: (newIssueNumber: number) => void; addAssignees: (assignees: string[]) => Promise; addLabels: (labels: string[]) => Promise; closeIssue: (reason: TCloseReason) => Promise; /** * @param body The comment body. * @returns The create new comment id. */ createComment: (body: string) => Promise; createCommentEmoji: (commentId: number, emoji: TEmoji[]) => Promise; /** * @param title * @param body * @param labels * @param assignees * @returns The create new issue number. */ createIssue: ( title: string, body: string, labels?: string[], assignees?: string[], ) => Promise; createIssueEmoji: (emoji: TEmoji[]) => Promise; createLabel: ( labelName: string, labelColor: string | undefined, labelDescription: string | undefined, ) => Promise; deleteComment: (commentId: number) => Promise; getIssue: () => Promise; getUserPermission: (username: string) => Promise; listComments: () => Promise; listIssues: (params: IListIssuesParams) => Promise; lockIssue: (lockReason: TLockReasons) => Promise; openIssue: () => Promise; removeAssignees: (assignees: string[]) => Promise; removeLabels: (labels: string[]) => Promise; setLabels: (labels: string[]) => Promise; unlockIssue: () => Promise; updateComment: (commentId: number, body: string, mode: TUpdateMode) => Promise; updateIssue: ( state: TIssueState, title: string | void, body: string | void, mode: TUpdateMode, labels?: string[] | void, assignees?: string[] | void, ) => Promise; }