UNPKG

2.04 kBTypeScriptView Raw
1/// <reference types="node" resolution-mode="require"/>
2import * as builtinHandlers from './handlers/index.js';
3import * as builtinResolvers from './resolver/index.js';
4import { makeFsImporter } from './importer/index.js';
5import * as utils from './utils/index.js';
6import type { Documentation } from './Documentation.js';
7import type DocumentationBuilder from './Documentation.js';
8import type { Resolver, ResolverClass, ResolverFunction } from './resolver/index.js';
9import type { Importer } from './importer/index.js';
10import type { Handler } from './handlers/index.js';
11import type FileState from './FileState.js';
12import type { Config } from './config.js';
13import { defaultHandlers } from './config.js';
14import { ERROR_CODES } from './error.js';
15declare const builtinImporters: {
16 fsImporter: Importer;
17 ignoreImporter: Importer;
18};
19declare module '@babel/traverse' {
20 interface HubInterface {
21 file: FileState;
22 parse: typeof FileState.prototype.parse;
23 import: typeof FileState.prototype.import;
24 }
25 interface Hub {
26 file: FileState;
27 parse: typeof FileState.prototype.parse;
28 import: typeof FileState.prototype.import;
29 }
30}
31/**
32 * Parse the *src* and scan for react components based on the config
33 * that gets supplied.
34 *
35 * The default resolvers look for *exported* react components.
36 *
37 * By default all handlers are applied, so that all possible
38 * different use cases are covered.
39 *
40 * The default importer is the fs-importer that tries to resolve
41 * files based on the nodejs resolve algorithm.
42 */
43declare function defaultParse(src: Buffer | string, config?: Config): Documentation[];
44export type { NodePath } from '@babel/traverse';
45export type * as babelTypes from '@babel/types';
46export { builtinHandlers, builtinResolvers, builtinImporters, defaultHandlers, makeFsImporter, defaultParse as parse, utils, ERROR_CODES, };
47export type { Importer, Handler, Resolver, ResolverClass, ResolverFunction, FileState, Config, Documentation, DocumentationBuilder, };