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.
I'd like to add type definitions for the library to DefinitelyTyped, but unfortunaltely the
active
global property is preventing that: https://github.com/LeaVerou/stretchy/blob/68bc05935f43cb76b6ebdf8a217b0eea1ab733ed/src/stretchy.js#L135Since 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:
This way the library could be (more easily) usable in TypeScript projects. You can see my current type definition implementation here.