import { StoreApi } from 'zustand'; /** * Copied from the zustand file 'react.d.ts' on line 2 */ type ExtractState = S extends { getState: () => infer T; } ? T : never; /** * Types a partial object based on the type of the original and the type of an array of keys. */ type PartObjFromArrOfKeys = { [Key in KeyArray[number]]: Obj[Key]; }; type ReadonlyStoreApi = Pick, 'getState' | 'getInitialState' | 'subscribe'>; export { ExtractState, PartObjFromArrOfKeys, ReadonlyStoreApi };