4 ms·
Nothing that a little `var unsafe = original as any;` couldn't solve!
by styfle 9y ago
Nothing that a little `var unsafe = original as any;` couldn't solve!
- cloverich 9y agoTo be a bit more explanatory: You can cast to the "any" type by adding `as any` to any variable, and it will then work just like Javascript. Typescript will know not to infer types from it or complain about it, and for that variable (which could be a simple variable or an entire library) will work just as it would in regular javascript. I typically use this when testing out a new library that doesn't have Typescript types so I can get a feel for it (and if I like it, I"ll progressively add types to it; its a very nice process imo).