A new framework for generalized Besov-type and Triebel-Lizorkin-type spaces