[@types/apidoc] Add apidoc typings (#44609)

* [@types/apidoc] Add apidoc typings

* Fix default export
This commit is contained in:
rigwild 2020-05-15 17:57:49 +02:00 committed by GitHub
parent 3ad3850465
commit 492b0ea590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import { createDoc } from 'apidoc';
const apidocOutput = createDoc({
dest: '',
template: '',
templateSingleFile: '',
debug: true,
single: true,
silent: true,
verbose: true,
simulate: true,
parse: true,
colorize: true,
markdown: true,
config: '',
apiprivate: true,
encoding: '',
});
if (typeof apidocOutput !== 'boolean') {
const { data, project } = apidocOutput;
}

23
types/apidoc/index.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
// Type definitions for apidoc 0.22
// Project: https://github.com/apidoc/apidoc
// Definitions by: rigwild <https://github.com/rigwild>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface DocOptions {
dest?: string;
template?: string;
templateSingleFile?: string;
debug?: boolean;
single?: boolean;
silent?: boolean;
verbose?: boolean;
simulate?: boolean;
parse?: boolean;
colorize?: boolean;
markdown?: boolean;
config?: string;
apiprivate?: boolean;
encoding?: string;
}
export function createDoc(options: DocOptions): boolean | { data: Record<string, any>; project: Record<string, any> };

View 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",
"apidoc-tests.ts"
]
}

1
types/apidoc/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }