The spartacus documentation about Module/type augmentation says it's supported in spartacus 2.1. https://sap.github.io/spartacus-docs/type-augmentation/#page-title
But when I try to extend the ConsentTemplate interface
import { ConsentTemplate } from '@spartacus/core';
declare module '@spartacus/core' {
interface ConsentTemplate {
documentUrl?: string;
}
}
I get this error => error TS2339: Property 'documentUrl' does not exist on type 'ConsentTemplate'.
Is it possible to use type augmentation in Spartacus 2.1? And if so how to make it work?
Type Augmentation is supported in Spartacus 2.1. I tested it in my app.module.ts.

Then in my application code I can see the new extended field "documentUrl" from Visual Studio Code field autocompletion list and use it as other standard fields.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With