mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(docdown): new type definition (#46020)
Definition types for 'docdown': - definitioins files - tests https://github.com/jdalton/docdown#readme Thanks!
This commit is contained in:
parent
0bfb40fb47
commit
e8378bbd71
18
types/docdown/docdown-tests.ts
Normal file
18
types/docdown/docdown-tests.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import docdown = require('docdown');
|
||||
import { Options } from 'docdown';
|
||||
|
||||
const options: Options = {
|
||||
path: './some/path',
|
||||
url: 'https://github.com/username/project/blob/master/my.js',
|
||||
};
|
||||
const markdown = docdown(options);
|
||||
// $ExpectType string
|
||||
docdown({
|
||||
path: './some/path',
|
||||
url: 'https://example.com/my.js',
|
||||
lang: 'js',
|
||||
sort: false,
|
||||
style: 'github',
|
||||
title: 'README',
|
||||
toc: 'properties',
|
||||
});
|
||||
50
types/docdown/index.d.ts
vendored
Normal file
50
types/docdown/index.d.ts
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
// Type definitions for docdown 0.7
|
||||
// Project: https://github.com/jdalton/docdown#readme
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* A simple JSDoc to Markdown documentation generator.
|
||||
* Generates Markdown documentation based on JSDoc comments.
|
||||
*/
|
||||
declare function docdown(options: docdown.Options): string;
|
||||
|
||||
declare namespace docdown {
|
||||
interface Options {
|
||||
/**
|
||||
* the input file pat
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* The source URL.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The language indicator for code blocks.
|
||||
* @default 'js'
|
||||
*/
|
||||
lang?: string;
|
||||
/**
|
||||
* Specify whether entries are sorted.
|
||||
* @default true
|
||||
*/
|
||||
sort?: boolean;
|
||||
/**
|
||||
* The hash style for links ('default' or 'github').
|
||||
* @default 'default'
|
||||
*/
|
||||
style?: string;
|
||||
/**
|
||||
* The documentation title.
|
||||
* @default '<%= basename(options.path) %> API documentation'
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* The table of contents organization style ('categories' or 'properties').
|
||||
* @default 'properties'
|
||||
*/
|
||||
toc?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = docdown;
|
||||
23
types/docdown/tsconfig.json
Normal file
23
types/docdown/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"docdown-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/docdown/tslint.json
Normal file
1
types/docdown/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user