Sensor with TTL digital output
"TTL" can mean that the output behaves exactly the same as with devices in the good old TTL logic family. This would imply that the output is specified to sink up to 16 mA and to source up to 0.4 mA (and that the high level is nowhere near 5 V, but typically 3.4 V).

However, "TTL" can also mean "5 V CMOS". This would imply that the voltage levels are rail-to-rail, and that the possible source and sink currents are symmetrical. But there is no standard for "TTL" CMOS currents.

Nowadays, very few devices are still made in bipolar logic, so "TTL" is likely to mean the second case.
So you have to look up the current in a real datasheet. (Which might not exist, or your merchant might not tell you about it.)



Note: many digital optocouplers (e.g., the H11L1) do not need more than 1.6 mA.