mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 09:40:02 +00:00
[changelog-parser] Add typing for changelog-parser (#34137)
* Added type defs for changelog-parser * Updated jsdoc comments * Corrected callback return type Added Partial<Options>
This commit is contained in:
16
types/changelog-parser/changelog-parser-tests.ts
Normal file
16
types/changelog-parser/changelog-parser-tests.ts
Normal file
@@ -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');
|
||||
24
types/changelog-parser/index.d.ts
vendored
Normal file
24
types/changelog-parser/index.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Type definitions for changelog-parser 2.7
|
||||
// Project: https://github.com/hypermodules/changelog-parser
|
||||
// Definitions by: Adam Zerella <https://github.com/adamzerella>
|
||||
// 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<Options>|string, callback?: (result: object, error: string|null) => void): Promise<object>;
|
||||
|
||||
export = parseChangelog;
|
||||
23
types/changelog-parser/tsconfig.json
Normal file
23
types/changelog-parser/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/changelog-parser/tslint.json
Normal file
1
types/changelog-parser/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user