-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types from external dependencies #134
Comments
Hey, thank you! Hm, I think this is an issue with |
An option to delicately pick which props to include sounds very reasonable to me, and is similar to how react-docgen-typescript does it with the propFilter prop. I've previously utilized this prop in my Storybook configuration to include metadata for props from |
This is now configurable through the import { APIReference } from "renoun/file-system";
export default function App() {
return (
<APIReference
source="src/button.tsx"
filter={(symbolMetadata) => {
if (symbolMetadata.filePath?.includes("styled-system")) {
return false;
}
return !symbolMetadata.isPrivate && !symbolMetadata.isInNodeModules;
}}
/>
);
} The filter function argument includes the following metadata for each resolved type: /** The name of the symbol if it exists. */
name?: string
/** Whether or not the symbol is exported. */
isExported: boolean
/** Whether or not the symbol is external to the current source file. */
isExternal: boolean
/** Whether or not the symbol is located in node_modules. */
isInNodeModules: boolean
/** Whether or not the symbol is global. */
isGlobal: boolean
/** Whether or not the node is generated by the compiler. */
isVirtual: boolean
/** Whether or not the symbol is private. */
isPrivate: boolean
/** The file path for the symbol declaration. */
filePath?: string Make sure to always include |
Hi! First of all, really great project!
I got things running using the
ExportedTypes
component like this:However, the output only includes local types defined in the
button.tsx
file and not any types that's extended. The button file looks like this:And I would like to get access to all props including those from within the React Aria Components library. How would I do it?
Thanks!
The text was updated successfully, but these errors were encountered: