UNPKG

@elsikora/commitizen-plugin-commitlint-ai

Version:
46 lines 1.9 kB
import type { PromptMessages, PromptName } from "@commitlint/types"; import type { Answers, ChoiceCollection, DistinctQuestion } from "inquirer"; import type { CaseFunction as CaseFunction } from "./utils/case-function.js"; import type { FullStopFunction as FullStopFunction } from "./utils/full-stop-function.js"; export type QuestionConfig = { caseFn?: CaseFunction; defaultValue?: string; enumList?: ChoiceCollection<{ name: string; value: string; }> | null; fullStopFn?: FullStopFunction; maxLength?: number; messages: PromptMessages; minLength?: number; multipleSelectDefaultDelimiter?: string; multipleValueDelimiters?: RegExp; skip?: boolean; title: string; when?: DistinctQuestion["when"]; }; export default class Question { get maxLength(): number; set maxLength(maxLength: number); get minLength(): number; set minLength(minLength: number); get question(): Readonly<DistinctQuestion>; private _maxLength; private _minLength; private readonly _question; private readonly caseFn; private readonly fullStopFn; private readonly messages; private readonly multipleSelectDefaultDelimiter?; private readonly multipleValueDelimiters?; private readonly skip; private readonly title; constructor(name: PromptName, { caseFn, defaultValue, enumList, fullStopFn, maxLength, messages, minLength, multipleSelectDefaultDelimiter, multipleValueDelimiters, skip, title, when }: QuestionConfig); getMessage(key: string): string; protected beforeQuestionStart(_answers: Answers): void; protected decorateMessage(_answers: Answers): string; protected filter(input: Array<string> | string): string; protected transformer(input: string, _answers: Answers): string; protected validate(input: string): boolean | string; } //# sourceMappingURL=Question.d.ts.map