There may be some specific idiomatic reason for it that I haven't heard of, but basically that's saying: IMessagesOperation is a function that has all the usual Function stuff and accepts an array of Message and returns an array of Message, like this:
type IMessagesOperation = (messages: Message[]) => Message[];
It's not clear to me why they didn't write it that way, other than that interfaces can be augmented by other declarations (see this and this). Or perhaps something to do with how conflicts are resolved in type aliases (type) with & vs. interface with extends.
To give you an idea what I mean by "augmented by other declarations," with an interface it's possible to do this elsewhere in the code:
interface IMessagesOperation {
(messages: string): Message[];
// ^^^^^^−−−−−− note the change
}
That gets merged with the interface in your question, producing a function overload type where both of these calls are valid:
const op: IMessagesOperation = /*...*/;
const messages1 = op("testing");
const messages2 = op(messages);
Playground link
You can't do that with the type alias (type IMessagesOperation = (messages: Message[]) => Message[];).
why Function has capital "F" instead of just being function
It's referring to JavaScript's Function constructor, although in that specific case (because it's a type context, not a value [runtime] context) it's referring to the type of thing the Function constructor creates: a function.
How do I implement the concrete class in this case.
It's a function, not a class, so you'd write a function:
const m1: IMessagesOperation = function(messages: Message[]): Message[] {
return messages;
};
Typescript playground example of the above