This isn't allowed, and as in the Playground, it gives error #2499.
An interface can only extend an identifier/qualified-name with optional type arguments. (2499)
This is also consistent with similar questions on SO: You have to define the type first. As a hunch, this is probably for compatibility with the ECMAScript extends
definition.
You can, however, do a type intersection dynamically. You can even extend the resulting type as an interface, assuming the result is an object type.
type A2 = import("some-module").B & {
a2(): void;
}
interface A3 extends A2 {
a3(): void;
}
Playground Link