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

Dets does not import declaration files? #45

Open
wiresnchains opened this issue Sep 5, 2024 · 3 comments
Open

Dets does not import declaration files? #45

wiresnchains opened this issue Sep 5, 2024 · 3 comments

Comments

@wiresnchains
Copy link

wiresnchains commented Sep 5, 2024

I may be doing something wrong here, however my declaration file for Utility interfaces and types does not include correctly when using dets.
Here is my declaration file which is referenced in the tsconfig.json (thus not imported by the typescript files using import keyword)

declare interface WaveDictionary<T> {
    [key: string]: T;
}

declare type WaveDataType = string | number | boolean;
declare type WaveProxyHandler = (newValue: any) => Promise<boolean>;
declare type WaveLogicalOperatorHandler = (data: any, compareWith: any) => boolean;

And these interfaces and types are not being imported into the dets out file when building (The .d.ts file is withing the --files parameter scope)
Here is my cli command:

dets src/index.ts --name @wave-frontend/wave-js --files src/**/*.ts --out dist/index.d.ts

The @types folder is located in the src folder so it should be picked up if I am not missing something

@wiresnchains wiresnchains changed the title Declaration import? Dets does not import declaration files? Sep 5, 2024
@FlorianRappl
Copy link
Owner

Hm we pretty much hand over the files to TypeScript. So we'd need to check how TypeScript handles those - and what might be the difference.

@wiresnchains
Copy link
Author

I did manage to come up with a solution using export keyword instead of declare

@FlorianRappl
Copy link
Owner

OK - I mean also in a d.ts you are supposed to export the things you want to use outside of it. The exception is that a d.ts file might contain module declarations.

To me it sounds like the d.ts might not have been sound (i.e., would it have worked in general?).

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