Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#46474 [@types/apidoc] Fix wrong args + add…
Browse files Browse the repository at this point in the history
… `src` param by @rigwild

* Update apidoc-tests.ts

* Fix apidoc argument typings

* Update apidoc-tests.ts

* Update index.d.ts

* Update apidoc-tests.ts
  • Loading branch information
rigwild committed Aug 2, 2020
1 parent 5651158 commit cdcf798
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 31 deletions.
39 changes: 24 additions & 15 deletions types/apidoc/apidoc-tests.ts
@@ -1,22 +1,37 @@
import { createDoc } from 'apidoc';

const apidocOutput = createDoc({
excludeFilters: [''],
includeFilters: [''],
src: '',
dest: '',
template: '',
templateSingleFile: '',
debug: true,
single: true,
silent: true,
config: '',
apiprivate: true,
verbose: true,
simulate: true,
single: true,
debug: true,
parse: true,
colorize: true,
filters: { aFilter: '' },
languages: { aLanguage: '' },
parsers: { aParser: '' },
workers: { aWorker: '' },
silent: true,
simulate: true,
markdown: true,
config: '',
apiprivate: true,
lineEnding: '',
encoding: '',
excludeFilters: [],
includeFilters: [],
copyDefinitions: true,
filterBy: '',
});

if (typeof apidocOutput !== 'boolean') {
const { data, project } = apidocOutput;
}

createDoc({
filters: {
api: {
postFilter: (parsedFiles, parsedFilenames) => { }
Expand All @@ -42,11 +57,5 @@ const apidocOutput = createDoc({
workers: {
work: {}
},
lineEnding: "LF",
copyDefinitions: false,
filterBy: '',
filterBy: [''],
});

if (typeof apidocOutput !== 'boolean') {
const { data, project } = apidocOutput;
}
33 changes: 17 additions & 16 deletions types/apidoc/index.d.ts
Expand Up @@ -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[];
excludeFilters?: string[];
includeFilters?: string[];
src?: string;
dest?: string;
template?: string;
templateSingleFile?: string;
debug?: boolean;
single?: boolean;
silent?: boolean;
config?: string;
apiprivate?: boolean;
verbose?: boolean;
simulate?: boolean;
single?: boolean;
debug?: boolean;
parse?: boolean;
colorize?: boolean;
markdown?: boolean;
config?: string;
apiprivate?: boolean;
encoding?: string;
excludeFilters?: string[];
includeFilters?: string[];
filters?: {
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;
Expand All @@ -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[];
}
Expand Down

0 comments on commit cdcf798

Please sign in to comment.