Skip to content
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

Remove type aliases from build/playcanvas.d.ts #4011

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

kungfooman
Copy link
Collaborator

@kungfooman kungfooman commented Feb 10, 2022

This script turns code like this:

type AssetRegistry$2 = AssetRegistry$c;
type GraphicsDevice$3 = GraphicsDevice$l;
type ResourceHandler$3 = ResourceHandler$h;
/**
 * Resource handler used for loading {@link Sprite} resources.
 *
 * @implements {ResourceHandler}
 */
declare class SpriteHandler implements ResourceHandler$3 {

into this:

/**
 * Resource handler used for loading {@link Sprite} resources.
 *
 * @implements {ResourceHandler}
 */
declare class SpriteHandler implements ResourceHandler {

I didn't test it a lot yet, but at least VSCode finds no errors. Partly addresses #3995

This script doesn't "integrate" with bundling or anything, its just creating a new file build/playcanvas_new.d.ts via node types_bundle_undollar.mjs.

It only messes with classes that it could detect from the regexType, so classes with the same name as native classes (Touch etc.) are left as they are:

image

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@willeastcott
Copy link
Contributor

This is great - thanks! 🙌

@willeastcott willeastcott merged commit d5bef0e into playcanvas:dev Feb 21, 2022
@kungfooman kungfooman deleted the typesBundleUndollar branch May 13, 2024 15:43
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.

None yet

2 participants