Two-dimensional adaptive membranes with programmable water and ionic channels