Add type declaration to function