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

Type definitions #46

Open
plungingChode opened this issue Dec 18, 2022 · 0 comments
Open

Type definitions #46

plungingChode opened this issue Dec 18, 2022 · 0 comments

Comments

@plungingChode
Copy link

I'd like to add type definitions for the library to DefinitelyTyped, but unfortunaltely the active global property is preventing that:

export let active = true;

Since in TypeScript type definition files all exported variables are treated as read-only, and cannot be reassigned. Would it be possbile to convert this to a function? For example:

let active = true;

function setActive(isActive) {
    active = isActive;
}

This way the library could be (more easily) usable in TypeScript projects. You can see my current type definition implementation here.

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

1 participant