I am currently working on an app where I am looking to promote the use of a wrapper for localStorage
that handles JSON conversion and type-checking automatically. I attempted to modify the global TS definition for window.localStorage like this:
declare global {
interface Window {
localStorage: null,
}
}
However, my attempt did not yield the desired result - Is there a way to prevent the usage of window.localStorage during compilation and potentially provide users with a helpful warning explaining why it is not compiling?