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

Dropping unexpected export in namespace TsExport #552

Open
faveoled opened this issue Jul 17, 2023 · 1 comment
Open

Dropping unexpected export in namespace TsExport #552

faveoled opened this issue Jul 17, 2023 · 1 comment

Comments

@faveoled
Copy link

faveoled commented Jul 17, 2023

Trying to convert this project: https://www.npmjs.com/package/@tauri-apps/api?activeTab=code
Gives multiple similar warnings like the following:

[warn ] 2023-07-17T10:26:30.224126Z ReplaceExports.scala:55 Dropping unexpected export in namespace TsExport(NoComments,false,Named,Names(IArray((TsQIdent(IArray(TsIdentSimple(notification_Options))),Some(TsIdentSimple(Options))), (TsQIdent(IArray(TsIdentSimple(notification_Permission))),Some(TsIdentSimple(Permission))), (TsQIdent(IArray(TsIdentSimple(notification_sendNotification))),Some(TsIdentSimple(sendNotification))), (TsQIdent(IArray(TsIdentSimple(notification_requestPermission))),Some(TsIdentSimple(requestPermission))), (TsQIdent(IArray(TsIdentSimple(notification_isPermissionGranted))),Some(TsIdentSimple(isPermissionGranted)))),None)) [id => @tauri-apps/api, thread => 1, phase => typescript, scope => TreeScope(TsParsedFile() / TsDeclModule(@tauri-apps/api/notification-6cd45c32) / TsDeclNamespace(notification))]

I'm assuming it can't parse the content as follows:

export { O as Options, P as Permission, i as isPermissionGranted, r as requestPermission, s as sendNotification } from './notification-6cd45c32.js';

The result is I can't import properly named bindings. At the same time machine-generated bindings do not work properly.
ScalablyTyped Converter (version 1.0.0-beta42)

@oyvindberg
Copy link
Collaborator

Thanks! I'm aware of this, but haven't gotten to it yet. Over time there typescript has grown a system for imports and exports inside namespaces, but I've never seen a spec for how it actually works.

It hasn't been all that much in use, which is why it hasn't been that urgent.

This is fairly high on my list of things to fix, but it'll be autumn before I have much time for this unfortunately

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

No branches or pull requests

2 participants