I have not been able to find any official documentation on shopify.dev for the window.Shopify object?
I’ve done some initial tests with Shopify markets in developer preview to switch locale via url or subdomain and the locale is set correctly on window.Shopify.locale as expected in dev tools.
I’ve found random references around the place but nothing concrete.
I’d like to know it is fully supported and what properties are available before relying on it for production use.
I contacted Shopify Partner support and they found a question someone had posted on the community forum about using it but apart from that it’s pretty scarce.
They suggested I ask a question here. The only other references have been other community members/partners asking the same thing.
Unlikely you will get these in definitelyTyped. It’s not fully complete but you informs on the most relevant references that you’d typically leverage. I’ve annotated the methods/props from which I have knowledge of but for the most part it’s difficult without seeing the unobfuscated code.
In addition, I have typed with JSDocs annotation section schema, you can find that in the various projects I Open Source and maintain (search my name of github or see the vscode-liquid extension repo).
Lastly, you’ll need to create a global.d.ts file and apply globalThis etc.
Hope it helps.
type Primitive = | null | undefined | string | number | boolean | symbol | bigint;
type LiteralUnion