move lib/internal/shared to lib/types