UNPKG

2.03 kBTypeScriptView Raw
1/// <reference types="node" />
2
3import * as Stream from "stream";
4
5import {
6 Context,
7 GitRawCommitsOptions,
8 Options as BaseOptions,
9 ParserOptions,
10 WriterOptions,
11} from "conventional-changelog-core";
12import { Context as WriterContext } from "conventional-changelog-writer";
13import { Commit } from "conventional-commits-parser";
14
15/**
16 * Returns a readable stream.
17 *
18 * @param options
19 * @param context
20 * @param gitRawCommitsOpts
21 * @param parserOpts
22 * @param writerOpts
23 */
24declare function conventionalChangelog<TCommit extends Commit = Commit, TContext extends WriterContext = Context>(
25 options?: Options<TCommit, TContext>,
26 context?: Partial<TContext>,
27 gitRawCommitsOpts?: GitRawCommitsOptions,
28 parserOpts?: ParserOptions,
29 writerOpts?: WriterOptions<TCommit, TContext>,
30): Stream.Readable;
31
32declare namespace conventionalChangelog {
33 /**
34 * See the [conventional-changelog-core](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core)
35 * docs. The API is the same with the following changes or additions:
36 */
37 interface Options<TCommit extends Commit = Commit, TContext extends WriterContext = WriterContext>
38 extends BaseOptions<TCommit, TContext>
39 {
40 /**
41 * It's recommended to use a preset so you don't have to define everything
42 * yourself. Presets are names of built-in `config`.
43 *
44 * A scoped preset package such as `@scope/conventional-changelog-custom-preset`
45 * can be used by passing `@scope/custom-preset` to this option.
46 *
47 * @remarks
48 * `options.config` will be overwritten by the values of preset. You should use
49 * either `preset` or `config`, but not both.
50 */
51 preset?: string | undefined;
52 }
53}
54
55type Options<TCommit extends Commit = Commit, TContext extends WriterContext = WriterContext> =
56 conventionalChangelog.Options<TCommit, TContext>;
57
58export = conventionalChangelog;