Skip to content

fix(dts-generator): in function typedefs, build parameters properly #508

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

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

akudev
Copy link
Member

@akudev akudev commented Jun 6, 2025

Fixes #502

@akudev akudev marked this pull request as draft June 6, 2025 16:15
@akudev
Copy link
Member Author

akudev commented Jun 6, 2025

NOT YET READY

This does generate the complete structure with resolve and reject, but their types are function() : void, which is invalid TypeScript and coming exactly from JSDoc. Either the source in UI5 Dialog needs to be adapted or the generator needs to reformat the type as it happens for https://github.com/SAP/openui5/blob/f15b7a07506ef1b085f35a5aa43c0d0856dc41e0/src/sap.ui.core/src/sap/ui/core/Core.js#L3325 where the type in dts is () => void.

@akudev akudev marked this pull request as ready for review June 24, 2025 08:06
@akudev
Copy link
Member Author

akudev commented Jun 24, 2025

Yep, the json-fixer now treats @typedef callback parameters like regular method parameters and produces:

/**
   * Escape handler for sap.m.Dialog control.
   */
  export type EscapeHandler = (oHandlers: {
    /**
     * Call this function if the dialog should be closed.
     */
    resolve: () => void;
    /**
     * Call this function if the dialog should not be closed.
     */
    reject: () => void;
  }) => void;

@akudev akudev merged commit 06e6c57 into main Jun 24, 2025
7 checks passed
@akudev akudev deleted the fix/functionTypedefPropertyParams branch June 24, 2025 08:39
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.

Type definitions not updated from JSdoc
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy