import type { IConstraint, ValidatorConstraintOptions } from "../types"; import type { ValidationArguments } from 'class-validator'; /** * @file Decorator Constraints - IsCommitConstraint * @module grease/constraints/IsCommit */ /** * Custom validator for the `IsCommit` decorator. * * @implements {IConstraint} */ export default class IsCommitConstraint implements IConstraint { /** * @static * @readonly * @property {ValidatorConstraintOptions} options - Custom constraint options */ static readonly options: ValidatorConstraintOptions; /** * Returns the default error message if validation fails. * * @param {ValidationArguments} args - Message builder arguments * @param {any[]} args.constraints - Validator constraints * @param {IsCommitOptions} args.constraints.0 - Validation options * @return {string} Default error message */ defaultMessage(args: ValidationArguments): string; /** * Checks if `value` is a commit in the current repository. * * @async * @param {any} value - Value to test against constraint * @param {ValidationArguments} args - Message builder arguments * @param {string} [args.constraints.0.dir=process.env.PROJECT_CWD] - `.git` * directory * @return {Promise} Boolean indicating if value is commit */ validate(value: any, args?: ValidationArguments): Promise; }