diff --git a/.changeset/curvy-roses-deny.md b/.changeset/curvy-roses-deny.md new file mode 100644 index 00000000000..b8ceb660f32 --- /dev/null +++ b/.changeset/curvy-roses-deny.md @@ -0,0 +1,5 @@ +--- +"react-docgen": patch +--- + +Expose more TypeScript types diff --git a/packages/react-docgen/src/main.ts b/packages/react-docgen/src/main.ts index cf733f85349..faa2bd17324 100644 --- a/packages/react-docgen/src/main.ts +++ b/packages/react-docgen/src/main.ts @@ -1,25 +1,40 @@ +import type DocumentationBuilder from './Documentation.js'; +import type { + BaseType, + Documentation, + ElementsType, + FunctionArgumentType, + FunctionSignatureType, + LiteralType, + MethodParameter, + MethodReturn, + ObjectSignatureType, + PropDescriptor, + PropTypeDescriptor, + SimpleType, + TSFunctionSignatureType, + TypeDescriptor, +} from './Documentation.js'; +import type FileState from './FileState.js'; +import type { Config } from './config.js'; +import { createConfig, defaultHandlers } from './config.js'; +import { ERROR_CODES } from './error.js'; +import type { Handler } from './handlers/index.js'; import * as builtinHandlers from './handlers/index.js'; -import parse from './parse.js'; -import * as builtinResolvers from './resolver/index.js'; +import type { Importer } from './importer/index.js'; import { fsImporter, ignoreImporter, makeFsImporter, } from './importer/index.js'; -import * as utils from './utils/index.js'; -import type { Documentation } from './Documentation.js'; -import type DocumentationBuilder from './Documentation.js'; +import parse from './parse.js'; import type { Resolver, ResolverClass, ResolverFunction, } from './resolver/index.js'; -import type { Importer } from './importer/index.js'; -import type { Handler } from './handlers/index.js'; -import type FileState from './FileState.js'; -import type { Config } from './config.js'; -import { createConfig, defaultHandlers } from './config.js'; -import { ERROR_CODES } from './error.js'; +import * as builtinResolvers from './resolver/index.js'; +import * as utils from './utils/index.js'; const builtinImporters = { fsImporter, @@ -66,23 +81,36 @@ export type * as babelTypes from '@babel/types'; export { builtinHandlers, - builtinResolvers, builtinImporters, + builtinResolvers, defaultHandlers, + ERROR_CODES, makeFsImporter, defaultParse as parse, utils, - ERROR_CODES, }; export type { - Importer, + BaseType, + Config, + Documentation, + DocumentationBuilder, + ElementsType, + FileState, + FunctionArgumentType, + FunctionSignatureType, Handler, + Importer, + LiteralType, + MethodParameter, + MethodReturn, + ObjectSignatureType, + PropDescriptor, + PropTypeDescriptor, Resolver, ResolverClass, ResolverFunction, - FileState, - Config, - Documentation, - DocumentationBuilder, + SimpleType, + TSFunctionSignatureType, + TypeDescriptor, };