Open DullReferenceException opened 7 years ago
"NO PRINT IMPLEMENTED: MappedType"
for https://github.com/redux-loop/redux-loop/blob/master/index.d.ts
Will take a look if I have time. See Mapped types
export type ReducerMapObject<S, A extends Action = AnyAction> = {
[K in keyof S]: LoopReducer<S[K], A>;
}
↓↓↓
declare export type ReducerMapObject<S, A> = {
[K: $Keys<S>]: LoopReducer<$Values<S>, A>
};
This is not precise transformation, other approach
type A<T extends { [key: string]: any }> =
{ [P in keyof T]?: (value: T[P]) => null };
let x: A<{ a: string, b: number, c: symbol }>;
In Flow this doesn't work
type m = <T>(T) => (T) => null
type A<T> = $Shape<$ObjMap<T, m>>
const test = (x: A<{| a: number, b: string |}>) => x.a && x.a('')
test({a: (x) => { if (typeof x !== "number") throw TypeError(); return null }})
Thought I'd report this if it wasn't already a known issue. I am attempting to generate some types from this definition:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sinon/index.d.ts
I currently get this error output: