fixes for TypeScript 5.0
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -101,7 +101,9 @@ export class MockStorageApi implements StorageApi {
|
||||
});
|
||||
}
|
||||
|
||||
observe$<T>(key: string): Observable<StorageValueSnapshot<T>> {
|
||||
observe$<T extends JsonValue>(
|
||||
key: string,
|
||||
): Observable<StorageValueSnapshot<T>> {
|
||||
return this.observable.filter(({ key: messageKey }) => messageKey === key);
|
||||
}
|
||||
|
||||
@@ -109,7 +111,7 @@ export class MockStorageApi implements StorageApi {
|
||||
return `${this.namespace}/${encodeURIComponent(key)}`;
|
||||
}
|
||||
|
||||
private notifyChanges<T>(message: StorageValueSnapshot<T>) {
|
||||
private notifyChanges<T extends JsonValue>(message: StorageValueSnapshot<T>) {
|
||||
for (const subscription of this.subscribers) {
|
||||
subscription.next(message);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ export function wrapInTestApp(
|
||||
|
||||
let wrappedElement: React.ReactElement;
|
||||
if (Component instanceof Function) {
|
||||
wrappedElement = <Component />;
|
||||
wrappedElement = React.createElement(Component as ComponentType);
|
||||
} else {
|
||||
wrappedElement = Component as React.ReactElement;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ export async function renderInTestApp(
|
||||
): Promise<RenderResult> {
|
||||
let wrappedElement: React.ReactElement;
|
||||
if (Component instanceof Function) {
|
||||
wrappedElement = <Component />;
|
||||
wrappedElement = React.createElement(Component as ComponentType);
|
||||
} else {
|
||||
wrappedElement = Component as React.ReactElement;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user