You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window.prestashop was the last any in the theme's TypeScript - src/js has none left outside test fixtures - and CONTEXT.md already forbids it.
Typed it against what the theme actually consumes, each member sourced rather than guessed:
the emitter, since src/js/prestashop.ts copies EventEmitter.prototype onto the global
responsive, which the theme itself writes in src/js/responsive-toggler.ts
urls, from FrontController::getTemplateVarUrls()
checkPasswordScore, whose zxcvbn result is narrowed to score and feedback because the theme has no zxcvbn dependency to import the upstream type from
blockcart, optional, added by src/js/modules/blockcart.ts
The payload of on/once/off is a type parameter inferred from the listener. A fixed payload type rejects nine existing call sites, because the emitting sides genuinely differ: {event: Event}, {context: 'main' | 'quickview'}, HTMLElement, Record<string, unknown>, a bare string.
No index signature. Core publishes more than this, and an open map is the same any under another name; a member that is needed later gets declared with its type, which is the coordination this issue asks for.
Two call sites move as a result. blockcart.ts built its entry as prestashop.blockcart || {} then assigned showModal, which the correctly-optional type rejects, so it is one assignment that spreads what was already there. quickview.ts drops prestashop.urls.pages.product as string, a cast that existed only because the global was untyped.
Verified: tsc --noEmit --skipLibCheck clean, jest 39 tests green, eslint exit 0. Mutation both ways - prestashop.thisMemberDoesNotExist now fails with TS2339 and prestashop.urls.pages.product.toFixed(2) with TS2551, while the same two lines compile clean against the current prestashop: any.
Activity
boo-code commentedon Sep 10, 2026
window.prestashopwas the lastanyin the theme's TypeScript -src/jshas none left outside test fixtures - andCONTEXT.mdalready forbids it.Typed it against what the theme actually consumes, each member sourced rather than guessed:
src/js/prestashop.tscopiesEventEmitter.prototypeonto the globalresponsive, which the theme itself writes insrc/js/responsive-toggler.tsurls, fromFrontController::getTemplateVarUrls()checkPasswordScore, whose zxcvbn result is narrowed toscoreandfeedbackbecause the theme has no zxcvbn dependency to import the upstream type fromblockcart, optional, added bysrc/js/modules/blockcart.tsThe payload of
on/once/offis a type parameter inferred from the listener. A fixed payload type rejects nine existing call sites, because the emitting sides genuinely differ:{event: Event},{context: 'main' | 'quickview'},HTMLElement,Record<string, unknown>, a barestring.No index signature. Core publishes more than this, and an open map is the same
anyunder another name; a member that is needed later gets declared with its type, which is the coordination this issue asks for.Two call sites move as a result.
blockcart.tsbuilt its entry asprestashop.blockcart || {}then assignedshowModal, which the correctly-optional type rejects, so it is one assignment that spreads what was already there.quickview.tsdropsprestashop.urls.pages.product as string, a cast that existed only because the global was untyped.Verified:
tsc --noEmit --skipLibCheckclean,jest39 tests green,eslintexit 0. Mutation both ways -prestashop.thisMemberDoesNotExistnow fails withTS2339andprestashop.urls.pages.product.toFixed(2)withTS2551, while the same two lines compile clean against the currentprestashop: any.