You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
import member from export as namespace library does not import types #16155
import{createSelector}from'reselect';/* * changing the import to * import * as reselect from 'reselect'; * and accessing reselect.createSelector fixes the issue*/exportinterfaceState{a: string;b: number;}exportconstselector=createSelector<State,string,number,{out: string}>(state=>state.a,state=>state.b,(a,b)=>{return{out: `${a}+${b}`};});console.log(selector({a: 'string',b: 5}));
Expected behavior:
The output .d.ts file will include an import for the relevant type from 'reselect'.
Actual behavior:
The output .d.ts file attempts to access Reselect as a global namespace. Any downstream consumer that imports from this code will error.
changed the title [-]import member from export as namespace library[/-][+]import member from export as namespace library does not import types[/+]on May 30, 2017
Activity
[-]import member from export as namespace library[/-][+]import member from export as namespace library does not import types[/+]cwmoo740 commentedon May 30, 2017
The typing file for reselect may also be helpful:
https://github.com/reactjs/reselect/blob/master/src/index.d.ts