diff --git a/types/changelog-parser/changelog-parser-tests.ts b/types/changelog-parser/changelog-parser-tests.ts new file mode 100644 index 0000000000..1195d8077f --- /dev/null +++ b/types/changelog-parser/changelog-parser-tests.ts @@ -0,0 +1,16 @@ +import parseChangelog = require('changelog-parser'); + +const options = { + filePath: 'path/to/CHANGELOG.md', + removeMarkdown: false +}; + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result, error) => {}); + +parseChangelog(options, (result, error) => {}); + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result) => {}); + +parseChangelog(options); + +parseChangelog('path/to/CHANGELOG.md'); diff --git a/types/changelog-parser/index.d.ts b/types/changelog-parser/index.d.ts new file mode 100644 index 0000000000..7c03ff3ecd --- /dev/null +++ b/types/changelog-parser/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for changelog-parser 2.7 +// Project: https://github.com/hypermodules/changelog-parser +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Options { + /** + * Path to changelog file. + */ + filePath: string; + /** + * Removes the markdown markup from the changelog entries by default. + * You can change its value to false to keep the markdown. + */ + removeMarkdown: boolean; +} + +/** + * Change log parser for node. + */ +declare function parseChangelog(options: Partial|string, callback?: (result: object, error: string|null) => void): Promise; + +export = parseChangelog; diff --git a/types/changelog-parser/tsconfig.json b/types/changelog-parser/tsconfig.json new file mode 100644 index 0000000000..e40482d8e4 --- /dev/null +++ b/types/changelog-parser/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "changelog-parser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/changelog-parser/tslint.json b/types/changelog-parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/changelog-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }