index.d.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. import * as _cz_git_inquirer from '@cz-git/inquirer';
  2. export * from '@cz-git/inquirer';
  3. export * from '@cz-git/loader';
  4. declare const generateQuestions: (options: CommitizenGitOptions, cz: any) => false | ({
  5. type: string;
  6. name: string;
  7. message: string | undefined;
  8. themeColorCode: string | undefined;
  9. source: (_: unknown, input: string) => _cz_git_inquirer.FilterArrayItemType[];
  10. separator?: undefined;
  11. validate?: undefined;
  12. when?: undefined;
  13. completeValue?: undefined;
  14. transformer?: undefined;
  15. filter?: undefined;
  16. default?: undefined;
  17. } | {
  18. type: string;
  19. name: string;
  20. message: string | string[] | undefined;
  21. themeColorCode: string | undefined;
  22. separator: string | undefined;
  23. source: (answer: Answers, input: string) => _cz_git_inquirer.FilterArrayItemType[];
  24. validate: (input: string | Array<string>) => string | true;
  25. when: (answer: Answers) => boolean;
  26. completeValue?: undefined;
  27. transformer?: undefined;
  28. filter?: undefined;
  29. default?: undefined;
  30. } | {
  31. type: string;
  32. name: string;
  33. message: string | undefined;
  34. completeValue: string | undefined;
  35. validate: (input: string | Array<string>) => string | true;
  36. when: (answers: Answers) => boolean;
  37. transformer: (input: string) => string;
  38. themeColorCode?: undefined;
  39. source?: undefined;
  40. separator?: undefined;
  41. filter?: undefined;
  42. default?: undefined;
  43. } | {
  44. type: string;
  45. name: string;
  46. message: string | undefined;
  47. validate: (subject: string, answers: Answers) => string | boolean;
  48. transformer: (subject: string, answers: Answers) => string;
  49. filter: (subject: string) => string;
  50. completeValue: string | undefined;
  51. themeColorCode?: undefined;
  52. source?: undefined;
  53. separator?: undefined;
  54. when?: undefined;
  55. default?: undefined;
  56. } | {
  57. type: string;
  58. name: string;
  59. message: string | undefined;
  60. completeValue: string | undefined;
  61. transformer: (input: string) => string;
  62. themeColorCode?: undefined;
  63. source?: undefined;
  64. separator?: undefined;
  65. validate?: undefined;
  66. when?: undefined;
  67. filter?: undefined;
  68. default?: undefined;
  69. } | {
  70. type: string;
  71. name: string;
  72. message: string | boolean | undefined;
  73. default: boolean;
  74. when: () => boolean;
  75. themeColorCode?: undefined;
  76. source?: undefined;
  77. separator?: undefined;
  78. validate?: undefined;
  79. completeValue?: undefined;
  80. transformer?: undefined;
  81. filter?: undefined;
  82. } | {
  83. type: string;
  84. name: string;
  85. message: string | undefined;
  86. completeValue: string | undefined;
  87. when: (answers: Answers) => string | boolean;
  88. transformer: (input: string) => string;
  89. themeColorCode?: undefined;
  90. source?: undefined;
  91. separator?: undefined;
  92. validate?: undefined;
  93. filter?: undefined;
  94. default?: undefined;
  95. } | {
  96. type: string;
  97. name: string;
  98. message: string | undefined;
  99. themeColorCode: string | undefined;
  100. source: (_: Answers, input: string) => _cz_git_inquirer.FilterArrayItemType[];
  101. when: () => boolean;
  102. separator?: undefined;
  103. validate?: undefined;
  104. completeValue?: undefined;
  105. transformer?: undefined;
  106. filter?: undefined;
  107. default?: undefined;
  108. })[];
  109. type GenerateQuestionsType = typeof generateQuestions;
  110. type QuestionsType = ReturnType<GenerateQuestionsType>;
  111. /**
  112. * @description: fork by "@commitlint/types" v16.2.1
  113. */
  114. /** ========== rules ========== */
  115. /**
  116. * Rules match the input either as successful or failed.
  117. * For example, when `header-full-stop` detects a full stop and is set as "always"; it's true.
  118. * If the `header-full-stop` discovers a full stop but is set to "never"; it's false.
  119. */
  120. type RuleOutcome = Readonly<[boolean, string?]>;
  121. /**
  122. * Rules receive a parsed commit, condition, and possible additional settings through value.
  123. * All rules should provide the most sensible rule condition and value.
  124. */
  125. type RuleType = 'async' | 'sync' | 'either';
  126. type BaseRule<Value = never, Type extends RuleType = 'either'> = (parsed: Commit, when?: RuleConfigCondition, value?: Value) => Type extends 'either' ? RuleOutcome | Promise<RuleOutcome> : Type extends 'async' ? Promise<RuleOutcome> : Type extends 'sync' ? RuleOutcome : never;
  127. type Rule<Value = never> = BaseRule<Value, 'either'>;
  128. type AsyncRule<Value = never> = BaseRule<Value, 'async'>;
  129. type SyncRule<Value = never> = BaseRule<Value, 'sync'>;
  130. /**
  131. * Rules always have a severity.
  132. * Severity indicates what to do if the rule is found to be broken
  133. * 0 - Disable this rule
  134. * 1 - Warn for violations
  135. * 2 - Error for violations
  136. */
  137. declare enum RuleConfigSeverity {
  138. Disabled = 0,
  139. Warning = 1,
  140. Error = 2
  141. }
  142. /**
  143. * Rules always have a condition.
  144. * It can be either "always" (as tested), or "never" (as tested).
  145. * For example, `header-full-stop` can be enforced as "always" or "never".
  146. */
  147. type RuleConfigCondition = 'always' | 'never';
  148. type RuleConfigTuple<T> = T extends void ? Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition]> : Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition, T]>;
  149. declare enum RuleConfigQuality {
  150. User = 0,
  151. Qualified = 1
  152. }
  153. type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => Promise<RuleConfigTuple<T>>) | RuleConfigTuple<T>;
  154. type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>;
  155. type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType | TargetCaseType[]>;
  156. type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>;
  157. type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>;
  158. interface RulesConfig<V = RuleConfigQuality.User> {
  159. 'body-case': CaseRuleConfig<V>;
  160. 'body-empty': RuleConfig<V>;
  161. 'body-full-stop': RuleConfig<V, string>;
  162. 'body-leading-blank': RuleConfig<V>;
  163. 'body-max-length': LengthRuleConfig<V>;
  164. 'body-max-line-length': LengthRuleConfig<V>;
  165. 'body-min-length': LengthRuleConfig<V>;
  166. 'footer-empty': RuleConfig<V>;
  167. 'footer-leading-blank': RuleConfig<V>;
  168. 'footer-max-length': LengthRuleConfig<V>;
  169. 'footer-max-line-length': LengthRuleConfig<V>;
  170. 'footer-min-length': LengthRuleConfig<V>;
  171. 'header-case': CaseRuleConfig<V>;
  172. 'header-full-stop': RuleConfig<V, string>;
  173. 'header-max-length': LengthRuleConfig<V>;
  174. 'header-min-length': LengthRuleConfig<V>;
  175. 'references-empty': RuleConfig<V>;
  176. 'scope-case': CaseRuleConfig<V>;
  177. 'scope-empty': RuleConfig<V>;
  178. 'scope-enum': EnumRuleConfig<V>;
  179. 'scope-max-length': LengthRuleConfig<V>;
  180. 'scope-min-length': LengthRuleConfig<V>;
  181. 'signed-off-by': RuleConfig<V, string>;
  182. 'subject-case': CaseRuleConfig<V>;
  183. 'subject-empty': RuleConfig<V>;
  184. 'subject-full-stop': RuleConfig<V, string>;
  185. 'subject-max-length': LengthRuleConfig<V>;
  186. 'subject-min-length': LengthRuleConfig<V>;
  187. 'trailer-exists': RuleConfig<V, string>;
  188. 'type-case': CaseRuleConfig<V>;
  189. 'type-empty': RuleConfig<V>;
  190. 'type-enum': EnumRuleConfig<V>;
  191. 'type-max-length': LengthRuleConfig<V>;
  192. 'type-min-length': LengthRuleConfig<V>;
  193. [key: string]: AnyRuleConfig<V>;
  194. }
  195. type AnyRuleConfig<V> = RuleConfig<V, unknown> | RuleConfig<V, void>;
  196. /** ========== load ========== */
  197. type PluginRecords = Record<string, Plugin>;
  198. interface Plugin {
  199. rules: {
  200. [ruleName: string]: Rule | AsyncRule | SyncRule;
  201. };
  202. }
  203. interface LoadOptions {
  204. cwd?: string;
  205. file?: string;
  206. }
  207. interface CommitlintUserConfig {
  208. extends?: string | string[];
  209. formatter?: string;
  210. rules?: Partial<RulesConfig>;
  211. parserPreset?: string | ParserPreset | Promise<ParserPreset>;
  212. ignores?: ((commit: string) => boolean)[];
  213. defaultIgnores?: boolean;
  214. plugins?: (string | Plugin)[];
  215. helpUrl?: string;
  216. [key: string]: unknown;
  217. }
  218. type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>;
  219. interface QualifiedConfig {
  220. extends: string[];
  221. formatter: string;
  222. rules: QualifiedRules;
  223. parserPreset?: ParserPreset;
  224. ignores?: ((commit: string) => boolean)[];
  225. defaultIgnores?: boolean;
  226. plugins: PluginRecords;
  227. helpUrl: string;
  228. }
  229. interface ParserPreset {
  230. name?: string;
  231. path?: string;
  232. parserOpts?: unknown;
  233. }
  234. /** ========== parse ========== */
  235. interface Commit {
  236. raw: string;
  237. header: string;
  238. type: string | null;
  239. scope: string | null;
  240. subject: string | null;
  241. body: string | null;
  242. footer: string | null;
  243. mentions: string[];
  244. notes: CommitNote[];
  245. references: CommitReference[];
  246. revert: any;
  247. merge: any;
  248. }
  249. interface CommitNote {
  250. title: string;
  251. text: string;
  252. }
  253. interface CommitReference {
  254. raw: string;
  255. prefix: string;
  256. action: string | null;
  257. owner: string | null;
  258. repository: string | null;
  259. issue: string | null;
  260. }
  261. /** ========== ensure ========== */
  262. type TargetCaseType = 'camel-case' | 'kebab-case' | 'snake-case' | 'pascal-case' | 'start-case' | 'upper-case' | 'uppercase' | 'sentence-case' | 'sentencecase' | 'lower-case' | 'lowercase' | 'lowerCase';
  263. /**
  264. * @description: cz-git types
  265. * @author: @Zhengqbbb (zhengqbbb@gmail.com)
  266. * @license: MIT
  267. * @copyright: Copyright (c) 2022-present Qiubin Zheng
  268. */
  269. interface UserConfig extends CommitlintUserConfig {
  270. prompt?: CommitizenGitOptions;
  271. }
  272. type Config = Omit<Partial<typeof defaultConfig>, 'scopes'> & {
  273. scopes: ScopesType;
  274. disableScopeLowerCase?: boolean;
  275. disableSubjectLowerCase?: boolean;
  276. maxHeaderLength?: number;
  277. maxSubjectLength?: number;
  278. minSubjectLength?: number;
  279. defaultScope?: string;
  280. defaultSubject?: string;
  281. defaultBody?: string;
  282. defaultFooterPrefix?: string;
  283. defaultIssues?: string;
  284. };
  285. interface Answers {
  286. /**
  287. * @default "Select the type of change that you're committing:"
  288. */
  289. type?: string;
  290. /**
  291. * @default 'Denote the SCOPE of this change (optional):'
  292. */
  293. scope?: string | string[];
  294. /**
  295. * @default 'Denote the SCOPE of this change:'
  296. */
  297. customScope?: string;
  298. /**
  299. * @default 'Write a SHORT, IMPERATIVE tense description of the change:\n'
  300. */
  301. subject?: string;
  302. /**
  303. * @default 'a LONGER description of the change (optional). Use "|" to break new line:\n'
  304. */
  305. body?: string;
  306. /**
  307. * @default 'Is any BREAKING CHANGE (add "!" in header) (optional) ?'
  308. * @use need turn on options "markBreakingChangeMode"
  309. */
  310. markBreaking?: string | boolean;
  311. /**
  312. * @default 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n'
  313. */
  314. breaking?: string;
  315. /** @deprecated Please use `footerPrefixesSelect` field instead. @note fix typo option field v1.4.0: Already processed for normal compatibility */
  316. footerPrefixsSelect?: string;
  317. /**
  318. * @default 'Select the ISSUES type of change (optional):'
  319. */
  320. footerPrefixesSelect?: string;
  321. /** @deprecated Please use `customFooterPrefix` field instead. @note fix typo option field v1.4.0: Already processed for normal compatibility */
  322. customFooterPrefixs?: string;
  323. /**
  324. * @default 'Input ISSUES prefix:'
  325. */
  326. customFooterPrefix?: string;
  327. /**
  328. * @default 'List any ISSUES AFFECTED by this change. E.g.: #31, #34:'
  329. */
  330. footer?: string;
  331. /**
  332. * @default 'Are you sure you want to proceed with the commit above?'
  333. */
  334. confirmCommit?: string;
  335. /**
  336. * @default 'Generating your AI commit subject...'
  337. */
  338. generatingByAI: string;
  339. /**
  340. * @default 'Select suitable subject by AI generated:'
  341. */
  342. generatedSelectByAI: string;
  343. footerPrefix?: string;
  344. }
  345. type ScopesType = string[] | Array<{
  346. name: string;
  347. value?: string;
  348. }>;
  349. interface CommitizenType {
  350. registerPrompt: (type: string, plugin: unknown) => void;
  351. prompt: (qs: QuestionsType) => Promise<Answers>;
  352. }
  353. interface Option {
  354. /**
  355. * @description: show prompt name
  356. */
  357. name: string;
  358. /**
  359. * @description: output real value
  360. */
  361. value: string;
  362. }
  363. interface TypesOption extends Option {
  364. /**
  365. * @description: Submit emoji commit string
  366. * @see: https://gitmoji.dev/
  367. * @example: ":bug:" => 🐛
  368. */
  369. emoji?: string;
  370. }
  371. /**
  372. * provide subdivides each message part
  373. */
  374. interface CommitMessageOptions {
  375. /**
  376. * @description: choose type list value
  377. * @example: 'feat'
  378. */
  379. type: string;
  380. /**
  381. * @description: choose or custom scope value
  382. * @example: 'app'
  383. */
  384. scope: string;
  385. /**
  386. * @description: choose type list emoji code. need turn on `useEmoji` options
  387. * @example: ':sparkles:'
  388. */
  389. emoji: string;
  390. /**
  391. * @description: express is a breaking change message
  392. * @example `!`
  393. */
  394. markBreaking: string;
  395. /**
  396. * @description: input subject
  397. */
  398. subject: string;
  399. /**
  400. * @description: base Angular format default header
  401. * @example `feat(app): add a feature`
  402. */
  403. defaultHeader: string;
  404. body: string;
  405. breaking: string;
  406. footer: string;
  407. /**
  408. * @description: base Angular format default all message
  409. */
  410. defaultMessage: string;
  411. }
  412. interface GenerateAIPromptType {
  413. type?: string;
  414. defaultScope?: string;
  415. maxSubjectLength?: number;
  416. upperCaseSubject?: boolean;
  417. diff?: string;
  418. }
  419. interface CommitizenGitOptions {
  420. /**
  421. * @description: define commonly used commit message alias
  422. * @default { fd: "docs: fix typos" }
  423. * @use commitizen CLI: "cz_alias=fd cz"
  424. * @use czg CLI: "czg --alias=fd" | "czg :fd"
  425. * @note use commitizen CLI will meet process not exit. cz-git can't resolve it.
  426. */
  427. alias?: Record<string, string>;
  428. /**
  429. * @description: Customize prompt questions
  430. */
  431. messages?: Answers;
  432. /**
  433. * @description: the prompt inquirer primary color
  434. * @rule `38;5;${color_code}`
  435. * @tip the color_code can get by https://github.com/sindresorhus/xterm-colors
  436. * @example "38;5;043"
  437. * @default '' //cyan color
  438. */
  439. themeColorCode?: string;
  440. /**
  441. * @description: Customize prompt type
  442. */
  443. types?: TypesOption[];
  444. /**
  445. * @description: Add extra types to default types
  446. * @use Use when you don't want to add bloated defaults and don't want to adjust the default order in configuration
  447. * @example `typesAppend: [ { value: "workflow", name: "workflow: Workflow changes"} ],`
  448. * @default []
  449. */
  450. typesAppend?: TypesOption[];
  451. /**
  452. * @description: default types list fuzzy search types `value` key of list.
  453. * if choose `false` will search `name` key of list
  454. * @use Using emoji unicode as `value` and that can't be searched
  455. * @default true
  456. */
  457. typesSearchValue?: boolean;
  458. /** @deprecated Please use `typesSearchValue` field instead. */
  459. typesSearchValueKey?: boolean;
  460. /**
  461. * @description: Use OpenAI to auto generate short description for commit message
  462. * @default false
  463. */
  464. useAI?: boolean;
  465. /**
  466. * @description: If >1 will turn on select mode, select generate options like returned by OpenAI
  467. * @default 1
  468. */
  469. aiNumber?: number;
  470. /**
  471. * @description: To ignore selection codes when sending AI API requests
  472. * @default [ "package-lock.json", "yarn.lock", "pnpm-lock.yaml" ]
  473. * @example: [ "pnpm-lock.yaml", "docs/public" ]
  474. */
  475. aiDiffIgnore?: string[];
  476. /**
  477. * Choose the AI model you want to use: gpt-3.5-turbo | text-davinci-003
  478. * gpt-3.5-turbo: Lower price consumption (10x) and faster
  479. * text-davinci-003: Get more reliable information
  480. *
  481. * @default openAI-Turbo
  482. */
  483. aiType?: 'openAI-Turbo' | 'openAI-Davinci';
  484. /**
  485. * @description: Alert!!! Save on "$HOME/.czrc" or "$HOME/.config/.czrc". Do not save on project
  486. */
  487. openAIToken?: string;
  488. /**
  489. * It is recommended to use the command to configure the local
  490. * `npx czg --api-proxy=<http_proxy>`
  491. * e.g: `npx czg --api-proxy="http://127.0.0.1:1080"` or `npx czg --api-proxy="socks5://127.0.0.1:1080"`
  492. */
  493. apiProxy?: string;
  494. /**
  495. * @description: Use the callback fn can customize edit information AI question information
  496. * @param GenerateAIPromptType: provide some known parameters
  497. * @default generateSubjectDefaultPrompt
  498. */
  499. aiQuestionCB?: (aiParam: GenerateAIPromptType) => string;
  500. /**
  501. * @description: Use emoji ?| it will be use typesOption.emoji code
  502. * @default false
  503. */
  504. useEmoji?: boolean;
  505. /**
  506. * @description: Set the location of emoji in header
  507. * @default "center"
  508. */
  509. emojiAlign?: 'left' | 'center' | 'right';
  510. /**
  511. * @description: Provides a select of prompt to select module scopes
  512. * @note it auto import value from rule "scope-enum" with `@commitlint`
  513. * @use want to add scopes description or when you not use commitlint
  514. */
  515. scopes?: ScopesType;
  516. /**
  517. * @description: default scope list fuzzy search types `name` key of list.
  518. * if choose `true` will search `value` key of list.
  519. * @use If have long description of scope. can use it to enhanced search.
  520. * @default false
  521. */
  522. scopesSearchValue?: boolean;
  523. /**
  524. * @description: Provides an overriding select of prompt to select module scopes under specific type
  525. * @note use this option should set `scopes` option to realize distinguish
  526. * @example: [test] => provide select e2eTest unitTest
  527. */
  528. scopeOverrides?: {
  529. [type: string]: ScopesType;
  530. };
  531. /**
  532. * @description: Filter select of prompt to select module scopes by the scope.value
  533. * @default ['.DS_Store']
  534. */
  535. scopeFilters?: string[];
  536. /**
  537. * @description: Whether to enable scope multiple mode
  538. * @default false
  539. */
  540. enableMultipleScopes?: boolean;
  541. /**
  542. * @description: Multiple choice scope separator
  543. * @default ","
  544. */
  545. scopeEnumSeparator?: string;
  546. /**
  547. * @description: Whether to show "custom" when selecting scopes
  548. * @note it auto check rule "scope-enum" set the option with `@commitlint`
  549. * @use when you not use commitlint
  550. * @default true
  551. */
  552. allowCustomScopes?: boolean;
  553. /**
  554. * @description: Whether to show "empty" when selecting scopes
  555. * @default true
  556. */
  557. allowEmptyScopes?: boolean;
  558. /**
  559. * @description: Set the location of empty option (empty) and custom option (custom) in selection range
  560. * @default "bottom"
  561. */
  562. customScopesAlign?: 'top' | 'bottom' | 'top-bottom' | 'bottom-top';
  563. /**
  564. * @default "custom"
  565. */
  566. customScopesAlias?: string;
  567. /**
  568. * @default "empty"
  569. */
  570. emptyScopesAlias?: string;
  571. /**
  572. * @description: Subject is need upper case first.
  573. * @default false
  574. */
  575. upperCaseSubject?: boolean;
  576. /**
  577. * @description: Whether to add extra prompt BREAKCHANGE ask. to add an extra "!" to the header
  578. * @see: https://cz-git.qbb.sh/recipes/breakingchange
  579. * @default false
  580. */
  581. markBreakingChangeMode?: boolean;
  582. /**
  583. * @description: Allow breaking changes in the included types output box
  584. * @default ['feat', 'fix']
  585. */
  586. allowBreakingChanges?: string[];
  587. /**
  588. * @description: set body and BREAKING CHANGE max length to break-line
  589. * @default 100
  590. * @note it auto check rule "body-max-line-length" set the option with `@commitlint`.
  591. * @use when you not use commitlint
  592. */
  593. breaklineNumber?: number;
  594. /**
  595. * @description: body and BREAKINGCHANGES new line char
  596. * @default "|"
  597. */
  598. breaklineChar?: string;
  599. /**
  600. * @deprecated Please use `issuePrefixes` field instead.
  601. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  602. */
  603. issuePrefixs?: Option[];
  604. /**
  605. * @description: Provides a select issue prefix box in footer
  606. * @default issuePrefixes: [{ value: "closed", name: "ISSUES has been processed" }]
  607. */
  608. issuePrefixes?: Option[];
  609. /**
  610. * @deprecated Please use `customIssuePrefixAlign` field instead.
  611. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  612. */
  613. customIssuePrefixsAlign?: 'top' | 'bottom' | 'top-bottom' | 'bottom-top';
  614. /**
  615. * @default "top"
  616. */
  617. customIssuePrefixAlign?: 'top' | 'bottom' | 'top-bottom' | 'bottom-top';
  618. /**
  619. * @deprecated Please use `emptyIssuePrefixAlias` field instead.
  620. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  621. */
  622. emptyIssuePrefixsAlias?: string;
  623. /**
  624. * @default "skip"
  625. */
  626. emptyIssuePrefixAlias?: string;
  627. /**
  628. * @deprecated Please use `customIssuePrefixAlias` field instead.
  629. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  630. */
  631. customIssuePrefixsAlias?: string;
  632. /**
  633. * @default "custom"
  634. */
  635. customIssuePrefixAlias?: string;
  636. /**
  637. * @deprecated Please use `allowCustomIssuePrefix` field instead.
  638. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  639. */
  640. allowCustomIssuePrefixs?: boolean;
  641. /**
  642. * @description: Whether to show "custom" selecting issue prefixes
  643. * @default true
  644. */
  645. allowCustomIssuePrefix?: boolean;
  646. /**
  647. * @deprecated Please use `allowEmptyIssuePrefix` field instead.
  648. * @note fix typo option field v1.3.4: Already processed for normal compatibility
  649. */
  650. allowEmptyIssuePrefixs?: boolean;
  651. /**
  652. * @description: Whether to show "skip(empty)" when selecting issue prefixes
  653. * @default true
  654. */
  655. allowEmptyIssuePrefix?: boolean;
  656. /**
  657. * @description: Prompt final determination whether to display the color
  658. * @default true
  659. */
  660. confirmColorize?: boolean;
  661. /**
  662. * @description: List of questions you want to skip
  663. * @default []
  664. * @example: ['body']
  665. */
  666. skipQuestions?: Array<'scope' | 'body' | 'breaking' | 'footerPrefix' | 'footer' | 'confirmCommit'>;
  667. /**
  668. * @description: Force set max header length | Equivalent setting maxSubjectLength.
  669. * @note it auto check rule "header-max-length" set the option with `@commitlint`.
  670. * @use when you not use commitlint
  671. */
  672. maxHeaderLength?: number;
  673. /**
  674. * @description: Force set max subject length.
  675. * @note it auto check rule "subject-max-length" set the option with `@commitlint`.
  676. * @use when you not use commitlint
  677. */
  678. maxSubjectLength?: number;
  679. /**
  680. * @description: Is not strict subject rule. Just provide prompt word length warning.
  681. * Effected maxHeader and maxSubject commitlint
  682. * @example [1, 'always', 80] 1: mean warning. will be true
  683. * @default false
  684. */
  685. isIgnoreCheckMaxSubjectLength?: boolean;
  686. /**
  687. * @description: Force set header width.
  688. * @note it auto check rule "subject-min-length" set the option with `@commitlint`.
  689. * @use when you not use commitlint
  690. */
  691. minSubjectLength?: number;
  692. /**
  693. * @description: pin type item the top of the types list (match item value)
  694. */
  695. defaultType?: string;
  696. /**
  697. * @description: Whether to use display default value in custom scope
  698. * @tip pin scope item the top of the scope list (match item value)
  699. * @example: When you want to use default, just keyboard <Enter> it
  700. */
  701. defaultScope?: string;
  702. /**
  703. * @description: default value show subject template prompt
  704. * @example: If you want to use template complete. just keyboard <Tab> or <Right Arrow> it
  705. * @example: If you want to use default, just keyboard <Enter> it
  706. */
  707. defaultSubject?: string;
  708. /**
  709. * @description: default value show body and BREAKINGCHANGES template prompt
  710. * @example: If you want to use template complete. just keyboard <Tab> or <Right Arrow> it
  711. * @example: When you want to use default, just keyboard <Enter> it
  712. */
  713. defaultBody?: string;
  714. /**
  715. * @description: default value show issuePrefixes custom template prompt
  716. * @example: If you want to use template complete. just keyboard <Tab> or <Right Arrow> it
  717. * @example: When you want to use default, just keyboard <Enter> it
  718. */
  719. defaultFooterPrefix?: string;
  720. /**
  721. * @description: default value show issue foot template prompt
  722. * @example: If you want to use template complete. just keyboard <Tab> or <Right Arrow> it
  723. * @example: When you want to use default, just keyboard <Enter> it
  724. */
  725. defaultIssues?: string;
  726. /**
  727. * @description: Whether to use GPG sign commit message (git commit -S -m)
  728. * @note the options only support `czg` cz-git cli and no support git hooks mode
  729. * @usage_see https://github.com/Zhengqbbb/cz-git/issues/58
  730. * @default false
  731. */
  732. useCommitSignGPG?: boolean;
  733. /**
  734. * @description: provide user custom finally message, can use the callback to change format
  735. * @param CommitMessageOptions: provide subdivides each message part
  736. * @default ({ defaultMessage }) => defaultMessage
  737. */
  738. formatMessageCB?: (messageMod: CommitMessageOptions) => string;
  739. }
  740. declare const defaultConfig: Readonly<CommitizenGitOptions>;
  741. /**
  742. * @description: customizable and git support commitizen adapter
  743. * @author: @Zhengqbbb (zhengqbbb@gmail.com)
  744. * @license: MIT
  745. * @copyright: Copyright (c) 2022-present Qiubin Zheng
  746. */
  747. declare const prompter: (cz: CommitizenType, commit: (message: string) => void, configPath?: string) => void;
  748. export { Answers, AnyRuleConfig, AsyncRule, BaseRule, CaseRuleConfig, Commit, CommitMessageOptions, CommitNote, CommitReference, CommitizenGitOptions, CommitizenType, CommitlintUserConfig, Config, EnumRuleConfig, GenerateAIPromptType, LengthRuleConfig, LoadOptions, Option, ParserPreset, Plugin, PluginRecords, QualifiedConfig, QualifiedRuleConfig, QualifiedRules, Rule, RuleConfig, RuleConfigCondition, RuleConfigQuality, RuleConfigSeverity, RuleConfigTuple, RuleOutcome, RuleType, RulesConfig, ScopesType, SyncRule, TargetCaseType, TypesOption, UserConfig, defaultConfig, prompter };