To specify the return type of a function, you would use the colon (:) separator outside of the function's parentheses. Here is a basic example to illustrate this concept.
Essentially, you are defining what type of value the function will return. For instance,
const fn = (): number => { return 1; }
indicates that the function returns a number.
In your specific situation:
type ReturnT = Record<string, unknown>;
type ObjectT = Record<string, unknown>;
const firstProp = (object: ObjectT): ReturnT => object[Object.keys(object)[0]];
If the return type matches the input object type, you can also utilize the same type reference for convenience.