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

[FEAT] Export types #363

Open
nklaasse opened this issue Oct 2, 2020 · 6 comments
Open

[FEAT] Export types #363

nklaasse opened this issue Oct 2, 2020 · 6 comments
Labels
Enhancement New feature or request v6 Included in the next major release

Comments

@nklaasse
Copy link

nklaasse commented Oct 2, 2020

It would make sense for Typescript projects also export typings such as CoreOptions.

@nklaasse nklaasse added the Enhancement New feature or request label Oct 2, 2020
@mrkosima
Copy link
Contributor

mrkosima commented Oct 5, 2020

As a workaround I'm using:

import type { CoreOptions } from '@adyen/adyen-web/dist/types/core/types';

But I'm agree that it would be much helpful to have exported types in root.

@iLaurens
Copy link

I would like to see this as well. In my case I am using the custom card integration (secured fields) and I wanted to make it more robust by using TypeScript. I tried mapping function signatures manually for functions like create, onChange, onError etc but found it difficult to find the correct typings due to arbitrary naming and such. I could also imagine that these internals may change with patch releases while they would end up on the integrating side as breaking changes. If types get exported, it would be great if they are precise instead of using types like any or object.

@WoodyWoodsta
Copy link

I'm looking for this as well.

@Benjamindudok
Copy link

As a workaround I'm using:

import type { CoreOptions } from '@adyen/adyen-web/dist/types/core/types';

But I'm agree that it would be much helpful to have exported types in root.

We used this workaround too. Though probably an update somewhere in our build system 'broke' this method because the types aren't in the 'exports' of the package. Which probably has something to do with Typescript not completely adhering to ESM module specifications (yet).

We're now getting the following error in our project with Vue 3 using Vite:

[ERROR] [plugin vite:dep-scan] Missing "./dist/types/core" export in "@adyen/adyen-web" package

Which is pretty much the same as this issue in the vite repository: vitejs/vite#7749.

@DanielRitvas
Copy link

DanielRitvas commented Feb 11, 2023

Up.It would actually be very useful to be able to import types via npm! I'm using the library as an embedded script so there is no way to access types in the code at the moment in any way.

@Fifciu
Copy link

Fifciu commented Aug 11, 2023

Up. I would love to import types easily. For now, I am using:

import type { CoreOptions } from "@adyen/adyen-web/dist/types/core/types";
import type { DropinElementProps } from "@adyen/adyen-web/dist/types/components/Dropin/types";

But it would be much better to import just from the @adyen/adyen-web.

I've just prepared a very simple PR addressing this issue: #2294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request v6 Included in the next major release
Projects
None yet
Development

No branches or pull requests

8 participants