From d015be5e399c8f8216c1f2aeed61f3d80bc11eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=A6rum-Onsager?= Date: Tue, 21 Jan 2025 11:46:23 +0100 Subject: [PATCH 1/2] Expose more Typescript types --- packages/react-docgen/src/main.ts | 64 ++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 18 deletions(-) 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, }; From 27a26da4aaab1da39c82b63db3fb4b3c0b1c5938 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder <231804+danez@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:58:35 +0100 Subject: [PATCH 2/2] Create curvy-roses-deny.md --- .changeset/curvy-roses-deny.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/curvy-roses-deny.md 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