Catalysis of the reaction: (n) + an NDP-alpha-D-glucose = (n+1) + a ribonucleoside 5'-diphosphate + H+, where NDP is ADP or UDP.
starch granule-bound nucleoside diphosphate glucose-starch glucosyltransferase activity