Skip to content

Commit

Permalink
refactor(types): expose types
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 3, 2021
1 parent 6b7c355 commit 3f2b4bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export {
_MapWritableStateObjectReturn,
_MapWritableStateReturn,
_Spread,
_StoreObject,
} from './mapHelpers'

// TODO: remove in beta
Expand Down
7 changes: 5 additions & 2 deletions src/mapHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export interface MapStoresCustomization {
// suffix?: string
}

type StoreObject<S> = S extends StoreDefinition<
/**
* @internal
*/
export type _StoreObject<S> = S extends StoreDefinition<
infer Ids,
infer State,
infer Getters,
Expand All @@ -46,7 +49,7 @@ type StoreObject<S> = S extends StoreDefinition<
* @internal
*/
export type _Spread<A extends readonly any[]> = A extends [infer L, ...infer R]
? StoreObject<L> & _Spread<R>
? _StoreObject<L> & _Spread<R>
: unknown

function getCachedStore<
Expand Down

0 comments on commit 3f2b4bf

Please sign in to comment.