formatAsYouTypeInternational

Groups digits the way the international form of a number is written mid-typing — e.g. Kenya's "712 084 336" rather than the national form's "0712 084 336", or a NANP region's "712-345-6789" rather than the national form's "(712) 345-6789".

This is the grouping a unified field wants for the digits it shows next to a dial-code prefix that is already displayed separately — the number itself should read the way it would in international dialing notation, not repeat national-only conventions like NANP's parentheses (which exist to set off a domestic area code, a distinction that doesn't apply once the country is already named by the prefix beside it).

Uses the same technique as formatAsYouType's national-trunk-prefix retry: libphonenumber's AsYouTypeFormatter only applies its international grouping rules once fed a leading +, so this feeds it +<callingCode><digits> and strips the calling code back off the result.

Return

The grouped international-style form, or digits unchanged when the region has no metadata or the calling code cannot be determined.

Parameters

digits

Raw digits, no separators. Anything non-digit is ignored.