When it means 'type of'. You can also use it as a filler word much like like or kinda in English. Det är typ omöjligt att tro 'That's like impossible to believe'.
On the other hand sorts has the genitive in it so it's en sorts bok but en typ av bok.
Okay, this is my first introduction to typ. I have noticed that some swedes use "typ" like some English speakers use "like". So, are they literally interspersing "type" in their sentences, or does it have some other meaning?