UNPKG

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