🤖 Merge PR #46474 [@types/apidoc] Fix wrong args + add src param by @rigwild

* Update apidoc-tests.ts

* Fix apidoc argument typings

* Update apidoc-tests.ts

* Update index.d.ts

* Update apidoc-tests.ts
This commit is contained in:
rigwild 2020-08-02 13:27:41 +02:00 committed by GitHub
parent 5651158378
commit cdcf798f8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 36 deletions

View File

@ -1,22 +1,37 @@
import { createDoc } from 'apidoc';
const apidocOutput = createDoc({
excludeFilters: [''],
includeFilters: [''],
src: '',
dest: '',
template: '',
templateSingleFile: '',
debug: true,
single: true,
silent: true,
verbose: true,
simulate: true,
parse: true,
colorize: true,
markdown: true,
config: '',
apiprivate: true,
verbose: true,
single: true,
debug: true,
parse: true,
colorize: true,
filters: { aFilter: '' },
languages: { aLanguage: '' },
parsers: { aParser: '' },
workers: { aWorker: '' },
silent: true,
simulate: true,
markdown: true,
lineEnding: '',
encoding: '',
excludeFilters: [],
includeFilters: [],
copyDefinitions: true,
filterBy: '',
});
if (typeof apidocOutput !== 'boolean') {
const { data, project } = apidocOutput;
}
createDoc({
filters: {
api: {
postFilter: (parsedFiles, parsedFilenames) => { }
@ -42,11 +57,5 @@ const apidocOutput = createDoc({
workers: {
work: {}
},
lineEnding: "LF",
copyDefinitions: false,
filterBy: '',
filterBy: [''],
});
if (typeof apidocOutput !== 'boolean') {
const { data, project } = apidocOutput;
}

View File

@ -8,38 +8,35 @@ export interface ParsedFile {
filename: string;
extension: string;
src: string;
blocks: Array<{ global: any; local: any; }>;
}
export interface DocOptions {
dest?: string | 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;
excludeFilters?: string[];
includeFilters?: string[];
filters?: {
src?: string;
dest?: string;
template?: string;
templateSingleFile?: string;
config?: string;
apiprivate?: boolean;
verbose?: boolean;
single?: boolean;
debug?: boolean;
parse?: boolean;
colorize?: boolean;
filters?: Record<string, string> | {
[keys: string]: {
postFilter: (parsedFiles: ParsedFile[], parsedFilenames: string[]) => void
}
};
languages?: {
languages?: Record<string, string> | {
[language: string]: {
docBlocksRegExp: RegExp;
inlineRegExp: RegExp;
}
};
parsers?: {
parsers?: Record<string, string> | {
parse: (content: string, source: string, messages: string) => {
name: string;
title: string;
@ -50,10 +47,14 @@ export interface DocOptions {
markdownFields?: string[];
markdownRemovePTags?: string[];
};
workers?: {
workers?: Record<string, string> | {
[keys: string]: any;
};
silent?: boolean;
simulate?: boolean;
markdown?: boolean;
lineEnding?: string;
encoding?: string;
copyDefinitions?: boolean;
filterBy?: string | string[];
}