A triangle typically represents an amplifier of some sort. A rectangle could represent anything from a resistor network to additional transistor switching circuits.
The schematic representation of a component is generally meant to convey the most basic operational functional blocks inside the chip that the user needs to be aware of. Here the important things for the user to know is that there's an LED, a photodiode with amplification of some sort, and some logic driving a "totem pole" output (the two output transistors).