diff --git a/types/conventional-changelog-core/conventional-changelog-core-tests.ts b/types/conventional-changelog-core/conventional-changelog-core-tests.ts new file mode 100644 index 0000000000..f091b25cc4 --- /dev/null +++ b/types/conventional-changelog-core/conventional-changelog-core-tests.ts @@ -0,0 +1,25 @@ +/* tslint:disable:no-mergeable-namespace no-namespace */ +"use strict"; + +import conventionalChangelogCore from "conventional-changelog-core"; + +namespace Module { + declare const context: conventionalChangelogCore.Context; + declare const gitRawCommitsOpts: conventionalChangelogCore.GitRawCommitsOptions; + declare const options: conventionalChangelogCore.Options; + declare const parserOpts: conventionalChangelogCore.ParserOptions; + declare const writerOpts: conventionalChangelogCore.WriterOptions; + + // $ExpectType Readable + conventionalChangelogCore(); + // $ExpectType Readable + conventionalChangelogCore(options); + // $ExpectType Readable + conventionalChangelogCore(options, context); + // $ExpectType Readable + conventionalChangelogCore(options, context, gitRawCommitsOpts); + // $ExpectType Readable + conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts); + // $ExpectType Readable + conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts); +} diff --git a/types/conventional-changelog-core/index.d.ts b/types/conventional-changelog-core/index.d.ts new file mode 100644 index 0000000000..31afb08f08 --- /dev/null +++ b/types/conventional-changelog-core/index.d.ts @@ -0,0 +1,367 @@ +// Type definitions for conventional-changelog-core 4.1 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +/// + +import * as Stream from "stream"; + +import { Commit, Options as BaseParserOptions } from "conventional-commits-parser"; +import { Context as BaseContext, Options as BaseWriterOptions } from "conventional-changelog-writer"; +import { GitOptions as BaseGitRawCommitsOptions } from "git-raw-commits"; +import { Package } from "normalize-package-data"; + +/** + * Returns a readable stream. + * + * @param options + * @param context + * @param gitRawCommitsOpts + * @param parserOpts + * @param writerOpts + */ +// tslint:disable-next-line max-line-length +declare function conventionalChangelogCore(options?: Options, context?: Partial, gitRawCommitsOpts?: GitRawCommitsOptions, parserOpts?: ParserOptions, writerOpts?: WriterOptions): Stream.Readable; + +declare namespace conventionalChangelogCore { + interface Context extends BaseContext { + /** + * The hosting website. Eg: `'https://github.com'` or `'https://bitbucket.org'`. + * + * @defaults + * Normalized host found in `package.json`. + */ + host?: BaseContext["host"]; + + /** + * Version number of the up-coming release. If `version` is found in the last + * commit before generating logs, it will be overwritten. + * + * @defaults + * Version found in `package.json`. + */ + version?: BaseContext["version"]; + + /** + * The owner of the repository. Eg: `'stevemao'`. + * + * @defaults + * Extracted from normalized `package.json` `repository.url` field. + */ + owner?: BaseContext["owner"]; + + /** + * The repository name on `host`. Eg: `'conventional-changelog-writer'`. + * + * @defaults + * Extracted from normalized `package.json` `repository.url` field. + */ + repository?: BaseContext["repository"]; + + /** + * The whole repository url. Eg: `'https://github.com/conventional-changelog/conventional-changelog-writer'`. + * The should be used as a fallback when `context.repository` doesn't exist. + * + * @defaults + * The whole normalized repository url in `package.json`. + */ + repoUrl?: BaseContext["repoUrl"]; + + /** + * @defaults + * Previous semver tag or the first commit hash if no previous tag. + */ + previousTag?: string; + + /** + * @defaults + * Current semver tag or `'v'` + version if no current tag. + */ + currentTag?: string; + + /** + * Should link to the page that compares current tag with previous tag? + * + * @defaults + * `true` if `previousTag` and `currentTag` are truthy. + */ + linkCompare?: boolean; + } + + /** + * Please check the available options at http://git-scm.com/docs/git-log. + * + * There are some defaults: + * + * @remarks + * Single dash arguments are not supported because of https://github.com/sindresorhus/dargs/blob/master/index.js#L5. + * + * @remarks + * For `` we can also use `..` pattern, and this + * module has the following extra options for shortcut of this pattern: + * + * * `from` + * * `to` + * + * This module also have the following additions: + * + * * `format` + * * `debug` + * * `path` + */ + interface GitRawCommitsOptions extends BaseGitRawCommitsOptions { + /** + * @default + * '%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci' + */ + format?: BaseGitRawCommitsOptions["format"]; + + /** + * @defaults + * Based on `options.releaseCount`. + */ + from?: BaseGitRawCommitsOptions["from"]; + + /** + * @defaults + * `true` if `options.append` is truthy. + */ + reverse?: boolean; + + /** + * A function to get debug information. + * + * @default + * options.debug + */ + debug?: BaseGitRawCommitsOptions["debug"]; + } + + type MergedContext = T & MergedContext.ExtraContext; + + namespace MergedContext { + interface ExtraContext { + /** + * All git semver tags found in the repository. You can't overwrite this value. + */ + readonly gitSemverTags?: ReadonlyArray; + + /** + * Your `package.json` data. You can't overwrite this value. + */ + readonly packageData?: Readonly>; + } + } + + interface Options { + /** + * This should serve as default values for other arguments of + * `conventionalChangelogCore` so you don't need to rewrite the same or similar + * config across your projects. Any value in this could be overwritten. If this + * is a promise (recommended if async), it should resolve with the config. If + * this is a function, it expects a node style callback with the config object. + * If this is an object, it is the config object. The config object should + * include `context`, `gitRawCommitsOpts`, `parserOpts` and `writerOpts`. + */ + config?: Options.Config; + + pkg?: Options.Pkg; + + /** + * Should the log be appended to existing data. + * + * @default + * false + */ + append?: boolean; + + /** + * How many releases of changelog you want to generate. It counts from the + * upcoming release. Useful when you forgot to generate any previous changelog. + * Set to `0` to regenerate all. + * + * @default + * 1 + */ + releaseCount?: number; + + /** + * A debug function. EG: `console.debug.bind(console)`. + * + * @default + * function () {} + */ + debug?: Options.Logger; + + /** + * A warn function. EG: `grunt.verbose.writeln`. + * + * @default + * options.debug + */ + warn?: Options.Logger; + + /** + * A transform function that applies after the parser and before the writer. + * + * This is the place to modify the parsed commits. + */ + transform?: Options.Transform; + + /** + * If this value is `true` and `context.version` equals last release then + * `context.version` will be changed to `'Unreleased'`. + * + * @remarks + * You may want to combine this option with `releaseCount` set to `0` to always + * overwrite the whole CHANGELOG. `conventional-changelog` only outputs a + * CHANGELOG but doesn't read any existing one. + * + * @defaults + * `true` if a different version than last release is given. Otherwise `false`. + */ + outputUnreleased?: boolean; + + /** + * Specify a package in lerna-style monorepo that the CHANGELOG should be + * generated for. + * + * Lerna tags releases in the format `foo-package@1.0.0` and assumes that + * packages are stored in the directory structure `./packages/foo-package`. + * + * @default + * null + */ + lernaPackage?: string | null; + + /** + * Specify a prefix for the git tag that will be taken into account during the + * comparison. For instance if your version tag is prefixed by `version/` + * instead of `v` you would specify `--tagPrefix=version/`. + */ + tagPrefix?: string; + } + + namespace Options { + type Config = Promise> | Config.Function | Config.Object; + + namespace Config { + type FunctionType = (callback: FunctionType.Callback) => void; + + namespace FunctionType { + type Callback = (error: any, config: ObjectType) => void; + } + + interface ObjectType { + context?: Partial; + gitRawCommitsOpts?: GitRawCommitsOptions; + parserOpts?: ParserOptions; + writerOpts?: WriterOptions; + } + + export { + FunctionType as Function, + ObjectType as Object, + }; + } + + type Logger = (message?: any) => void; + + interface Pkg { + /** + * The location of your "package.json". + */ + path?: string; + + /** + * A function that takes `package.json` data as the argument and returns the + * modified data. Note this is performed before normalizing package.json data. + * Useful when you need to add a leading 'v' to your version or modify your + * repository url, etc. + * + * @defaults + * Pass through. + */ + transform?: (pkg: Record) => Record; + } + + interface Transform { + /** + * A transform function that applies after the parser and before the writer. + * + * This is the place to modify the parsed commits. + * + * @param commit The commit from conventional-commits-parser. + * @param cb Callback when you are done. + */ + (this: Stream.Transform, commit: Commit, cb: Transform.Callback): void; + } + + namespace Transform { + type Callback = (error: any, commit: T) => void; + } + } + + interface ParserOptions extends BaseParserOptions { + /** + * What warn function to use. For example, `console.warn.bind(console)` or + * `grunt.log.writeln`. By default, it's a noop. If it is `true`, it will error + * if commit cannot be parsed (strict). + * + * @default + * options.warn + */ + warn?: BaseParserOptions["warn"]; + } + + interface WriterOptions extends BaseWriterOptions> { + /** + * Last chance to modify your context before generating a changelog. + * + * Finalize context is used for generating above context. + * + * @remarks + * If you overwrite this value the above context defaults will be gone. + */ + finalizeContext?: BaseWriterOptions>["finalizeContext"]; + + /** + * A function to get debug information. + * + * @default + * options.debug + */ + debug?: BaseWriterOptions["debug"]; + + /** + * The normal order means reverse chronological order. `reverse` order means + * chronological order. Are the commits from upstream in the reverse order? You + * should only worry about this when generating more than one blocks of logs + * based on `generateOn`. If you find the last commit is in the wrong block + * inverse this value. + * + * @default + * options.append + */ + reverse?: BaseWriterOptions["reverse"]; + + /** + * If `true`, the stream will flush out the last bit of commits (could be empty) + * to changelog. + * + * @default + * options.outputUnreleased + */ + doFlush?: BaseWriterOptions["doFlush"]; + } +} + +type Context = conventionalChangelogCore.Context; +type GitRawCommitsOptions = conventionalChangelogCore.GitRawCommitsOptions; +type Options = conventionalChangelogCore.Options; +type ParserOptions = conventionalChangelogCore.ParserOptions; +type WriterOptions = conventionalChangelogCore.WriterOptions; + +export = conventionalChangelogCore; diff --git a/types/conventional-changelog-core/tsconfig.json b/types/conventional-changelog-core/tsconfig.json new file mode 100644 index 0000000000..b3f0357c22 --- /dev/null +++ b/types/conventional-changelog-core/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conventional-changelog-core-tests.ts" + ] +} diff --git a/types/conventional-changelog-core/tslint.json b/types/conventional-changelog-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conventional-changelog-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts b/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts new file mode 100644 index 0000000000..5252d5085c --- /dev/null +++ b/types/conventional-changelog-preset-loader/conventional-changelog-preset-loader-tests.ts @@ -0,0 +1,35 @@ +/* tslint:disable:no-mergeable-namespace no-namespace */ +"use strict"; + +import conventionalChangelogPresetLoader from "conventional-changelog-preset-loader"; + +namespace Module { + declare const path: string; + declare const config: conventionalChangelogPresetLoader.Config; + + // $ExpectType Config, Context> + conventionalChangelogPresetLoader(path); + // $ExpectType Config, Context> + conventionalChangelogPresetLoader(config); + + // $ExpectError + conventionalChangelogPresetLoader(); +} + +namespace Module.presetLoader { + declare const require: conventionalChangelogPresetLoader.presetLoader.RequireMethod; + + // $ExpectType typeof conventionalChangelogPresetLoader + conventionalChangelogPresetLoader.presetLoader(require); + + // $ExpectError + conventionalChangelogPresetLoader.presetLoader(); +} + +namespace Module.Config { + declare const config: conventionalChangelogPresetLoader.Config; + + // $ExpectType Config + config; + config.name; // $ExpectType string +} diff --git a/types/conventional-changelog-preset-loader/index.d.ts b/types/conventional-changelog-preset-loader/index.d.ts new file mode 100644 index 0000000000..89c20fce0a --- /dev/null +++ b/types/conventional-changelog-preset-loader/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for conventional-changelog-preset-loader 2.3 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-preset-loader#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import { Options as CoreOptions } from "conventional-changelog-core"; +import { Commit } from "conventional-commits-parser"; +import { Context as WriterContext } from "conventional-changelog-writer"; + +/** + * The string that is passed to the preset loader is manipulated by prepending + * `conventional-changelog` to the name. + * + * For example: + * + * * `angular` => `conventional-changelog-angular` + * * `angular/preset/path` => `conventional-changelog-angular/preset/path` + * * `@scope/angular` => `@scope/conventional-changelog-angular` + * * `@scope/angular/preset/path` => `@scope/conventional-changelog-angular/preset/path` + * + * Will return whatever is exported by the preset package. That may be a + * configuration object, a function, or a promise. + * + * @param path + */ +declare function conventionalChangelogPresetLoader(path: string | Config): CoreOptions.Config; + +declare namespace conventionalChangelogPresetLoader { + function presetLoader(requireMethod: presetLoader.RequireMethod): typeof conventionalChangelogPresetLoader; + + namespace presetLoader { + type RequireMethod = (id: string) => any; + } + + interface Config { + /** + * The string that is passed to the preset loader is manipulated by prepending + * `conventional-changelog` to the name. + * + * For example: + * + * * `angular` => `conventional-changelog-angular` + * * `angular/preset/path` => `conventional-changelog-angular/preset/path` + * * `@scope/angular` => `@scope/conventional-changelog-angular` + * * `@scope/angular/preset/path` => `@scope/conventional-changelog-angular/preset/path` + */ + name: string; + } +} + +type Config = conventionalChangelogPresetLoader.Config; + +export = conventionalChangelogPresetLoader; diff --git a/types/conventional-changelog-preset-loader/tsconfig.json b/types/conventional-changelog-preset-loader/tsconfig.json new file mode 100644 index 0000000000..1913853cf1 --- /dev/null +++ b/types/conventional-changelog-preset-loader/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conventional-changelog-preset-loader-tests.ts" + ] +} diff --git a/types/conventional-changelog-preset-loader/tslint.json b/types/conventional-changelog-preset-loader/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conventional-changelog-preset-loader/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/conventional-changelog-writer/conventional-changelog-writer-tests.ts b/types/conventional-changelog-writer/conventional-changelog-writer-tests.ts new file mode 100644 index 0000000000..986de3cb94 --- /dev/null +++ b/types/conventional-changelog-writer/conventional-changelog-writer-tests.ts @@ -0,0 +1,21 @@ +"use strict"; + +import conventionalChangelogWriter from "conventional-changelog-writer"; + +declare const context: conventionalChangelogWriter.Context; +declare const options: conventionalChangelogWriter.Options; + +// $ExpectType Transform +conventionalChangelogWriter(); + +// $ExpectType Transform +conventionalChangelogWriter(context); + +// $ExpectType Transform +conventionalChangelogWriter(context, options); + +// $ExpectError +conventionalChangelogWriter(options); + +// $ExpectError +conventionalChangelogWriter(options, context); diff --git a/types/conventional-changelog-writer/index.d.ts b/types/conventional-changelog-writer/index.d.ts new file mode 100644 index 0000000000..7d1c782863 --- /dev/null +++ b/types/conventional-changelog-writer/index.d.ts @@ -0,0 +1,384 @@ +// Type definitions for conventional-changelog-writer 4.0 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +/// + +import * as Stream from "stream"; + +import { Commit } from "conventional-commits-parser"; + +/** + * Returns a transform stream. + * + * @param context Variables that will be interpolated to the template. This + * object contains, but not limits to the following fields. + * @param options + */ +// tslint:disable-next-line no-unnecessary-generics +declare function conventionalChangelogWriter(context?: Partial, options?: Options): Stream.Transform; + +declare namespace conventionalChangelogWriter { + interface CommitGroup { + title: string | false; + commits: Array>; + } + + interface Context { + /** + * Version number of the up-coming release. If `version` is found in the last + * commit before generating logs, it will be overwritten. + */ + version?: string; + + title?: string; + + /** + * By default, this value is true if `version`'s patch is `0`. + * + * @default + * semver.patch(context.version) !== 0 + */ + isPatch?: boolean; + + /** + * The hosting website. Eg: `'https://github.com'` or `'https://bitbucket.org'`. + */ + host?: string; + + /** + * The owner of the repository. Eg: `'stevemao'`. + */ + owner?: string; + + /** + * The repository name on `host`. Eg: `'conventional-changelog-writer'`. + */ + repository?: string; + + /** + * The whole repository url. Eg: `'https://github.com/conventional-changelog/conventional-changelog-writer'`. + * The should be used as a fallback when `context.repository` doesn't exist. + */ + repoUrl?: string; + + /** + * Should all references be linked? + * + * @defaults + * `true` if (`context.repository` or `context.repoUrl`), `context.commit` and + * `context.issue` are truthy. + */ + linkReferences?: boolean; + + /** + * Commit keyword in the url if `context.linkReferences === true`. + * + * @default + * 'commits' + */ + commit: string; + + /** + * Issue or pull request keyword in the url if `context.linkReferences === true`. + * + * @default + * 'issues' + */ + issue: string; + + /** + * Default to formatted (`'yyyy-mm-dd'`) today's date. [dateformat](https://github.com/felixge/node-dateformat) + * is used for formatting the date. If `version` is found in the last commit, + * `committerDate` will overwrite this. + * + * @default + * dateFormat(new Date(), 'yyyy-mm-dd', true) + */ + date: string; + } + + type GeneratedContext = TContext & TransformedCommit & GeneratedContext.ExtraContext; + + namespace GeneratedContext { + interface ExtraContext { + /** + * @default + * [] + */ + commitGroups: Array>; + + /** + * @default + * [] + */ + noteGroups: NoteGroup[]; + } + } + + interface NoteGroup { + title: string | false; + commits: Commit.Note[]; + } + + interface Options { + /** + * Replace with new values in each commit. + * + * If this is an object, the keys are paths to a nested object property. the + * values can be a string (static) and a function (dynamic) with the old value + * and path passed as arguments. This value is merged with your own transform + * object. + * + * If this is a function, the commit chunk will be passed as the argument and + * the returned value would be the new commit object. This is a handy function + * if you can't provide a transform stream as an upstream of this one. If + * returns a falsy value this commit is ignored. + * + * A `raw` object that is originally poured form upstream is attached to `commit`. + */ + transform?: Options.Transform; + + /** + * How to group the commits. EG: based on the same type. If this value is falsy, + * commits are not grouped. + * + * @default + * 'type' + */ + groupBy?: string | false; + + /** + * A compare function used to sort commit groups. If it's a string or array, it + * sorts on the property(ies) by `localeCompare`. Will not sort if this is a + * falsy value. + * + * The string can be a dot path to a nested object property. + */ + commitGroupsSort?: Options.Sort>; + + /** + * A compare function used to sort commits. If it's a string or array, it sorts + * on the property(ies) by `localeCompare`. Will not sort if this is a falsy + * value. + * + * The string can be a dot path to a nested object property. + * + * @default + * 'header' + */ + commitsSort?: Options.Sort>; + + /** + * A compare function used to sort note groups. If it's a string or array, it + * sorts on the property(ies) by `localeCompare`. Will not sort if this is a + * falsy value. + * + * The string can be a dot path to a nested object property. + * + * @default + * 'title' + */ + noteGroupsSort?: Options.Sort; + + /** + * A compare function used to sort note groups. If it's a string or array, it + * sorts on the property(ies) by `localeCompare`. Will not sort if this is a + * falsy value. + * + * The string can be a dot path to a nested object property. + * + * @default + * 'text' + */ + notesSort?: Options.Sort; + + /** + * When the upstream finishes pouring the commits it will generate a block of + * logs if `doFlush` is `true`. However, you can generate more than one block + * based on this criteria (usually a version) even if there are still commits + * from the upstream. + * + * @remarks + * It checks on the transformed commit chunk instead of the original one (you + * can check on the original by access the `raw` object on the `commit`). + * However, if the transformed commit is ignored it falls back to the original + * commit. + * + * @remarks + * If this value is a `string`, it checks the existence of the field. Set to + * other type to disable it. + * + * @defaults + * If `commit.version` is a valid semver. + */ + generateOn?: Options.GenerateOn; + + /** + * Last chance to modify your context before generating a changelog. + * + * @defaults + * Pass through. + */ + finalizeContext?: Options.FinalizeContext; + + /** + * A function to get debug information. + * + * @default + * function () {} + */ + debug?: (message?: any) => void; + + /** + * The normal order means reverse chronological order. `reverse` order means + * chronological order. Are the commits from upstream in the reverse order? You + * should only worry about this when generating more than one blocks of logs + * based on `generateOn`. If you find the last commit is in the wrong block + * inverse this value. + * + * @default + * false + */ + reverse?: boolean; + + /** + * If this value is `true`, instead of emitting strings of changelog, it emits + * objects containing the details the block. + * + * @remarks + * The downstream must be in object mode if this is `true`. + * + * @default + * false + */ + includeDetails?: boolean; + + /** + * If `true`, reverted commits will be ignored. + * + * @default + * true + */ + ignoreReverted?: boolean; + + /** + * If `true`, the stream will flush out the last bit of commits (could be empty) + * to changelog. + * + * @default + * true + */ + doFlush?: boolean; + + /** + * The main handlebars template. + * + * @defaults + * [template.hbs](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/templates/template.hbs) + */ + mainTemplate?: string; + + /** + * @defaults + * [header.hbs](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/templates/header.hbs) + */ + headerPartial?: string; + + /** + * @defaults + * [commit.hbs](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/templates/commit.hbs) + */ + commitPartial?: string; + + /** + * @defaults + * [footer.hbs](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/templates/footer.hbs) + */ + footerPartial?: string; + + /** + * Partials that used in the main template, if any. The key should be the + * partial name and the value should be handlebars template strings. If you are + * using handlebars template files, read files by yourself. + */ + partials?: Record; + } + + namespace Options { + interface FinalizeContext { + /** + * @param context The generated context based on original input `context` and + * `options`. + * @param options Normalized options. + * @param commits Filtered commits from your git metadata. + * @param keyCommit The commit that triggers to generate the log. + */ + // tslint:disable-next-line max-line-length + (context: GeneratedContext, options: Options, commits: Array>, keyCommit: TransformedCommit): GeneratedContext; + } + + type GenerateOn = GenerateOn.Function | string | object; + + namespace GenerateOn { + interface FunctionType { + /** + * @param commit Current commit. + * @param commits Current collected commits. + * @param context The generated context based on original input `context` and + * `options`. + * @param options Normalized options. + */ + (commit: TransformedCommit, commits: Array>, context: GeneratedContext, options: Options): boolean; + } + + export { + FunctionType as Function, + }; + } + + type Sort = Sort.Function | string | ReadonlyArray | false; + + namespace Sort { + type FunctionType = (a: T, b: T) => number; + + export { + FunctionType as Function, + }; + } + + type Transform = Transform.Object | Transform.Function; + + namespace Transform { + interface FunctionType { + (commit: Commit, context: TContext): TCommit | false; + } + + type ObjectType = Record; + + namespace ObjectType { + type FunctionType = (value: T, path: string) => T; + + export { + FunctionType as Function, + }; + } + + export { + FunctionType as Function, + ObjectType as Object, + }; + } + } + + type TransformedCommit = Omit & { raw: T; }; +} + +type Context = conventionalChangelogWriter.Context; +type Options = conventionalChangelogWriter.Options; + +type Omit = { [P in Exclude]: T[P]; }; + +export = conventionalChangelogWriter; diff --git a/types/conventional-changelog-writer/tsconfig.json b/types/conventional-changelog-writer/tsconfig.json new file mode 100644 index 0000000000..df9d311bba --- /dev/null +++ b/types/conventional-changelog-writer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conventional-changelog-writer-tests.ts" + ] +} diff --git a/types/conventional-changelog-writer/tslint.json b/types/conventional-changelog-writer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conventional-changelog-writer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/conventional-commits-parser/conventional-commits-parser-tests.ts b/types/conventional-commits-parser/conventional-commits-parser-tests.ts new file mode 100644 index 0000000000..e4cb95ba37 --- /dev/null +++ b/types/conventional-commits-parser/conventional-commits-parser-tests.ts @@ -0,0 +1,70 @@ +/* tslint:disable:no-mergeable-namespace no-namespace */ +"use strict"; + +import conventionalCommitsParser from "conventional-commits-parser"; + +namespace Module { + declare const options: conventionalCommitsParser.Options; + + conventionalCommitsParser(); // $ExpectType Transform + conventionalCommitsParser(options); // $ExpectType Transform +} + +namespace Module.sync { + declare const commit: string; + declare const options: conventionalCommitsParser.Options; + + conventionalCommitsParser.sync(commit); // $ExpectType Commit + conventionalCommitsParser.sync(commit, options); // $ExpectType Commit +} + +namespace Module.Commit { + namespace Case01 { + declare const commit: conventionalCommitsParser.Commit; + + // $ExpectType Commit + commit; + commit.body; // $ExpectType Field + commit.footer; // $ExpectType Field + commit.header; // $ExpectType Field + commit.mentions; // $ExpectType string[] + commit.merge; // $ExpectType Field + commit.notes; // $ExpectType Note[] + commit.references; // $ExpectType Reference[] + commit.revert; // $ExpectType Revert | null + commit.scope; // $ExpectType string | null | undefined + commit.subject; // $ExpectType string | null | undefined + commit.type; // $ExpectType string | null | undefined + } +} + +namespace Module.Commit.Note { + declare const note: conventionalCommitsParser.Commit.Note; + + // $ExpectType Note + note; + note.text; // $ExpectType string + note.title; // $ExpectType string +} + +namespace Module.Commit.Reference { + declare const reference: conventionalCommitsParser.Commit.Reference; + + // $ExpectType Reference + reference; + reference.action; // $ExpectType Field + reference.issue; // $ExpectType string + reference.owner; // $ExpectType Field + reference.prefix; // $ExpectType string + reference.raw; // $ExpectType string + reference.repository; // $ExpectType Field +} + +namespace Module.Commit.Revert { + declare const revert: conventionalCommitsParser.Commit.Revert; + + // $ExpectType Revert + revert; + revert.hash; // $ExpectType string | null | undefined + revert.header; // $ExpectType string | null | undefined +} diff --git a/types/conventional-commits-parser/index.d.ts b/types/conventional-commits-parser/index.d.ts new file mode 100644 index 0000000000..b0abcd1e94 --- /dev/null +++ b/types/conventional-commits-parser/index.d.ts @@ -0,0 +1,305 @@ +// Type definitions for conventional-commits-parser 3.0 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +/// + +import * as Stream from "stream"; + +/** + * Returns an transform stream. If there is any malformed commits it will be + * gracefully ignored (an empty data will be emitted so down stream can notice). + * + * @param options + */ +declare function conventionalCommitsParser(options?: conventionalCommitsParser.Options): Stream.Transform; + +declare namespace conventionalCommitsParser { + /** + * The sync version. Useful when parsing a single commit. Returns the result. + * + * @param commit A single commit to be parsed. + * @param options Same as the `options` of `conventionalCommitsParser`. + */ + function sync(commit: string, options?: Options): Commit; + + type Commit = CommitBase & { [Field in Exclude]?: Commit.Field }; + + namespace Commit { + type Field = string | null; + + interface Note { + title: string; + text: string; + } + + interface Reference { + issue: string; + + /** + * @default + * null + */ + action: Field; + + /** + * @default + * null + */ + owner: Field; + + /** + * @default + * null + */ + repository: Field; + + prefix: string; + raw: string; + } + + interface Revert { + hash?: Field; + header?: Field; + [field: string]: Field | undefined; + } + } + + interface CommitBase { + /** + * @default + * null + */ + merge: Commit.Field; + + /** + * @default + * null + */ + header: Commit.Field; + + /** + * @default + * null + */ + body: Commit.Field; + + /** + * @default + * null + */ + footer: Commit.Field; + + /** + * @default + * [] + */ + notes: Commit.Note[]; + + /** + * @default + * [] + */ + references: Commit.Reference[]; + + /** + * @default + * [] + */ + mentions: string[]; + + /** + * @default + * null + */ + revert: Commit.Revert | null; + + type?: Commit.Field; + scope?: Commit.Field; + subject?: Commit.Field; + } + + interface Options { + /** + * Pattern to match merge headers. EG: branch merge, GitHub or GitLab like pull + * requests headers. When a merge header is parsed, the next line is used for + * conventional header parsing. + * + * For example, if we have a commit + * + * ```text + * Merge pull request #1 from user/feature/feature-name + * + * feat(scope): broadcast $destroy event on scope destruction + * ``` + * + * We can parse it with these options and the default headerPattern: + * + * ```javascript + * { + * mergePattern: /^Merge pull request #(\d+) from (.*)$/, + * mergeCorrespondence: ['id', 'source'] + * } + * ``` + * + * @default + * null + */ + mergePattern?: Options.Pattern; + + /** + * Used to define what capturing group of `mergePattern`. + * + * If it's a `string` it will be converted to an `array` separated by a comma. + * + * @default + * null + */ + mergeCorrespondence?: Options.Correspondence; + + /** + * Used to match header pattern. + * + * @default + * /^(\w*)(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$/ + */ + headerPattern?: Options.Pattern; + + /** + * Used to define what capturing group of `headerPattern` captures what header + * part. The order of the array should correspond to the order of + * `headerPattern`'s capturing group. If the part is not captured it is `null`. + * If it's a `string` it will be converted to an `array` separated by a comma. + * + * @default + * ['type', 'scope', 'subject'] + */ + headerCorrespondence?: Options.Correspondence; + + /** + * Keywords to reference an issue. This value is case __insensitive__. If it's a + * `string` it will be converted to an `array` separated by a comma. + * + * Set it to `null` to reference an issue without any action. + * + * @default + * ['close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved'] + */ + referenceActions?: Options.Actions; + + /** + * The prefixes of an issue. EG: In `gh-123` `gh-` is the prefix. + * + * @default + * ['#'] + */ + issuePrefixes?: Options.Prefixes; + + /** + * Used to define if `issuePrefixes` should be considered case sensitive. + * + * @default + * false + */ + issuePrefixesCaseSensitive?: boolean; + + /** + * Keywords for important notes. This value is case __insensitive__. If it's a + * `string` it will be converted to an `array` separated by a comma. + * + * @default + * ['BREAKING CHANGE'] + */ + noteKeywords?: Options.Keywords; + + /** + * Pattern to match other fields. + * + * @default + * /^-(.*?)-$/ + */ + fieldPattern?: Options.Pattern; + + /** + * Pattern to match what this commit reverts. + * + * @default + * /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./ + */ + revertPattern?: Options.Pattern; + + /** + * Used to define what capturing group of `revertPattern` captures what reverted + * commit fields. The order of the array should correspond to the order of + * `revertPattern`'s capturing group. + * + * For example, if we had commit + * + * ``` + * Revert "throw an error if a callback is passed" + * + * This reverts commit 9bb4d6c. + * ``` + * + * If configured correctly, the parsed result would be + * + * ``` + * { + * revert: { + * header: 'throw an error if a callback is passed', + * hash: '9bb4d6c' + * } + * } + * ``` + * + * It implies that this commit reverts a commit with header `'throw an error if + * a callback is passed'` and hash `'9bb4d6c'`. + * + * If it's a `string` it will be converted to an `array` separated by a comma. + * + * @default + * ['header', 'hash'] + */ + revertCorrespondence?: Options.Correspondence; + + /** + * What commentChar to use. By default it is `null`, so no comments are stripped. + * Set to `#` if you pass the contents of `.git/COMMIT_EDITMSG` directly. + * + * If you have configured the git commentchar via git config `core.commentchar` + * you'll want to pass what you have set there. + * + * @default + * null + */ + commentChar?: string | null; + + /** + * What warn function to use. For example, `console.warn.bind(console)` or + * `grunt.log.writeln`. By default, it's a noop. If it is `true`, it will error + * if commit cannot be parsed (strict). + * + * @default + * function () {} + */ + warn?: (message?: any) => void | boolean; + } + + namespace Options { + type Actions = string[] | string | null; + type Correspondence = string[] | string | null; + type Keywords = string[] | string | null; + type Pattern = RegExp | string | null; + type Prefixes = string[] | string | null; + } + + export { + Commit, + Options, + sync, + }; +} + +export = conventionalCommitsParser; diff --git a/types/conventional-commits-parser/tsconfig.json b/types/conventional-commits-parser/tsconfig.json new file mode 100644 index 0000000000..ce12143030 --- /dev/null +++ b/types/conventional-commits-parser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conventional-commits-parser-tests.ts" + ] +} diff --git a/types/conventional-commits-parser/tslint.json b/types/conventional-commits-parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conventional-commits-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/conventional-recommended-bump/conventional-recommended-bump-tests.ts b/types/conventional-recommended-bump/conventional-recommended-bump-tests.ts new file mode 100644 index 0000000000..79be75019a --- /dev/null +++ b/types/conventional-recommended-bump/conventional-recommended-bump-tests.ts @@ -0,0 +1,65 @@ +/* tslint:disable:no-mergeable-namespace no-namespace */ +"use strict"; + +import conventionalCommitsParser from "conventional-commits-parser"; +import conventionalRecommendedBump from "conventional-recommended-bump"; + +namespace Module { + declare const callback: conventionalRecommendedBump.Callback; + declare const options: conventionalRecommendedBump.Options; + declare const parserOpts: conventionalCommitsParser.Options; + + // $ExpectType void + conventionalRecommendedBump(options, callback); + // $ExpectType void + conventionalRecommendedBump(options, parserOpts, callback); + + // $ExpectError + conventionalRecommendedBump(); +} + +namespace Module.Callback { + const callback: conventionalRecommendedBump.Callback = (error, recommendation) => { + // $ExpectType any + error; + + // $ExpectType Recommendation + recommendation; + recommendation.level; // $ExpectType number | undefined + recommendation.reason; // $ExpectType string | undefined + recommendation.releaseType; // $ExpectType "major" | "minor" | "patch" | undefined + }; +} + +namespace Module.Options { + declare const options: conventionalRecommendedBump.Options; + + // $ExpectType Options + options; + // tslint:disable-next-line max-line-length + options.ignoreReverted; // $ExpectType boolean | undefined + options.lernaPackage; // $ExpectType string | undefined + options.preset; // $ExpectType string | undefined + options.tagPrefix; // $ExpectType string | undefined + options.whatBump; // $ExpectType WhatBump | undefined +} + +namespace Module.Options.WhatBump { + declare const commits: conventionalCommitsParser.Commit[]; + declare const whatBump: conventionalRecommendedBump.Options.WhatBump; + + // $ExpectType Result + whatBump(commits); + + // $ExpectError + whatBump(); +} + +namespace Module.Options.WhatBump.Result { + declare const result: conventionalRecommendedBump.Options.WhatBump.Result; + + // $ExpectType Result + result; + result.level; // $ExpectType number | undefined + result.reason; // $ExpectType string | undefined +} diff --git a/types/conventional-recommended-bump/index.d.ts b/types/conventional-recommended-bump/index.d.ts new file mode 100644 index 0000000000..17bf274114 --- /dev/null +++ b/types/conventional-recommended-bump/index.d.ts @@ -0,0 +1,165 @@ +// Type definitions for conventional-recommended-bump 6.0 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import { Options as CoreOptions } from "conventional-changelog-core"; +import { Commit, Options as ParserOptions } from "conventional-commits-parser"; +import { Context as WriterContext } from "conventional-changelog-writer"; + +/** + * @param options `options` is an object with the following properties: + * + * * `ignoreReverted` + * * `preset` + * * `config` + * * `whatBump` + * @param callback + */ +declare function conventionalRecommendedBump(options: Options, callback: Callback): void; + +/** + * + * @param options `options` is an object with the following properties: + * + * * `ignoreReverted` + * * `preset` + * * `config` + * * `whatBump` + * @param parserOpts See the [conventional-commits-parser](https://github.com/conventional-changelog/conventional-commits-parser) + * documentation for available options. + * @param callback + */ +declare function conventionalRecommendedBump(options: Options, parserOpts: ParserOptions, callback: Callback): void; + +declare namespace conventionalRecommendedBump { + /** + * `recommendation` is an `object` with a single property, `releaseType`. + * + * `releaseType` is a `string`: Possible values: `major`, `minor` and `patch`, + * or `undefined` if `whatBump` does not return a valid `level` property, or + * the `level` property is not set by `whatBump`. + */ + interface Callback { + /** + * @param error + * @param recommendation `recommendation` is an `object` with a single property, + * `releaseType`. + */ + (error: any, recommendation: Callback.Recommendation): void; + } + + namespace Callback { + /** + * `recommendation` is an `object` with a single property, `releaseType`. + * + * `releaseType` is a `string`: Possible values: `major`, `minor` and `patch`, + * or `undefined` if `whatBump` does not return a valid `level` property, or + * the `level` property is not set by `whatBump`. + */ + interface Recommendation extends Options.WhatBump.Result { + /** + * `releaseType` is a `string`: Possible values: `major`, `minor` and `patch`, + * or `undefined` if `whatBump` does not return a valid `level` property, or + * the `level` property is not set by `whatBump`. + */ + releaseType?: Recommendation.ReleaseType; + } + + namespace Recommendation { + type ReleaseType = "major" | "minor" | "patch"; + } + } + + /** + * `options` is an object with the following properties: + * * `ignoreReverted` + * * `preset` + * * `config` + * * `whatBump` + */ + interface Options { + /** + * If `true`, reverted commits will be ignored. + * + * @default + * true + */ + ignoreReverted?: boolean; + + /** + * It's recommended to use a preset so you don't have to define everything + * yourself. + * + * The value is passed to [`conventional-changelog-preset-loader`](https://www.npmjs.com/package/conventional-changelog-preset-loader). + */ + preset?: string; + + /** + * This should serve as default values for other arguments of + * `conventional-recommended-bump` so you don't need to rewrite the same or + * similar config across your projects. + * + * @remarks + * `config` option will be overwritten by the value loaded by + * `conventional-changelog-preset-loader` if the `preset` options is set. + */ + config?: CoreOptions.Config; + + /** + * A function that takes parsed commits as an argument. + * + * ``` + * whatBump(commits) {}; + * ``` + * + * `commits` is an array of all commits from last semver tag to `HEAD` as parsed + * by `conventional-commits-parser`. + * + * This should return an object including but not limited to `level` and `reason`. + * `level` is a `number` indicating what bump it should be and `reason` is the + * reason of such release. + */ + whatBump?: Options.WhatBump; + + /** + * Specify a prefix for the git tag that will be taken into account during the + * comparison. + * + * For instance if your version tag is prefixed by `version/` instead of `v` you + * would specifying `--tagPrefix=version/` using the CLI, or `version/` as the + * value of the `tagPrefix` option. + */ + tagPrefix?: string; + + /** + * Specify the name of a package in a [Lerna](https://lernajs.io/)-managed + * repository. The package name will be used when fetching all changes to a + * package since the last time that package was released. + * + * For instance if your project contained a package named + * `conventional-changelog`, you could have only commits that have happened + * since the last release of `conventional-changelog` was tagged by + * specifying `--lernaPackage=conventional-changelog` using the CLI, or + * `conventional-changelog` as the value of the `lernaPackage` option. + */ + lernaPackage?: string; + } + + namespace Options { + type WhatBump = (commits: Commit[]) => WhatBump.Result; + + namespace WhatBump { + interface Result { + level?: number; + reason?: string; + } + } + } +} + +type Callback = conventionalRecommendedBump.Callback; +type Options = conventionalRecommendedBump.Options; + +export = conventionalRecommendedBump; diff --git a/types/conventional-recommended-bump/tsconfig.json b/types/conventional-recommended-bump/tsconfig.json new file mode 100644 index 0000000000..2e6c14256d --- /dev/null +++ b/types/conventional-recommended-bump/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conventional-recommended-bump-tests.ts" + ] +} diff --git a/types/conventional-recommended-bump/tslint.json b/types/conventional-recommended-bump/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conventional-recommended-bump/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-raw-commits/git-raw-commits-tests.ts b/types/git-raw-commits/git-raw-commits-tests.ts new file mode 100644 index 0000000000..cc852ab3e7 --- /dev/null +++ b/types/git-raw-commits/git-raw-commits-tests.ts @@ -0,0 +1,18 @@ +"use strict"; + +import gitRawCommits from "git-raw-commits"; + +declare const execOptions: gitRawCommits.ExecOptions; +declare const gitOptions: gitRawCommits.GitOptions; + +// $ExpectType Readable +gitRawCommits(gitOptions); + +// $ExpectType Readable +gitRawCommits(gitOptions, execOptions); + +// $ExpectError +gitRawCommits(); + +// $ExpectError +gitRawCommits(execOptions, gitOptions); diff --git a/types/git-raw-commits/index.d.ts b/types/git-raw-commits/index.d.ts new file mode 100644 index 0000000000..f89e46dd3e --- /dev/null +++ b/types/git-raw-commits/index.d.ts @@ -0,0 +1,84 @@ +// Type definitions for git-raw-commits 2.0 +// Project: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits#readme +// Definitions by: Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +import * as Stream from "stream"; + +/** + * Returns a readable stream. Stream is split to break on each commit. + * + * @param gitOpts + * @param execOpts Options to pass to `git` `childProcess`. + */ +declare function gitRawCommits(gitOptions: gitRawCommits.GitOptions, execOptions?: gitRawCommits.ExecOptions): Stream.Readable; + +declare namespace gitRawCommits { + /** + * Options to pass to `git` `childProcess`. + */ + interface ExecOptions { + /** + * Current working directory to execute git in. + */ + cwd?: string; + } + + /** + * Please check the available options at http://git-scm.com/docs/git-log. + * + * @remarks + * Single dash arguments are not supported because of https://github.com/sindresorhus/dargs/blob/master/index.js#L5. + * + * @remarks + * For `` we can also use `..` pattern, and this + * module has the following extra options for shortcut of this pattern: + * + * * `from` + * * `to` + * + * This module also have the following additions: + * + * * `format` + * * `debug` + * * `path` + */ + interface GitOptions { + /** + * @default + * '' + */ + from?: string; + + /** + * @default + * 'HEAD' + */ + to?: string; + + /** + * Please check http://git-scm.com/docs/git-log for format options. + * + * @default + * '%B' + */ + format?: string; + + /** + * A function to get debug information. + */ + debug?: (message: any) => void; + + /** + * Filter commits to the path provided. + */ + path?: string; + + [options: string]: any; + } +} + +export = gitRawCommits; diff --git a/types/git-raw-commits/tsconfig.json b/types/git-raw-commits/tsconfig.json new file mode 100644 index 0000000000..dbd9f30a5b --- /dev/null +++ b/types/git-raw-commits/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "git-raw-commits-tests.ts" + ] +} diff --git a/types/git-raw-commits/tslint.json b/types/git-raw-commits/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-raw-commits/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }