From a8065f6cf097589f5b38bc7ab7b41b3a2f326aae Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Mon, 11 May 2026 21:34:17 +0200 Subject: [PATCH] Add optional clone() to IPurchasableOffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useCatalog's localization-refresh effect calls 'offer?.clone ? offer.clone() : offer' to mint fresh references when locale strings change. Offer.ts implements clone() but the interface didn't declare it, so the guarded call broke tsgo. FurnitureOffer (the lazy wrapper) doesn't implement clone — and the call site is guarded — so 'clone?(): IPurchasableOffer' (optional) keeps the interface honest without forcing FurnitureOffer to grow a no-op clone. Net tsgo error count: -4. --- src/api/catalog/IPurchasableOffer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/catalog/IPurchasableOffer.ts b/src/api/catalog/IPurchasableOffer.ts index bea7781..e918c50 100644 --- a/src/api/catalog/IPurchasableOffer.ts +++ b/src/api/catalog/IPurchasableOffer.ts @@ -24,4 +24,5 @@ export interface IPurchasableOffer products: IProduct[]; itemIds: string; haveOffer: boolean; + clone?(): IPurchasableOffer; }