type Reducer<TreeT, ActionT extends Action> = (
  treeState: TreeT | undefined,
  action: ActionT
) => TreeT;

Related types: