Skip to content

Commit 77d790a

Browse files
committed
fix(type): when having init option, the value type should not contain null
1 parent bb67910 commit 77d790a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/storage/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,12 @@ export interface WxtStorage {
749749
key: StorageItemKey,
750750
options: WxtStorageItemOptions<TValue> & { defaultValue: TValue },
751751
): WxtStorageItem<TValue, TMetadata>;
752+
defineItem<TValue, TMetadata extends Record<string, unknown> = {}>(
753+
key: StorageItemKey,
754+
options: WxtStorageItemOptions<TValue> & {
755+
init: () => TValue | Promise<TValue>;
756+
},
757+
): WxtStorageItem<TValue, TMetadata>;
752758
defineItem<TValue, TMetadata extends Record<string, unknown> = {}>(
753759
key: StorageItemKey,
754760
options: WxtStorageItemOptions<TValue>,

0 commit comments

Comments
 (0)