Interface extends are supported but not the type ampersand syntax
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start by reproducing the reported TypeScript example, including the Omit utility and ampersand intersections, then trace the type parsing path that handles interface extends. Check existing tests for TypeScript type extraction if available. Done means both intersection syntax and the shown Omit-based definition are recognized without breaking existing interface-extends behavior.
Written by the indexing model from the issue text.
Description
If we use types in Typescript that can be extended with ampersand syntax &, it won't work.
For example, we have a pretty funky type definition like this in our repository:
export type ILinkProps = ITypeAgnosticLinkProps &
Omit<INextLinkProps, "children"> & {
/**
* Disables a link, visually and functionally
* @default false
*/
isDisabled?: boolean;
/**
* Sets `target="_blank"` and `rel="noreferrer"` explicitly.
* If props contain `target="_blank"` and `rel="noreferrer"`
* this will be set to isExternal automatically.
* _NOTE:_ This is a pure technical flag, if you're looking for a visual
* representation of an external link, use the `icon` and the `iconPosition` prop.
*/
isExternal?: boolean;
};
First it won't work because of the Omit, but if that would be solved (or deleted), it still doesn't work as the & is not recognized as extends.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 316
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reactjs/react-docgen
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reactjs/react-docgen#1102 ·
-
Typescript Status Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
reactjs/react-docgen#1005 · 4 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
reactjs/react-docgen#997 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
reactjs/react-docgen#994 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
reactjs/react-docgen#982 · 2 comments ·
All issues in reactjs/react-docgen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fil-donadoni/tolaria#4409 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·