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

Export Typescript types and interfaces #780

Closed
Jax-p opened this issue Oct 13, 2021 · 2 comments
Closed

Export Typescript types and interfaces #780

Jax-p opened this issue Oct 13, 2021 · 2 comments

Comments

@Jax-p
Copy link

Jax-p commented Oct 13, 2021

Is there any reason why types and interfaces are not exported?
There is not exported namespace with types, nor any of the types or interfaces in purgecss.d.ts.

Example use-case:

/** Error: Module '"purgecss"' has no exported member 'UserDefinedSafelist'.  */
const myCoolFunction = async (safelist: UserDefinedSafelist) => {
    await new PurgeCSS().purge({
          content: something,
          css: something,
          safelist: safelist
    });
}

Is it be possible to export all non-internal types and interfaces?

Ffloriel added a commit that referenced this issue Nov 26, 2021
@Ffloriel
Copy link
Member

You can import the types UserDefinedSafelist in version > 4.1.0.

import { PurgeCSS, UserDefinedSafelist } from 'purgecss';

@Jax-p
Copy link
Author

Jax-p commented Nov 29, 2021

Works fine. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants