Skip to content

Commit 4092d66

Browse files
authored
fix(types): Vendor minimal type for localforage in Offline integration (#3508)
1 parent cbfe9f3 commit 4092d66

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/integrations/src/offline.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
23
import { Event, EventProcessor, Hub, Integration } from '@sentry/types';
34
import { getGlobalObject, logger, normalize, uuid4 } from '@sentry/utils';
45
import localForage from 'localforage';
56

7+
type LocalForage = {
8+
setItem<T>(key: string, value: T, callback?: (err: any, value: T) => void): Promise<T>;
9+
iterate<T, U>(
10+
iteratee: (value: T, key: string, iterationNumber: number) => U,
11+
callback?: (err: any, result: U) => void,
12+
): Promise<U>;
13+
removeItem(key: string, callback?: (err: any) => void): Promise<void>;
14+
};
15+
616
/**
717
* cache offline errors and send when connected
818
*/
@@ -36,7 +46,7 @@ export class Offline implements Integration {
3646
/**
3747
* event cache
3848
*/
39-
public offlineEventStore: typeof localForage;
49+
public offlineEventStore: LocalForage;
4050

4151
/**
4252
* @inheritDoc

0 commit comments

Comments
 (0)