Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 13 and Typscript 4.4 #101

Open
Stexxen opened this issue Nov 30, 2021 · 1 comment
Open

Angular 13 and Typscript 4.4 #101

Stexxen opened this issue Nov 30, 2021 · 1 comment

Comments

@Stexxen
Copy link

Stexxen commented Nov 30, 2021

Simlilar to #97 but this occurs after upgrading to Angular 13 which uses typescript 4.4

Error: node_modules/ngx-store/lib/utility/storage/storage-event.d.ts:1:22 - error TS2420: Class 'NgxStorageEvent<T>' incorrectly implements interface 'Omit<StorageEvent, "oldValue" | "newValue">'.
  Property 'initStorageEvent' is missing in type 'NgxStorageEvent<T>' but required in type 'Omit<StorageEvent, "oldValue" | "newValue">'.

StorageEvent is now defined as

interface StorageEvent extends Event {
    /**
     * Returns the key of the storage item being changed.
     */
    readonly key: string | null;
    /**
     * Returns the new value of the key of the storage item whose value is being changed.
     */
    readonly newValue: string | null;
    /**
     * Returns the old value of the key of the storage item whose value is being changed.
     */
    readonly oldValue: string | null;
    /**
     * Returns the Storage object that was affected.
     */
    readonly storageArea: Storage | null;
    /**
     * Returns the URL of the document whose storage item changed.
     */
    readonly url: string;
    initStorageEvent(type: string, bubbles?: boolean, cancelable?: boolean, key?: string | null, oldValue?: string | null, newValue?: string | null, url?: string | URL, storageArea?: Storage | null): void;
}

adding the prototype for initStorageEvent to storage-event.d.ts allows it to compile but should it be added to Omit instead?

@stanciupaul
Copy link

As a workaround, add "skipLibCheck": true to compilerOptions in tsconfig.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants