import React from 'react' ; import { useStore } from './useStore' ; import { createReducer } from '../..' ; type IsNumber < P > = P extends number ? 1 : 0 ; type IsString < P > = P extends string ? 1 : 0 ; type IsBoolean < P > = P extends boolean ? 1 : 0 ; type IsArray < P > = P extends [ ] ? 1 : 0 ; type IsAny < P > = P extends never ? 1 : 0 ; const createMockStore = ( storeName ) => { return createReducer ( storeName , 1 ) ; } ; describe ( 'check useStoreSelector type infer' , ( ) => { it ( 'infer right store state type' , ( ) => { const Cmp = ( ) => { const store = createMockStore ( 'test' ) ; const state = useStore ( store ) ; const isNumber = 1 ; const isAny = 1 ; return null ; } ; } ) ; } ) ;