UNPKG

ds-sfcoe-ailabs

Version:

AI-powered code review tool with static analysis integration for comprehensive code quality assessment.

94 lines (93 loc) 2.77 kB
/** * @fileoverview Git provider module exports and type definitions * Provides abstractions for Git operations and pull request management across different platforms * * @example * ```typescript * import { GitProviderFactory, GitProviderType, PullRequestComment } from './gitProvider'; * * const gitProvider = GitProviderFactory.create(GitProviderType.GitHub, config); * const comment: PullRequestComment = { * prNumber: '123', * commitId: 'abc123', * message: 'Review comment', * suggestedCodeChange: undefined, * startLine: 10, * endLine: 15, * sourceFile: 'src/example.ts' * }; * ``` */ export { default as GitHelper } from './gitHelper.js'; export { default as GitProvider } from './gitProvider.js'; export { default as GitProviderFactory } from './gitProviderFactory.js'; export { default as GitHub } from './gitHub.js'; /** * Enumeration of supported Git hosting providers * Currently supports GitHub with extensibility for future platforms */ export declare enum GitProviderType { GitHub = "GitHub" } /** * Represents a pull request comment with code location and suggestion details * Used for posting review comments to pull requests with optional code changes * * @example * ```typescript * const comment: PullRequestComment = { * prNumber: '456', * commitId: 'def789', * message: 'Consider using const instead of var', * suggestedCodeChange: 'const value = 42;', * startLine: 5, * endLine: 5, * sourceFile: 'src/utils.js' * }; * ``` */ export declare type PullRequestComment = { /** The pull request number as a string */ prNumber: string; /** The commit SHA identifier */ commitId: string; /** The review comment message */ message: string; /** Optional suggested code change for the comment */ suggestedCodeChange: string | undefined; /** Starting line number for the comment */ startLine: number; /** Ending line number for the comment */ endLine: number; /** Source file path where the comment applies */ sourceFile: string; }; /** * GitHub API comment response structure * Represents the structure of comments returned from GitHub's REST API * * @example * ```typescript * const githubComment: GitHubComment = { * id: 123456, * body: 'This looks good!', * user: { * login: 'reviewer', * type: 'User' * } * }; * ``` */ export type GitHubComment = { /** Unique identifier for the comment */ id: number; /** The comment body/message content */ body: string; /** User information for the comment author */ user: { /** GitHub username of the comment author */ login: string; /** Type of user (e.g., 'User', 'Bot') */ type: string; }; };