From the manual :
Note: typeof(x) can for historical reasons also be written as type(x) but type(x) is discouraged.
Typedesc is a generic type that can describe all types while typeof is an operator.
The manual gives more info on this : https://nim-lang.org/docs/manual.html#special-types-typedesc-t