Skip to content

fix(dts-generator): support rest parameters in functions in nested types #507

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akudev
Copy link
Contributor

@akudev akudev commented Jun 6, 2025

When api.json contains:
Object<string,function(...any)>|function

Then the d.ts file will contain:
Record<string, (...p1: any) => void> | Function;

Before this fix, the function had no parameter.

@akudev akudev requested a review from codeworrior June 6, 2025 07:42
1.)
When no param and no return type is given, generate "Function" instead
of "()=>void" to allow passing parameters, just like it happens in
simple function types.

2.)
When api.json contains:
Object<string,function(...any)>|function

Then the d.ts file will contain:
Record<string, (...p1: any) => void> | Function;

Before this fix, the function had no parameter.
@akudev akudev force-pushed the fix/nestedRestParams branch from 487c2c2 to b39de70 Compare June 6, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant