Skip to content

Commit e279b02

Browse files
committed
fix: replace Storage with a generic implementation schema
1 parent a2c6169 commit e279b02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/types/src/lib/interfaces.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ export type KV = Record<string, any>;
253253
* binded globally
254254
*/
255255
export const StorageProviderSchema = z.object({
256-
provider: z.instanceof(Storage),
256+
provider: z.object({
257+
getItem: z.function().args(z.string()).returns(z.union([z.string(), z.null()])),
258+
setItem: z.function().args(z.string(), z.string()).returns(z.void()),
259+
removeItem: z.function().args(z.string()).returns(z.void()),
260+
clear: z.function().returns(z.void())
261+
}),
257262
});
258263
export type StorageProvider = z.infer<typeof StorageProviderSchema>;
259264

0 commit comments

Comments
 (0)