diff --git a/packages/solid/store/src/index.ts b/packages/solid/store/src/index.ts index 99a3ae076..9a3317567 100644 --- a/packages/solid/store/src/index.ts +++ b/packages/solid/store/src/index.ts @@ -8,6 +8,7 @@ export type { SetStoreFunction, SolidStore, Store, + StoreBundle, StoreNode, StorePathRange, StoreSetter diff --git a/packages/solid/store/src/store.ts b/packages/solid/store/src/store.ts index 3402bae1a..195aabb1e 100644 --- a/packages/solid/store/src/store.ts +++ b/packages/solid/store/src/store.ts @@ -490,6 +490,8 @@ export interface SetStoreFunction { ): void; } +export type StoreBundle = [get: Store, set: SetStoreFunction]; + /** * Creates a reactive store that can be read through a proxy object and written with a setter function * @@ -499,7 +501,7 @@ export function createStore( ...[store, options]: {} extends T ? [store?: T | Store, options?: { name?: string }] : [store: T | Store, options?: { name?: string }] -): [get: Store, set: SetStoreFunction] { +): StoreBundle { const unwrappedStore = unwrap((store || {}) as T); const isArray = Array.isArray(unwrappedStore); if ("_SOLID_DEV_" && typeof unwrappedStore !== "object" && typeof unwrappedStore !== "function")