I came across this line in three.d.ts:
dispatchEvent(event: { type: string; [attachment: string]: any; }): void;
and was wondering what it
The brackets declare an index signature, meaning beside type, which is mandatory, you can put anything into the first argument.
Basically this weakens the type safety of the argument. This mechanism is of great use if the function is not itself a consumer but a generic interlink between players using stronger typing (they'll have deeper knowledge of the event structure).
I added another answer because the existing answer named this an optional argument, which it is not. An optional argument is postfixed with a "?" and quite different.